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 MongoCluster service API entry point.
+ *
+ * @param credential the credential to use.
+ * @param profile the Azure profile for client.
+ * @return the MongoCluster 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 wrapped service client MongoClusterManagementClient providing direct access to the underlying auto-generated
+ * API implementation, based on Azure REST API.
+ *
+ * @return Wrapped service client MongoClusterManagementClient.
+ */
+ public MongoClusterManagementClient serviceClient() {
+ return this.clientObject;
+ }
+}
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 000000000000..33b3167997ad
--- /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) AutoRest 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 {
+ /**
+ * 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);
+
+ /**
+ * 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 represents a mongo cluster firewall rule.
+ */
+ @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 represents a mongo cluster firewall rule.
+ */
+ @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 represents a mongo cluster firewall rule.
+ */
+ @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 represents a mongo cluster firewall rule.
+ */
+ @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);
+}
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/MongoClusterManagementClient.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/MongoClusterManagementClient.java
new file mode 100644
index 000000000000..43bfcdacb324
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/MongoClusterManagementClient.java
@@ -0,0 +1,83 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.mongocluster.fluent;
+
+import com.azure.core.http.HttpPipeline;
+import java.time.Duration;
+
+/**
+ * The interface for MongoClusterManagementClient class.
+ */
+public interface MongoClusterManagementClient {
+ /**
+ * Gets The ID of the target subscription. The value must be an UUID.
+ *
+ * @return the subscriptionId value.
+ */
+ String getSubscriptionId();
+
+ /**
+ * Gets server parameter.
+ *
+ * @return the endpoint value.
+ */
+ String getEndpoint();
+
+ /**
+ * Gets Api Version.
+ *
+ * @return the apiVersion value.
+ */
+ String getApiVersion();
+
+ /**
+ * Gets The HTTP pipeline to send requests through.
+ *
+ * @return the httpPipeline value.
+ */
+ HttpPipeline getHttpPipeline();
+
+ /**
+ * Gets The default poll interval for long-running operation.
+ *
+ * @return the defaultPollInterval value.
+ */
+ Duration getDefaultPollInterval();
+
+ /**
+ * Gets the OperationsClient object to access its operations.
+ *
+ * @return the OperationsClient object.
+ */
+ OperationsClient getOperations();
+
+ /**
+ * Gets the 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();
+}
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 000000000000..c08d514508de
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/MongoClustersClient.java
@@ -0,0 +1,338 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest 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;
+
+/**
+ * An instance of this class provides access to all the operations defined in MongoClustersClient.
+ */
+public interface MongoClustersClient {
+ /**
+ * Check if mongo cluster name is available for use.
+ *
+ * @param location The name of the Azure region.
+ * @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 name of the Azure region.
+ * @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);
+
+ /**
+ * 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 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);
+
+ /**
+ * 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 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);
+}
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 000000000000..7dfcdbb7fc7f
--- /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) AutoRest 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 000000000000..bdeeba124dfc
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/PrivateEndpointConnectionsClient.java
@@ -0,0 +1,220 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest 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 concrete proxy resource types can be created by aliasing this type
+ * using a specific property type.
+ */
+ @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 concrete proxy resource types can be created by aliasing this type
+ * using a specific property type.
+ */
+ @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 concrete proxy resource types can be created by aliasing this type using a specific property type.
+ */
+ @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 concrete proxy resource types can be created by aliasing this type using a specific property type.
+ */
+ @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 000000000000..08d23b4984e7
--- /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) AutoRest 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/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 000000000000..1148b6cf8c8a
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/CheckNameAvailabilityResponseInner.java
@@ -0,0 +1,107 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.mongocluster.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.resourcemanager.mongocluster.models.CheckNameAvailabilityReason;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * The check availability result.
+ */
+@Fluent
+public final class CheckNameAvailabilityResponseInner {
+ /*
+ * Indicates if the resource name is available.
+ */
+ @JsonProperty(value = "nameAvailable")
+ private Boolean nameAvailable;
+
+ /*
+ * The reason why the given name is not available.
+ */
+ @JsonProperty(value = "reason")
+ private CheckNameAvailabilityReason reason;
+
+ /*
+ * Detailed reason why the given name is available.
+ */
+ @JsonProperty(value = "message")
+ private String message;
+
+ /**
+ * Creates an instance of CheckNameAvailabilityResponseInner class.
+ */
+ public CheckNameAvailabilityResponseInner() {
+ }
+
+ /**
+ * Get the nameAvailable property: Indicates if the resource name is available.
+ *
+ * @return the nameAvailable value.
+ */
+ public Boolean nameAvailable() {
+ return this.nameAvailable;
+ }
+
+ /**
+ * Set the nameAvailable property: Indicates if the resource name is available.
+ *
+ * @param nameAvailable the nameAvailable value to set.
+ * @return the CheckNameAvailabilityResponseInner object itself.
+ */
+ public CheckNameAvailabilityResponseInner withNameAvailable(Boolean nameAvailable) {
+ this.nameAvailable = nameAvailable;
+ return this;
+ }
+
+ /**
+ * Get the reason property: The reason why the given name is not available.
+ *
+ * @return the reason value.
+ */
+ public CheckNameAvailabilityReason reason() {
+ return this.reason;
+ }
+
+ /**
+ * Set the reason property: The reason why the given name is not available.
+ *
+ * @param reason the reason value to set.
+ * @return the CheckNameAvailabilityResponseInner object itself.
+ */
+ public CheckNameAvailabilityResponseInner withReason(CheckNameAvailabilityReason reason) {
+ this.reason = reason;
+ return this;
+ }
+
+ /**
+ * Get the message property: Detailed reason why the given name is available.
+ *
+ * @return the message value.
+ */
+ public String message() {
+ return this.message;
+ }
+
+ /**
+ * Set the message property: Detailed reason why the given name is available.
+ *
+ * @param message the message value to set.
+ * @return the CheckNameAvailabilityResponseInner object itself.
+ */
+ public CheckNameAvailabilityResponseInner withMessage(String message) {
+ this.message = message;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+}
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 000000000000..4b8bd4763b5d
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/FirewallRuleInner.java
@@ -0,0 +1,119 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest 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.resourcemanager.mongocluster.models.ProvisioningState;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Represents a mongo cluster firewall rule.
+ */
+@Fluent
+public final class FirewallRuleInner extends ProxyResource {
+ /*
+ * The resource-specific properties for this resource.
+ */
+ @JsonProperty(value = "properties")
+ private FirewallRuleProperties innerProperties;
+
+ /*
+ * Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ */
+ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
+ private SystemData systemData;
+
+ /**
+ * Creates an instance of FirewallRuleInner class.
+ */
+ public FirewallRuleInner() {
+ }
+
+ /**
+ * Get the innerProperties property: The resource-specific properties for this resource.
+ *
+ * @return the innerProperties value.
+ */
+ private FirewallRuleProperties innerProperties() {
+ return this.innerProperties;
+ }
+
+ /**
+ * 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 provisioningState property: The provisioning state of the firewall rule.
+ *
+ * @return the provisioningState value.
+ */
+ public ProvisioningState provisioningState() {
+ return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
+ }
+
+ /**
+ * Get the startIpAddress property: The start IP address of the mongo cluster firewall rule. Must be IPv4 format.
+ *
+ * @return the startIpAddress value.
+ */
+ public String startIpAddress() {
+ return this.innerProperties() == null ? null : this.innerProperties().startIpAddress();
+ }
+
+ /**
+ * Set the startIpAddress property: The start IP address of the mongo cluster firewall rule. Must be IPv4 format.
+ *
+ * @param startIpAddress the startIpAddress value to set.
+ * @return the FirewallRuleInner object itself.
+ */
+ public FirewallRuleInner withStartIpAddress(String startIpAddress) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new FirewallRuleProperties();
+ }
+ this.innerProperties().withStartIpAddress(startIpAddress);
+ return this;
+ }
+
+ /**
+ * Get the endIpAddress property: The end IP address of the mongo cluster firewall rule. Must be IPv4 format.
+ *
+ * @return the endIpAddress value.
+ */
+ public String endIpAddress() {
+ return this.innerProperties() == null ? null : this.innerProperties().endIpAddress();
+ }
+
+ /**
+ * Set the endIpAddress property: The end IP address of the mongo cluster firewall rule. Must be IPv4 format.
+ *
+ * @param endIpAddress the endIpAddress value to set.
+ * @return the FirewallRuleInner object itself.
+ */
+ public FirewallRuleInner withEndIpAddress(String endIpAddress) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new FirewallRuleProperties();
+ }
+ this.innerProperties().withEndIpAddress(endIpAddress);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (innerProperties() != null) {
+ innerProperties().validate();
+ }
+ }
+}
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/FirewallRuleProperties.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/FirewallRuleProperties.java
new file mode 100644
index 000000000000..6aaabc9988aa
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/FirewallRuleProperties.java
@@ -0,0 +1,109 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.mongocluster.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.mongocluster.models.ProvisioningState;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * The properties of a mongo cluster firewall rule.
+ */
+@Fluent
+public final class FirewallRuleProperties {
+ /*
+ * The provisioning state of the firewall rule.
+ */
+ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
+ private ProvisioningState provisioningState;
+
+ /*
+ * The start IP address of the mongo cluster firewall rule. Must be IPv4 format.
+ */
+ @JsonProperty(value = "startIpAddress", required = true)
+ private String startIpAddress;
+
+ /*
+ * The end IP address of the mongo cluster firewall rule. Must be IPv4 format.
+ */
+ @JsonProperty(value = "endIpAddress", required = true)
+ private String endIpAddress;
+
+ /**
+ * Creates an instance of FirewallRuleProperties class.
+ */
+ public FirewallRuleProperties() {
+ }
+
+ /**
+ * Get the provisioningState property: The provisioning state of the firewall rule.
+ *
+ * @return the provisioningState value.
+ */
+ public ProvisioningState provisioningState() {
+ return this.provisioningState;
+ }
+
+ /**
+ * Get the startIpAddress property: The start IP address of the mongo cluster firewall rule. Must be IPv4 format.
+ *
+ * @return the startIpAddress value.
+ */
+ public String startIpAddress() {
+ return this.startIpAddress;
+ }
+
+ /**
+ * Set the startIpAddress property: The start IP address of the mongo cluster firewall rule. Must be IPv4 format.
+ *
+ * @param startIpAddress the startIpAddress value to set.
+ * @return the FirewallRuleProperties object itself.
+ */
+ public FirewallRuleProperties withStartIpAddress(String startIpAddress) {
+ this.startIpAddress = startIpAddress;
+ return this;
+ }
+
+ /**
+ * Get the endIpAddress property: The end IP address of the mongo cluster firewall rule. Must be IPv4 format.
+ *
+ * @return the endIpAddress value.
+ */
+ public String endIpAddress() {
+ return this.endIpAddress;
+ }
+
+ /**
+ * Set the endIpAddress property: The end IP address of the mongo cluster firewall rule. Must be IPv4 format.
+ *
+ * @param endIpAddress the endIpAddress value to set.
+ * @return the FirewallRuleProperties object itself.
+ */
+ public FirewallRuleProperties withEndIpAddress(String endIpAddress) {
+ this.endIpAddress = endIpAddress;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (startIpAddress() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Missing required property startIpAddress in model FirewallRuleProperties"));
+ }
+ if (endIpAddress() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Missing required property endIpAddress in model FirewallRuleProperties"));
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(FirewallRuleProperties.class);
+}
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 000000000000..38dc03e412df
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/ListConnectionStringsResultInner.java
@@ -0,0 +1,48 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.mongocluster.fluent.models;
+
+import com.azure.core.annotation.Immutable;
+import com.azure.resourcemanager.mongocluster.models.ConnectionString;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+
+/**
+ * The connection strings for the given mongo cluster.
+ */
+@Immutable
+public final class ListConnectionStringsResultInner {
+ /*
+ * An array that contains the connection strings for a mongo cluster.
+ */
+ @JsonProperty(value = "connectionStrings", access = JsonProperty.Access.WRITE_ONLY)
+ private List connectionStrings;
+
+ /**
+ * Creates an instance of ListConnectionStringsResultInner class.
+ */
+ public 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());
+ }
+ }
+}
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 000000000000..6756932aa299
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/MongoClusterInner.java
@@ -0,0 +1,298 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest 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.resourcemanager.mongocluster.models.AzureResourceManagerPrivateEndpointConnection;
+import com.azure.resourcemanager.mongocluster.models.CreateMode;
+import com.azure.resourcemanager.mongocluster.models.MongoClusterRestoreParameters;
+import com.azure.resourcemanager.mongocluster.models.MongoClusterStatus;
+import com.azure.resourcemanager.mongocluster.models.NodeGroupSpec;
+import com.azure.resourcemanager.mongocluster.models.ProvisioningState;
+import com.azure.resourcemanager.mongocluster.models.PublicNetworkAccess;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Represents a mongo cluster resource.
+ */
+@Fluent
+public final class MongoClusterInner extends Resource {
+ /*
+ * The resource-specific properties for this resource.
+ */
+ @JsonProperty(value = "properties")
+ private MongoClusterProperties innerProperties;
+
+ /*
+ * Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ */
+ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
+ private SystemData systemData;
+
+ /**
+ * Creates an instance of MongoClusterInner class.
+ */
+ public MongoClusterInner() {
+ }
+
+ /**
+ * Get the innerProperties property: The resource-specific properties for this resource.
+ *
+ * @return the innerProperties value.
+ */
+ private MongoClusterProperties innerProperties() {
+ return this.innerProperties;
+ }
+
+ /**
+ * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public MongoClusterInner withLocation(String location) {
+ super.withLocation(location);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public MongoClusterInner withTags(Map tags) {
+ super.withTags(tags);
+ return this;
+ }
+
+ /**
+ * Get the createMode property: The mode to create a mongo cluster.
+ *
+ * @return the createMode value.
+ */
+ public CreateMode createMode() {
+ return this.innerProperties() == null ? null : this.innerProperties().createMode();
+ }
+
+ /**
+ * Set the createMode property: The mode to create a mongo cluster.
+ *
+ * @param createMode the createMode value to set.
+ * @return the MongoClusterInner object itself.
+ */
+ public MongoClusterInner withCreateMode(CreateMode createMode) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new MongoClusterProperties();
+ }
+ this.innerProperties().withCreateMode(createMode);
+ return this;
+ }
+
+ /**
+ * Get the restoreParameters property: The parameters to create a point-in-time restore mongo cluster.
+ *
+ * @return the restoreParameters value.
+ */
+ public MongoClusterRestoreParameters restoreParameters() {
+ return this.innerProperties() == null ? null : this.innerProperties().restoreParameters();
+ }
+
+ /**
+ * Set the restoreParameters property: The parameters to create a point-in-time restore mongo cluster.
+ *
+ * @param restoreParameters the restoreParameters value to set.
+ * @return the MongoClusterInner object itself.
+ */
+ public MongoClusterInner withRestoreParameters(MongoClusterRestoreParameters restoreParameters) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new MongoClusterProperties();
+ }
+ this.innerProperties().withRestoreParameters(restoreParameters);
+ return this;
+ }
+
+ /**
+ * Get the administratorLogin property: The administrator's login for the mongo cluster.
+ *
+ * @return the administratorLogin value.
+ */
+ public String administratorLogin() {
+ return this.innerProperties() == null ? null : this.innerProperties().administratorLogin();
+ }
+
+ /**
+ * Set the administratorLogin property: The administrator's login for the mongo cluster.
+ *
+ * @param administratorLogin the administratorLogin value to set.
+ * @return the MongoClusterInner object itself.
+ */
+ public MongoClusterInner withAdministratorLogin(String administratorLogin) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new MongoClusterProperties();
+ }
+ this.innerProperties().withAdministratorLogin(administratorLogin);
+ return this;
+ }
+
+ /**
+ * Get the administratorLoginPassword property: The password of the administrator login.
+ *
+ * @return the administratorLoginPassword value.
+ */
+ public String administratorLoginPassword() {
+ return this.innerProperties() == null ? null : this.innerProperties().administratorLoginPassword();
+ }
+
+ /**
+ * Set the administratorLoginPassword property: The password of the administrator login.
+ *
+ * @param administratorLoginPassword the administratorLoginPassword value to set.
+ * @return the MongoClusterInner object itself.
+ */
+ public MongoClusterInner withAdministratorLoginPassword(String administratorLoginPassword) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new MongoClusterProperties();
+ }
+ this.innerProperties().withAdministratorLoginPassword(administratorLoginPassword);
+ return this;
+ }
+
+ /**
+ * Get the serverVersion property: The Mongo DB server version. Defaults to the latest available version if not
+ * specified.
+ *
+ * @return the serverVersion value.
+ */
+ public String serverVersion() {
+ return this.innerProperties() == null ? null : this.innerProperties().serverVersion();
+ }
+
+ /**
+ * Set the serverVersion property: The Mongo DB server version. Defaults to the latest available version if not
+ * specified.
+ *
+ * @param serverVersion the serverVersion value to set.
+ * @return the MongoClusterInner object itself.
+ */
+ public MongoClusterInner withServerVersion(String serverVersion) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new MongoClusterProperties();
+ }
+ this.innerProperties().withServerVersion(serverVersion);
+ return this;
+ }
+
+ /**
+ * Get the connectionString property: The default mongo connection string for the cluster.
+ *
+ * @return the connectionString value.
+ */
+ public String connectionString() {
+ return this.innerProperties() == null ? null : this.innerProperties().connectionString();
+ }
+
+ /**
+ * Get the earliestRestoreTime property: Earliest restore timestamp in UTC ISO8601 format.
+ *
+ * @return the earliestRestoreTime value.
+ */
+ public String earliestRestoreTime() {
+ return this.innerProperties() == null ? null : this.innerProperties().earliestRestoreTime();
+ }
+
+ /**
+ * Get the provisioningState property: The provisioning state of the mongo cluster.
+ *
+ * @return the provisioningState value.
+ */
+ public ProvisioningState provisioningState() {
+ return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
+ }
+
+ /**
+ * Get the clusterStatus property: The status of the mongo cluster.
+ *
+ * @return the clusterStatus value.
+ */
+ public MongoClusterStatus clusterStatus() {
+ return this.innerProperties() == null ? null : this.innerProperties().clusterStatus();
+ }
+
+ /**
+ * Get the publicNetworkAccess property: Whether or not public endpoint access is allowed for this mongo cluster.
+ *
+ * @return the publicNetworkAccess value.
+ */
+ public PublicNetworkAccess publicNetworkAccess() {
+ return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess();
+ }
+
+ /**
+ * Set the publicNetworkAccess property: Whether or not public endpoint access is allowed for this mongo cluster.
+ *
+ * @param publicNetworkAccess the publicNetworkAccess value to set.
+ * @return the MongoClusterInner object itself.
+ */
+ public MongoClusterInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new MongoClusterProperties();
+ }
+ this.innerProperties().withPublicNetworkAccess(publicNetworkAccess);
+ return this;
+ }
+
+ /**
+ * Get the nodeGroupSpecs property: The list of node group specs in the cluster.
+ *
+ * @return the nodeGroupSpecs value.
+ */
+ public List nodeGroupSpecs() {
+ return this.innerProperties() == null ? null : this.innerProperties().nodeGroupSpecs();
+ }
+
+ /**
+ * Set the nodeGroupSpecs property: The list of node group specs in the cluster.
+ *
+ * @param nodeGroupSpecs the nodeGroupSpecs value to set.
+ * @return the MongoClusterInner object itself.
+ */
+ public MongoClusterInner withNodeGroupSpecs(List nodeGroupSpecs) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new MongoClusterProperties();
+ }
+ this.innerProperties().withNodeGroupSpecs(nodeGroupSpecs);
+ return this;
+ }
+
+ /**
+ * Get the privateEndpointConnections property: List of private endpoint connections.
+ *
+ * @return the privateEndpointConnections value.
+ */
+ public List privateEndpointConnections() {
+ return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections();
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (innerProperties() != null) {
+ innerProperties().validate();
+ }
+ }
+}
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/MongoClusterProperties.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/MongoClusterProperties.java
new file mode 100644
index 000000000000..16ce02012935
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/MongoClusterProperties.java
@@ -0,0 +1,304 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.mongocluster.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.resourcemanager.mongocluster.models.AzureResourceManagerPrivateEndpointConnection;
+import com.azure.resourcemanager.mongocluster.models.CreateMode;
+import com.azure.resourcemanager.mongocluster.models.MongoClusterRestoreParameters;
+import com.azure.resourcemanager.mongocluster.models.MongoClusterStatus;
+import com.azure.resourcemanager.mongocluster.models.NodeGroupSpec;
+import com.azure.resourcemanager.mongocluster.models.ProvisioningState;
+import com.azure.resourcemanager.mongocluster.models.PublicNetworkAccess;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+
+/**
+ * The properties of a mongo cluster.
+ */
+@Fluent
+public final class MongoClusterProperties {
+ /*
+ * The mode to create a mongo cluster.
+ */
+ @JsonProperty(value = "createMode")
+ private CreateMode createMode;
+
+ /*
+ * The parameters to create a point-in-time restore mongo cluster.
+ */
+ @JsonProperty(value = "restoreParameters")
+ private MongoClusterRestoreParameters restoreParameters;
+
+ /*
+ * The administrator's login for the mongo cluster.
+ */
+ @JsonProperty(value = "administratorLogin")
+ private String administratorLogin;
+
+ /*
+ * The password of the administrator login.
+ */
+ @JsonProperty(value = "administratorLoginPassword")
+ private String administratorLoginPassword;
+
+ /*
+ * The Mongo DB server version. Defaults to the latest available version if not specified.
+ */
+ @JsonProperty(value = "serverVersion")
+ private String serverVersion;
+
+ /*
+ * The default mongo connection string for the cluster.
+ */
+ @JsonProperty(value = "connectionString", access = JsonProperty.Access.WRITE_ONLY)
+ private String connectionString;
+
+ /*
+ * Earliest restore timestamp in UTC ISO8601 format.
+ */
+ @JsonProperty(value = "earliestRestoreTime", access = JsonProperty.Access.WRITE_ONLY)
+ private String earliestRestoreTime;
+
+ /*
+ * The provisioning state of the mongo cluster.
+ */
+ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
+ private ProvisioningState provisioningState;
+
+ /*
+ * The status of the mongo cluster.
+ */
+ @JsonProperty(value = "clusterStatus", access = JsonProperty.Access.WRITE_ONLY)
+ private MongoClusterStatus clusterStatus;
+
+ /*
+ * Whether or not public endpoint access is allowed for this mongo cluster.
+ */
+ @JsonProperty(value = "publicNetworkAccess")
+ private PublicNetworkAccess publicNetworkAccess;
+
+ /*
+ * The list of node group specs in the cluster.
+ */
+ @JsonProperty(value = "nodeGroupSpecs")
+ private List nodeGroupSpecs;
+
+ /*
+ * List of private endpoint connections.
+ */
+ @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY)
+ private List privateEndpointConnections;
+
+ /**
+ * Creates an instance of MongoClusterProperties class.
+ */
+ public MongoClusterProperties() {
+ }
+
+ /**
+ * Get the createMode property: The mode to create a mongo cluster.
+ *
+ * @return the createMode value.
+ */
+ public CreateMode createMode() {
+ return this.createMode;
+ }
+
+ /**
+ * Set the createMode property: The mode to create a mongo cluster.
+ *
+ * @param createMode the createMode value to set.
+ * @return the MongoClusterProperties object itself.
+ */
+ public MongoClusterProperties withCreateMode(CreateMode createMode) {
+ this.createMode = createMode;
+ return this;
+ }
+
+ /**
+ * Get the restoreParameters property: The parameters to create a point-in-time restore mongo cluster.
+ *
+ * @return the restoreParameters value.
+ */
+ public MongoClusterRestoreParameters restoreParameters() {
+ return this.restoreParameters;
+ }
+
+ /**
+ * Set the restoreParameters property: The parameters to create a point-in-time restore mongo cluster.
+ *
+ * @param restoreParameters the restoreParameters value to set.
+ * @return the MongoClusterProperties object itself.
+ */
+ public MongoClusterProperties withRestoreParameters(MongoClusterRestoreParameters restoreParameters) {
+ this.restoreParameters = restoreParameters;
+ return this;
+ }
+
+ /**
+ * Get the administratorLogin property: The administrator's login for the mongo cluster.
+ *
+ * @return the administratorLogin value.
+ */
+ public String administratorLogin() {
+ return this.administratorLogin;
+ }
+
+ /**
+ * Set the administratorLogin property: The administrator's login for the mongo cluster.
+ *
+ * @param administratorLogin the administratorLogin value to set.
+ * @return the MongoClusterProperties object itself.
+ */
+ public MongoClusterProperties withAdministratorLogin(String administratorLogin) {
+ this.administratorLogin = administratorLogin;
+ return this;
+ }
+
+ /**
+ * Get the administratorLoginPassword property: The password of the administrator login.
+ *
+ * @return the administratorLoginPassword value.
+ */
+ public String administratorLoginPassword() {
+ return this.administratorLoginPassword;
+ }
+
+ /**
+ * Set the administratorLoginPassword property: The password of the administrator login.
+ *
+ * @param administratorLoginPassword the administratorLoginPassword value to set.
+ * @return the MongoClusterProperties object itself.
+ */
+ public MongoClusterProperties withAdministratorLoginPassword(String administratorLoginPassword) {
+ this.administratorLoginPassword = administratorLoginPassword;
+ return this;
+ }
+
+ /**
+ * Get the serverVersion property: The Mongo DB server version. Defaults to the latest available version if not
+ * specified.
+ *
+ * @return the serverVersion value.
+ */
+ public String serverVersion() {
+ return this.serverVersion;
+ }
+
+ /**
+ * Set the serverVersion property: The Mongo DB server version. Defaults to the latest available version if not
+ * specified.
+ *
+ * @param serverVersion the serverVersion value to set.
+ * @return the MongoClusterProperties object itself.
+ */
+ public MongoClusterProperties withServerVersion(String serverVersion) {
+ this.serverVersion = serverVersion;
+ return this;
+ }
+
+ /**
+ * Get the connectionString property: The default mongo connection string for the cluster.
+ *
+ * @return the connectionString value.
+ */
+ public String connectionString() {
+ return this.connectionString;
+ }
+
+ /**
+ * Get the earliestRestoreTime property: Earliest restore timestamp in UTC ISO8601 format.
+ *
+ * @return the earliestRestoreTime value.
+ */
+ public String earliestRestoreTime() {
+ return this.earliestRestoreTime;
+ }
+
+ /**
+ * Get the provisioningState property: The provisioning state of the mongo cluster.
+ *
+ * @return the provisioningState value.
+ */
+ public ProvisioningState provisioningState() {
+ return this.provisioningState;
+ }
+
+ /**
+ * Get the clusterStatus property: The status of the mongo cluster.
+ *
+ * @return the clusterStatus value.
+ */
+ public MongoClusterStatus clusterStatus() {
+ return this.clusterStatus;
+ }
+
+ /**
+ * Get the publicNetworkAccess property: Whether or not public endpoint access is allowed for this mongo cluster.
+ *
+ * @return the publicNetworkAccess value.
+ */
+ public PublicNetworkAccess publicNetworkAccess() {
+ return this.publicNetworkAccess;
+ }
+
+ /**
+ * Set the publicNetworkAccess property: Whether or not public endpoint access is allowed for this mongo cluster.
+ *
+ * @param publicNetworkAccess the publicNetworkAccess value to set.
+ * @return the MongoClusterProperties object itself.
+ */
+ public MongoClusterProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) {
+ this.publicNetworkAccess = publicNetworkAccess;
+ return this;
+ }
+
+ /**
+ * Get the nodeGroupSpecs property: The list of node group specs in the cluster.
+ *
+ * @return the nodeGroupSpecs value.
+ */
+ public List nodeGroupSpecs() {
+ return this.nodeGroupSpecs;
+ }
+
+ /**
+ * Set the nodeGroupSpecs property: The list of node group specs in the cluster.
+ *
+ * @param nodeGroupSpecs the nodeGroupSpecs value to set.
+ * @return the MongoClusterProperties object itself.
+ */
+ public MongoClusterProperties withNodeGroupSpecs(List nodeGroupSpecs) {
+ this.nodeGroupSpecs = nodeGroupSpecs;
+ return this;
+ }
+
+ /**
+ * Get the privateEndpointConnections property: List of private endpoint connections.
+ *
+ * @return the privateEndpointConnections value.
+ */
+ public List privateEndpointConnections() {
+ return this.privateEndpointConnections;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (restoreParameters() != null) {
+ restoreParameters().validate();
+ }
+ if (nodeGroupSpecs() != null) {
+ nodeGroupSpecs().forEach(e -> e.validate());
+ }
+ if (privateEndpointConnections() != null) {
+ privateEndpointConnections().forEach(e -> e.validate());
+ }
+ }
+}
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/MongoClusterUpdateProperties.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/MongoClusterUpdateProperties.java
new file mode 100644
index 000000000000..ab6fd5bbc93d
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/MongoClusterUpdateProperties.java
@@ -0,0 +1,166 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.mongocluster.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.resourcemanager.mongocluster.models.NodeGroupSpec;
+import com.azure.resourcemanager.mongocluster.models.PublicNetworkAccess;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+
+/**
+ * The updatable properties of the MongoCluster.
+ */
+@Fluent
+public final class MongoClusterUpdateProperties {
+ /*
+ * The administrator's login for the mongo cluster.
+ */
+ @JsonProperty(value = "administratorLogin")
+ private String administratorLogin;
+
+ /*
+ * The password of the administrator login.
+ */
+ @JsonProperty(value = "administratorLoginPassword")
+ private String administratorLoginPassword;
+
+ /*
+ * The Mongo DB server version. Defaults to the latest available version if not specified.
+ */
+ @JsonProperty(value = "serverVersion")
+ private String serverVersion;
+
+ /*
+ * Whether or not public endpoint access is allowed for this mongo cluster.
+ */
+ @JsonProperty(value = "publicNetworkAccess")
+ private PublicNetworkAccess publicNetworkAccess;
+
+ /*
+ * The list of node group specs in the cluster.
+ */
+ @JsonProperty(value = "nodeGroupSpecs")
+ private List nodeGroupSpecs;
+
+ /**
+ * Creates an instance of MongoClusterUpdateProperties class.
+ */
+ public MongoClusterUpdateProperties() {
+ }
+
+ /**
+ * Get the administratorLogin property: The administrator's login for the mongo cluster.
+ *
+ * @return the administratorLogin value.
+ */
+ public String administratorLogin() {
+ return this.administratorLogin;
+ }
+
+ /**
+ * Set the administratorLogin property: The administrator's login for the mongo cluster.
+ *
+ * @param administratorLogin the administratorLogin value to set.
+ * @return the MongoClusterUpdateProperties object itself.
+ */
+ public MongoClusterUpdateProperties withAdministratorLogin(String administratorLogin) {
+ this.administratorLogin = administratorLogin;
+ return this;
+ }
+
+ /**
+ * Get the administratorLoginPassword property: The password of the administrator login.
+ *
+ * @return the administratorLoginPassword value.
+ */
+ public String administratorLoginPassword() {
+ return this.administratorLoginPassword;
+ }
+
+ /**
+ * Set the administratorLoginPassword property: The password of the administrator login.
+ *
+ * @param administratorLoginPassword the administratorLoginPassword value to set.
+ * @return the MongoClusterUpdateProperties object itself.
+ */
+ public MongoClusterUpdateProperties withAdministratorLoginPassword(String administratorLoginPassword) {
+ this.administratorLoginPassword = administratorLoginPassword;
+ return this;
+ }
+
+ /**
+ * Get the serverVersion property: The Mongo DB server version. Defaults to the latest available version if not
+ * specified.
+ *
+ * @return the serverVersion value.
+ */
+ public String serverVersion() {
+ return this.serverVersion;
+ }
+
+ /**
+ * Set the serverVersion property: The Mongo DB server version. Defaults to the latest available version if not
+ * specified.
+ *
+ * @param serverVersion the serverVersion value to set.
+ * @return the MongoClusterUpdateProperties object itself.
+ */
+ public MongoClusterUpdateProperties withServerVersion(String serverVersion) {
+ this.serverVersion = serverVersion;
+ return this;
+ }
+
+ /**
+ * Get the publicNetworkAccess property: Whether or not public endpoint access is allowed for this mongo cluster.
+ *
+ * @return the publicNetworkAccess value.
+ */
+ public PublicNetworkAccess publicNetworkAccess() {
+ return this.publicNetworkAccess;
+ }
+
+ /**
+ * Set the publicNetworkAccess property: Whether or not public endpoint access is allowed for this mongo cluster.
+ *
+ * @param publicNetworkAccess the publicNetworkAccess value to set.
+ * @return the MongoClusterUpdateProperties object itself.
+ */
+ public MongoClusterUpdateProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) {
+ this.publicNetworkAccess = publicNetworkAccess;
+ return this;
+ }
+
+ /**
+ * Get the nodeGroupSpecs property: The list of node group specs in the cluster.
+ *
+ * @return the nodeGroupSpecs value.
+ */
+ public List nodeGroupSpecs() {
+ return this.nodeGroupSpecs;
+ }
+
+ /**
+ * Set the nodeGroupSpecs property: The list of node group specs in the cluster.
+ *
+ * @param nodeGroupSpecs the nodeGroupSpecs value to set.
+ * @return the MongoClusterUpdateProperties object itself.
+ */
+ public MongoClusterUpdateProperties withNodeGroupSpecs(List nodeGroupSpecs) {
+ this.nodeGroupSpecs = nodeGroupSpecs;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (nodeGroupSpecs() != null) {
+ nodeGroupSpecs().forEach(e -> e.validate());
+ }
+ }
+}
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 000000000000..f5c0ff341bec
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/OperationInner.java
@@ -0,0 +1,126 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.mongocluster.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.resourcemanager.mongocluster.models.ActionType;
+import com.azure.resourcemanager.mongocluster.models.OperationDisplay;
+import com.azure.resourcemanager.mongocluster.models.Origin;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * REST API Operation
+ *
+ * Details of a REST API operation, returned from the Resource Provider Operations API.
+ */
+@Fluent
+public final class OperationInner {
+ /*
+ * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action"
+ */
+ @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY)
+ private String name;
+
+ /*
+ * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations.
+ */
+ @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY)
+ private Boolean isDataAction;
+
+ /*
+ * Localized display information for this particular operation.
+ */
+ @JsonProperty(value = "display")
+ 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"
+ */
+ @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY)
+ private Origin origin;
+
+ /*
+ * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
+ */
+ @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY)
+ private ActionType actionType;
+
+ /**
+ * Creates an instance of OperationInner class.
+ */
+ public 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 ARM/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;
+ }
+
+ /**
+ * Set the display property: Localized display information for this particular operation.
+ *
+ * @param display the display value to set.
+ * @return the OperationInner object itself.
+ */
+ public OperationInner withDisplay(OperationDisplay display) {
+ this.display = display;
+ return this;
+ }
+
+ /**
+ * 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: 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();
+ }
+ }
+}
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/PrivateEndpointConnectionProperties.java
new file mode 100644
index 000000000000..5baebda2a33d
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/PrivateEndpointConnectionProperties.java
@@ -0,0 +1,130 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.mongocluster.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.mongocluster.models.PrivateEndpoint;
+import com.azure.resourcemanager.mongocluster.models.PrivateEndpointConnectionProvisioningState;
+import com.azure.resourcemanager.mongocluster.models.PrivateLinkServiceConnectionState;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+
+/**
+ * Properties of the private endpoint connection.
+ */
+@Fluent
+public final class PrivateEndpointConnectionProperties {
+ /*
+ * The group ids for the private endpoint resource.
+ */
+ @JsonProperty(value = "groupIds", access = JsonProperty.Access.WRITE_ONLY)
+ private List groupIds;
+
+ /*
+ * The private endpoint resource.
+ */
+ @JsonProperty(value = "privateEndpoint")
+ private PrivateEndpoint privateEndpoint;
+
+ /*
+ * A collection of information about the state of the connection between service consumer and provider.
+ */
+ @JsonProperty(value = "privateLinkServiceConnectionState", required = true)
+ private PrivateLinkServiceConnectionState privateLinkServiceConnectionState;
+
+ /*
+ * The provisioning state of the private endpoint connection resource.
+ */
+ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
+ private PrivateEndpointConnectionProvisioningState provisioningState;
+
+ /**
+ * Creates an instance of PrivateEndpointConnectionProperties class.
+ */
+ public PrivateEndpointConnectionProperties() {
+ }
+
+ /**
+ * Get the groupIds property: The group ids for the private endpoint resource.
+ *
+ * @return the groupIds value.
+ */
+ public List groupIds() {
+ return this.groupIds;
+ }
+
+ /**
+ * Get the privateEndpoint property: The private endpoint resource.
+ *
+ * @return the privateEndpoint value.
+ */
+ public PrivateEndpoint privateEndpoint() {
+ return this.privateEndpoint;
+ }
+
+ /**
+ * Set the privateEndpoint property: The private endpoint resource.
+ *
+ * @param privateEndpoint the privateEndpoint value to set.
+ * @return the PrivateEndpointConnectionProperties object itself.
+ */
+ public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpoint privateEndpoint) {
+ this.privateEndpoint = privateEndpoint;
+ return this;
+ }
+
+ /**
+ * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection
+ * between service consumer and provider.
+ *
+ * @return the privateLinkServiceConnectionState value.
+ */
+ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() {
+ return this.privateLinkServiceConnectionState;
+ }
+
+ /**
+ * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection
+ * between service consumer and provider.
+ *
+ * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set.
+ * @return the PrivateEndpointConnectionProperties object itself.
+ */
+ public PrivateEndpointConnectionProperties
+ withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) {
+ this.privateLinkServiceConnectionState = privateLinkServiceConnectionState;
+ return this;
+ }
+
+ /**
+ * Get the provisioningState property: The provisioning state of the private endpoint connection resource.
+ *
+ * @return the provisioningState value.
+ */
+ public PrivateEndpointConnectionProvisioningState provisioningState() {
+ return this.provisioningState;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (privateEndpoint() != null) {
+ privateEndpoint().validate();
+ }
+ if (privateLinkServiceConnectionState() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Missing required property privateLinkServiceConnectionState in model PrivateEndpointConnectionProperties"));
+ } else {
+ privateLinkServiceConnectionState().validate();
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionProperties.class);
+}
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 000000000000..3b81eb60b48c
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/PrivateEndpointConnectionResourceInner.java
@@ -0,0 +1,134 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.mongocluster.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.ProxyResource;
+import com.azure.core.management.SystemData;
+import com.azure.resourcemanager.mongocluster.models.PrivateEndpoint;
+import com.azure.resourcemanager.mongocluster.models.PrivateEndpointConnectionProvisioningState;
+import com.azure.resourcemanager.mongocluster.models.PrivateLinkServiceConnectionState;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+
+/**
+ * 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.
+ */
+ @JsonProperty(value = "properties")
+ private PrivateEndpointConnectionProperties innerProperties;
+
+ /*
+ * Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ */
+ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
+ private SystemData systemData;
+
+ /**
+ * Creates an instance of PrivateEndpointConnectionResourceInner class.
+ */
+ public PrivateEndpointConnectionResourceInner() {
+ }
+
+ /**
+ * Get the innerProperties property: The resource-specific properties for this resource.
+ *
+ * @return the innerProperties value.
+ */
+ private PrivateEndpointConnectionProperties innerProperties() {
+ return this.innerProperties;
+ }
+
+ /**
+ * 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 groupIds property: The group ids for the private endpoint resource.
+ *
+ * @return the groupIds value.
+ */
+ public List groupIds() {
+ return this.innerProperties() == null ? null : this.innerProperties().groupIds();
+ }
+
+ /**
+ * Get the privateEndpoint property: The private endpoint resource.
+ *
+ * @return the privateEndpoint value.
+ */
+ public PrivateEndpoint privateEndpoint() {
+ return this.innerProperties() == null ? null : this.innerProperties().privateEndpoint();
+ }
+
+ /**
+ * Set the privateEndpoint property: The private endpoint resource.
+ *
+ * @param privateEndpoint the privateEndpoint value to set.
+ * @return the PrivateEndpointConnectionResourceInner object itself.
+ */
+ public PrivateEndpointConnectionResourceInner withPrivateEndpoint(PrivateEndpoint privateEndpoint) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new PrivateEndpointConnectionProperties();
+ }
+ this.innerProperties().withPrivateEndpoint(privateEndpoint);
+ return this;
+ }
+
+ /**
+ * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection
+ * between service consumer and provider.
+ *
+ * @return the privateLinkServiceConnectionState value.
+ */
+ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() {
+ return this.innerProperties() == null ? null : this.innerProperties().privateLinkServiceConnectionState();
+ }
+
+ /**
+ * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection
+ * between service consumer and provider.
+ *
+ * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set.
+ * @return the PrivateEndpointConnectionResourceInner object itself.
+ */
+ public PrivateEndpointConnectionResourceInner
+ withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new PrivateEndpointConnectionProperties();
+ }
+ this.innerProperties().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState);
+ return this;
+ }
+
+ /**
+ * Get the provisioningState property: The provisioning state of the private endpoint connection resource.
+ *
+ * @return the provisioningState value.
+ */
+ public PrivateEndpointConnectionProvisioningState provisioningState() {
+ return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (innerProperties() != null) {
+ innerProperties().validate();
+ }
+ }
+}
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 000000000000..f9e9fe5ab916
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/PrivateLinkResourceInner.java
@@ -0,0 +1,105 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest 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.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+
+/**
+ * Concrete proxy resource types can be created by aliasing this type using a specific property type.
+ */
+@Fluent
+public final class PrivateLinkResourceInner extends ProxyResource {
+ /*
+ * The resource-specific properties for this resource.
+ */
+ @JsonProperty(value = "properties")
+ private PrivateLinkResourceProperties innerProperties;
+
+ /*
+ * Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ */
+ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
+ private SystemData systemData;
+
+ /**
+ * Creates an instance of PrivateLinkResourceInner class.
+ */
+ public PrivateLinkResourceInner() {
+ }
+
+ /**
+ * Get the innerProperties property: The resource-specific properties for this resource.
+ *
+ * @return the innerProperties value.
+ */
+ private PrivateLinkResourceProperties innerProperties() {
+ return this.innerProperties;
+ }
+
+ /**
+ * 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 groupId property: The private link resource group id.
+ *
+ * @return the groupId value.
+ */
+ public String groupId() {
+ return this.innerProperties() == null ? null : this.innerProperties().groupId();
+ }
+
+ /**
+ * Get the requiredMembers property: The private link resource required member names.
+ *
+ * @return the requiredMembers value.
+ */
+ public List requiredMembers() {
+ return this.innerProperties() == null ? null : this.innerProperties().requiredMembers();
+ }
+
+ /**
+ * Get the requiredZoneNames property: The private link resource private link DNS zone name.
+ *
+ * @return the requiredZoneNames value.
+ */
+ public List requiredZoneNames() {
+ return this.innerProperties() == null ? null : this.innerProperties().requiredZoneNames();
+ }
+
+ /**
+ * Set the requiredZoneNames property: The private link resource private link DNS zone name.
+ *
+ * @param requiredZoneNames the requiredZoneNames value to set.
+ * @return the PrivateLinkResourceInner object itself.
+ */
+ public PrivateLinkResourceInner withRequiredZoneNames(List requiredZoneNames) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new PrivateLinkResourceProperties();
+ }
+ this.innerProperties().withRequiredZoneNames(requiredZoneNames);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (innerProperties() != null) {
+ innerProperties().validate();
+ }
+ }
+}
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/PrivateLinkResourceProperties.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/PrivateLinkResourceProperties.java
new file mode 100644
index 000000000000..7b08e783b668
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/PrivateLinkResourceProperties.java
@@ -0,0 +1,85 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.mongocluster.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+
+/**
+ * Properties of a private link resource.
+ */
+@Fluent
+public final class PrivateLinkResourceProperties {
+ /*
+ * The private link resource group id.
+ */
+ @JsonProperty(value = "groupId", access = JsonProperty.Access.WRITE_ONLY)
+ private String groupId;
+
+ /*
+ * The private link resource required member names.
+ */
+ @JsonProperty(value = "requiredMembers", access = JsonProperty.Access.WRITE_ONLY)
+ private List requiredMembers;
+
+ /*
+ * The private link resource private link DNS zone name.
+ */
+ @JsonProperty(value = "requiredZoneNames")
+ private List requiredZoneNames;
+
+ /**
+ * Creates an instance of PrivateLinkResourceProperties class.
+ */
+ public PrivateLinkResourceProperties() {
+ }
+
+ /**
+ * Get the groupId property: The private link resource group id.
+ *
+ * @return the groupId value.
+ */
+ public String groupId() {
+ return this.groupId;
+ }
+
+ /**
+ * Get the requiredMembers property: The private link resource required member names.
+ *
+ * @return the requiredMembers value.
+ */
+ public List requiredMembers() {
+ return this.requiredMembers;
+ }
+
+ /**
+ * Get the requiredZoneNames property: The private link resource private link DNS zone name.
+ *
+ * @return the requiredZoneNames value.
+ */
+ public List requiredZoneNames() {
+ return this.requiredZoneNames;
+ }
+
+ /**
+ * Set the requiredZoneNames property: The private link resource private link DNS zone name.
+ *
+ * @param requiredZoneNames the requiredZoneNames value to set.
+ * @return the PrivateLinkResourceProperties object itself.
+ */
+ public PrivateLinkResourceProperties withRequiredZoneNames(List requiredZoneNames) {
+ this.requiredZoneNames = requiredZoneNames;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+}
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 000000000000..8119c68b4f31
--- /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) AutoRest 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 000000000000..64a699badc4b
--- /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) AutoRest 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 000000000000..90bcd142f801
--- /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) AutoRest 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/FirewallRuleImpl.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/FirewallRuleImpl.java
new file mode 100644
index 000000000000..72165ebc2856
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/FirewallRuleImpl.java
@@ -0,0 +1,142 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest 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.ProvisioningState;
+
+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 SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public ProvisioningState provisioningState() {
+ return this.innerModel().provisioningState();
+ }
+
+ public String startIpAddress() {
+ return this.innerModel().startIpAddress();
+ }
+
+ public String endIpAddress() {
+ return this.innerModel().endIpAddress();
+ }
+
+ 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 withStartIpAddress(String startIpAddress) {
+ this.innerModel().withStartIpAddress(startIpAddress);
+ return this;
+ }
+
+ public FirewallRuleImpl withEndIpAddress(String endIpAddress) {
+ this.innerModel().withEndIpAddress(endIpAddress);
+ 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 000000000000..1844c719685e
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/FirewallRulesClientImpl.java
@@ -0,0 +1,948 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest 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.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 MongoClusterManagementClientImpl client;
+
+ /**
+ * Initializes an instance of FirewallRulesClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ FirewallRulesClientImpl(MongoClusterManagementClientImpl client) {
+ this.service
+ = RestProxy.create(FirewallRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for MongoClusterManagementClientFirewallRules to be used by the proxy
+ * service to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "MongoClusterManageme")
+ public interface FirewallRulesService {
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByMongoCluster(@HostParam("$host") 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}/firewallRules/{firewallRuleName}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> get(@HostParam("$host") 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("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("mongoClusterName") String mongoClusterName,
+ @PathParam("firewallRuleName") String firewallRuleName,
+ @BodyParam("application/json") FirewallRuleInner resource, @HeaderParam("Accept") String accept,
+ 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("$host") 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("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByMongoClusterNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept, 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 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));
+ }
+
+ /**
+ * 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 represents a mongo cluster firewall rule 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, resource,
+ accept, 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 represents a mongo cluster firewall rule 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, resource, accept,
+ 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 represents a mongo cluster firewall rule.
+ */
+ @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 represents a mongo cluster firewall rule.
+ */
+ @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 represents a mongo cluster firewall rule.
+ */
+ @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 represents a mongo cluster firewall rule.
+ */
+ @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 represents a mongo cluster firewall rule 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 represents a mongo cluster firewall rule 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 represents a mongo cluster firewall rule.
+ */
+ @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 represents a mongo cluster firewall rule.
+ */
+ @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();
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ *
+ * The nextLink parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return 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
+ *
+ * The nextLink parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return 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 000000000000..bf7429a12ef2
--- /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) AutoRest 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 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 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 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 000000000000..0539a25b12c4
--- /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) AutoRest 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 000000000000..cdd570ce1b4e
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/MongoClusterImpl.java
@@ -0,0 +1,304 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest 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.AzureResourceManagerPrivateEndpointConnection;
+import com.azure.resourcemanager.mongocluster.models.CreateMode;
+import com.azure.resourcemanager.mongocluster.models.ListConnectionStringsResult;
+import com.azure.resourcemanager.mongocluster.models.MongoCluster;
+import com.azure.resourcemanager.mongocluster.models.MongoClusterRestoreParameters;
+import com.azure.resourcemanager.mongocluster.models.MongoClusterStatus;
+import com.azure.resourcemanager.mongocluster.models.MongoClusterUpdate;
+import com.azure.resourcemanager.mongocluster.models.NodeGroupSpec;
+import com.azure.resourcemanager.mongocluster.models.ProvisioningState;
+import com.azure.resourcemanager.mongocluster.models.PublicNetworkAccess;
+import java.util.Collections;
+import java.util.List;
+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 SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public CreateMode createMode() {
+ return this.innerModel().createMode();
+ }
+
+ public MongoClusterRestoreParameters restoreParameters() {
+ return this.innerModel().restoreParameters();
+ }
+
+ public String administratorLogin() {
+ return this.innerModel().administratorLogin();
+ }
+
+ public String administratorLoginPassword() {
+ return this.innerModel().administratorLoginPassword();
+ }
+
+ public String serverVersion() {
+ return this.innerModel().serverVersion();
+ }
+
+ public String connectionString() {
+ return this.innerModel().connectionString();
+ }
+
+ public String earliestRestoreTime() {
+ return this.innerModel().earliestRestoreTime();
+ }
+
+ public ProvisioningState provisioningState() {
+ return this.innerModel().provisioningState();
+ }
+
+ public MongoClusterStatus clusterStatus() {
+ return this.innerModel().clusterStatus();
+ }
+
+ public PublicNetworkAccess publicNetworkAccess() {
+ return this.innerModel().publicNetworkAccess();
+ }
+
+ public List nodeGroupSpecs() {
+ List inner = this.innerModel().nodeGroupSpecs();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public List privateEndpointConnections() {
+ List inner = this.innerModel().privateEndpointConnections();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ 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 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 withCreateMode(CreateMode createMode) {
+ this.innerModel().withCreateMode(createMode);
+ return this;
+ }
+
+ public MongoClusterImpl withRestoreParameters(MongoClusterRestoreParameters restoreParameters) {
+ this.innerModel().withRestoreParameters(restoreParameters);
+ return this;
+ }
+
+ public MongoClusterImpl withAdministratorLogin(String administratorLogin) {
+ if (isInCreateMode()) {
+ this.innerModel().withAdministratorLogin(administratorLogin);
+ return this;
+ } else {
+ this.updateProperties.withAdministratorLogin(administratorLogin);
+ return this;
+ }
+ }
+
+ public MongoClusterImpl withAdministratorLoginPassword(String administratorLoginPassword) {
+ if (isInCreateMode()) {
+ this.innerModel().withAdministratorLoginPassword(administratorLoginPassword);
+ return this;
+ } else {
+ this.updateProperties.withAdministratorLoginPassword(administratorLoginPassword);
+ return this;
+ }
+ }
+
+ public MongoClusterImpl withServerVersion(String serverVersion) {
+ if (isInCreateMode()) {
+ this.innerModel().withServerVersion(serverVersion);
+ return this;
+ } else {
+ this.updateProperties.withServerVersion(serverVersion);
+ return this;
+ }
+ }
+
+ public MongoClusterImpl withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) {
+ if (isInCreateMode()) {
+ this.innerModel().withPublicNetworkAccess(publicNetworkAccess);
+ return this;
+ } else {
+ this.updateProperties.withPublicNetworkAccess(publicNetworkAccess);
+ return this;
+ }
+ }
+
+ public MongoClusterImpl withNodeGroupSpecs(List nodeGroupSpecs) {
+ if (isInCreateMode()) {
+ this.innerModel().withNodeGroupSpecs(nodeGroupSpecs);
+ return this;
+ } else {
+ this.updateProperties.withNodeGroupSpecs(nodeGroupSpecs);
+ 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/MongoClusterManagementClientBuilder.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/MongoClusterManagementClientBuilder.java
new file mode 100644
index 000000000000..8a8273298545
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/MongoClusterManagementClientBuilder.java
@@ -0,0 +1,138 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest 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 MongoClusterManagementClientImpl type.
+ */
+@ServiceClientBuilder(serviceClients = { MongoClusterManagementClientImpl.class })
+public final class MongoClusterManagementClientBuilder {
+ /*
+ * 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 MongoClusterManagementClientBuilder.
+ */
+ public MongoClusterManagementClientBuilder subscriptionId(String subscriptionId) {
+ this.subscriptionId = subscriptionId;
+ return this;
+ }
+
+ /*
+ * server parameter
+ */
+ private String endpoint;
+
+ /**
+ * Sets server parameter.
+ *
+ * @param endpoint the endpoint value.
+ * @return the MongoClusterManagementClientBuilder.
+ */
+ public MongoClusterManagementClientBuilder endpoint(String endpoint) {
+ this.endpoint = endpoint;
+ return this;
+ }
+
+ /*
+ * The environment to connect to
+ */
+ private AzureEnvironment environment;
+
+ /**
+ * Sets The environment to connect to.
+ *
+ * @param environment the environment value.
+ * @return the MongoClusterManagementClientBuilder.
+ */
+ public MongoClusterManagementClientBuilder 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 MongoClusterManagementClientBuilder.
+ */
+ public MongoClusterManagementClientBuilder 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 MongoClusterManagementClientBuilder.
+ */
+ public MongoClusterManagementClientBuilder 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 MongoClusterManagementClientBuilder.
+ */
+ public MongoClusterManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) {
+ this.serializerAdapter = serializerAdapter;
+ return this;
+ }
+
+ /**
+ * Builds an instance of MongoClusterManagementClientImpl with the provided parameters.
+ *
+ * @return an instance of MongoClusterManagementClientImpl.
+ */
+ public MongoClusterManagementClientImpl buildClient() {
+ String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com";
+ AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE;
+ HttpPipeline localPipeline = (pipeline != null)
+ ? pipeline
+ : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build();
+ Duration localDefaultPollInterval
+ = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30);
+ SerializerAdapter localSerializerAdapter = (serializerAdapter != null)
+ ? serializerAdapter
+ : SerializerFactory.createDefaultManagementSerializerAdapter();
+ MongoClusterManagementClientImpl client = new MongoClusterManagementClientImpl(localPipeline,
+ localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint);
+ return client;
+ }
+}
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/MongoClusterManagementClientImpl.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/MongoClusterManagementClientImpl.java
new file mode 100644
index 000000000000..3533e331667f
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/MongoClusterManagementClientImpl.java
@@ -0,0 +1,352 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest 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.FirewallRulesClient;
+import com.azure.resourcemanager.mongocluster.fluent.MongoClusterManagementClient;
+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 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 MongoClusterManagementClientImpl type.
+ */
+@ServiceClient(builder = MongoClusterManagementClientBuilder.class)
+public final class MongoClusterManagementClientImpl implements MongoClusterManagementClient {
+ /**
+ * 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;
+ }
+
+ /**
+ * server parameter.
+ */
+ private final String endpoint;
+
+ /**
+ * Gets server parameter.
+ *
+ * @return the endpoint value.
+ */
+ public String getEndpoint() {
+ return this.endpoint;
+ }
+
+ /**
+ * Api Version.
+ */
+ private final String apiVersion;
+
+ /**
+ * Gets Api Version.
+ *
+ * @return the apiVersion value.
+ */
+ public String getApiVersion() {
+ return this.apiVersion;
+ }
+
+ /**
+ * The HTTP pipeline to send requests through.
+ */
+ private final HttpPipeline httpPipeline;
+
+ /**
+ * Gets The HTTP pipeline to send requests through.
+ *
+ * @return the httpPipeline value.
+ */
+ public HttpPipeline getHttpPipeline() {
+ return this.httpPipeline;
+ }
+
+ /**
+ * The serializer to serialize an object into a string.
+ */
+ private final SerializerAdapter serializerAdapter;
+
+ /**
+ * Gets The serializer to serialize an object into a string.
+ *
+ * @return the serializerAdapter value.
+ */
+ SerializerAdapter getSerializerAdapter() {
+ return this.serializerAdapter;
+ }
+
+ /**
+ * The default poll interval for long-running operation.
+ */
+ private final Duration defaultPollInterval;
+
+ /**
+ * Gets The default poll interval for long-running operation.
+ *
+ * @return the defaultPollInterval value.
+ */
+ public Duration getDefaultPollInterval() {
+ return this.defaultPollInterval;
+ }
+
+ /**
+ * The OperationsClient object to access its operations.
+ */
+ private final OperationsClient operations;
+
+ /**
+ * Gets the OperationsClient object to access its operations.
+ *
+ * @return the OperationsClient object.
+ */
+ public OperationsClient getOperations() {
+ return this.operations;
+ }
+
+ /**
+ * The 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;
+ }
+
+ /**
+ * Initializes an instance of MongoClusterManagementClient client.
+ *
+ * @param httpPipeline The HTTP pipeline to send requests through.
+ * @param serializerAdapter The serializer to serialize an object into a string.
+ * @param defaultPollInterval The default poll interval for long-running operation.
+ * @param environment The Azure environment.
+ * @param subscriptionId The ID of the target subscription. The value must be an UUID.
+ * @param endpoint server parameter.
+ */
+ MongoClusterManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter,
+ Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) {
+ this.httpPipeline = httpPipeline;
+ this.serializerAdapter = serializerAdapter;
+ this.defaultPollInterval = defaultPollInterval;
+ this.subscriptionId = subscriptionId;
+ this.endpoint = endpoint;
+ this.apiVersion = "2024-03-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);
+ }
+
+ /**
+ * 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(MongoClusterManagementClientImpl.class);
+}
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 000000000000..594d2b862c19
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/MongoClustersClientImpl.java
@@ -0,0 +1,1584 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest 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.models.CheckNameAvailabilityRequest;
+import com.azure.resourcemanager.mongocluster.models.MongoClusterListResult;
+import com.azure.resourcemanager.mongocluster.models.MongoClusterUpdate;
+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 MongoClusterManagementClientImpl client;
+
+ /**
+ * Initializes an instance of MongoClustersClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ MongoClustersClientImpl(MongoClusterManagementClientImpl client) {
+ this.service
+ = RestProxy.create(MongoClustersService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for MongoClusterManagementClientMongoClusters to be used by the proxy
+ * service to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "MongoClusterManageme")
+ public interface MongoClustersService {
+ @Headers({ "Content-Type: application/json" })
+ @Post("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/checkMongoClusterNameAvailability")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> checkNameAvailability(@HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("location") String location, @BodyParam("application/json") CheckNameAvailabilityRequest body,
+ @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("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByResourceGroup(@HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> getByResourceGroup(@HostParam("$host") 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("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("mongoClusterName") String mongoClusterName,
+ @BodyParam("application/json") MongoClusterInner resource, @HeaderParam("Accept") String accept,
+ 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("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("mongoClusterName") String mongoClusterName,
+ @BodyParam("application/json") MongoClusterUpdate properties, @HeaderParam("Accept") String accept,
+ 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("$host") 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/listConnectionStrings")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listConnectionStrings(@HostParam("$host") 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> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByResourceGroupNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept, Context context);
+ }
+
+ /**
+ * Check if mongo cluster name is available for use.
+ *
+ * @param location The name of the Azure region.
+ * @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, body, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Check if mongo cluster name is available for use.
+ *
+ * @param location The name of the Azure region.
+ * @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, body, accept, context);
+ }
+
+ /**
+ * Check if mongo cluster name is available for use.
+ *
+ * @param location The name of the Azure region.
+ * @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 name of the Azure region.
+ * @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 name of the Azure region.
+ * @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();
+ }
+
+ /**
+ * 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 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));
+ }
+
+ /**
+ * 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, resource, accept, 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, resource, accept, 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, properties, accept, 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, properties, accept, 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 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();
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ *
+ * The nextLink parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return 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
+ *
+ * The nextLink parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return 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));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ *
+ * The nextLink parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return 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
+ *
+ * The nextLink parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return 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));
+ }
+}
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 000000000000..6ec15135b2c4
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/MongoClustersImpl.java
@@ -0,0 +1,194 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.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;
+
+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 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 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 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 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 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 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 000000000000..a3e07c629b0c
--- /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) AutoRest 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 000000000000..7b6f68a51dfa
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/OperationsClientImpl.java
@@ -0,0 +1,239 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest 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.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 MongoClusterManagementClientImpl client;
+
+ /**
+ * Initializes an instance of OperationsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ OperationsClientImpl(MongoClusterManagementClientImpl client) {
+ this.service
+ = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for MongoClusterManagementClientOperations to be used by the proxy
+ * service to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "MongoClusterManageme")
+ public interface OperationsService {
+ @Headers({ "Content-Type: application/json" })
+ @Get("/providers/Microsoft.DocumentDB/operations")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(@HostParam("$host") 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("$host") 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
+ *
+ * The nextLink parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a 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
+ *
+ * The nextLink parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a 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 000000000000..f6848113d939
--- /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) AutoRest 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 000000000000..5d5a2e72b4ea
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/PrivateEndpointConnectionResourceImpl.java
@@ -0,0 +1,135 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest 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.PrivateEndpoint;
+import com.azure.resourcemanager.mongocluster.models.PrivateEndpointConnectionProvisioningState;
+import com.azure.resourcemanager.mongocluster.models.PrivateEndpointConnectionResource;
+import com.azure.resourcemanager.mongocluster.models.PrivateLinkServiceConnectionState;
+import java.util.Collections;
+import java.util.List;
+
+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 SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public List groupIds() {
+ List inner = this.innerModel().groupIds();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public PrivateEndpoint privateEndpoint() {
+ return this.innerModel().privateEndpoint();
+ }
+
+ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() {
+ return this.innerModel().privateLinkServiceConnectionState();
+ }
+
+ public PrivateEndpointConnectionProvisioningState provisioningState() {
+ return this.innerModel().provisioningState();
+ }
+
+ 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 withPrivateEndpoint(PrivateEndpoint privateEndpoint) {
+ this.innerModel().withPrivateEndpoint(privateEndpoint);
+ return this;
+ }
+
+ public PrivateEndpointConnectionResourceImpl
+ withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) {
+ this.innerModel().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState);
+ 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 000000000000..d48401aeb542
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/PrivateEndpointConnectionsClientImpl.java
@@ -0,0 +1,1003 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest 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.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 MongoClusterManagementClientImpl client;
+
+ /**
+ * Initializes an instance of PrivateEndpointConnectionsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ PrivateEndpointConnectionsClientImpl(MongoClusterManagementClientImpl client) {
+ this.service = RestProxy.create(PrivateEndpointConnectionsService.class, client.getHttpPipeline(),
+ client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for MongoClusterManagementClientPrivateEndpointConnections to be used by
+ * the proxy service to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "MongoClusterManageme")
+ 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("$host") 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("$host") 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("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("mongoClusterName") String mongoClusterName,
+ @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName,
+ @BodyParam("application/json") PrivateEndpointConnectionResourceInner resource,
+ @HeaderParam("Accept") String accept, 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