diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/CHANGELOG.md b/sdk/mongocluster/azure-resourcemanager-mongocluster/CHANGELOG.md
index ca18d519ed771..3786c9e9136f1 100644
--- a/sdk/mongocluster/azure-resourcemanager-mongocluster/CHANGELOG.md
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/CHANGELOG.md
@@ -1,6 +1,8 @@
# Release History
-## 1.0.0-beta.2 (Unreleased)
+## 1.0.0-beta.1 (2024-07-17)
+
+- Azure Resource Manager Mongo Cluster client library for Java. This package contains Microsoft Azure SDK for Mongo Cluster Management SDK. 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 tag package-2024-06-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
### Features Added
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/README.md b/sdk/mongocluster/azure-resourcemanager-mongocluster/README.md
index 0c28919389d27..1faac878de5a6 100644
--- a/sdk/mongocluster/azure-resourcemanager-mongocluster/README.md
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/README.md
@@ -2,7 +2,7 @@
Azure Resource Manager Mongo Cluster client library for Java.
-This package contains Microsoft Azure SDK for Mongo Cluster Management SDK. 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. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
+This package contains Microsoft Azure SDK for Mongo Cluster Management SDK. 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 tag package-2024-06-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
## We'd love to hear your feedback
@@ -32,7 +32,7 @@ Various documentation is available to help you get started
com.azure.resourcemanager
azure-resourcemanager-mongocluster
- 1.0.0-beta.1
+ 1.0.0-beta.2
```
[//]: # ({x-version-update-end})
@@ -45,15 +45,11 @@ Azure Management Libraries require a `TokenCredential` implementation for authen
### Authentication
-By default, Microsoft Entra ID token authentication depends on correct configuration of the following environment variables.
+Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package.
-- `AZURE_CLIENT_ID` for Azure client ID.
-- `AZURE_TENANT_ID` for Azure tenant ID.
-- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate.
+Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable.
-In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable.
-
-With above configuration, `azure` client can be authenticated using the following code:
+Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code:
```java
AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE);
@@ -97,6 +93,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m
[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/
[azure_subscription]: https://azure.microsoft.com/free/
[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity
+[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials
[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty
[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md
[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/SAMPLE.md b/sdk/mongocluster/azure-resourcemanager-mongocluster/SAMPLE.md
index e5ea54fff25f9..22310cf0b55ad 100644
--- a/sdk/mongocluster/azure-resourcemanager-mongocluster/SAMPLE.md
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/SAMPLE.md
@@ -17,6 +17,7 @@
- [List](#mongoclusters_list)
- [ListByResourceGroup](#mongoclusters_listbyresourcegroup)
- [ListConnectionStrings](#mongoclusters_listconnectionstrings)
+- [Promote](#mongoclusters_promote)
- [Update](#mongoclusters_update)
## Operations
@@ -33,6 +34,10 @@
## PrivateLinks
- [ListByMongoCluster](#privatelinks_listbymongocluster)
+
+## Replicas
+
+- [ListByMongoCluster](#replicas_listbymongocluster)
### FirewallRules_CreateOrUpdate
```java
@@ -43,7 +48,8 @@ import com.azure.resourcemanager.mongocluster.models.FirewallRuleProperties;
*/
public final class FirewallRulesCreateOrUpdateSamples {
/*
- * x-ms-original-file: specification/mongocluster/DocumentDB.MongoCluster.Management/examples/2024-03-01-preview/
+ * x-ms-original-file:
+ * specification/mongocluster/resource-manager/Microsoft.DocumentDB/preview/2024-06-01-preview/examples/
* MongoClusters_FirewallRuleCreate.json
*/
/**
@@ -71,7 +77,8 @@ public final class FirewallRulesCreateOrUpdateSamples {
*/
public final class FirewallRulesDeleteSamples {
/*
- * x-ms-original-file: specification/mongocluster/DocumentDB.MongoCluster.Management/examples/2024-03-01-preview/
+ * x-ms-original-file:
+ * specification/mongocluster/resource-manager/Microsoft.DocumentDB/preview/2024-06-01-preview/examples/
* MongoClusters_FirewallRuleDelete.json
*/
/**
@@ -94,7 +101,8 @@ public final class FirewallRulesDeleteSamples {
*/
public final class FirewallRulesGetSamples {
/*
- * x-ms-original-file: specification/mongocluster/DocumentDB.MongoCluster.Management/examples/2024-03-01-preview/
+ * x-ms-original-file:
+ * specification/mongocluster/resource-manager/Microsoft.DocumentDB/preview/2024-06-01-preview/examples/
* MongoClusters_FirewallRuleGet.json
*/
/**
@@ -118,7 +126,8 @@ public final class FirewallRulesGetSamples {
*/
public final class FirewallRulesListByMongoClusterSamples {
/*
- * x-ms-original-file: specification/mongocluster/DocumentDB.MongoCluster.Management/examples/2024-03-01-preview/
+ * x-ms-original-file:
+ * specification/mongocluster/resource-manager/Microsoft.DocumentDB/preview/2024-06-01-preview/examples/
* MongoClusters_FirewallRuleList.json
*/
/**
@@ -143,7 +152,8 @@ import com.azure.resourcemanager.mongocluster.models.CheckNameAvailabilityReques
*/
public final class MongoClustersCheckNameAvailabilitySamples {
/*
- * x-ms-original-file: specification/mongocluster/DocumentDB.MongoCluster.Management/examples/2024-03-01-preview/
+ * x-ms-original-file:
+ * specification/mongocluster/resource-manager/Microsoft.DocumentDB/preview/2024-06-01-preview/examples/
* MongoClusters_NameAvailability.json
*/
/**
@@ -157,15 +167,38 @@ public final class MongoClustersCheckNameAvailabilitySamples {
.checkNameAvailabilityWithResponse("westus2", new CheckNameAvailabilityRequest().withName("newmongocluster")
.withType("Microsoft.DocumentDB/mongoClusters"), com.azure.core.util.Context.NONE);
}
+
+ /*
+ * x-ms-original-file:
+ * specification/mongocluster/resource-manager/Microsoft.DocumentDB/preview/2024-06-01-preview/examples/
+ * MongoClusters_NameAvailability_AlreadyExists.json
+ */
+ /**
+ * Sample code: Checks and returns that the Mongo Cluster name is already in-use.
+ *
+ * @param manager Entry point to MongoClusterManager.
+ */
+ public static void checksAndReturnsThatTheMongoClusterNameIsAlreadyInUse(
+ com.azure.resourcemanager.mongocluster.MongoClusterManager manager) {
+ manager.mongoClusters()
+ .checkNameAvailabilityWithResponse("westus2",
+ new CheckNameAvailabilityRequest().withName("existingmongocluster")
+ .withType("Microsoft.DocumentDB/mongoClusters"),
+ com.azure.core.util.Context.NONE);
+ }
}
```
### MongoClusters_CreateOrUpdate
```java
+import com.azure.resourcemanager.mongocluster.models.CreateMode;
import com.azure.resourcemanager.mongocluster.models.MongoClusterProperties;
+import com.azure.resourcemanager.mongocluster.models.MongoClusterReplicaParameters;
+import com.azure.resourcemanager.mongocluster.models.MongoClusterRestoreParameters;
import com.azure.resourcemanager.mongocluster.models.NodeGroupSpec;
import com.azure.resourcemanager.mongocluster.models.NodeKind;
+import java.time.OffsetDateTime;
import java.util.Arrays;
/**
@@ -174,8 +207,55 @@ import java.util.Arrays;
public final class MongoClustersCreateOrUpdateSamples {
/*
* x-ms-original-file:
- * specification/mongocluster/DocumentDB.MongoCluster.Management/examples/2024-03-01-preview/MongoClusters_Create.
- * json
+ * specification/mongocluster/resource-manager/Microsoft.DocumentDB/preview/2024-06-01-preview/examples/
+ * MongoClusters_CreateGeoReplica.json
+ */
+ /**
+ * Sample code: Creates a replica Mongo Cluster resource from a source resource.
+ *
+ * @param manager Entry point to MongoClusterManager.
+ */
+ public static void createsAReplicaMongoClusterResourceFromASourceResource(
+ com.azure.resourcemanager.mongocluster.MongoClusterManager manager) {
+ manager.mongoClusters()
+ .define("myReplicaMongoCluster")
+ .withRegion("centralus")
+ .withExistingResourceGroup("TestResourceGroup")
+ .withProperties(new MongoClusterProperties().withCreateMode(CreateMode.GEO_REPLICA)
+ .withReplicaParameters(new MongoClusterReplicaParameters().withSourceResourceId(
+ "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/mySourceMongoCluster")
+ .withSourceLocation("eastus")))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file:
+ * specification/mongocluster/resource-manager/Microsoft.DocumentDB/preview/2024-06-01-preview/examples/
+ * MongoClusters_CreatePITR.json
+ */
+ /**
+ * Sample code: Creates a Mongo Cluster resource from a point in time restore.
+ *
+ * @param manager Entry point to MongoClusterManager.
+ */
+ public static void createsAMongoClusterResourceFromAPointInTimeRestore(
+ com.azure.resourcemanager.mongocluster.MongoClusterManager manager) {
+ manager.mongoClusters()
+ .define("myMongoCluster")
+ .withRegion("westus2")
+ .withExistingResourceGroup("TestResourceGroup")
+ .withProperties(new MongoClusterProperties().withCreateMode(CreateMode.POINT_IN_TIME_RESTORE)
+ .withRestoreParameters(new MongoClusterRestoreParameters()
+ .withPointInTimeUtc(OffsetDateTime.parse("2023-01-13T20:07:35Z"))
+ .withSourceResourceId(
+ "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myOtherMongoCluster")))
+ .create();
+ }
+
+ /*
+ * x-ms-original-file:
+ * specification/mongocluster/resource-manager/Microsoft.DocumentDB/preview/2024-06-01-preview/examples/
+ * MongoClusters_Create.json
*/
/**
* Sample code: Creates a new Mongo Cluster resource.
@@ -210,8 +290,8 @@ public final class MongoClustersCreateOrUpdateSamples {
public final class MongoClustersDeleteSamples {
/*
* x-ms-original-file:
- * specification/mongocluster/DocumentDB.MongoCluster.Management/examples/2024-03-01-preview/MongoClusters_Delete.
- * json
+ * specification/mongocluster/resource-manager/Microsoft.DocumentDB/preview/2024-06-01-preview/examples/
+ * MongoClusters_Delete.json
*/
/**
* Sample code: Deletes a Mongo Cluster resource.
@@ -234,7 +314,8 @@ public final class MongoClustersDeleteSamples {
public final class MongoClustersGetByResourceGroupSamples {
/*
* x-ms-original-file:
- * specification/mongocluster/DocumentDB.MongoCluster.Management/examples/2024-03-01-preview/MongoClusters_Get.json
+ * specification/mongocluster/resource-manager/Microsoft.DocumentDB/preview/2024-06-01-preview/examples/
+ * MongoClusters_Get.json
*/
/**
* Sample code: Gets a Mongo Cluster resource.
@@ -257,7 +338,8 @@ public final class MongoClustersGetByResourceGroupSamples {
public final class MongoClustersListSamples {
/*
* x-ms-original-file:
- * specification/mongocluster/DocumentDB.MongoCluster.Management/examples/2024-03-01-preview/MongoClusters_List.json
+ * specification/mongocluster/resource-manager/Microsoft.DocumentDB/preview/2024-06-01-preview/examples/
+ * MongoClusters_List.json
*/
/**
* Sample code: Lists the Mongo Cluster resources in a subscription.
@@ -279,7 +361,8 @@ public final class MongoClustersListSamples {
*/
public final class MongoClustersListByResourceGroupSamples {
/*
- * x-ms-original-file: specification/mongocluster/DocumentDB.MongoCluster.Management/examples/2024-03-01-preview/
+ * x-ms-original-file:
+ * specification/mongocluster/resource-manager/Microsoft.DocumentDB/preview/2024-06-01-preview/examples/
* MongoClusters_ListByResourceGroup.json
*/
/**
@@ -302,7 +385,8 @@ public final class MongoClustersListByResourceGroupSamples {
*/
public final class MongoClustersListConnectionStringsSamples {
/*
- * x-ms-original-file: specification/mongocluster/DocumentDB.MongoCluster.Management/examples/2024-03-01-preview/
+ * x-ms-original-file:
+ * specification/mongocluster/resource-manager/Microsoft.DocumentDB/preview/2024-06-01-preview/examples/
* MongoClusters_ListConnectionStrings.json
*/
/**
@@ -318,6 +402,37 @@ public final class MongoClustersListConnectionStringsSamples {
}
```
+### MongoClusters_Promote
+
+```java
+import com.azure.resourcemanager.mongocluster.models.PromoteMode;
+import com.azure.resourcemanager.mongocluster.models.PromoteOption;
+import com.azure.resourcemanager.mongocluster.models.PromoteReplicaRequest;
+
+/**
+ * Samples for MongoClusters Promote.
+ */
+public final class MongoClustersPromoteSamples {
+ /*
+ * x-ms-original-file:
+ * specification/mongocluster/resource-manager/Microsoft.DocumentDB/preview/2024-06-01-preview/examples/
+ * MongoClusters_ForcePromoteReplica.json
+ */
+ /**
+ * Sample code: Promotes a replica Mongo Cluster resource to a primary role.
+ *
+ * @param manager Entry point to MongoClusterManager.
+ */
+ public static void promotesAReplicaMongoClusterResourceToAPrimaryRole(
+ com.azure.resourcemanager.mongocluster.MongoClusterManager manager) {
+ manager.mongoClusters()
+ .promote("TestGroup", "myMongoCluster",
+ new PromoteReplicaRequest().withPromoteOption(PromoteOption.FORCED).withMode(PromoteMode.SWITCHOVER),
+ com.azure.core.util.Context.NONE);
+ }
+}
+```
+
### MongoClusters_Update
```java
@@ -325,6 +440,7 @@ import com.azure.resourcemanager.mongocluster.models.MongoCluster;
import com.azure.resourcemanager.mongocluster.models.MongoClusterUpdateProperties;
import com.azure.resourcemanager.mongocluster.models.NodeGroupSpec;
import com.azure.resourcemanager.mongocluster.models.NodeKind;
+import com.azure.resourcemanager.mongocluster.models.PublicNetworkAccess;
import java.util.Arrays;
/**
@@ -332,7 +448,29 @@ import java.util.Arrays;
*/
public final class MongoClustersUpdateSamples {
/*
- * x-ms-original-file: specification/mongocluster/DocumentDB.MongoCluster.Management/examples/2024-03-01-preview/
+ * x-ms-original-file:
+ * specification/mongocluster/resource-manager/Microsoft.DocumentDB/preview/2024-06-01-preview/examples/
+ * MongoClusters_ResetPassword.json
+ */
+ /**
+ * Sample code: Resets the administrator login password.
+ *
+ * @param manager Entry point to MongoClusterManager.
+ */
+ public static void
+ resetsTheAdministratorLoginPassword(com.azure.resourcemanager.mongocluster.MongoClusterManager manager) {
+ MongoCluster resource = manager.mongoClusters()
+ .getByResourceGroupWithResponse("TestResourceGroup", "myMongoCluster", com.azure.core.util.Context.NONE)
+ .getValue();
+ resource.update()
+ .withProperties(new MongoClusterUpdateProperties().withAdministratorLogin("mongoAdmin")
+ .withAdministratorLoginPassword("fakeTokenPlaceholder"))
+ .apply();
+ }
+
+ /*
+ * x-ms-original-file:
+ * specification/mongocluster/resource-manager/Microsoft.DocumentDB/preview/2024-06-01-preview/examples/
* MongoClusters_PatchDiskSize.json
*/
/**
@@ -350,6 +488,54 @@ public final class MongoClustersUpdateSamples {
.withNodeGroupSpecs(Arrays.asList(new NodeGroupSpec().withDiskSizeGB(256L).withKind(NodeKind.SHARD))))
.apply();
}
+
+ /*
+ * x-ms-original-file:
+ * specification/mongocluster/resource-manager/Microsoft.DocumentDB/preview/2024-06-01-preview/examples/
+ * MongoClusters_PatchPrivateNetworkAccess.json
+ */
+ /**
+ * Sample code: Disables public network access on a Mongo Cluster resource with a private endpoint connection.
+ *
+ * @param manager Entry point to MongoClusterManager.
+ */
+ public static void disablesPublicNetworkAccessOnAMongoClusterResourceWithAPrivateEndpointConnection(
+ com.azure.resourcemanager.mongocluster.MongoClusterManager manager) {
+ MongoCluster resource = manager.mongoClusters()
+ .getByResourceGroupWithResponse("TestResourceGroup", "myMongoCluster", com.azure.core.util.Context.NONE)
+ .getValue();
+ resource.update()
+ .withProperties(new MongoClusterUpdateProperties().withPublicNetworkAccess(PublicNetworkAccess.DISABLED))
+ .apply();
+ }
+
+ /*
+ * x-ms-original-file:
+ * specification/mongocluster/resource-manager/Microsoft.DocumentDB/preview/2024-06-01-preview/examples/
+ * MongoClusters_Update.json
+ */
+ /**
+ * Sample code: Updates a Mongo Cluster resource.
+ *
+ * @param manager Entry point to MongoClusterManager.
+ */
+ public static void
+ updatesAMongoClusterResource(com.azure.resourcemanager.mongocluster.MongoClusterManager manager) {
+ MongoCluster resource = manager.mongoClusters()
+ .getByResourceGroupWithResponse("TestResourceGroup", "myMongoCluster", com.azure.core.util.Context.NONE)
+ .getValue();
+ resource.update()
+ .withProperties(new MongoClusterUpdateProperties().withAdministratorLogin("mongoAdmin")
+ .withAdministratorLoginPassword("fakeTokenPlaceholder")
+ .withServerVersion("5.0")
+ .withPublicNetworkAccess(PublicNetworkAccess.ENABLED)
+ .withNodeGroupSpecs(Arrays.asList(new NodeGroupSpec().withSku("M50")
+ .withDiskSizeGB(256L)
+ .withEnableHa(true)
+ .withKind(NodeKind.SHARD)
+ .withNodeCount(1))))
+ .apply();
+ }
}
```
@@ -362,7 +548,8 @@ public final class MongoClustersUpdateSamples {
public final class OperationsListSamples {
/*
* x-ms-original-file:
- * specification/mongocluster/DocumentDB.MongoCluster.Management/examples/2024-03-01-preview/Operations_List.json
+ * specification/mongocluster/resource-manager/Microsoft.DocumentDB/preview/2024-06-01-preview/examples/
+ * Operations_List.json
*/
/**
* Sample code: Operations_List.
@@ -387,7 +574,8 @@ import com.azure.resourcemanager.mongocluster.models.PrivateLinkServiceConnectio
*/
public final class PrivateEndpointConnectionsCreateSamples {
/*
- * x-ms-original-file: specification/mongocluster/DocumentDB.MongoCluster.Management/examples/2024-03-01-preview/
+ * x-ms-original-file:
+ * specification/mongocluster/resource-manager/Microsoft.DocumentDB/preview/2024-06-01-preview/examples/
* MongoClusters_PrivateEndpointConnectionPut.json
*/
/**
@@ -416,7 +604,8 @@ public final class PrivateEndpointConnectionsCreateSamples {
*/
public final class PrivateEndpointConnectionsDeleteSamples {
/*
- * x-ms-original-file: specification/mongocluster/DocumentDB.MongoCluster.Management/examples/2024-03-01-preview/
+ * x-ms-original-file:
+ * specification/mongocluster/resource-manager/Microsoft.DocumentDB/preview/2024-06-01-preview/examples/
* MongoClusters_PrivateEndpointConnectionDelete.json
*/
/**
@@ -441,7 +630,8 @@ public final class PrivateEndpointConnectionsDeleteSamples {
*/
public final class PrivateEndpointConnectionsGetSamples {
/*
- * x-ms-original-file: specification/mongocluster/DocumentDB.MongoCluster.Management/examples/2024-03-01-preview/
+ * x-ms-original-file:
+ * specification/mongocluster/resource-manager/Microsoft.DocumentDB/preview/2024-06-01-preview/examples/
* MongoClusters_PrivateEndpointConnectionGet.json
*/
/**
@@ -466,7 +656,8 @@ public final class PrivateEndpointConnectionsGetSamples {
*/
public final class PrivateEndpointConnectionsListByMongoClusterSamples {
/*
- * x-ms-original-file: specification/mongocluster/DocumentDB.MongoCluster.Management/examples/2024-03-01-preview/
+ * x-ms-original-file:
+ * specification/mongocluster/resource-manager/Microsoft.DocumentDB/preview/2024-06-01-preview/examples/
* MongoClusters_PrivateEndpointConnectionList.json
*/
/**
@@ -490,7 +681,8 @@ public final class PrivateEndpointConnectionsListByMongoClusterSamples {
*/
public final class PrivateLinksListByMongoClusterSamples {
/*
- * x-ms-original-file: specification/mongocluster/DocumentDB.MongoCluster.Management/examples/2024-03-01-preview/
+ * x-ms-original-file:
+ * specification/mongocluster/resource-manager/Microsoft.DocumentDB/preview/2024-06-01-preview/examples/
* MongoClusters_PrivateLinkResourceList.json
*/
/**
@@ -505,3 +697,27 @@ public final class PrivateLinksListByMongoClusterSamples {
}
```
+### Replicas_ListByMongoCluster
+
+```java
+/**
+ * Samples for Replicas ListByMongoCluster.
+ */
+public final class ReplicasListByMongoClusterSamples {
+ /*
+ * x-ms-original-file:
+ * specification/mongocluster/resource-manager/Microsoft.DocumentDB/preview/2024-06-01-preview/examples/
+ * MongoClusters_ReplicaList.json
+ */
+ /**
+ * Sample code: List the replicas linked to a Mongo Cluster resource.
+ *
+ * @param manager Entry point to MongoClusterManager.
+ */
+ public static void listTheReplicasLinkedToAMongoClusterResource(
+ com.azure.resourcemanager.mongocluster.MongoClusterManager manager) {
+ manager.replicas().listByMongoCluster("TestGroup", "myMongoCluster", com.azure.core.util.Context.NONE);
+ }
+}
+```
+
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/pom.xml b/sdk/mongocluster/azure-resourcemanager-mongocluster/pom.xml
index 126cc2fd57925..5a1af5f75c3f2 100644
--- a/sdk/mongocluster/azure-resourcemanager-mongocluster/pom.xml
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/pom.xml
@@ -1,7 +1,7 @@
4.0.0
@@ -18,7 +18,7 @@
jar
Microsoft Azure SDK for Mongo Cluster Management
- This package contains Microsoft Azure SDK for Mongo Cluster Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. 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.
+ This package contains Microsoft Azure SDK for Mongo Cluster Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. 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 tag package-2024-06-01-preview.
https://github.com/Azure/azure-sdk-for-java
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/MongoClusterManager.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/MongoClusterManager.java
index b141707957b89..9f52c0f7b4954 100644
--- a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/MongoClusterManager.java
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/MongoClusterManager.java
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster;
@@ -23,18 +23,20 @@
import com.azure.core.management.profile.AzureProfile;
import com.azure.core.util.Configuration;
import com.azure.core.util.logging.ClientLogger;
-import com.azure.resourcemanager.mongocluster.fluent.DocumentDBClient;
-import com.azure.resourcemanager.mongocluster.implementation.DocumentDBClientBuilder;
+import com.azure.resourcemanager.mongocluster.fluent.MongoClusterManagementClient;
import com.azure.resourcemanager.mongocluster.implementation.FirewallRulesImpl;
+import com.azure.resourcemanager.mongocluster.implementation.MongoClusterManagementClientBuilder;
import com.azure.resourcemanager.mongocluster.implementation.MongoClustersImpl;
import com.azure.resourcemanager.mongocluster.implementation.OperationsImpl;
import com.azure.resourcemanager.mongocluster.implementation.PrivateEndpointConnectionsImpl;
import com.azure.resourcemanager.mongocluster.implementation.PrivateLinksImpl;
+import com.azure.resourcemanager.mongocluster.implementation.ReplicasImpl;
import com.azure.resourcemanager.mongocluster.models.FirewallRules;
import com.azure.resourcemanager.mongocluster.models.MongoClusters;
import com.azure.resourcemanager.mongocluster.models.Operations;
import com.azure.resourcemanager.mongocluster.models.PrivateEndpointConnections;
import com.azure.resourcemanager.mongocluster.models.PrivateLinks;
+import com.azure.resourcemanager.mongocluster.models.Replicas;
import java.time.Duration;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
@@ -58,12 +60,14 @@ public final class MongoClusterManager {
private PrivateLinks privateLinks;
- private final DocumentDBClient clientObject;
+ private Replicas replicas;
+
+ private final MongoClusterManagementClient clientObject;
private MongoClusterManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) {
Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null.");
Objects.requireNonNull(profile, "'profile' cannot be null.");
- this.clientObject = new DocumentDBClientBuilder().pipeline(httpPipeline)
+ this.clientObject = new MongoClusterManagementClientBuilder().pipeline(httpPipeline)
.endpoint(profile.getEnvironment().getResourceManagerEndpoint())
.subscriptionId(profile.getSubscriptionId())
.defaultPollInterval(defaultPollInterval)
@@ -330,12 +334,24 @@ public PrivateLinks privateLinks() {
}
/**
- * Gets wrapped service client DocumentDBClient providing direct access to the underlying auto-generated API
- * implementation, based on Azure REST API.
+ * Gets the resource collection API of Replicas.
+ *
+ * @return Resource collection API of Replicas.
+ */
+ public Replicas replicas() {
+ if (this.replicas == null) {
+ this.replicas = new ReplicasImpl(clientObject.getReplicas(), this);
+ }
+ return replicas;
+ }
+
+ /**
+ * Gets wrapped service client MongoClusterManagementClient providing direct access to the underlying auto-generated
+ * API implementation, based on Azure REST API.
*
- * @return Wrapped service client DocumentDBClient.
+ * @return Wrapped service client MongoClusterManagementClient.
*/
- public DocumentDBClient serviceClient() {
+ 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
index 26dadf543722d..33b3167997ade 100644
--- 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
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.fluent;
@@ -17,6 +17,34 @@
* 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.
*
@@ -170,32 +198,4 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String
*/
@ServiceMethod(returns = ReturnType.SINGLE)
void delete(String resourceGroupName, String mongoClusterName, String firewallRuleName, Context context);
-
- /**
- * List all the firewall rules in a given mongo cluster.
- *
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param mongoClusterName The name of the mongo cluster.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the response of a FirewallRule list operation as paginated response with {@link PagedIterable}.
- */
- @ServiceMethod(returns = ReturnType.COLLECTION)
- PagedIterable listByMongoCluster(String resourceGroupName, String mongoClusterName);
-
- /**
- * List all the firewall rules in a given mongo cluster.
- *
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param mongoClusterName The name of the mongo cluster.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the response of a FirewallRule list operation as paginated response with {@link PagedIterable}.
- */
- @ServiceMethod(returns = ReturnType.COLLECTION)
- PagedIterable listByMongoCluster(String resourceGroupName, String mongoClusterName,
- Context context);
}
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/DocumentDBClient.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/MongoClusterManagementClient.java
similarity index 82%
rename from sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/DocumentDBClient.java
rename to sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/MongoClusterManagementClient.java
index 38bdf7114dcf6..e232bc4170416 100644
--- a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/DocumentDBClient.java
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/MongoClusterManagementClient.java
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.fluent;
@@ -8,29 +8,29 @@
import java.time.Duration;
/**
- * The interface for DocumentDBClient class.
+ * The interface for MongoClusterManagementClient class.
*/
-public interface DocumentDBClient {
+public interface MongoClusterManagementClient {
/**
- * Gets Server parameter.
+ * Gets The ID of the target subscription. The value must be an UUID.
*
- * @return the endpoint value.
+ * @return the subscriptionId value.
*/
- String getEndpoint();
+ String getSubscriptionId();
/**
- * Gets Version parameter.
+ * Gets server parameter.
*
- * @return the apiVersion value.
+ * @return the endpoint value.
*/
- String getApiVersion();
+ String getEndpoint();
/**
- * Gets The ID of the target subscription. The value must be an UUID.
+ * Gets Api Version.
*
- * @return the subscriptionId value.
+ * @return the apiVersion value.
*/
- String getSubscriptionId();
+ String getApiVersion();
/**
* Gets The HTTP pipeline to send requests through.
@@ -80,4 +80,11 @@ public interface DocumentDBClient {
* @return the PrivateLinksClient object.
*/
PrivateLinksClient getPrivateLinks();
+
+ /**
+ * Gets the ReplicasClient object to access its operations.
+ *
+ * @return the ReplicasClient object.
+ */
+ ReplicasClient getReplicas();
}
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/MongoClustersClient.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/MongoClustersClient.java
index 5ce7b73048a1b..b70400a65bc21 100644
--- 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
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.fluent;
@@ -16,11 +16,87 @@
import com.azure.resourcemanager.mongocluster.fluent.models.MongoClusterInner;
import com.azure.resourcemanager.mongocluster.models.CheckNameAvailabilityRequest;
import com.azure.resourcemanager.mongocluster.models.MongoClusterUpdate;
+import com.azure.resourcemanager.mongocluster.models.PromoteReplicaRequest;
/**
* An instance of this class provides access to all the operations defined in MongoClustersClient.
*/
public interface MongoClustersClient {
+ /**
+ * 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.
*
@@ -232,107 +308,90 @@ MongoClusterInner update(String resourceGroupName, String mongoClusterName, Mong
void delete(String resourceGroupName, String mongoClusterName, Context context);
/**
- * List all the mongo clusters in a given resource group.
+ * 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 response of a MongoCluster list operation as paginated response with {@link PagedIterable}.
+ * @return the connection strings for the given mongo cluster along with {@link Response}.
*/
- @ServiceMethod(returns = ReturnType.COLLECTION)
- PagedIterable listByResourceGroup(String resourceGroupName);
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response listConnectionStringsWithResponse(String resourceGroupName,
+ String mongoClusterName, Context context);
/**
- * List all the mongo clusters in a given resource group.
+ * 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 context The context to associate with this operation.
+ * @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 MongoCluster list operation as paginated response with {@link PagedIterable}.
- */
- @ServiceMethod(returns = ReturnType.COLLECTION)
- PagedIterable listByResourceGroup(String resourceGroupName, Context context);
-
- /**
- * List all the mongo clusters in a given subscription.
- *
- * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the response of a MongoCluster list operation as paginated response with {@link PagedIterable}.
+ * @return the connection strings for the given mongo cluster.
*/
- @ServiceMethod(returns = ReturnType.COLLECTION)
- PagedIterable list();
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ListConnectionStringsResultInner listConnectionStrings(String resourceGroupName, String mongoClusterName);
/**
- * List all the mongo clusters in a given subscription.
+ * Promotes a replica mongo cluster to a primary role.
*
- * @param context The context to associate with this operation.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param body The content of the action request.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the response of a MongoCluster list operation as paginated response with {@link PagedIterable}.
+ * @return the {@link SyncPoller} for polling of long-running operation.
*/
- @ServiceMethod(returns = ReturnType.COLLECTION)
- PagedIterable list(Context context);
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginPromote(String resourceGroupName, String mongoClusterName,
+ PromoteReplicaRequest body);
/**
- * 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.
+ * Promotes a replica mongo cluster to a primary role.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param mongoClusterName The name of the mongo cluster.
+ * @param body The content of the action request.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the connection strings for the given mongo cluster along with {@link Response}.
+ * @return the {@link SyncPoller} for polling of long-running operation.
*/
- @ServiceMethod(returns = ReturnType.SINGLE)
- Response listConnectionStringsWithResponse(String resourceGroupName,
- String mongoClusterName, Context context);
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginPromote(String resourceGroupName, String mongoClusterName,
+ PromoteReplicaRequest body, 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.
+ * Promotes a replica mongo cluster to a primary role.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param mongoClusterName The name of the mongo cluster.
+ * @param body The content of the action request.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the connection strings for the given mongo cluster.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- ListConnectionStringsResultInner listConnectionStrings(String resourceGroupName, String mongoClusterName);
+ void promote(String resourceGroupName, String mongoClusterName, PromoteReplicaRequest body);
/**
- * Check if mongo cluster name is available for use.
+ * Promotes a replica mongo cluster to a primary role.
*
- * @param location The location name.
- * @param body The CheckAvailability request.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param body The content of the action request.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the check availability result along with {@link Response}.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- Response checkNameAvailabilityWithResponse(String location,
- CheckNameAvailabilityRequest body, Context context);
-
- /**
- * Check if mongo cluster name is available for use.
- *
- * @param location The location name.
- * @param body The CheckAvailability request.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the check availability result.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- CheckNameAvailabilityResponseInner checkNameAvailability(String location, CheckNameAvailabilityRequest body);
+ void promote(String resourceGroupName, String mongoClusterName, PromoteReplicaRequest body, Context context);
}
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/OperationsClient.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/OperationsClient.java
index fc74d29eef1cb..7dfcdbb7fc7fe 100644
--- 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
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.fluent;
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
index afaa0178d1a10..bdeeba124dfc0 100644
--- 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
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.fluent;
@@ -92,7 +92,8 @@ PrivateEndpointConnectionResourceInner get(String resourceGroupName, String mong
* @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.
+ * @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(
@@ -111,7 +112,8 @@ SyncPoller, PrivateEndpointCo
* @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.
+ * @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(
@@ -129,7 +131,7 @@ SyncPoller, PrivateEndpointCo
* @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.
+ * @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,
@@ -147,7 +149,7 @@ PrivateEndpointConnectionResourceInner create(String resourceGroupName, String m
* @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.
+ * @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,
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
index 8779553179b88..08d23b4984e77 100644
--- 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
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.fluent;
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/ReplicasClient.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/ReplicasClient.java
new file mode 100644
index 0000000000000..b2a0aba86b1ea
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/ReplicasClient.java
@@ -0,0 +1,43 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) 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.ReplicaInner;
+
+/**
+ * An instance of this class provides access to all the operations defined in ReplicasClient.
+ */
+public interface ReplicasClient {
+ /**
+ * List all the replicas for the mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Replica list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByMongoCluster(String resourceGroupName, String mongoClusterName);
+
+ /**
+ * List all the replicas for the mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Replica list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByMongoCluster(String resourceGroupName, String mongoClusterName, Context context);
+}
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/CheckNameAvailabilityResponseInner.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/CheckNameAvailabilityResponseInner.java
index 4e3682130046d..aa1dc0d485acb 100644
--- 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
@@ -1,10 +1,10 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.fluent.models;
-import com.azure.core.annotation.Immutable;
+import com.azure.core.annotation.Fluent;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
@@ -15,7 +15,7 @@
/**
* The check availability result.
*/
-@Immutable
+@Fluent
public final class CheckNameAvailabilityResponseInner implements JsonSerializable {
/*
* Indicates if the resource name is available.
@@ -28,14 +28,14 @@ public final class CheckNameAvailabilityResponseInner implements JsonSerializabl
private CheckNameAvailabilityReason reason;
/*
- * Detailed reason why the given name is not available.
+ * Detailed reason why the given name is available.
*/
private String message;
/**
* Creates an instance of CheckNameAvailabilityResponseInner class.
*/
- private CheckNameAvailabilityResponseInner() {
+ public CheckNameAvailabilityResponseInner() {
}
/**
@@ -47,6 +47,17 @@ 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.
*
@@ -57,7 +68,18 @@ public CheckNameAvailabilityReason reason() {
}
/**
- * Get the message property: Detailed reason why the given name is not available.
+ * 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.
*/
@@ -65,6 +87,17 @@ 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.
*
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
index 18de0706ef34a..ccbbc0ecfd6da 100644
--- 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
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.fluent.models;
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
index 7070e9205a959..c3fc8c92a1dd4 100644
--- 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
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.fluent.models;
@@ -26,7 +26,7 @@ public final class ListConnectionStringsResultInner implements JsonSerializable<
/**
* Creates an instance of ListConnectionStringsResultInner class.
*/
- private ListConnectionStringsResultInner() {
+ public ListConnectionStringsResultInner() {
}
/**
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
index 5720c3558a3de..3ba6763a166b5 100644
--- 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
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.fluent.models;
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
index 30ff471e7dd71..51c621cd1a8c1 100644
--- 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
@@ -1,10 +1,10 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.fluent.models;
-import com.azure.core.annotation.Immutable;
+import com.azure.core.annotation.Fluent;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
@@ -15,9 +15,11 @@
import java.io.IOException;
/**
+ * REST API Operation
+ *
* Details of a REST API operation, returned from the Resource Provider Operations API.
*/
-@Immutable
+@Fluent
public final class OperationInner implements JsonSerializable {
/*
* The name of the operation, as per Resource-Based Access Control (RBAC). Examples:
@@ -26,8 +28,8 @@ public final class OperationInner implements JsonSerializable {
private String name;
/*
- * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure
- * Resource Manager/control-plane operations.
+ * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for
+ * ARM/control-plane operations.
*/
private Boolean isDataAction;
@@ -43,14 +45,14 @@ public final class OperationInner implements JsonSerializable {
private Origin origin;
/*
- * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
+ * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
*/
private ActionType actionType;
/**
* Creates an instance of OperationInner class.
*/
- private OperationInner() {
+ public OperationInner() {
}
/**
@@ -65,7 +67,7 @@ public String name() {
/**
* Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane
- * operations and "false" for Azure Resource Manager/control-plane operations.
+ * operations and "false" for ARM/control-plane operations.
*
* @return the isDataAction value.
*/
@@ -82,6 +84,17 @@ 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".
@@ -93,8 +106,8 @@ public Origin origin() {
}
/**
- * Get the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are
- * for internal only APIs.
+ * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal
+ * only APIs.
*
* @return the actionType value.
*/
@@ -120,7 +133,6 @@ public void validate() {
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeJsonField("display", this.display);
- jsonWriter.writeStringField("actionType", this.actionType == null ? null : this.actionType.toString());
return jsonWriter.writeEndObject();
}
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
index 181255cc2393d..99abe724a6960 100644
--- 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
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.fluent.models;
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
index e5b9c58b51c16..e97b73febb0a8 100644
--- 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
@@ -1,10 +1,10 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.fluent.models;
-import com.azure.core.annotation.Immutable;
+import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.core.management.SystemData;
import com.azure.json.JsonReader;
@@ -16,7 +16,7 @@
/**
* Concrete proxy resource types can be created by aliasing this type using a specific property type.
*/
-@Immutable
+@Fluent
public final class PrivateLinkResourceInner extends ProxyResource {
/*
* The resource-specific properties for this resource.
@@ -46,7 +46,7 @@ public final class PrivateLinkResourceInner extends ProxyResource {
/**
* Creates an instance of PrivateLinkResourceInner class.
*/
- private PrivateLinkResourceInner() {
+ public PrivateLinkResourceInner() {
}
/**
@@ -58,6 +58,17 @@ public PrivateLinkResourceProperties properties() {
return this.properties;
}
+ /**
+ * Set the properties property: The resource-specific properties for this resource.
+ *
+ * @param properties the properties value to set.
+ * @return the PrivateLinkResourceInner object itself.
+ */
+ public PrivateLinkResourceInner withProperties(PrivateLinkResourceProperties properties) {
+ this.properties = properties;
+ return this;
+ }
+
/**
* Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
*
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/ReplicaInner.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/ReplicaInner.java
new file mode 100644
index 0000000000000..a1bd75306deea
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/ReplicaInner.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.core.management.ProxyResource;
+import com.azure.core.management.SystemData;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import com.azure.resourcemanager.mongocluster.models.MongoClusterProperties;
+import java.io.IOException;
+
+/**
+ * Represents a mongo cluster replica.
+ */
+@Fluent
+public final class ReplicaInner extends ProxyResource {
+ /*
+ * The resource-specific properties for this resource.
+ */
+ private MongoClusterProperties properties;
+
+ /*
+ * Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ */
+ private SystemData systemData;
+
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
+ /**
+ * Creates an instance of ReplicaInner class.
+ */
+ public ReplicaInner() {
+ }
+
+ /**
+ * Get the properties property: The resource-specific properties for this resource.
+ *
+ * @return the properties value.
+ */
+ public MongoClusterProperties properties() {
+ return this.properties;
+ }
+
+ /**
+ * Set the properties property: The resource-specific properties for this resource.
+ *
+ * @param properties the properties value to set.
+ * @return the ReplicaInner object itself.
+ */
+ public ReplicaInner withProperties(MongoClusterProperties properties) {
+ this.properties = properties;
+ return this;
+ }
+
+ /**
+ * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (properties() != null) {
+ properties().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeJsonField("properties", this.properties);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ReplicaInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ReplicaInner if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the ReplicaInner.
+ */
+ public static ReplicaInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ReplicaInner deserializedReplicaInner = new ReplicaInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedReplicaInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedReplicaInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedReplicaInner.type = reader.getString();
+ } else if ("properties".equals(fieldName)) {
+ deserializedReplicaInner.properties = MongoClusterProperties.fromJson(reader);
+ } else if ("systemData".equals(fieldName)) {
+ deserializedReplicaInner.systemData = SystemData.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedReplicaInner;
+ });
+ }
+}
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/package-info.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/package-info.java
index c5de4d0cfd262..8119c68b4f314 100644
--- 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
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
/**
* Package containing the inner data models for MongoClusterManagementClient.
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
index ca90018d82028..64a699badc4bc 100644
--- 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
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
/**
* Package containing the service clients for MongoClusterManagementClient.
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
index ba97ed3f859cd..90bcd142f8014 100644
--- 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
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.implementation;
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
index 3b33a5bc74650..7bc9503b6a4ec 100644
--- 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
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.implementation;
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
index 3e134773a7585..d87e932a1f1f9 100644
--- 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
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.implementation;
@@ -33,7 +33,7 @@
import com.azure.core.util.polling.SyncPoller;
import com.azure.resourcemanager.mongocluster.fluent.FirewallRulesClient;
import com.azure.resourcemanager.mongocluster.fluent.models.FirewallRuleInner;
-import com.azure.resourcemanager.mongocluster.implementation.models.FirewallRuleListResult;
+import com.azure.resourcemanager.mongocluster.models.FirewallRuleListResult;
import java.nio.ByteBuffer;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
@@ -50,67 +50,68 @@ public final class FirewallRulesClientImpl implements FirewallRulesClient {
/**
* The service client containing this operation class.
*/
- private final DocumentDBClientImpl client;
+ private final MongoClusterManagementClientImpl client;
/**
* Initializes an instance of FirewallRulesClientImpl.
*
* @param client the instance of the service client containing this operation class.
*/
- FirewallRulesClientImpl(DocumentDBClientImpl client) {
+ FirewallRulesClientImpl(MongoClusterManagementClientImpl client) {
this.service
= RestProxy.create(FirewallRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter());
this.client = client;
}
/**
- * The interface defining all the services for DocumentDBClientFirewallRules to be used by the proxy service to
- * perform REST calls.
+ * The interface defining all the services for MongoClusterManagementClientFirewallRules to be used by the proxy
+ * service to perform REST calls.
*/
- @Host("{endpoint}")
- @ServiceInterface(name = "DocumentDBClientFire")
+ @Host("{$host}")
+ @ServiceInterface(name = "MongoClusterManageme")
public interface FirewallRulesService {
@Headers({ "Content-Type: application/json" })
- @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules/{firewallRuleName}")
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono> get(@HostParam("endpoint") String endpoint,
+ Mono> listByMongoCluster(@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,
+ @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}/firewallRules/{firewallRuleName}")
- @ExpectedResponses({ 200, 201, 202 })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules/{firewallRuleName}")
+ @ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono>> createOrUpdate(@HostParam("endpoint") String endpoint,
+ 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,
- @BodyParam("application/json") FirewallRuleInner resource, Context context);
+ @PathParam("firewallRuleName") String firewallRuleName, @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 })
+ @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules/{firewallRuleName}")
+ @ExpectedResponses({ 200, 201, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono>> delete(@HostParam("endpoint") String endpoint,
+ 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, @HeaderParam("accept") String accept,
+ @PathParam("firewallRuleName") String firewallRuleName,
+ @BodyParam("application/json") FirewallRuleInner resource, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
- @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules")
- @ExpectedResponses({ 200 })
+ @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules/{firewallRuleName}")
+ @ExpectedResponses({ 202, 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono> listByMongoCluster(@HostParam("endpoint") String endpoint,
+ 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,
+ @PathParam("mongoClusterName") String mongoClusterName,
+ @PathParam("firewallRuleName") String firewallRuleName, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@@ -118,8 +119,153 @@ Mono> listByMongoCluster(@HostParam("endpoint")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listByMongoClusterNext(
- @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
- @HeaderParam("accept") String accept, Context context);
+ @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));
}
/**
@@ -301,8 +447,8 @@ private Mono>> createOrUpdateWithResponseAsync(String
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(),
- this.client.getSubscriptionId(), resourceGroupName, mongoClusterName, firewallRuleName, accept,
- resource, context))
+ this.client.getSubscriptionId(), resourceGroupName, mongoClusterName, firewallRuleName, resource,
+ accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
@@ -351,7 +497,7 @@ private Mono>> createOrUpdateWithResponseAsync(String
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(),
- this.client.getSubscriptionId(), resourceGroupName, mongoClusterName, firewallRuleName, accept, resource,
+ this.client.getSubscriptionId(), resourceGroupName, mongoClusterName, firewallRuleName, resource, accept,
context);
}
@@ -740,151 +886,6 @@ public void delete(String resourceGroupName, String mongoClusterName, String fir
deleteAsync(resourceGroupName, mongoClusterName, firewallRuleName, context).block();
}
- /**
- * List all the firewall rules in a given mongo cluster.
- *
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param mongoClusterName The name of the mongo cluster.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the response of a FirewallRule list operation along with {@link PagedResponse} on successful completion
- * of {@link Mono}.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listByMongoClusterSinglePageAsync(String resourceGroupName,
- String mongoClusterName) {
- if (this.client.getEndpoint() == null) {
- return Mono.error(
- new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- if (this.client.getSubscriptionId() == null) {
- return Mono.error(new IllegalArgumentException(
- "Parameter this.client.getSubscriptionId() is required and cannot be null."));
- }
- if (resourceGroupName == null) {
- return Mono
- .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
- }
- if (mongoClusterName == null) {
- return Mono
- .error(new IllegalArgumentException("Parameter mongoClusterName is required and cannot be null."));
- }
- final String accept = "application/json";
- return FluxUtil
- .withContext(context -> service.listByMongoCluster(this.client.getEndpoint(), this.client.getApiVersion(),
- this.client.getSubscriptionId(), resourceGroupName, mongoClusterName, accept, context))
- .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
- res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
- .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
- }
-
- /**
- * List all the firewall rules in a given mongo cluster.
- *
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param mongoClusterName The name of the mongo cluster.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the response of a FirewallRule list operation along with {@link PagedResponse} on successful completion
- * of {@link Mono}.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listByMongoClusterSinglePageAsync(String resourceGroupName,
- String mongoClusterName, Context context) {
- if (this.client.getEndpoint() == null) {
- return Mono.error(
- new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- if (this.client.getSubscriptionId() == null) {
- return Mono.error(new IllegalArgumentException(
- "Parameter this.client.getSubscriptionId() is required and cannot be null."));
- }
- if (resourceGroupName == null) {
- return Mono
- .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
- }
- if (mongoClusterName == null) {
- return Mono
- .error(new IllegalArgumentException("Parameter mongoClusterName is required and cannot be null."));
- }
- final String accept = "application/json";
- context = this.client.mergeContext(context);
- return service
- .listByMongoCluster(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
- resourceGroupName, mongoClusterName, accept, context)
- .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
- res.getValue().value(), res.getValue().nextLink(), null));
- }
-
- /**
- * List all the firewall rules in a given mongo cluster.
- *
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param mongoClusterName The name of the mongo cluster.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the response of a FirewallRule list operation as paginated response with {@link PagedFlux}.
- */
- @ServiceMethod(returns = ReturnType.COLLECTION)
- private PagedFlux listByMongoClusterAsync(String resourceGroupName, String mongoClusterName) {
- return new PagedFlux<>(() -> listByMongoClusterSinglePageAsync(resourceGroupName, mongoClusterName),
- nextLink -> listByMongoClusterNextSinglePageAsync(nextLink));
- }
-
- /**
- * List all the firewall rules in a given mongo cluster.
- *
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param mongoClusterName The name of the mongo cluster.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the response of a FirewallRule list operation as paginated response with {@link PagedFlux}.
- */
- @ServiceMethod(returns = ReturnType.COLLECTION)
- private PagedFlux listByMongoClusterAsync(String resourceGroupName, String mongoClusterName,
- Context context) {
- return new PagedFlux<>(() -> listByMongoClusterSinglePageAsync(resourceGroupName, mongoClusterName, context),
- nextLink -> listByMongoClusterNextSinglePageAsync(nextLink, context));
- }
-
- /**
- * List all the firewall rules in a given mongo cluster.
- *
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param mongoClusterName The name of the mongo cluster.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the response of a FirewallRule list operation as paginated response with {@link PagedIterable}.
- */
- @ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedIterable listByMongoCluster(String resourceGroupName, String mongoClusterName) {
- return new PagedIterable<>(listByMongoClusterAsync(resourceGroupName, mongoClusterName));
- }
-
- /**
- * List all the firewall rules in a given mongo cluster.
- *
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param mongoClusterName The name of the mongo cluster.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the response of a FirewallRule list operation as paginated response with {@link PagedIterable}.
- */
- @ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedIterable listByMongoCluster(String resourceGroupName, String mongoClusterName,
- Context context) {
- return new PagedIterable<>(listByMongoClusterAsync(resourceGroupName, mongoClusterName, context));
- }
-
/**
* Get the next page of items.
*
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
index 6b408ab3abcab..bf7429a12ef28 100644
--- 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
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.implementation;
@@ -27,6 +27,19 @@ public FirewallRulesImpl(FirewallRulesClient 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
@@ -56,19 +69,6 @@ public void delete(String resourceGroupName, String mongoClusterName, String fir
this.serviceClient().delete(resourceGroupName, mongoClusterName, firewallRuleName, context);
}
- public PagedIterable listByMongoCluster(String resourceGroupName, String mongoClusterName) {
- PagedIterable inner
- = this.serviceClient().listByMongoCluster(resourceGroupName, mongoClusterName);
- return ResourceManagerUtils.mapPage(inner, inner1 -> new FirewallRuleImpl(inner1, this.manager()));
- }
-
- public PagedIterable listByMongoCluster(String resourceGroupName, String mongoClusterName,
- Context context) {
- PagedIterable inner
- = this.serviceClient().listByMongoCluster(resourceGroupName, mongoClusterName, context);
- return ResourceManagerUtils.mapPage(inner, inner1 -> new FirewallRuleImpl(inner1, this.manager()));
- }
-
public FirewallRule getById(String id) {
String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups");
if (resourceGroupName == null) {
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
index 25f607d90a2c0..0539a25b12c4b 100644
--- 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
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.implementation;
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
index 3d98b5b6312d9..d2cf3d7f8b5d0 100644
--- 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
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.implementation;
@@ -14,6 +14,7 @@
import com.azure.resourcemanager.mongocluster.models.MongoClusterProperties;
import com.azure.resourcemanager.mongocluster.models.MongoClusterUpdate;
import com.azure.resourcemanager.mongocluster.models.MongoClusterUpdateProperties;
+import com.azure.resourcemanager.mongocluster.models.PromoteReplicaRequest;
import java.util.Collections;
import java.util.Map;
@@ -158,6 +159,14 @@ public ListConnectionStringsResult listConnectionStrings() {
return serviceManager.mongoClusters().listConnectionStrings(resourceGroupName, mongoClusterName);
}
+ public void promote(PromoteReplicaRequest body) {
+ serviceManager.mongoClusters().promote(resourceGroupName, mongoClusterName, body);
+ }
+
+ public void promote(PromoteReplicaRequest body, Context context) {
+ serviceManager.mongoClusters().promote(resourceGroupName, mongoClusterName, body, context);
+ }
+
public MongoClusterImpl withRegion(Region location) {
this.innerModel().withLocation(location.toString());
return this;
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/DocumentDBClientBuilder.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/MongoClusterManagementClientBuilder.java
similarity index 63%
rename from sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/DocumentDBClientBuilder.java
rename to sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/MongoClusterManagementClientBuilder.java
index 899aa78dc1266..8a82732985455 100644
--- a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/DocumentDBClientBuilder.java
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/MongoClusterManagementClientBuilder.java
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.implementation;
@@ -15,39 +15,39 @@
import java.time.Duration;
/**
- * A builder for creating a new instance of the DocumentDBClientImpl type.
+ * A builder for creating a new instance of the MongoClusterManagementClientImpl type.
*/
-@ServiceClientBuilder(serviceClients = { DocumentDBClientImpl.class })
-public final class DocumentDBClientBuilder {
+@ServiceClientBuilder(serviceClients = { MongoClusterManagementClientImpl.class })
+public final class MongoClusterManagementClientBuilder {
/*
- * Server parameter
+ * The ID of the target subscription. The value must be an UUID.
*/
- private String endpoint;
+ private String subscriptionId;
/**
- * Sets Server parameter.
+ * Sets The ID of the target subscription. The value must be an UUID.
*
- * @param endpoint the endpoint value.
- * @return the DocumentDBClientBuilder.
+ * @param subscriptionId the subscriptionId value.
+ * @return the MongoClusterManagementClientBuilder.
*/
- public DocumentDBClientBuilder endpoint(String endpoint) {
- this.endpoint = endpoint;
+ public MongoClusterManagementClientBuilder subscriptionId(String subscriptionId) {
+ this.subscriptionId = subscriptionId;
return this;
}
/*
- * The ID of the target subscription. The value must be an UUID.
+ * server parameter
*/
- private String subscriptionId;
+ private String endpoint;
/**
- * Sets The ID of the target subscription. The value must be an UUID.
+ * Sets server parameter.
*
- * @param subscriptionId the subscriptionId value.
- * @return the DocumentDBClientBuilder.
+ * @param endpoint the endpoint value.
+ * @return the MongoClusterManagementClientBuilder.
*/
- public DocumentDBClientBuilder subscriptionId(String subscriptionId) {
- this.subscriptionId = subscriptionId;
+ public MongoClusterManagementClientBuilder endpoint(String endpoint) {
+ this.endpoint = endpoint;
return this;
}
@@ -60,9 +60,9 @@ public DocumentDBClientBuilder subscriptionId(String subscriptionId) {
* Sets The environment to connect to.
*
* @param environment the environment value.
- * @return the DocumentDBClientBuilder.
+ * @return the MongoClusterManagementClientBuilder.
*/
- public DocumentDBClientBuilder environment(AzureEnvironment environment) {
+ public MongoClusterManagementClientBuilder environment(AzureEnvironment environment) {
this.environment = environment;
return this;
}
@@ -76,9 +76,9 @@ public DocumentDBClientBuilder environment(AzureEnvironment environment) {
* Sets The HTTP pipeline to send requests through.
*
* @param pipeline the pipeline value.
- * @return the DocumentDBClientBuilder.
+ * @return the MongoClusterManagementClientBuilder.
*/
- public DocumentDBClientBuilder pipeline(HttpPipeline pipeline) {
+ public MongoClusterManagementClientBuilder pipeline(HttpPipeline pipeline) {
this.pipeline = pipeline;
return this;
}
@@ -92,9 +92,9 @@ public DocumentDBClientBuilder pipeline(HttpPipeline pipeline) {
* Sets The default poll interval for long-running operation.
*
* @param defaultPollInterval the defaultPollInterval value.
- * @return the DocumentDBClientBuilder.
+ * @return the MongoClusterManagementClientBuilder.
*/
- public DocumentDBClientBuilder defaultPollInterval(Duration defaultPollInterval) {
+ public MongoClusterManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) {
this.defaultPollInterval = defaultPollInterval;
return this;
}
@@ -108,19 +108,20 @@ public DocumentDBClientBuilder defaultPollInterval(Duration defaultPollInterval)
* Sets The serializer to serialize an object into a string.
*
* @param serializerAdapter the serializerAdapter value.
- * @return the DocumentDBClientBuilder.
+ * @return the MongoClusterManagementClientBuilder.
*/
- public DocumentDBClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) {
+ public MongoClusterManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) {
this.serializerAdapter = serializerAdapter;
return this;
}
/**
- * Builds an instance of DocumentDBClientImpl with the provided parameters.
+ * Builds an instance of MongoClusterManagementClientImpl with the provided parameters.
*
- * @return an instance of DocumentDBClientImpl.
+ * @return an instance of MongoClusterManagementClientImpl.
*/
- public DocumentDBClientImpl buildClient() {
+ public MongoClusterManagementClientImpl buildClient() {
+ String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com";
AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE;
HttpPipeline localPipeline = (pipeline != null)
? pipeline
@@ -130,8 +131,8 @@ public DocumentDBClientImpl buildClient() {
SerializerAdapter localSerializerAdapter = (serializerAdapter != null)
? serializerAdapter
: SerializerFactory.createDefaultManagementSerializerAdapter();
- DocumentDBClientImpl client = new DocumentDBClientImpl(localPipeline, localSerializerAdapter,
- localDefaultPollInterval, localEnvironment, this.endpoint, this.subscriptionId);
+ 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/DocumentDBClientImpl.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/MongoClusterManagementClientImpl.java
similarity index 89%
rename from sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/DocumentDBClientImpl.java
rename to sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/MongoClusterManagementClientImpl.java
index 8175c14c61ea3..ff05b1eeef536 100644
--- a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/DocumentDBClientImpl.java
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/MongoClusterManagementClientImpl.java
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.implementation;
@@ -23,12 +23,13 @@
import com.azure.core.util.polling.PollerFlux;
import com.azure.core.util.serializer.SerializerAdapter;
import com.azure.core.util.serializer.SerializerEncoding;
-import com.azure.resourcemanager.mongocluster.fluent.DocumentDBClient;
import com.azure.resourcemanager.mongocluster.fluent.FirewallRulesClient;
+import com.azure.resourcemanager.mongocluster.fluent.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 com.azure.resourcemanager.mongocluster.fluent.ReplicasClient;
import java.io.IOException;
import java.lang.reflect.Type;
import java.nio.ByteBuffer;
@@ -39,50 +40,50 @@
import reactor.core.publisher.Mono;
/**
- * Initializes a new instance of the DocumentDBClientImpl type.
+ * Initializes a new instance of the MongoClusterManagementClientImpl type.
*/
-@ServiceClient(builder = DocumentDBClientBuilder.class)
-public final class DocumentDBClientImpl implements DocumentDBClient {
+@ServiceClient(builder = MongoClusterManagementClientBuilder.class)
+public final class MongoClusterManagementClientImpl implements MongoClusterManagementClient {
/**
- * Server parameter.
+ * The ID of the target subscription. The value must be an UUID.
*/
- private final String endpoint;
+ private final String subscriptionId;
/**
- * Gets Server parameter.
+ * Gets The ID of the target subscription. The value must be an UUID.
*
- * @return the endpoint value.
+ * @return the subscriptionId value.
*/
- public String getEndpoint() {
- return this.endpoint;
+ public String getSubscriptionId() {
+ return this.subscriptionId;
}
/**
- * Version parameter.
+ * server parameter.
*/
- private final String apiVersion;
+ private final String endpoint;
/**
- * Gets Version parameter.
+ * Gets server parameter.
*
- * @return the apiVersion value.
+ * @return the endpoint value.
*/
- public String getApiVersion() {
- return this.apiVersion;
+ public String getEndpoint() {
+ return this.endpoint;
}
/**
- * The ID of the target subscription. The value must be an UUID.
+ * Api Version.
*/
- private final String subscriptionId;
+ private final String apiVersion;
/**
- * Gets The ID of the target subscription. The value must be an UUID.
+ * Gets Api Version.
*
- * @return the subscriptionId value.
+ * @return the apiVersion value.
*/
- public String getSubscriptionId() {
- return this.subscriptionId;
+ public String getApiVersion() {
+ return this.apiVersion;
}
/**
@@ -198,28 +199,43 @@ public PrivateLinksClient getPrivateLinks() {
}
/**
- * Initializes an instance of DocumentDBClient client.
+ * The ReplicasClient object to access its operations.
+ */
+ private final ReplicasClient replicas;
+
+ /**
+ * Gets the ReplicasClient object to access its operations.
+ *
+ * @return the ReplicasClient object.
+ */
+ public ReplicasClient getReplicas() {
+ return this.replicas;
+ }
+
+ /**
+ * Initializes an instance of 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 endpoint Server parameter.
* @param subscriptionId The ID of the target subscription. The value must be an UUID.
+ * @param endpoint server parameter.
*/
- DocumentDBClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval,
- AzureEnvironment environment, String endpoint, String subscriptionId) {
+ MongoClusterManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter,
+ Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) {
this.httpPipeline = httpPipeline;
this.serializerAdapter = serializerAdapter;
this.defaultPollInterval = defaultPollInterval;
- this.endpoint = endpoint;
this.subscriptionId = subscriptionId;
- this.apiVersion = "2024-03-01-preview";
+ this.endpoint = endpoint;
+ this.apiVersion = "2024-06-01-preview";
this.operations = new OperationsClientImpl(this);
this.mongoClusters = new MongoClustersClientImpl(this);
this.firewallRules = new FirewallRulesClientImpl(this);
this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this);
this.privateLinks = new PrivateLinksClientImpl(this);
+ this.replicas = new ReplicasClientImpl(this);
}
/**
@@ -348,5 +364,5 @@ public Mono getBodyAsString(Charset charset) {
}
}
- private static final ClientLogger LOGGER = new ClientLogger(DocumentDBClientImpl.class);
+ 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
index ffb13c2e0c573..021b0228b3965 100644
--- 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
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.implementation;
@@ -37,9 +37,10 @@
import com.azure.resourcemanager.mongocluster.fluent.models.CheckNameAvailabilityResponseInner;
import com.azure.resourcemanager.mongocluster.fluent.models.ListConnectionStringsResultInner;
import com.azure.resourcemanager.mongocluster.fluent.models.MongoClusterInner;
-import com.azure.resourcemanager.mongocluster.implementation.models.MongoClusterListResult;
import com.azure.resourcemanager.mongocluster.models.CheckNameAvailabilityRequest;
+import com.azure.resourcemanager.mongocluster.models.MongoClusterListResult;
import com.azure.resourcemanager.mongocluster.models.MongoClusterUpdate;
+import com.azure.resourcemanager.mongocluster.models.PromoteReplicaRequest;
import java.nio.ByteBuffer;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
@@ -56,116 +57,487 @@ public final class MongoClustersClientImpl implements MongoClustersClient {
/**
* The service client containing this operation class.
*/
- private final DocumentDBClientImpl client;
+ private final MongoClusterManagementClientImpl client;
/**
* Initializes an instance of MongoClustersClientImpl.
*
* @param client the instance of the service client containing this operation class.
*/
- MongoClustersClientImpl(DocumentDBClientImpl client) {
+ MongoClustersClientImpl(MongoClusterManagementClientImpl client) {
this.service
= RestProxy.create(MongoClustersService.class, client.getHttpPipeline(), client.getSerializerAdapter());
this.client = client;
}
/**
- * The interface defining all the services for DocumentDBClientMongoClusters to be used by the proxy service to
- * perform REST calls.
+ * The interface defining all the services for MongoClusterManagementClientMongoClusters to be used by the proxy
+ * service to perform REST calls.
*/
- @Host("{endpoint}")
- @ServiceInterface(name = "DocumentDBClientMong")
+ @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("endpoint") String endpoint,
+ 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,
+ @PathParam("mongoClusterName") String mongoClusterName, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}")
@ExpectedResponses({ 200, 201 })
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono>> createOrUpdate(@HostParam("endpoint") String endpoint,
+ Mono>> createOrUpdate(@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,
- @BodyParam("application/json") MongoClusterInner resource, Context context);
+ @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("endpoint") String endpoint,
+ Mono>> update(@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,
- @BodyParam("application/json") MongoClusterUpdate properties, Context context);
+ @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("endpoint") String endpoint,
+ 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,
+ @PathParam("mongoClusterName") String mongoClusterName, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
- @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters")
+ @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/listConnectionStrings")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono> listByResourceGroup(@HostParam("endpoint") String endpoint,
+ Mono> listConnectionStrings(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
- @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("accept") String accept,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("mongoClusterName") String mongoClusterName, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
- @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/mongoClusters")
- @ExpectedResponses({ 200 })
+ @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/promote")
+ @ExpectedResponses({ 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono> list(@HostParam("endpoint") String endpoint,
- @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
- @HeaderParam("accept") String accept, Context context);
-
- @Headers({ "Content-Type: application/json" })
- @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/listConnectionStrings")
- @ExpectedResponses({ 200 })
- @UnexpectedResponseExceptionType(ManagementException.class)
- Mono> listConnectionStrings(@HostParam("endpoint") String endpoint,
+ Mono>> promote(@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,
+ @PathParam("mongoClusterName") String mongoClusterName,
+ @BodyParam("application/json") PromoteReplicaRequest body, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
- @Post("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/checkMongoClusterNameAvailability")
+ @Get("{nextLink}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono> checkNameAvailability(@HostParam("endpoint") String endpoint,
- @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
- @PathParam("location") String location, @HeaderParam("accept") String accept,
- @BodyParam("application/json") CheckNameAvailabilityRequest body, Context context);
+ 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("endpoint") String endpoint,
- @HeaderParam("accept") String accept, Context context);
+ @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));
+ }
- @Headers({ "Content-Type: application/json" })
- @Get("{nextLink}")
- @ExpectedResponses({ 200 })
- @UnexpectedResponseExceptionType(ManagementException.class)
- Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
- @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, Context context);
+ /**
+ * List 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));
}
/**
@@ -327,7 +699,7 @@ private Mono>> createOrUpdateWithResponseAsync(String
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(),
- this.client.getSubscriptionId(), resourceGroupName, mongoClusterName, accept, resource, context))
+ this.client.getSubscriptionId(), resourceGroupName, mongoClusterName, resource, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
@@ -371,7 +743,7 @@ private Mono>> createOrUpdateWithResponseAsync(String
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(),
- this.client.getSubscriptionId(), resourceGroupName, mongoClusterName, accept, resource, context);
+ this.client.getSubscriptionId(), resourceGroupName, mongoClusterName, resource, accept, context);
}
/**
@@ -570,7 +942,7 @@ private Mono>> updateWithResponseAsync(String resource
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(),
- this.client.getSubscriptionId(), resourceGroupName, mongoClusterName, accept, properties, context))
+ this.client.getSubscriptionId(), resourceGroupName, mongoClusterName, properties, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
@@ -614,7 +986,7 @@ private Mono>> updateWithResponseAsync(String resource
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
- resourceGroupName, mongoClusterName, accept, properties, context);
+ resourceGroupName, mongoClusterName, properties, accept, context);
}
/**
@@ -890,327 +1262,90 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the {@link SyncPoller} for polling of long-running operation.
- */
- @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
- public SyncPoller, Void> beginDelete(String resourceGroupName, String mongoClusterName) {
- return this.beginDeleteAsync(resourceGroupName, mongoClusterName).getSyncPoller();
- }
-
- /**
- * Deletes a mongo cluster.
- *
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param mongoClusterName The name of the mongo cluster.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the {@link SyncPoller} for polling of long-running operation.
- */
- @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
- public SyncPoller, Void> beginDelete(String resourceGroupName, String mongoClusterName,
- Context context) {
- return this.beginDeleteAsync(resourceGroupName, mongoClusterName, context).getSyncPoller();
- }
-
- /**
- * Deletes a mongo cluster.
- *
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param mongoClusterName The name of the mongo cluster.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return A {@link Mono} that completes when a successful response is received.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono deleteAsync(String resourceGroupName, String mongoClusterName) {
- return beginDeleteAsync(resourceGroupName, mongoClusterName).last()
- .flatMap(this.client::getLroFinalResultOrError);
- }
-
- /**
- * Deletes a mongo cluster.
- *
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param mongoClusterName The name of the mongo cluster.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return A {@link Mono} that completes when a successful response is received.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono deleteAsync(String resourceGroupName, String mongoClusterName, Context context) {
- return beginDeleteAsync(resourceGroupName, mongoClusterName, context).last()
- .flatMap(this.client::getLroFinalResultOrError);
- }
-
- /**
- * Deletes a mongo cluster.
- *
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param mongoClusterName The name of the mongo cluster.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- public void delete(String resourceGroupName, String mongoClusterName) {
- deleteAsync(resourceGroupName, mongoClusterName).block();
- }
-
- /**
- * Deletes a mongo cluster.
- *
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param mongoClusterName The name of the mongo cluster.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- public void delete(String resourceGroupName, String mongoClusterName, Context context) {
- deleteAsync(resourceGroupName, mongoClusterName, context).block();
- }
-
- /**
- * List all the mongo clusters in a given resource group.
- *
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the response of a MongoCluster list operation along with {@link PagedResponse} on successful completion
- * of {@link Mono}.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) {
- if (this.client.getEndpoint() == null) {
- return Mono.error(
- new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- if (this.client.getSubscriptionId() == null) {
- return Mono.error(new IllegalArgumentException(
- "Parameter this.client.getSubscriptionId() is required and cannot be null."));
- }
- if (resourceGroupName == null) {
- return Mono
- .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
- }
- final String accept = "application/json";
- return FluxUtil
- .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(),
- this.client.getSubscriptionId(), resourceGroupName, accept, context))
- .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
- res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
- .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
- }
-
- /**
- * List all the mongo clusters in a given resource group.
- *
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the response of a MongoCluster list operation along with {@link PagedResponse} on successful completion
- * of {@link Mono}.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName,
- Context context) {
- if (this.client.getEndpoint() == null) {
- return Mono.error(
- new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- if (this.client.getSubscriptionId() == null) {
- return Mono.error(new IllegalArgumentException(
- "Parameter this.client.getSubscriptionId() is required and cannot be null."));
- }
- if (resourceGroupName == null) {
- return Mono
- .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
- }
- final String accept = "application/json";
- context = this.client.mergeContext(context);
- return service
- .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(),
- this.client.getSubscriptionId(), resourceGroupName, accept, context)
- .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
- res.getValue().value(), res.getValue().nextLink(), null));
- }
-
- /**
- * List all the mongo clusters in a given resource group.
- *
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the response of a MongoCluster list operation as paginated response with {@link PagedFlux}.
- */
- @ServiceMethod(returns = ReturnType.COLLECTION)
- private PagedFlux listByResourceGroupAsync(String resourceGroupName) {
- return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName),
- nextLink -> listByResourceGroupNextSinglePageAsync(nextLink));
- }
-
- /**
- * List all the mongo clusters in a given resource group.
- *
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the response of a MongoCluster list operation as paginated response with {@link PagedFlux}.
- */
- @ServiceMethod(returns = ReturnType.COLLECTION)
- private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) {
- return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context),
- nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context));
- }
-
- /**
- * List all the mongo clusters in a given resource group.
- *
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the response of a MongoCluster list operation as paginated response with {@link PagedIterable}.
- */
- @ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedIterable listByResourceGroup(String resourceGroupName) {
- return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName));
- }
-
- /**
- * List all the mongo clusters in a given resource group.
- *
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the response of a MongoCluster list operation as paginated response with {@link PagedIterable}.
- */
- @ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
- return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context));
- }
-
- /**
- * List all the mongo clusters in a given subscription.
- *
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the response of a MongoCluster list operation along with {@link PagedResponse} on successful completion
- * of {@link Mono}.
+ * @return the {@link SyncPoller} for polling of long-running operation.
*/
- @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()));
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginDelete(String resourceGroupName, String mongoClusterName) {
+ return this.beginDeleteAsync(resourceGroupName, mongoClusterName).getSyncPoller();
}
/**
- * List all the mongo clusters in a given subscription.
+ * 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 response of a MongoCluster list operation along with {@link PagedResponse} on successful completion
- * of {@link Mono}.
+ * @return the {@link SyncPoller} for polling of long-running operation.
*/
- @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));
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginDelete(String resourceGroupName, String mongoClusterName,
+ Context context) {
+ return this.beginDeleteAsync(resourceGroupName, mongoClusterName, context).getSyncPoller();
}
/**
- * List all the mongo clusters in a given subscription.
+ * 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 response of a MongoCluster list operation as paginated response with {@link PagedFlux}.
+ * @return A {@link Mono} that completes when a successful response is received.
*/
- @ServiceMethod(returns = ReturnType.COLLECTION)
- private PagedFlux listAsync() {
- return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink));
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(String resourceGroupName, String mongoClusterName) {
+ return beginDeleteAsync(resourceGroupName, mongoClusterName).last()
+ .flatMap(this.client::getLroFinalResultOrError);
}
/**
- * List all the mongo clusters in a given subscription.
+ * 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 response of a MongoCluster list operation as paginated response with {@link PagedFlux}.
+ * @return A {@link Mono} that completes when a successful response is received.
*/
- @ServiceMethod(returns = ReturnType.COLLECTION)
- private PagedFlux listAsync(Context context) {
- return new PagedFlux<>(() -> listSinglePageAsync(context),
- nextLink -> listNextSinglePageAsync(nextLink, context));
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(String resourceGroupName, String mongoClusterName, Context context) {
+ return beginDeleteAsync(resourceGroupName, mongoClusterName, context).last()
+ .flatMap(this.client::getLroFinalResultOrError);
}
/**
- * List all the mongo clusters in a given subscription.
+ * 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 response of a MongoCluster list operation as paginated response with {@link PagedIterable}.
*/
- @ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedIterable list() {
- return new PagedIterable<>(listAsync());
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void delete(String resourceGroupName, String mongoClusterName) {
+ deleteAsync(resourceGroupName, mongoClusterName).block();
}
/**
- * List all the mongo clusters in a given subscription.
+ * 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 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));
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void delete(String resourceGroupName, String mongoClusterName, Context context) {
+ deleteAsync(resourceGroupName, mongoClusterName, context).block();
}
/**
@@ -1343,18 +1478,19 @@ public ListConnectionStringsResultInner listConnectionStrings(String resourceGro
}
/**
- * Check if mongo cluster name is available for use.
+ * Promotes a replica mongo cluster to a primary role.
*
- * @param location The location name.
- * @param body The CheckAvailability request.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param body The content of the action request.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the check availability result along with {@link Response} on successful completion of {@link Mono}.
+ * @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> checkNameAvailabilityWithResponseAsync(String location,
- CheckNameAvailabilityRequest body) {
+ private Mono>> promoteWithResponseAsync(String resourceGroupName, String mongoClusterName,
+ PromoteReplicaRequest body) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
@@ -1363,8 +1499,13 @@ private Mono> checkNameAvailability
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 (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (mongoClusterName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter mongoClusterName is required and cannot be null."));
}
if (body == null) {
return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null."));
@@ -1373,25 +1514,26 @@ private Mono> checkNameAvailability
}
final String accept = "application/json";
return FluxUtil
- .withContext(context -> service.checkNameAvailability(this.client.getEndpoint(),
- this.client.getApiVersion(), this.client.getSubscriptionId(), location, accept, body, context))
+ .withContext(context -> service.promote(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, mongoClusterName, body, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
- * Check if mongo cluster name is available for use.
+ * Promotes a replica mongo cluster to a primary role.
*
- * @param location The location name.
- * @param body The CheckAvailability request.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param body The content of the action request.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the check availability result along with {@link Response} on successful completion of {@link Mono}.
+ * @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> checkNameAvailabilityWithResponseAsync(String location,
- CheckNameAvailabilityRequest body, Context context) {
+ private Mono>> promoteWithResponseAsync(String resourceGroupName, String mongoClusterName,
+ PromoteReplicaRequest body, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
@@ -1400,8 +1542,13 @@ private Mono> checkNameAvailability
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 (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (mongoClusterName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter mongoClusterName is required and cannot be null."));
}
if (body == null) {
return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null."));
@@ -1410,57 +1557,152 @@ private Mono> checkNameAvailability
}
final String accept = "application/json";
context = this.client.mergeContext(context);
- return service.checkNameAvailability(this.client.getEndpoint(), this.client.getApiVersion(),
- this.client.getSubscriptionId(), location, accept, body, context);
+ return service.promote(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ resourceGroupName, mongoClusterName, body, accept, context);
}
/**
- * Check if mongo cluster name is available for use.
+ * Promotes a replica mongo cluster to a primary role.
*
- * @param location The location name.
- * @param body The CheckAvailability request.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param body The content of the action request.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the check availability result on successful completion of {@link Mono}.
+ * @return the {@link PollerFlux} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginPromoteAsync(String resourceGroupName, String mongoClusterName,
+ PromoteReplicaRequest body) {
+ Mono>> mono = promoteWithResponseAsync(resourceGroupName, mongoClusterName, body);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Promotes a replica mongo cluster to a primary role.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param body The content of the action request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginPromoteAsync(String resourceGroupName, String mongoClusterName,
+ PromoteReplicaRequest body, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono
+ = promoteWithResponseAsync(resourceGroupName, mongoClusterName, body, context);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
+ context);
+ }
+
+ /**
+ * Promotes a replica mongo cluster to a primary role.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param body The content of the action request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginPromote(String resourceGroupName, String mongoClusterName,
+ PromoteReplicaRequest body) {
+ return this.beginPromoteAsync(resourceGroupName, mongoClusterName, body).getSyncPoller();
+ }
+
+ /**
+ * Promotes a replica mongo cluster to a primary role.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param body The content of the action request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginPromote(String resourceGroupName, String mongoClusterName,
+ PromoteReplicaRequest body, Context context) {
+ return this.beginPromoteAsync(resourceGroupName, mongoClusterName, body, context).getSyncPoller();
+ }
+
+ /**
+ * Promotes a replica mongo cluster to a primary role.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param body The content of the action request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono checkNameAvailabilityAsync(String location,
- CheckNameAvailabilityRequest body) {
- return checkNameAvailabilityWithResponseAsync(location, body).flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ private Mono promoteAsync(String resourceGroupName, String mongoClusterName, PromoteReplicaRequest body) {
+ return beginPromoteAsync(resourceGroupName, mongoClusterName, body).last()
+ .flatMap(this.client::getLroFinalResultOrError);
}
/**
- * Check if mongo cluster name is available for use.
+ * Promotes a replica mongo cluster to a primary role.
*
- * @param location The location name.
- * @param body The CheckAvailability request.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param body The content of the action request.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the check availability result along with {@link Response}.
+ * @return A {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Response checkNameAvailabilityWithResponse(String location,
- CheckNameAvailabilityRequest body, Context context) {
- return checkNameAvailabilityWithResponseAsync(location, body, context).block();
+ private Mono promoteAsync(String resourceGroupName, String mongoClusterName, PromoteReplicaRequest body,
+ Context context) {
+ return beginPromoteAsync(resourceGroupName, mongoClusterName, body, context).last()
+ .flatMap(this.client::getLroFinalResultOrError);
}
/**
- * Check if mongo cluster name is available for use.
+ * Promotes a replica mongo cluster to a primary role.
*
- * @param location The location name.
- * @param body The CheckAvailability request.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param body The content of the action request.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the check availability result.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public CheckNameAvailabilityResponseInner checkNameAvailability(String location,
- CheckNameAvailabilityRequest body) {
- return checkNameAvailabilityWithResponse(location, body, Context.NONE).getValue();
+ public void promote(String resourceGroupName, String mongoClusterName, PromoteReplicaRequest body) {
+ promoteAsync(resourceGroupName, mongoClusterName, body).block();
+ }
+
+ /**
+ * Promotes a replica mongo cluster to a primary role.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param body The content of the action request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void promote(String resourceGroupName, String mongoClusterName, PromoteReplicaRequest body,
+ Context context) {
+ promoteAsync(resourceGroupName, mongoClusterName, body, context).block();
}
/**
@@ -1474,7 +1716,7 @@ public CheckNameAvailabilityResponseInner checkNameAvailability(String location,
* of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) {
+ private Mono> listNextSinglePageAsync(String nextLink) {
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
@@ -1483,9 +1725,7 @@ private Mono> listByResourceGroupNextSinglePage
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))
+ 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()));
@@ -1503,8 +1743,7 @@ private Mono> listByResourceGroupNextSinglePage
* of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listByResourceGroupNextSinglePageAsync(String nextLink,
- Context context) {
+ private Mono> listNextSinglePageAsync(String nextLink, Context context) {
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
@@ -1514,7 +1753,7 @@ private Mono> listByResourceGroupNextSinglePage
}
final String accept = "application/json";
context = this.client.mergeContext(context);
- return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, 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));
}
@@ -1530,7 +1769,7 @@ private Mono> listByResourceGroupNextSinglePage
* of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listNextSinglePageAsync(String nextLink) {
+ private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) {
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
@@ -1539,7 +1778,9 @@ private Mono> listNextSinglePageAsync(String ne
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))
+ 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()));
@@ -1557,7 +1798,8 @@ private Mono> listNextSinglePageAsync(String ne
* of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listNextSinglePageAsync(String nextLink, Context context) {
+ private Mono> listByResourceGroupNextSinglePageAsync(String nextLink,
+ Context context) {
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
@@ -1567,7 +1809,7 @@ private Mono> listNextSinglePageAsync(String ne
}
final String accept = "application/json";
context = this.client.mergeContext(context);
- return service.listNext(nextLink, this.client.getEndpoint(), accept, 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
index 47a86627a3593..403396219d377 100644
--- 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
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.implementation;
@@ -18,6 +18,7 @@
import com.azure.resourcemanager.mongocluster.models.ListConnectionStringsResult;
import com.azure.resourcemanager.mongocluster.models.MongoCluster;
import com.azure.resourcemanager.mongocluster.models.MongoClusters;
+import com.azure.resourcemanager.mongocluster.models.PromoteReplicaRequest;
public final class MongoClustersImpl implements MongoClusters {
private static final ClientLogger LOGGER = new ClientLogger(MongoClustersImpl.class);
@@ -32,33 +33,35 @@ public MongoClustersImpl(MongoClustersClient innerClient,
this.serviceManager = serviceManager;
}
- public Response getByResourceGroupWithResponse(String resourceGroupName, String mongoClusterName,
- Context context) {
- Response inner
- = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, mongoClusterName, context);
+ 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 MongoClusterImpl(inner.getValue(), this.manager()));
+ new CheckNameAvailabilityResponseImpl(inner.getValue(), this.manager()));
} else {
return null;
}
}
- public MongoCluster getByResourceGroup(String resourceGroupName, String mongoClusterName) {
- MongoClusterInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, mongoClusterName);
+ public CheckNameAvailabilityResponse checkNameAvailability(String location, CheckNameAvailabilityRequest body) {
+ CheckNameAvailabilityResponseInner inner = this.serviceClient().checkNameAvailability(location, body);
if (inner != null) {
- return new MongoClusterImpl(inner, this.manager());
+ return new CheckNameAvailabilityResponseImpl(inner, this.manager());
} else {
return null;
}
}
- public void deleteByResourceGroup(String resourceGroupName, String mongoClusterName) {
- this.serviceClient().delete(resourceGroupName, mongoClusterName);
+ public PagedIterable list() {
+ PagedIterable inner = this.serviceClient().list();
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new MongoClusterImpl(inner1, this.manager()));
}
- public void delete(String resourceGroupName, String mongoClusterName, Context context) {
- this.serviceClient().delete(resourceGroupName, mongoClusterName, context);
+ 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) {
@@ -71,14 +74,33 @@ public PagedIterable listByResourceGroup(String resourceGroupName,
return ResourceManagerUtils.mapPage(inner, inner1 -> new MongoClusterImpl(inner1, this.manager()));
}
- public PagedIterable list() {
- PagedIterable inner = this.serviceClient().list();
- return ResourceManagerUtils.mapPage(inner, inner1 -> new MongoClusterImpl(inner1, this.manager()));
+ public 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 PagedIterable list(Context context) {
- PagedIterable inner = this.serviceClient().list(context);
- return ResourceManagerUtils.mapPage(inner, inner1 -> new MongoClusterImpl(inner1, this.manager()));
+ 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,
@@ -103,25 +125,13 @@ public ListConnectionStringsResult listConnectionStrings(String resourceGroupNam
}
}
- 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 void promote(String resourceGroupName, String mongoClusterName, PromoteReplicaRequest body) {
+ this.serviceClient().promote(resourceGroupName, mongoClusterName, body);
}
- public CheckNameAvailabilityResponse checkNameAvailability(String location, CheckNameAvailabilityRequest body) {
- CheckNameAvailabilityResponseInner inner = this.serviceClient().checkNameAvailability(location, body);
- if (inner != null) {
- return new CheckNameAvailabilityResponseImpl(inner, this.manager());
- } else {
- return null;
- }
+ public void promote(String resourceGroupName, String mongoClusterName, PromoteReplicaRequest body,
+ Context context) {
+ this.serviceClient().promote(resourceGroupName, mongoClusterName, body, context);
}
public MongoCluster getById(String id) {
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
index cd003b9ad1baa..a3e07c629b0ca 100644
--- 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
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.implementation;
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
index ddcad08ab734f..402409d7ddd74 100644
--- 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
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.implementation;
@@ -27,7 +27,7 @@
import com.azure.core.util.FluxUtil;
import com.azure.resourcemanager.mongocluster.fluent.OperationsClient;
import com.azure.resourcemanager.mongocluster.fluent.models.OperationInner;
-import com.azure.resourcemanager.mongocluster.implementation.models.OperationListResult;
+import com.azure.resourcemanager.mongocluster.models.OperationListResult;
import reactor.core.publisher.Mono;
/**
@@ -42,39 +42,39 @@ public final class OperationsClientImpl implements OperationsClient {
/**
* The service client containing this operation class.
*/
- private final DocumentDBClientImpl client;
+ private final MongoClusterManagementClientImpl client;
/**
* Initializes an instance of OperationsClientImpl.
*
* @param client the instance of the service client containing this operation class.
*/
- OperationsClientImpl(DocumentDBClientImpl client) {
+ OperationsClientImpl(MongoClusterManagementClientImpl client) {
this.service
= RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
this.client = client;
}
/**
- * The interface defining all the services for DocumentDBClientOperations to be used by the proxy service to perform
- * REST calls.
+ * The interface defining all the services for MongoClusterManagementClientOperations to be used by the proxy
+ * service to perform REST calls.
*/
- @Host("{endpoint}")
- @ServiceInterface(name = "DocumentDBClientOper")
+ @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("endpoint") String endpoint,
- @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, Context context);
+ 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("endpoint") String endpoint, @HeaderParam("accept") String accept, Context context);
+ @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context);
}
/**
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
index 341c50b16fc54..f6848113d939a 100644
--- 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
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.implementation;
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
index 2c6c557d6f733..29cde3a8bd44b 100644
--- 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
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.implementation;
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
index 277e962a7b368..f3eacbeb05246 100644
--- 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
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.implementation;
@@ -33,7 +33,7 @@
import com.azure.core.util.polling.SyncPoller;
import com.azure.resourcemanager.mongocluster.fluent.PrivateEndpointConnectionsClient;
import com.azure.resourcemanager.mongocluster.fluent.models.PrivateEndpointConnectionResourceInner;
-import com.azure.resourcemanager.mongocluster.implementation.models.PrivateEndpointConnectionResourceListResult;
+import com.azure.resourcemanager.mongocluster.models.PrivateEndpointConnectionResourceListResult;
import java.nio.ByteBuffer;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
@@ -50,78 +50,78 @@ public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpoi
/**
* The service client containing this operation class.
*/
- private final DocumentDBClientImpl client;
+ private final MongoClusterManagementClientImpl client;
/**
* Initializes an instance of PrivateEndpointConnectionsClientImpl.
*
* @param client the instance of the service client containing this operation class.
*/
- PrivateEndpointConnectionsClientImpl(DocumentDBClientImpl client) {
+ PrivateEndpointConnectionsClientImpl(MongoClusterManagementClientImpl client) {
this.service = RestProxy.create(PrivateEndpointConnectionsService.class, client.getHttpPipeline(),
client.getSerializerAdapter());
this.client = client;
}
/**
- * The interface defining all the services for DocumentDBClientPrivateEndpointConnections to be used by the proxy
- * service to perform REST calls.
+ * The interface defining all the services for MongoClusterManagementClientPrivateEndpointConnections to be used by
+ * the proxy service to perform REST calls.
*/
- @Host("{endpoint}")
- @ServiceInterface(name = "DocumentDBClientPriv")
+ @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("endpoint") String endpoint, @QueryParam("api-version") String apiVersion,
+ @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,
+ @PathParam("mongoClusterName") String mongoClusterName, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/privateEndpointConnections/{privateEndpointConnectionName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono> get(@HostParam("endpoint") String endpoint,
+ 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);
+ @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/privateEndpointConnections/{privateEndpointConnectionName}")
@ExpectedResponses({ 200, 201, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono>> create(@HostParam("endpoint") String endpoint,
+ 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,
- @HeaderParam("accept") String accept,
- @BodyParam("application/json") PrivateEndpointConnectionResourceInner resource, Context context);
+ @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>> delete(@HostParam("endpoint") String endpoint,
+ Mono>> delete(@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);
+ @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("{nextLink}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listByMongoClusterNext(
- @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
- @HeaderParam("accept") String accept, Context context);
+ @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept, Context context);
}
/**
@@ -429,7 +429,8 @@ public PrivateEndpointConnectionResourceInner get(String resourceGroupName, Stri
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the response body along with {@link Response} on successful completion of {@link Mono}.
+ * @return concrete proxy resource types can be created by aliasing this type using a specific property type along
+ * with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> createWithResponseAsync(String resourceGroupName, String mongoClusterName,
@@ -463,7 +464,7 @@ private Mono>> createWithResponseAsync(String resource
return FluxUtil
.withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, mongoClusterName, privateEndpointConnectionName,
- accept, resource, context))
+ resource, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
@@ -479,7 +480,8 @@ private Mono>> createWithResponseAsync(String resource
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the response body along with {@link Response} on successful completion of {@link Mono}.
+ * @return concrete proxy resource types can be created by aliasing this type using a specific property type along
+ * with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> createWithResponseAsync(String resourceGroupName, String mongoClusterName,
@@ -512,7 +514,7 @@ private Mono>> createWithResponseAsync(String resource
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
- resourceGroupName, mongoClusterName, privateEndpointConnectionName, accept, resource, context);
+ resourceGroupName, mongoClusterName, privateEndpointConnectionName, resource, accept, context);
}
/**
@@ -526,7 +528,8 @@ private Mono>> createWithResponseAsync(String resource
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the {@link PollerFlux} for polling of long-running operation.
+ * @return the {@link PollerFlux} 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)
private PollerFlux, PrivateEndpointConnectionResourceInner>
@@ -551,7 +554,8 @@ private Mono>> createWithResponseAsync(String resource
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the {@link PollerFlux} for polling of long-running operation.
+ * @return the {@link PollerFlux} 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)
private PollerFlux, PrivateEndpointConnectionResourceInner>
@@ -576,7 +580,8 @@ private Mono>> createWithResponseAsync(String resource
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the {@link SyncPoller} for polling of long-running operation.
+ * @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)
public SyncPoller, PrivateEndpointConnectionResourceInner>
@@ -598,7 +603,8 @@ private Mono>> createWithResponseAsync(String resource
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the {@link SyncPoller} for polling of long-running operation.
+ * @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)
public SyncPoller, PrivateEndpointConnectionResourceInner>
@@ -620,7 +626,8 @@ private Mono>> createWithResponseAsync(String resource
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the response body on successful completion of {@link Mono}.
+ * @return concrete proxy resource types can be created by aliasing this type using a specific property type on
+ * successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createAsync(String resourceGroupName, String mongoClusterName,
@@ -641,7 +648,8 @@ private Mono createAsync(String resource
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the response body on successful completion of {@link Mono}.
+ * @return concrete proxy resource types can be created by aliasing this type using a specific property type on
+ * successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createAsync(String resourceGroupName, String mongoClusterName,
@@ -662,7 +670,7 @@ private Mono createAsync(String resource
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the response.
+ * @return concrete proxy resource types can be created by aliasing this type using a specific property type.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public PrivateEndpointConnectionResourceInner create(String resourceGroupName, String mongoClusterName,
@@ -682,7 +690,7 @@ public PrivateEndpointConnectionResourceInner create(String resourceGroupName, S
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException 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.
+ * @return concrete proxy resource types can be created by aliasing this type using a specific property type.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public PrivateEndpointConnectionResourceInner create(String resourceGroupName, String mongoClusterName,
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/PrivateEndpointConnectionsImpl.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/PrivateEndpointConnectionsImpl.java
index 8d1204e21c235..b9d74f1fd67b2 100644
--- a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/PrivateEndpointConnectionsImpl.java
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/PrivateEndpointConnectionsImpl.java
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.implementation;
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/PrivateLinkResourceImpl.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/PrivateLinkResourceImpl.java
index f39e35cbbc0f6..94294069d048d 100644
--- a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/PrivateLinkResourceImpl.java
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/PrivateLinkResourceImpl.java
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.implementation;
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/PrivateLinksClientImpl.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/PrivateLinksClientImpl.java
index 26b63a75d40cf..9aa0b12026423 100644
--- a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/PrivateLinksClientImpl.java
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/PrivateLinksClientImpl.java
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.implementation;
@@ -27,7 +27,7 @@
import com.azure.core.util.FluxUtil;
import com.azure.resourcemanager.mongocluster.fluent.PrivateLinksClient;
import com.azure.resourcemanager.mongocluster.fluent.models.PrivateLinkResourceInner;
-import com.azure.resourcemanager.mongocluster.implementation.models.PrivateLinkResourceListResult;
+import com.azure.resourcemanager.mongocluster.models.PrivateLinkResourceListResult;
import reactor.core.publisher.Mono;
/**
@@ -42,34 +42,34 @@ public final class PrivateLinksClientImpl implements PrivateLinksClient {
/**
* The service client containing this operation class.
*/
- private final DocumentDBClientImpl client;
+ private final MongoClusterManagementClientImpl client;
/**
* Initializes an instance of PrivateLinksClientImpl.
*
* @param client the instance of the service client containing this operation class.
*/
- PrivateLinksClientImpl(DocumentDBClientImpl client) {
+ PrivateLinksClientImpl(MongoClusterManagementClientImpl client) {
this.service
= RestProxy.create(PrivateLinksService.class, client.getHttpPipeline(), client.getSerializerAdapter());
this.client = client;
}
/**
- * The interface defining all the services for DocumentDBClientPrivateLinks to be used by the proxy service to
- * perform REST calls.
+ * The interface defining all the services for MongoClusterManagementClientPrivateLinks to be used by the proxy
+ * service to perform REST calls.
*/
- @Host("{endpoint}")
- @ServiceInterface(name = "DocumentDBClientPriv")
+ @Host("{$host}")
+ @ServiceInterface(name = "MongoClusterManageme")
public interface PrivateLinksService {
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/privateLinkResources")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono> listByMongoCluster(@HostParam("endpoint") String endpoint,
+ 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,
+ @PathParam("mongoClusterName") String mongoClusterName, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@@ -77,8 +77,8 @@ Mono> listByMongoCluster(@HostParam("end
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listByMongoClusterNext(
- @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
- @HeaderParam("accept") String accept, Context context);
+ @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept, Context context);
}
/**
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/PrivateLinksImpl.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/PrivateLinksImpl.java
index 134ba73d361ed..4077660d608ef 100644
--- a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/PrivateLinksImpl.java
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/PrivateLinksImpl.java
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.implementation;
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/ReplicaImpl.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/ReplicaImpl.java
new file mode 100644
index 0000000000000..675be58f695fa
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/ReplicaImpl.java
@@ -0,0 +1,49 @@
+// 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.resourcemanager.mongocluster.fluent.models.ReplicaInner;
+import com.azure.resourcemanager.mongocluster.models.MongoClusterProperties;
+import com.azure.resourcemanager.mongocluster.models.Replica;
+
+public final class ReplicaImpl implements Replica {
+ private ReplicaInner innerObject;
+
+ private final com.azure.resourcemanager.mongocluster.MongoClusterManager serviceManager;
+
+ ReplicaImpl(ReplicaInner 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 MongoClusterProperties properties() {
+ return this.innerModel().properties();
+ }
+
+ public SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public ReplicaInner 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/ReplicasClientImpl.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/ReplicasClientImpl.java
new file mode 100644
index 0000000000000..82480a816ea2c
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/ReplicasClientImpl.java
@@ -0,0 +1,282 @@
+// 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.ReplicasClient;
+import com.azure.resourcemanager.mongocluster.fluent.models.ReplicaInner;
+import com.azure.resourcemanager.mongocluster.models.ReplicaListResult;
+import reactor.core.publisher.Mono;
+
+/**
+ * An instance of this class provides access to all the operations defined in ReplicasClient.
+ */
+public final class ReplicasClientImpl implements ReplicasClient {
+ /**
+ * The proxy service used to perform REST calls.
+ */
+ private final ReplicasService service;
+
+ /**
+ * The service client containing this operation class.
+ */
+ private final MongoClusterManagementClientImpl client;
+
+ /**
+ * Initializes an instance of ReplicasClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ ReplicasClientImpl(MongoClusterManagementClientImpl client) {
+ this.service = RestProxy.create(ReplicasService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for MongoClusterManagementClientReplicas to be used by the proxy service
+ * to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "MongoClusterManageme")
+ public interface ReplicasService {
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/replicas")
+ @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("{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 replicas for the mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Replica list operation 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 replicas for the mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Replica list operation 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 replicas for the mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Replica list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByMongoClusterAsync(String resourceGroupName, String mongoClusterName) {
+ return new PagedFlux<>(() -> listByMongoClusterSinglePageAsync(resourceGroupName, mongoClusterName),
+ nextLink -> listByMongoClusterNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List all the replicas for the mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Replica list operation as paginated response with {@link 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 replicas for the mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Replica list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByMongoCluster(String resourceGroupName, String mongoClusterName) {
+ return new PagedIterable<>(listByMongoClusterAsync(resourceGroupName, mongoClusterName));
+ }
+
+ /**
+ * List all the replicas for the mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Replica list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByMongoCluster(String resourceGroupName, String mongoClusterName,
+ Context context) {
+ return new PagedIterable<>(listByMongoClusterAsync(resourceGroupName, mongoClusterName, context));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Replica list operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByMongoClusterNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context -> service.listByMongoClusterNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
+ res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Replica 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/ReplicasImpl.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/ReplicasImpl.java
new file mode 100644
index 0000000000000..04ad1264350f2
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/ReplicasImpl.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.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.ReplicasClient;
+import com.azure.resourcemanager.mongocluster.fluent.models.ReplicaInner;
+import com.azure.resourcemanager.mongocluster.models.Replica;
+import com.azure.resourcemanager.mongocluster.models.Replicas;
+
+public final class ReplicasImpl implements Replicas {
+ private static final ClientLogger LOGGER = new ClientLogger(ReplicasImpl.class);
+
+ private final ReplicasClient innerClient;
+
+ private final com.azure.resourcemanager.mongocluster.MongoClusterManager serviceManager;
+
+ public ReplicasImpl(ReplicasClient 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 ReplicaImpl(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 ReplicaImpl(inner1, this.manager()));
+ }
+
+ private ReplicasClient 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/ResourceManagerUtils.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/ResourceManagerUtils.java
index feb7fa3ca2f57..e8dde58e8c4ec 100644
--- a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/ResourceManagerUtils.java
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/ResourceManagerUtils.java
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.implementation;
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/package-info.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/package-info.java
index 6ca3f50abfa5a..fbcee02138dd0 100644
--- a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/package-info.java
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/package-info.java
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
/**
* Package containing the implementations for MongoClusterManagementClient.
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/ActionType.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/ActionType.java
index 6d0d60c2fe2fa..15bbf5e700cf7 100644
--- a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/ActionType.java
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/ActionType.java
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.models;
@@ -8,7 +8,7 @@
import java.util.Collection;
/**
- * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
+ * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
*/
public final class ActionType extends ExpandableStringEnum {
/**
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/CheckNameAvailabilityReason.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/CheckNameAvailabilityReason.java
index 335d5ebff5014..af5f5059f0200 100644
--- a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/CheckNameAvailabilityReason.java
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/CheckNameAvailabilityReason.java
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.models;
@@ -8,7 +8,7 @@
import java.util.Collection;
/**
- * Possible reasons for a name not being available.
+ * The reason why the given name is not available.
*/
public final class CheckNameAvailabilityReason extends ExpandableStringEnum {
/**
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/CheckNameAvailabilityRequest.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/CheckNameAvailabilityRequest.java
index 9c0cbb077019e..ca8ff1f55221f 100644
--- a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/CheckNameAvailabilityRequest.java
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/CheckNameAvailabilityRequest.java
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.models;
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/CheckNameAvailabilityResponse.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/CheckNameAvailabilityResponse.java
index 3e22a3fb66040..eab187dd161d5 100644
--- a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/CheckNameAvailabilityResponse.java
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/CheckNameAvailabilityResponse.java
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.models;
@@ -25,7 +25,7 @@ public interface CheckNameAvailabilityResponse {
CheckNameAvailabilityReason reason();
/**
- * Gets the message property: Detailed reason why the given name is not available.
+ * Gets the message property: Detailed reason why the given name is available.
*
* @return the message value.
*/
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/ConnectionString.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/ConnectionString.java
index 14fc3246b8e8f..d5ccda21cafe9 100644
--- a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/ConnectionString.java
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/ConnectionString.java
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.models;
@@ -29,7 +29,7 @@ public final class ConnectionString implements JsonSerializable {
*/
public static final CreateMode POINT_IN_TIME_RESTORE = fromString("PointInTimeRestore");
+ /**
+ * Static value GeoReplica for CreateMode.
+ */
+ public static final CreateMode GEO_REPLICA = fromString("GeoReplica");
+
+ /**
+ * Static value Replica for CreateMode.
+ */
+ public static final CreateMode REPLICA = fromString("Replica");
+
/**
* Creates a new instance of CreateMode value.
*
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/FirewallRule.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/FirewallRule.java
index 3a114c17e38ac..93341a278af36 100644
--- a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/FirewallRule.java
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/FirewallRule.java
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.models;
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/models/FirewallRuleListResult.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/FirewallRuleListResult.java
similarity index 80%
rename from sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/models/FirewallRuleListResult.java
rename to sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/FirewallRuleListResult.java
index c0a2bfc574b2f..ee2cd58ab7cb5 100644
--- a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/models/FirewallRuleListResult.java
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/FirewallRuleListResult.java
@@ -1,10 +1,10 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
-package com.azure.resourcemanager.mongocluster.implementation.models;
+package com.azure.resourcemanager.mongocluster.models;
-import com.azure.core.annotation.Immutable;
+import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
@@ -17,7 +17,7 @@
/**
* The response of a FirewallRule list operation.
*/
-@Immutable
+@Fluent
public final class FirewallRuleListResult implements JsonSerializable {
/*
* The FirewallRule items on this page
@@ -32,7 +32,7 @@ public final class FirewallRuleListResult implements JsonSerializable value() {
return this.value;
}
+ /**
+ * Set the value property: The FirewallRule items on this page.
+ *
+ * @param value the value value to set.
+ * @return the FirewallRuleListResult object itself.
+ */
+ public FirewallRuleListResult withValue(List value) {
+ this.value = value;
+ return this;
+ }
+
/**
* Get the nextLink property: The link to the next page of items.
*
@@ -53,6 +64,17 @@ public String nextLink() {
return this.nextLink;
}
+ /**
+ * Set the nextLink property: The link to the next page of items.
+ *
+ * @param nextLink the nextLink value to set.
+ * @return the FirewallRuleListResult object itself.
+ */
+ public FirewallRuleListResult withNextLink(String nextLink) {
+ this.nextLink = nextLink;
+ return this;
+ }
+
/**
* Validates the instance.
*
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/FirewallRuleProperties.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/FirewallRuleProperties.java
index 854801a6c5f6e..fc4175f817bd3 100644
--- a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/FirewallRuleProperties.java
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/FirewallRuleProperties.java
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.models;
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/FirewallRules.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/FirewallRules.java
index c4cae9325e469..57b91da7b1cff 100644
--- a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/FirewallRules.java
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/FirewallRules.java
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.models;
@@ -13,82 +13,82 @@
*/
public interface FirewallRules {
/**
- * Gets information about a mongo cluster firewall rule.
+ * 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 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}.
+ * @return the response of a FirewallRule list operation as paginated response with {@link PagedIterable}.
*/
- Response getWithResponse(String resourceGroupName, String mongoClusterName, String firewallRuleName,
- Context context);
+ PagedIterable listByMongoCluster(String resourceGroupName, String mongoClusterName);
/**
- * Gets information about a mongo cluster firewall rule.
+ * 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 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.
+ * @return the response of a FirewallRule list operation as paginated response with {@link PagedIterable}.
*/
- FirewallRule get(String resourceGroupName, String mongoClusterName, String firewallRuleName);
+ PagedIterable listByMongoCluster(String resourceGroupName, String mongoClusterName, Context context);
/**
- * Deletes a mongo cluster firewall rule.
+ * 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}.
*/
- void delete(String resourceGroupName, String mongoClusterName, String firewallRuleName);
+ Response getWithResponse(String resourceGroupName, String mongoClusterName, String firewallRuleName,
+ Context context);
/**
- * Deletes a mongo cluster firewall rule.
+ * 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.
*/
- void delete(String resourceGroupName, String mongoClusterName, String firewallRuleName, Context context);
+ FirewallRule get(String resourceGroupName, String mongoClusterName, String firewallRuleName);
/**
- * List all the firewall rules in a given mongo cluster.
+ * 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 response of a FirewallRule list operation as paginated response with {@link PagedIterable}.
*/
- PagedIterable listByMongoCluster(String resourceGroupName, String mongoClusterName);
+ void delete(String resourceGroupName, String mongoClusterName, String firewallRuleName);
/**
- * List all the firewall rules in a given mongo cluster.
+ * 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 response of a FirewallRule list operation as paginated response with {@link PagedIterable}.
*/
- PagedIterable listByMongoCluster(String resourceGroupName, String mongoClusterName, Context context);
+ void delete(String resourceGroupName, String mongoClusterName, String firewallRuleName, Context context);
/**
* Gets information about a mongo cluster firewall rule.
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/ListConnectionStringsResult.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/ListConnectionStringsResult.java
index eedc1f35e213b..49e96a9a3630f 100644
--- a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/ListConnectionStringsResult.java
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/ListConnectionStringsResult.java
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.models;
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/MongoCluster.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/MongoCluster.java
index ae44e30a50ad6..6035523200ad5 100644
--- a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/MongoCluster.java
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/MongoCluster.java
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.models;
@@ -240,9 +240,9 @@ interface WithTags {
*/
interface WithProperties {
/**
- * Specifies the properties property: The properties property..
+ * Specifies the properties property: The updatable properties of the MongoCluster..
*
- * @param properties The properties property.
+ * @param properties The updatable properties of the MongoCluster.
* @return the next definition stage.
*/
Update withProperties(MongoClusterUpdateProperties properties);
@@ -285,4 +285,25 @@ interface WithProperties {
* @return the connection strings for the given mongo cluster.
*/
ListConnectionStringsResult listConnectionStrings();
+
+ /**
+ * Promotes a replica mongo cluster to a primary role.
+ *
+ * @param body The content of the action request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ void promote(PromoteReplicaRequest body);
+
+ /**
+ * Promotes a replica mongo cluster to a primary role.
+ *
+ * @param body The content of the action request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ void promote(PromoteReplicaRequest body, Context context);
}
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/models/MongoClusterListResult.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/MongoClusterListResult.java
similarity index 80%
rename from sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/models/MongoClusterListResult.java
rename to sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/MongoClusterListResult.java
index 50e1e35cd1e2c..3d74e15056c5c 100644
--- a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/models/MongoClusterListResult.java
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/MongoClusterListResult.java
@@ -1,10 +1,10 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
-package com.azure.resourcemanager.mongocluster.implementation.models;
+package com.azure.resourcemanager.mongocluster.models;
-import com.azure.core.annotation.Immutable;
+import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
@@ -17,7 +17,7 @@
/**
* The response of a MongoCluster list operation.
*/
-@Immutable
+@Fluent
public final class MongoClusterListResult implements JsonSerializable {
/*
* The MongoCluster items on this page
@@ -32,7 +32,7 @@ public final class MongoClusterListResult implements JsonSerializable value() {
return this.value;
}
+ /**
+ * Set the value property: The MongoCluster items on this page.
+ *
+ * @param value the value value to set.
+ * @return the MongoClusterListResult object itself.
+ */
+ public MongoClusterListResult withValue(List value) {
+ this.value = value;
+ return this;
+ }
+
/**
* Get the nextLink property: The link to the next page of items.
*
@@ -53,6 +64,17 @@ public String nextLink() {
return this.nextLink;
}
+ /**
+ * Set the nextLink property: The link to the next page of items.
+ *
+ * @param nextLink the nextLink value to set.
+ * @return the MongoClusterListResult object itself.
+ */
+ public MongoClusterListResult withNextLink(String nextLink) {
+ this.nextLink = nextLink;
+ return this;
+ }
+
/**
* Validates the instance.
*
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/MongoClusterProperties.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/MongoClusterProperties.java
index 2076c9f61d368..1feae89de452a 100644
--- a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/MongoClusterProperties.java
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/models/MongoClusterProperties.java
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) TypeSpec Code Generator.
+// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mongocluster.models;
@@ -27,6 +27,11 @@ public final class MongoClusterProperties implements JsonSerializable privateEndpointConnections;
+ /*
+ * List of private endpoint connections.
+ */
+ private List