From 93618e527629bbb0cdbc32294afb8af00516f0b4 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Sat, 20 Jun 2026 14:26:25 +0000 Subject: [PATCH] Configurations: 'specification/liftrmongodb/MongoDB.Atlas.Management/tspconfig.yaml', API Version: 2026-03-01-preview, SDK Release Type: beta, and CommitSHA: '18ebae7ea8f6aefd83268aacdb1f480b24842726' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6461791 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- .../CHANGELOG.md | 89 +- .../README.md | 4 +- .../SAMPLE.md | 269 ++++- .../pom.xml | 5 +- .../mongodbatlas/MongoDBAtlasManager.java | 32 + .../mongodbatlas/fluent/ClustersClient.java | 214 ++++ .../fluent/MongoDBAtlasManagementClient.java | 14 + .../mongodbatlas/fluent/ProjectsClient.java | 264 +++++ .../fluent/models/ClusterInner.java | 155 +++ .../fluent/models/ProjectInner.java | 155 +++ .../models/RegionsByTierResponseInner.java | 109 ++ .../models/TierLimitReachedResponseInner.java | 78 ++ .../implementation/ClusterImpl.java | 134 +++ .../implementation/ClustersClientImpl.java | 800 +++++++++++++++ .../implementation/ClustersImpl.java | 176 ++++ .../MongoDBAtlasManagementClientImpl.java | 34 +- .../implementation/ProjectImpl.java | 149 +++ .../implementation/ProjectsClientImpl.java | 958 ++++++++++++++++++ .../implementation/ProjectsImpl.java | 194 ++++ .../RegionsByTierResponseImpl.java | 48 + .../TierLimitReachedResponseImpl.java | 40 + .../models/ClusterListResult.java | 95 ++ .../models/ProjectListResult.java | 95 ++ .../mongodbatlas/models/Cluster.java | 190 ++++ .../models/ClusterProperties.java | 195 ++++ .../mongodbatlas/models/ClusterTier.java | 61 ++ .../mongodbatlas/models/Clusters.java | 151 +++ .../mongodbatlas/models/Project.java | 230 +++++ .../models/ProjectLimitStatus.java | 126 +++ .../models/ProjectProperties.java | 138 +++ .../mongodbatlas/models/Projects.java | 200 ++++ .../models/RegionsByTierResponse.java | 41 + .../models/TierLimitReachedResponse.java | 27 + .../mongodbatlas/models/TierRegions.java | 94 ++ ...resourcemanager-mongodbatlas_metadata.json | 2 +- .../proxy-config.json | 2 +- .../ClustersCreateOrUpdateSamples.java | 30 + .../generated/ClustersDeleteSamples.java | 23 + .../generated/ClustersGetSamples.java | 23 + .../generated/ClustersListSamples.java | 22 + .../generated/OperationsListSamples.java | 4 +- .../OrganizationsCreateOrUpdateSamples.java | 2 +- .../generated/OrganizationsDeleteSamples.java | 2 +- ...rganizationsGetByResourceGroupSamples.java | 2 +- ...ganizationsListByResourceGroupSamples.java | 4 +- .../generated/OrganizationsListSamples.java | 4 +- .../generated/OrganizationsUpdateSamples.java | 2 +- .../ProjectsCreateOrUpdateSamples.java | 29 + .../generated/ProjectsDeleteSamples.java | 22 + .../generated/ProjectsGetSamples.java | 23 + ...ProjectsListClusterTierRegionsSamples.java | 25 + .../generated/ProjectsListSamples.java | 22 + .../ProjectsTierLimitReachedSamples.java | 24 + .../generated/ClusterInnerTests.java | 31 + .../generated/ClusterListResultTests.java | 22 + .../generated/ClusterPropertiesTests.java | 29 + .../ClustersCreateOrUpdateMockTests.java | 44 + .../ClustersGetWithResponseMockTests.java | 42 + .../generated/ClustersListMockTests.java | 41 + .../generated/OperationsListMockTests.java | 2 +- .../OrganizationsCreateOrUpdateMockTests.java | 86 +- ...tByResourceGroupWithResponseMockTests.java | 40 +- ...nizationsListByResourceGroupMockTests.java | 42 +- .../generated/OrganizationsListMockTests.java | 45 +- .../generated/ProjectInnerTests.java | 24 + .../generated/ProjectLimitStatusTests.java | 23 + .../generated/ProjectListResultTests.java | 19 + .../generated/ProjectPropertiesTests.java | 23 + .../ProjectsCreateOrUpdateMockTests.java | 40 + .../ProjectsGetWithResponseMockTests.java | 37 + ...usterTierRegionsWithResponseMockTests.java | 37 + .../generated/ProjectsListMockTests.java | 37 + ...TierLimitReachedWithResponseMockTests.java | 37 + .../RegionsByTierResponseInnerTests.java | 17 + .../TierLimitReachedResponseInnerTests.java | 18 + .../generated/TierRegionsTests.java | 20 + .../tsp-location.yaml | 2 +- 77 files changed, 6448 insertions(+), 141 deletions(-) create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/ClustersClient.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/ProjectsClient.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/models/ClusterInner.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/models/ProjectInner.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/models/RegionsByTierResponseInner.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/models/TierLimitReachedResponseInner.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/ClusterImpl.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/ClustersClientImpl.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/ClustersImpl.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/ProjectImpl.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/ProjectsClientImpl.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/ProjectsImpl.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/RegionsByTierResponseImpl.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/TierLimitReachedResponseImpl.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/models/ClusterListResult.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/models/ProjectListResult.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/Cluster.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/ClusterProperties.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/ClusterTier.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/Clusters.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/Project.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/ProjectLimitStatus.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/ProjectProperties.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/Projects.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/RegionsByTierResponse.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/TierLimitReachedResponse.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/TierRegions.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/ClustersCreateOrUpdateSamples.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/ClustersDeleteSamples.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/ClustersGetSamples.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/ClustersListSamples.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsCreateOrUpdateSamples.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsDeleteSamples.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsGetSamples.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsListClusterTierRegionsSamples.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsListSamples.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsTierLimitReachedSamples.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ClusterInnerTests.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ClusterListResultTests.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ClusterPropertiesTests.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ClustersCreateOrUpdateMockTests.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ClustersGetWithResponseMockTests.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ClustersListMockTests.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectInnerTests.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectLimitStatusTests.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectListResultTests.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectPropertiesTests.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsCreateOrUpdateMockTests.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsGetWithResponseMockTests.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsListClusterTierRegionsWithResponseMockTests.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsListMockTests.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsTierLimitReachedWithResponseMockTests.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/RegionsByTierResponseInnerTests.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/TierLimitReachedResponseInnerTests.java create mode 100644 sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/TierRegionsTests.java diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/CHANGELOG.md b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/CHANGELOG.md index 092a276edde5..f934faca33b3 100644 --- a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/CHANGELOG.md +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/CHANGELOG.md @@ -1,14 +1,95 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.1.0-beta.1 (2026-06-20) -### Features Added +- Azure Resource Manager Mongo DB Atlas client library for Java. This package contains Microsoft Azure SDK for Mongo DB Atlas Management SDK. Package api-version 2026-03-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Breaking Changes -### Bugs Fixed +#### `models.OperationDisplay` was modified + +* `validate()` was removed + +#### `models.OrganizationResourceUpdateProperties` was modified + +* `validate()` was removed + +#### `models.UserAssignedIdentity` was modified + +* `validate()` was removed + +#### `models.MarketplaceDetails` was modified + +* `validate()` was removed + +#### `models.ManagedServiceIdentity` was modified + +* `validate()` was removed + +#### `models.UserDetails` was modified + +* `validate()` was removed + +#### `models.OfferDetails` was modified + +* `validate()` was removed + +#### `models.OrganizationResourceUpdate` was modified + +* `validate()` was removed + +#### `models.PartnerProperties` was modified + +* `validate()` was removed + +#### `models.OrganizationProperties` was modified + +* `validate()` was removed + +### Features Added + +* `models.Cluster$DefinitionStages` was added + +* `models.ClusterTier` was added + +* `models.Cluster$Definition` was added + +* `models.TierLimitReachedResponse` was added + +* `models.Cluster$Update` was added + +* `models.ProjectProperties` was added + +* `models.Cluster` was added + +* `models.ProjectLimitStatus` was added + +* `models.Project$DefinitionStages` was added + +* `models.TierRegions` was added + +* `models.Cluster$UpdateStages` was added + +* `models.Projects` was added + +* `models.Project$Update` was added + +* `models.RegionsByTierResponse` was added + +* `models.Project$UpdateStages` was added + +* `models.Project$Definition` was added + +* `models.ClusterProperties` was added + +* `models.Project` was added + +* `models.Clusters` was added + +#### `MongoDBAtlasManager` was modified -### Other Changes +* `clusters()` was added +* `projects()` was added ## 1.0.0 (2025-07-02) diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/README.md b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/README.md index 040356d421ba..b1e2ba536bef 100644 --- a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/README.md +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/README.md @@ -2,7 +2,7 @@ Azure Resource Manager Mongo DB Atlas client library for Java. -This package contains Microsoft Azure SDK for Mongo DB Atlas Management SDK. Package api-version 2025-06-01. 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 DB Atlas Management SDK. Package api-version 2026-03-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-mongodbatlas - 1.0.0 + 1.1.0-beta.1 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/SAMPLE.md b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/SAMPLE.md index b0c5d65b771c..79c366444d84 100644 --- a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/SAMPLE.md +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/SAMPLE.md @@ -1,6 +1,13 @@ # Code snippets and samples +## Clusters + +- [CreateOrUpdate](#clusters_createorupdate) +- [Delete](#clusters_delete) +- [Get](#clusters_get) +- [List](#clusters_list) + ## Operations - [List](#operations_list) @@ -13,6 +20,109 @@ - [List](#organizations_list) - [ListByResourceGroup](#organizations_listbyresourcegroup) - [Update](#organizations_update) + +## Projects + +- [CreateOrUpdate](#projects_createorupdate) +- [Delete](#projects_delete) +- [Get](#projects_get) +- [List](#projects_list) +- [ListClusterTierRegions](#projects_listclustertierregions) +- [TierLimitReached](#projects_tierlimitreached) +### Clusters_CreateOrUpdate + +```java +import com.azure.resourcemanager.mongodbatlas.models.ClusterProperties; +import com.azure.resourcemanager.mongodbatlas.models.ClusterTier; + +/** + * Samples for Clusters CreateOrUpdate. + */ +public final class ClustersCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-03-01-preview/Clusters_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: Clusters_CreateOrUpdate_MaximumSet. + * + * @param manager Entry point to MongoDBAtlasManager. + */ + public static void + clustersCreateOrUpdateMaximumSet(com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager manager) { + manager.clusters() + .define("myCluster") + .withExistingProject("rgopenapi", "myOrganization", "myProject") + .withProperties(new ClusterProperties().withClusterTier(ClusterTier.FREE).withRegionName("eastus")) + .create(); + } +} +``` + +### Clusters_Delete + +```java +/** + * Samples for Clusters Delete. + */ +public final class ClustersDeleteSamples { + /* + * x-ms-original-file: 2026-03-01-preview/Clusters_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: Clusters_Delete_MaximumSet. + * + * @param manager Entry point to MongoDBAtlasManager. + */ + public static void clustersDeleteMaximumSet(com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager manager) { + manager.clusters() + .delete("rgopenapi", "myOrganization", "myProject", "myCluster", com.azure.core.util.Context.NONE); + } +} +``` + +### Clusters_Get + +```java +/** + * Samples for Clusters Get. + */ +public final class ClustersGetSamples { + /* + * x-ms-original-file: 2026-03-01-preview/Clusters_Get_MaximumSet_Gen.json + */ + /** + * Sample code: Clusters_Get_MaximumSet. + * + * @param manager Entry point to MongoDBAtlasManager. + */ + public static void clustersGetMaximumSet(com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager manager) { + manager.clusters() + .getWithResponse("rgopenapi", "myOrganization", "myProject", "myCluster", com.azure.core.util.Context.NONE); + } +} +``` + +### Clusters_List + +```java +/** + * Samples for Clusters List. + */ +public final class ClustersListSamples { + /* + * x-ms-original-file: 2026-03-01-preview/Clusters_List_MaximumSet_Gen.json + */ + /** + * Sample code: Clusters_List_MaximumSet. + * + * @param manager Entry point to MongoDBAtlasManager. + */ + public static void clustersListMaximumSet(com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager manager) { + manager.clusters().list("rgopenapi", "myOrganization", "myProject", com.azure.core.util.Context.NONE); + } +} +``` + ### Operations_List ```java @@ -21,7 +131,7 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: 2025-06-01/Operations_List_MinimumSet_Gen.json + * x-ms-original-file: 2026-03-01-preview/Operations_List_MinimumSet_Gen.json */ /** * Sample code: Operations_List_MinimumSet. @@ -33,7 +143,7 @@ public final class OperationsListSamples { } /* - * x-ms-original-file: 2025-06-01/Operations_List_MaximumSet_Gen.json + * x-ms-original-file: 2026-03-01-preview/Operations_List_MaximumSet_Gen.json */ /** * Sample code: Operations_List_MaximumSet. @@ -64,7 +174,7 @@ import java.util.Map; */ public final class OrganizationsCreateOrUpdateSamples { /* - * x-ms-original-file: 2025-06-01/Organizations_CreateOrUpdate_MaximumSet_Gen.json + * x-ms-original-file: 2026-03-01-preview/Organizations_CreateOrUpdate_MaximumSet_Gen.json */ /** * Sample code: Organizations_CreateOrUpdate_MaximumSet. @@ -122,7 +232,7 @@ public final class OrganizationsCreateOrUpdateSamples { */ public final class OrganizationsDeleteSamples { /* - * x-ms-original-file: 2025-06-01/Organizations_Delete_MaximumSet_Gen.json + * x-ms-original-file: 2026-03-01-preview/Organizations_Delete_MaximumSet_Gen.json */ /** * Sample code: Organizations_Delete_MaximumSet. @@ -144,7 +254,7 @@ public final class OrganizationsDeleteSamples { */ public final class OrganizationsGetByResourceGroupSamples { /* - * x-ms-original-file: 2025-06-01/Organizations_Get_MaximumSet_Gen.json + * x-ms-original-file: 2026-03-01-preview/Organizations_Get_MaximumSet_Gen.json */ /** * Sample code: Organizations_Get_MaximumSet. @@ -165,7 +275,7 @@ public final class OrganizationsGetByResourceGroupSamples { */ public final class OrganizationsListSamples { /* - * x-ms-original-file: 2025-06-01/Organizations_ListBySubscription_MaximumSet_Gen.json + * x-ms-original-file: 2026-03-01-preview/Organizations_ListBySubscription_MaximumSet_Gen.json */ /** * Sample code: Organizations_ListBySubscription_MaximumSet. @@ -178,7 +288,7 @@ public final class OrganizationsListSamples { } /* - * x-ms-original-file: 2025-06-01/Organizations_ListBySubscription_MinimumSet_Gen.json + * x-ms-original-file: 2026-03-01-preview/Organizations_ListBySubscription_MinimumSet_Gen.json */ /** * Sample code: Organizations_ListBySubscription_MaximumSet - generated by [MinimumSet] rule. @@ -200,7 +310,7 @@ public final class OrganizationsListSamples { */ public final class OrganizationsListByResourceGroupSamples { /* - * x-ms-original-file: 2025-06-01/Organizations_ListByResourceGroup_MaximumSet_Gen.json + * x-ms-original-file: 2026-03-01-preview/Organizations_ListByResourceGroup_MaximumSet_Gen.json */ /** * Sample code: Organizations_ListByResourceGroup_MaximumSet. @@ -213,7 +323,7 @@ public final class OrganizationsListByResourceGroupSamples { } /* - * x-ms-original-file: 2025-06-01/Organizations_ListByResourceGroup_MinimumSet_Gen.json + * x-ms-original-file: 2026-03-01-preview/Organizations_ListByResourceGroup_MinimumSet_Gen.json */ /** * Sample code: Organizations_ListByResourceGroup_MaximumSet - generated by [MinimumSet] rule. @@ -244,7 +354,7 @@ import java.util.Map; */ public final class OrganizationsUpdateSamples { /* - * x-ms-original-file: 2025-06-01/Organizations_Update_MaximumSet_Gen.json + * x-ms-original-file: 2026-03-01-preview/Organizations_Update_MaximumSet_Gen.json */ /** * Sample code: Organizations_Update_MaximumSet. @@ -287,3 +397,142 @@ public final class OrganizationsUpdateSamples { } ``` +### Projects_CreateOrUpdate + +```java +import com.azure.resourcemanager.mongodbatlas.models.ProjectProperties; + +/** + * Samples for Projects CreateOrUpdate. + */ +public final class ProjectsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-03-01-preview/Projects_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: Projects_CreateOrUpdate_MaximumSet. + * + * @param manager Entry point to MongoDBAtlasManager. + */ + public static void + projectsCreateOrUpdateMaximumSet(com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager manager) { + manager.projects() + .define("myProject") + .withExistingOrganization("rgopenapi", "myOrganization") + .withProperties(new ProjectProperties()) + .create(); + } +} +``` + +### Projects_Delete + +```java +/** + * Samples for Projects Delete. + */ +public final class ProjectsDeleteSamples { + /* + * x-ms-original-file: 2026-03-01-preview/Projects_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: Projects_Delete_MaximumSet. + * + * @param manager Entry point to MongoDBAtlasManager. + */ + public static void projectsDeleteMaximumSet(com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager manager) { + manager.projects().delete("rgopenapi", "myOrganization", "myProject", com.azure.core.util.Context.NONE); + } +} +``` + +### Projects_Get + +```java +/** + * Samples for Projects Get. + */ +public final class ProjectsGetSamples { + /* + * x-ms-original-file: 2026-03-01-preview/Projects_Get_MaximumSet_Gen.json + */ + /** + * Sample code: Projects_Get_MaximumSet. + * + * @param manager Entry point to MongoDBAtlasManager. + */ + public static void projectsGetMaximumSet(com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager manager) { + manager.projects() + .getWithResponse("rgopenapi", "myOrganization", "myProject", com.azure.core.util.Context.NONE); + } +} +``` + +### Projects_List + +```java +/** + * Samples for Projects List. + */ +public final class ProjectsListSamples { + /* + * x-ms-original-file: 2026-03-01-preview/Projects_List_MaximumSet_Gen.json + */ + /** + * Sample code: Projects_List_MaximumSet. + * + * @param manager Entry point to MongoDBAtlasManager. + */ + public static void projectsListMaximumSet(com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager manager) { + manager.projects().list("rgopenapi", "myOrganization", com.azure.core.util.Context.NONE); + } +} +``` + +### Projects_ListClusterTierRegions + +```java +/** + * Samples for Projects ListClusterTierRegions. + */ +public final class ProjectsListClusterTierRegionsSamples { + /* + * x-ms-original-file: 2026-03-01-preview/Projects_ListClusterTierRegions_MaximumSet_Gen.json + */ + /** + * Sample code: Projects_ListClusterTierRegions_MaximumSet. + * + * @param manager Entry point to MongoDBAtlasManager. + */ + public static void + projectsListClusterTierRegionsMaximumSet(com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager manager) { + manager.projects() + .listClusterTierRegionsWithResponse("rgopenapi", "myOrganization", "myProject", + com.azure.core.util.Context.NONE); + } +} +``` + +### Projects_TierLimitReached + +```java +/** + * Samples for Projects TierLimitReached. + */ +public final class ProjectsTierLimitReachedSamples { + /* + * x-ms-original-file: 2026-03-01-preview/Projects_TierLimitReached_MaximumSet_Gen.json + */ + /** + * Sample code: Projects_TierLimitReached_MaximumSet. + * + * @param manager Entry point to MongoDBAtlasManager. + */ + public static void + projectsTierLimitReachedMaximumSet(com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager manager) { + manager.projects() + .tierLimitReachedWithResponse("rgopenapi", "myOrganization", "myProject", com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/pom.xml b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/pom.xml index 456597bc9628..8d716fca05c6 100644 --- a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/pom.xml +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/pom.xml @@ -3,7 +3,7 @@ ~ Licensed under the MIT License. ~ Code generated by Microsoft (R) TypeSpec Code Generator. --> - + 4.0.0 com.azure @@ -18,7 +18,7 @@ jar Microsoft Azure SDK for Mongo DB Atlas Management - This package contains Microsoft Azure SDK for Mongo DB Atlas Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package api-version 2025-06-01. + This package contains Microsoft Azure SDK for Mongo DB Atlas Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package api-version 2026-03-01-preview. https://github.com/Azure/azure-sdk-for-java @@ -45,6 +45,7 @@ UTF-8 0 0 + true diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/MongoDBAtlasManager.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/MongoDBAtlasManager.java index d4134722176d..9bad5713b2ee 100644 --- a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/MongoDBAtlasManager.java +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/MongoDBAtlasManager.java @@ -25,11 +25,15 @@ import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.mongodbatlas.fluent.MongoDBAtlasManagementClient; +import com.azure.resourcemanager.mongodbatlas.implementation.ClustersImpl; import com.azure.resourcemanager.mongodbatlas.implementation.MongoDBAtlasManagementClientBuilder; import com.azure.resourcemanager.mongodbatlas.implementation.OperationsImpl; import com.azure.resourcemanager.mongodbatlas.implementation.OrganizationsImpl; +import com.azure.resourcemanager.mongodbatlas.implementation.ProjectsImpl; +import com.azure.resourcemanager.mongodbatlas.models.Clusters; import com.azure.resourcemanager.mongodbatlas.models.Operations; import com.azure.resourcemanager.mongodbatlas.models.Organizations; +import com.azure.resourcemanager.mongodbatlas.models.Projects; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; @@ -46,6 +50,10 @@ public final class MongoDBAtlasManager { private Organizations organizations; + private Projects projects; + + private Clusters clusters; + private final MongoDBAtlasManagementClient clientObject; private MongoDBAtlasManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -285,6 +293,30 @@ public Organizations organizations() { return organizations; } + /** + * Gets the resource collection API of Projects. It manages Project. + * + * @return Resource collection API of Projects. + */ + public Projects projects() { + if (this.projects == null) { + this.projects = new ProjectsImpl(clientObject.getProjects(), this); + } + return projects; + } + + /** + * Gets the resource collection API of Clusters. It manages Cluster. + * + * @return Resource collection API of Clusters. + */ + public Clusters clusters() { + if (this.clusters == null) { + this.clusters = new ClustersImpl(clientObject.getClusters(), this); + } + return clusters; + } + /** * Gets wrapped service client MongoDBAtlasManagementClient providing direct access to the underlying auto-generated * API implementation, based on Azure REST API. diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/ClustersClient.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/ClustersClient.java new file mode 100644 index 000000000000..5bf296d9cb8b --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/ClustersClient.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mongodbatlas.fluent.models.ClusterInner; + +/** + * An instance of this class provides access to all the operations defined in ClustersClient. + */ +public interface ClustersClient { + /** + * Create a Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param clusterName Name of the MongoDB Atlas Cluster resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the MongoDB Atlas Cluster resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ClusterInner> beginCreateOrUpdate(String resourceGroupName, + String organizationName, String projectName, String clusterName, ClusterInner resource); + + /** + * Create a Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param clusterName Name of the MongoDB Atlas Cluster resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the MongoDB Atlas Cluster resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ClusterInner> beginCreateOrUpdate(String resourceGroupName, + String organizationName, String projectName, String clusterName, ClusterInner resource, Context context); + + /** + * Create a Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param clusterName Name of the MongoDB Atlas Cluster resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the MongoDB Atlas Cluster resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner createOrUpdate(String resourceGroupName, String organizationName, String projectName, + String clusterName, ClusterInner resource); + + /** + * Create a Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param clusterName Name of the MongoDB Atlas Cluster resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the MongoDB Atlas Cluster resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner createOrUpdate(String resourceGroupName, String organizationName, String projectName, + String clusterName, ClusterInner resource, Context context); + + /** + * Delete a Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param clusterName Name of the MongoDB Atlas Cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String organizationName, + String projectName, String clusterName); + + /** + * Delete a Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param clusterName Name of the MongoDB Atlas Cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String organizationName, + String projectName, String clusterName, Context context); + + /** + * Delete a Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param clusterName Name of the MongoDB Atlas Cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String organizationName, String projectName, String clusterName); + + /** + * Delete a Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param clusterName Name of the MongoDB Atlas Cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String organizationName, String projectName, String clusterName, + Context context); + + /** + * List Cluster resources by Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Cluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String organizationName, String projectName); + + /** + * List Cluster resources by Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Cluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String organizationName, String projectName, + Context context); + + /** + * Get a Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param clusterName Name of the MongoDB Atlas Cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String organizationName, String projectName, + String clusterName, Context context); + + /** + * Get a Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param clusterName Name of the MongoDB Atlas Cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner get(String resourceGroupName, String organizationName, String projectName, String clusterName); +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/MongoDBAtlasManagementClient.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/MongoDBAtlasManagementClient.java index 0edc6d3f039a..3202523dea99 100644 --- a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/MongoDBAtlasManagementClient.java +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/MongoDBAtlasManagementClient.java @@ -59,4 +59,18 @@ public interface MongoDBAtlasManagementClient { * @return the OrganizationsClient object. */ OrganizationsClient getOrganizations(); + + /** + * Gets the ProjectsClient object to access its operations. + * + * @return the ProjectsClient object. + */ + ProjectsClient getProjects(); + + /** + * Gets the ClustersClient object to access its operations. + * + * @return the ClustersClient object. + */ + ClustersClient getClusters(); } diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/ProjectsClient.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/ProjectsClient.java new file mode 100644 index 000000000000..f2c1b2500c45 --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/ProjectsClient.java @@ -0,0 +1,264 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mongodbatlas.fluent.models.ProjectInner; +import com.azure.resourcemanager.mongodbatlas.fluent.models.RegionsByTierResponseInner; +import com.azure.resourcemanager.mongodbatlas.fluent.models.TierLimitReachedResponseInner; + +/** + * An instance of this class provides access to all the operations defined in ProjectsClient. + */ +public interface ProjectsClient { + /** + * Get a Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Project along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String organizationName, String projectName, + Context context); + + /** + * Get a Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Project. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProjectInner get(String resourceGroupName, String organizationName, String projectName); + + /** + * Create a Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the MongoDB Atlas Project resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProjectInner> beginCreateOrUpdate(String resourceGroupName, + String organizationName, String projectName, ProjectInner resource); + + /** + * Create a Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the MongoDB Atlas Project resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProjectInner> beginCreateOrUpdate(String resourceGroupName, + String organizationName, String projectName, ProjectInner resource, Context context); + + /** + * Create a Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the MongoDB Atlas Project resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProjectInner createOrUpdate(String resourceGroupName, String organizationName, String projectName, + ProjectInner resource); + + /** + * Create a Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the MongoDB Atlas Project resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProjectInner createOrUpdate(String resourceGroupName, String organizationName, String projectName, + ProjectInner resource, Context context); + + /** + * Delete a Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String organizationName, + String projectName); + + /** + * Delete a Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String organizationName, + String projectName, Context context); + + /** + * Delete a Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String organizationName, String projectName); + + /** + * Delete a Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String organizationName, String projectName, Context context); + + /** + * List Project resources by OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Project list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String organizationName); + + /** + * List Project resources by OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Project list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String organizationName, Context context); + + /** + * Check if tier limit is reached for the project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for tier limit check along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response tierLimitReachedWithResponse(String resourceGroupName, + String organizationName, String projectName, Context context); + + /** + * Check if tier limit is reached for the project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for tier limit check. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TierLimitReachedResponseInner tierLimitReached(String resourceGroupName, String organizationName, + String projectName); + + /** + * List available regions by cluster tier for the project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for regions by cluster tier along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listClusterTierRegionsWithResponse(String resourceGroupName, + String organizationName, String projectName, Context context); + + /** + * List available regions by cluster tier for the project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for regions by cluster tier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RegionsByTierResponseInner listClusterTierRegions(String resourceGroupName, String organizationName, + String projectName); +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/models/ClusterInner.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/models/ClusterInner.java new file mode 100644 index 000000000000..903a9f6a4361 --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/models/ClusterInner.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.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.mongodbatlas.models.ClusterProperties; +import java.io.IOException; + +/** + * The MongoDB Atlas Cluster resource type. A cluster is a managed database deployment within a project. + */ +@Fluent +public final class ClusterInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private ClusterProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ClusterInner class. + */ + public ClusterInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public ClusterProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withProperties(ClusterProperties 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 type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterInner 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 ClusterInner. + */ + public static ClusterInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterInner deserializedClusterInner = new ClusterInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedClusterInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedClusterInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedClusterInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedClusterInner.properties = ClusterProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedClusterInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterInner; + }); + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/models/ProjectInner.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/models/ProjectInner.java new file mode 100644 index 000000000000..fcfb799287f8 --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/models/ProjectInner.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.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.mongodbatlas.models.ProjectProperties; +import java.io.IOException; + +/** + * The MongoDB Atlas Project resource type. A project is a logical grouping of clusters within an organization. + */ +@Fluent +public final class ProjectInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private ProjectProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ProjectInner class. + */ + public ProjectInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public ProjectProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the ProjectInner object itself. + */ + public ProjectInner withProperties(ProjectProperties 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 type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProjectInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProjectInner 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 ProjectInner. + */ + public static ProjectInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProjectInner deserializedProjectInner = new ProjectInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedProjectInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedProjectInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedProjectInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedProjectInner.properties = ProjectProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedProjectInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedProjectInner; + }); + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/models/RegionsByTierResponseInner.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/models/RegionsByTierResponseInner.java new file mode 100644 index 000000000000..eb48746a7d38 --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/models/RegionsByTierResponseInner.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.mongodbatlas.models.TierRegions; +import java.io.IOException; +import java.util.List; + +/** + * Response for regions by cluster tier. + */ +@Immutable +public final class RegionsByTierResponseInner implements JsonSerializable { + /* + * Atlas organization id. + */ + private String organizationId; + + /* + * Atlas project id. + */ + private String projectId; + + /* + * List of cluster tiers and their supported regions. + */ + private List regionsByTier; + + /** + * Creates an instance of RegionsByTierResponseInner class. + */ + private RegionsByTierResponseInner() { + } + + /** + * Get the organizationId property: Atlas organization id. + * + * @return the organizationId value. + */ + public String organizationId() { + return this.organizationId; + } + + /** + * Get the projectId property: Atlas project id. + * + * @return the projectId value. + */ + public String projectId() { + return this.projectId; + } + + /** + * Get the regionsByTier property: List of cluster tiers and their supported regions. + * + * @return the regionsByTier value. + */ + public List regionsByTier() { + return this.regionsByTier; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RegionsByTierResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RegionsByTierResponseInner 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 RegionsByTierResponseInner. + */ + public static RegionsByTierResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RegionsByTierResponseInner deserializedRegionsByTierResponseInner = new RegionsByTierResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("organizationId".equals(fieldName)) { + deserializedRegionsByTierResponseInner.organizationId = reader.getString(); + } else if ("projectId".equals(fieldName)) { + deserializedRegionsByTierResponseInner.projectId = reader.getString(); + } else if ("regionsByTier".equals(fieldName)) { + List regionsByTier = reader.readArray(reader1 -> TierRegions.fromJson(reader1)); + deserializedRegionsByTierResponseInner.regionsByTier = regionsByTier; + } else { + reader.skipChildren(); + } + } + + return deserializedRegionsByTierResponseInner; + }); + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/models/TierLimitReachedResponseInner.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/models/TierLimitReachedResponseInner.java new file mode 100644 index 000000000000..88f1ab0efe0c --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/models/TierLimitReachedResponseInner.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.mongodbatlas.models.ProjectLimitStatus; +import java.io.IOException; +import java.util.List; + +/** + * Response for tier limit check. + */ +@Immutable +public final class TierLimitReachedResponseInner implements JsonSerializable { + /* + * List of project limit statuses. + */ + private List limits; + + /** + * Creates an instance of TierLimitReachedResponseInner class. + */ + private TierLimitReachedResponseInner() { + } + + /** + * Get the limits property: List of project limit statuses. + * + * @return the limits value. + */ + public List limits() { + return this.limits; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TierLimitReachedResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TierLimitReachedResponseInner 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 TierLimitReachedResponseInner. + */ + public static TierLimitReachedResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TierLimitReachedResponseInner deserializedTierLimitReachedResponseInner + = new TierLimitReachedResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("limits".equals(fieldName)) { + List limits = reader.readArray(reader1 -> ProjectLimitStatus.fromJson(reader1)); + deserializedTierLimitReachedResponseInner.limits = limits; + } else { + reader.skipChildren(); + } + } + + return deserializedTierLimitReachedResponseInner; + }); + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/ClusterImpl.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/ClusterImpl.java new file mode 100644 index 000000000000..cd8aa25deb53 --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/ClusterImpl.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mongodbatlas.fluent.models.ClusterInner; +import com.azure.resourcemanager.mongodbatlas.models.Cluster; +import com.azure.resourcemanager.mongodbatlas.models.ClusterProperties; + +public final class ClusterImpl implements Cluster, Cluster.Definition, Cluster.Update { + private ClusterInner innerObject; + + private final com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ClusterProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ClusterInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String organizationName; + + private String projectName; + + private String clusterName; + + public ClusterImpl withExistingProject(String resourceGroupName, String organizationName, String projectName) { + this.resourceGroupName = resourceGroupName; + this.organizationName = organizationName; + this.projectName = projectName; + return this; + } + + public Cluster create() { + this.innerObject = serviceManager.serviceClient() + .getClusters() + .createOrUpdate(resourceGroupName, organizationName, projectName, clusterName, this.innerModel(), + Context.NONE); + return this; + } + + public Cluster create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getClusters() + .createOrUpdate(resourceGroupName, organizationName, projectName, clusterName, this.innerModel(), context); + return this; + } + + ClusterImpl(String name, com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager serviceManager) { + this.innerObject = new ClusterInner(); + this.serviceManager = serviceManager; + this.clusterName = name; + } + + public ClusterImpl update() { + return this; + } + + public Cluster apply() { + this.innerObject = serviceManager.serviceClient() + .getClusters() + .createOrUpdate(resourceGroupName, organizationName, projectName, clusterName, this.innerModel(), + Context.NONE); + return this; + } + + public Cluster apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getClusters() + .createOrUpdate(resourceGroupName, organizationName, projectName, clusterName, this.innerModel(), context); + return this; + } + + ClusterImpl(ClusterInner innerObject, com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.organizationName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "organizations"); + this.projectName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "projects"); + this.clusterName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "clusters"); + } + + public Cluster refresh() { + this.innerObject = serviceManager.serviceClient() + .getClusters() + .getWithResponse(resourceGroupName, organizationName, projectName, clusterName, Context.NONE) + .getValue(); + return this; + } + + public Cluster refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getClusters() + .getWithResponse(resourceGroupName, organizationName, projectName, clusterName, context) + .getValue(); + return this; + } + + public ClusterImpl withProperties(ClusterProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/ClustersClientImpl.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/ClustersClientImpl.java new file mode 100644 index 000000000000..816b8f62d811 --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/ClustersClientImpl.java @@ -0,0 +1,800 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mongodbatlas.fluent.ClustersClient; +import com.azure.resourcemanager.mongodbatlas.fluent.models.ClusterInner; +import com.azure.resourcemanager.mongodbatlas.implementation.models.ClusterListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ClustersClient. + */ +public final class ClustersClientImpl implements ClustersClient { + /** + * The proxy service used to perform REST calls. + */ + private final ClustersService service; + + /** + * The service client containing this operation class. + */ + private final MongoDBAtlasManagementClientImpl client; + + /** + * Initializes an instance of ClustersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ClustersClientImpl(MongoDBAtlasManagementClientImpl client) { + this.service = RestProxy.create(ClustersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MongoDBAtlasManagementClientClusters to be used by the proxy service + * to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "MongoDBAtlasManagementClientClusters") + public interface ClustersService { + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/MongoDB.Atlas/organizations/{organizationName}/projects/{projectName}/clusters/{clusterName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @PathParam("projectName") String projectName, + @PathParam("clusterName") String clusterName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ClusterInner resource, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/MongoDB.Atlas/organizations/{organizationName}/projects/{projectName}/clusters/{clusterName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @PathParam("projectName") String projectName, + @PathParam("clusterName") String clusterName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ClusterInner resource, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/MongoDB.Atlas/organizations/{organizationName}/projects/{projectName}/clusters/{clusterName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @PathParam("projectName") String projectName, + @PathParam("clusterName") String clusterName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/MongoDB.Atlas/organizations/{organizationName}/projects/{projectName}/clusters/{clusterName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @PathParam("projectName") String projectName, + @PathParam("clusterName") String clusterName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/MongoDB.Atlas/organizations/{organizationName}/projects/{projectName}/clusters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @PathParam("projectName") String projectName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/MongoDB.Atlas/organizations/{organizationName}/projects/{projectName}/clusters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @PathParam("projectName") String projectName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/MongoDB.Atlas/organizations/{organizationName}/projects/{projectName}/clusters/{clusterName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @PathParam("projectName") String projectName, + @PathParam("clusterName") String clusterName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/MongoDB.Atlas/organizations/{organizationName}/projects/{projectName}/clusters/{clusterName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @PathParam("projectName") String projectName, + @PathParam("clusterName") String clusterName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Create a Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param clusterName Name of the MongoDB Atlas Cluster resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the MongoDB Atlas Cluster resource type along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String organizationName, String projectName, String clusterName, ClusterInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, projectName, clusterName, + contentType, accept, resource, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param clusterName Name of the MongoDB Atlas Cluster resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the MongoDB Atlas Cluster resource type along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String organizationName, + String projectName, String clusterName, ClusterInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, projectName, clusterName, contentType, + accept, resource, Context.NONE); + } + + /** + * Create a Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param clusterName Name of the MongoDB Atlas Cluster resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the MongoDB Atlas Cluster resource type along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String organizationName, + String projectName, String clusterName, ClusterInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, projectName, clusterName, contentType, + accept, resource, context); + } + + /** + * Create a Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param clusterName Name of the MongoDB Atlas Cluster resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the MongoDB Atlas Cluster resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterInner> beginCreateOrUpdateAsync(String resourceGroupName, + String organizationName, String projectName, String clusterName, ClusterInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, organizationName, projectName, clusterName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ClusterInner.class, ClusterInner.class, this.client.getContext()); + } + + /** + * Create a Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param clusterName Name of the MongoDB Atlas Cluster resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the MongoDB Atlas Cluster resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterInner> beginCreateOrUpdate(String resourceGroupName, + String organizationName, String projectName, String clusterName, ClusterInner resource) { + Response response + = createOrUpdateWithResponse(resourceGroupName, organizationName, projectName, clusterName, resource); + return this.client.getLroResult(response, ClusterInner.class, ClusterInner.class, + Context.NONE); + } + + /** + * Create a Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param clusterName Name of the MongoDB Atlas Cluster resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the MongoDB Atlas Cluster resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterInner> beginCreateOrUpdate(String resourceGroupName, + String organizationName, String projectName, String clusterName, ClusterInner resource, Context context) { + Response response = createOrUpdateWithResponse(resourceGroupName, organizationName, projectName, + clusterName, resource, context); + return this.client.getLroResult(response, ClusterInner.class, ClusterInner.class, + context); + } + + /** + * Create a Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param clusterName Name of the MongoDB Atlas Cluster resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the MongoDB Atlas Cluster resource type on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String organizationName, + String projectName, String clusterName, ClusterInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, organizationName, projectName, clusterName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param clusterName Name of the MongoDB Atlas Cluster resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the MongoDB Atlas Cluster resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner createOrUpdate(String resourceGroupName, String organizationName, String projectName, + String clusterName, ClusterInner resource) { + return beginCreateOrUpdate(resourceGroupName, organizationName, projectName, clusterName, resource) + .getFinalResult(); + } + + /** + * Create a Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param clusterName Name of the MongoDB Atlas Cluster resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the MongoDB Atlas Cluster resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner createOrUpdate(String resourceGroupName, String organizationName, String projectName, + String clusterName, ClusterInner resource, Context context) { + return beginCreateOrUpdate(resourceGroupName, organizationName, projectName, clusterName, resource, context) + .getFinalResult(); + } + + /** + * Delete a Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param clusterName Name of the MongoDB Atlas Cluster 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String organizationName, + String projectName, String clusterName) { + return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, projectName, clusterName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param clusterName Name of the MongoDB Atlas Cluster 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String organizationName, + String projectName, String clusterName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, projectName, clusterName, + Context.NONE); + } + + /** + * Delete a Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param clusterName Name of the MongoDB Atlas Cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String organizationName, + String projectName, String clusterName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, projectName, clusterName, context); + } + + /** + * Delete a Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param clusterName Name of the MongoDB Atlas Cluster 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. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String organizationName, + String projectName, String clusterName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, organizationName, projectName, clusterName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param clusterName Name of the MongoDB Atlas Cluster 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. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String organizationName, + String projectName, String clusterName) { + Response response + = deleteWithResponse(resourceGroupName, organizationName, projectName, clusterName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete a Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param clusterName Name of the MongoDB Atlas Cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String organizationName, + String projectName, String clusterName, Context context) { + Response response + = deleteWithResponse(resourceGroupName, organizationName, projectName, clusterName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete a Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param clusterName Name of the MongoDB Atlas Cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String organizationName, String projectName, + String clusterName) { + return beginDeleteAsync(resourceGroupName, organizationName, projectName, clusterName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param clusterName Name of the MongoDB Atlas Cluster 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String organizationName, String projectName, String clusterName) { + beginDelete(resourceGroupName, organizationName, projectName, clusterName).getFinalResult(); + } + + /** + * Delete a Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param clusterName Name of the MongoDB Atlas Cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String organizationName, String projectName, String clusterName, + Context context) { + beginDelete(resourceGroupName, organizationName, projectName, clusterName, context).getFinalResult(); + } + + /** + * List Cluster resources by Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project 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 of a Cluster list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String organizationName, + String projectName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, projectName, 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 Cluster resources by Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project 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 of a Cluster list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String organizationName, String projectName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, organizationName, projectName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List Cluster resources by Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project 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 of a Cluster list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String organizationName, + String projectName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, projectName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List Cluster resources by Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Cluster list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String organizationName, + String projectName, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, projectName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List Cluster resources by Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project 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 of a Cluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String organizationName, String projectName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, organizationName, projectName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List Cluster resources by Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Cluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String organizationName, String projectName, + Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, organizationName, projectName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get a Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param clusterName Name of the MongoDB Atlas Cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cluster along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String organizationName, + String projectName, String clusterName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, projectName, clusterName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param clusterName Name of the MongoDB Atlas Cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String organizationName, String projectName, + String clusterName) { + return getWithResponseAsync(resourceGroupName, organizationName, projectName, clusterName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param clusterName Name of the MongoDB Atlas Cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String organizationName, String projectName, + String clusterName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, organizationName, projectName, clusterName, accept, context); + } + + /** + * Get a Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param clusterName Name of the MongoDB Atlas Cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner get(String resourceGroupName, String organizationName, String projectName, String clusterName) { + return getWithResponse(resourceGroupName, organizationName, projectName, clusterName, Context.NONE).getValue(); + } + + /** + * 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 Cluster list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Cluster list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 Cluster list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/ClustersImpl.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/ClustersImpl.java new file mode 100644 index 000000000000..681b298b52a6 --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/ClustersImpl.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mongodbatlas.fluent.ClustersClient; +import com.azure.resourcemanager.mongodbatlas.fluent.models.ClusterInner; +import com.azure.resourcemanager.mongodbatlas.models.Cluster; +import com.azure.resourcemanager.mongodbatlas.models.Clusters; + +public final class ClustersImpl implements Clusters { + private static final ClientLogger LOGGER = new ClientLogger(ClustersImpl.class); + + private final ClustersClient innerClient; + + private final com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager serviceManager; + + public ClustersImpl(ClustersClient innerClient, + com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String organizationName, String projectName, String clusterName) { + this.serviceClient().delete(resourceGroupName, organizationName, projectName, clusterName); + } + + public void delete(String resourceGroupName, String organizationName, String projectName, String clusterName, + Context context) { + this.serviceClient().delete(resourceGroupName, organizationName, projectName, clusterName, context); + } + + public PagedIterable list(String resourceGroupName, String organizationName, String projectName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, organizationName, projectName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ClusterImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String organizationName, String projectName, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, organizationName, projectName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ClusterImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String organizationName, String projectName, + String clusterName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, organizationName, projectName, clusterName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ClusterImpl(inner.getValue(), this.manager())); + } + + public Cluster get(String resourceGroupName, String organizationName, String projectName, String clusterName) { + ClusterInner inner = this.serviceClient().get(resourceGroupName, organizationName, projectName, clusterName); + if (inner != null) { + return new ClusterImpl(inner, this.manager()); + } else { + return null; + } + } + + public Cluster getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String organizationName = ResourceManagerUtils.getValueFromIdByName(id, "organizations"); + if (organizationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'organizations'.", id))); + } + String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + String clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + return this.getWithResponse(resourceGroupName, organizationName, projectName, clusterName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String organizationName = ResourceManagerUtils.getValueFromIdByName(id, "organizations"); + if (organizationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'organizations'.", id))); + } + String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + String clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + return this.getWithResponse(resourceGroupName, organizationName, projectName, clusterName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String organizationName = ResourceManagerUtils.getValueFromIdByName(id, "organizations"); + if (organizationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'organizations'.", id))); + } + String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + String clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + this.delete(resourceGroupName, organizationName, projectName, clusterName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String organizationName = ResourceManagerUtils.getValueFromIdByName(id, "organizations"); + if (organizationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'organizations'.", id))); + } + String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + String clusterName = ResourceManagerUtils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + this.delete(resourceGroupName, organizationName, projectName, clusterName, context); + } + + private ClustersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager manager() { + return this.serviceManager; + } + + public ClusterImpl define(String name) { + return new ClusterImpl(name, this.manager()); + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/MongoDBAtlasManagementClientImpl.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/MongoDBAtlasManagementClientImpl.java index cb9ae4f8f589..36b3bf02def2 100644 --- a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/MongoDBAtlasManagementClientImpl.java +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/MongoDBAtlasManagementClientImpl.java @@ -26,9 +26,11 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.mongodbatlas.fluent.ClustersClient; import com.azure.resourcemanager.mongodbatlas.fluent.MongoDBAtlasManagementClient; import com.azure.resourcemanager.mongodbatlas.fluent.OperationsClient; import com.azure.resourcemanager.mongodbatlas.fluent.OrganizationsClient; +import com.azure.resourcemanager.mongodbatlas.fluent.ProjectsClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -155,6 +157,34 @@ public OrganizationsClient getOrganizations() { return this.organizations; } + /** + * The ProjectsClient object to access its operations. + */ + private final ProjectsClient projects; + + /** + * Gets the ProjectsClient object to access its operations. + * + * @return the ProjectsClient object. + */ + public ProjectsClient getProjects() { + return this.projects; + } + + /** + * The ClustersClient object to access its operations. + */ + private final ClustersClient clusters; + + /** + * Gets the ClustersClient object to access its operations. + * + * @return the ClustersClient object. + */ + public ClustersClient getClusters() { + return this.clusters; + } + /** * Initializes an instance of MongoDBAtlasManagementClient client. * @@ -172,9 +202,11 @@ public OrganizationsClient getOrganizations() { this.defaultPollInterval = defaultPollInterval; this.endpoint = endpoint; this.subscriptionId = subscriptionId; - this.apiVersion = "2025-06-01"; + this.apiVersion = "2026-03-01-preview"; this.operations = new OperationsClientImpl(this); this.organizations = new OrganizationsClientImpl(this); + this.projects = new ProjectsClientImpl(this); + this.clusters = new ClustersClientImpl(this); } /** diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/ProjectImpl.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/ProjectImpl.java new file mode 100644 index 000000000000..371f7b686c11 --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/ProjectImpl.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mongodbatlas.fluent.models.ProjectInner; +import com.azure.resourcemanager.mongodbatlas.models.Project; +import com.azure.resourcemanager.mongodbatlas.models.ProjectProperties; +import com.azure.resourcemanager.mongodbatlas.models.RegionsByTierResponse; +import com.azure.resourcemanager.mongodbatlas.models.TierLimitReachedResponse; + +public final class ProjectImpl implements Project, Project.Definition, Project.Update { + private ProjectInner innerObject; + + private final com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ProjectProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ProjectInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String organizationName; + + private String projectName; + + public ProjectImpl withExistingOrganization(String resourceGroupName, String organizationName) { + this.resourceGroupName = resourceGroupName; + this.organizationName = organizationName; + return this; + } + + public Project create() { + this.innerObject = serviceManager.serviceClient() + .getProjects() + .createOrUpdate(resourceGroupName, organizationName, projectName, this.innerModel(), Context.NONE); + return this; + } + + public Project create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getProjects() + .createOrUpdate(resourceGroupName, organizationName, projectName, this.innerModel(), context); + return this; + } + + ProjectImpl(String name, com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager serviceManager) { + this.innerObject = new ProjectInner(); + this.serviceManager = serviceManager; + this.projectName = name; + } + + public ProjectImpl update() { + return this; + } + + public Project apply() { + this.innerObject = serviceManager.serviceClient() + .getProjects() + .createOrUpdate(resourceGroupName, organizationName, projectName, this.innerModel(), Context.NONE); + return this; + } + + public Project apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getProjects() + .createOrUpdate(resourceGroupName, organizationName, projectName, this.innerModel(), context); + return this; + } + + ProjectImpl(ProjectInner innerObject, com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.organizationName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "organizations"); + this.projectName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "projects"); + } + + public Project refresh() { + this.innerObject = serviceManager.serviceClient() + .getProjects() + .getWithResponse(resourceGroupName, organizationName, projectName, Context.NONE) + .getValue(); + return this; + } + + public Project refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getProjects() + .getWithResponse(resourceGroupName, organizationName, projectName, context) + .getValue(); + return this; + } + + public Response tierLimitReachedWithResponse(Context context) { + return serviceManager.projects() + .tierLimitReachedWithResponse(resourceGroupName, organizationName, projectName, context); + } + + public TierLimitReachedResponse tierLimitReached() { + return serviceManager.projects().tierLimitReached(resourceGroupName, organizationName, projectName); + } + + public Response listClusterTierRegionsWithResponse(Context context) { + return serviceManager.projects() + .listClusterTierRegionsWithResponse(resourceGroupName, organizationName, projectName, context); + } + + public RegionsByTierResponse listClusterTierRegions() { + return serviceManager.projects().listClusterTierRegions(resourceGroupName, organizationName, projectName); + } + + public ProjectImpl withProperties(ProjectProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/ProjectsClientImpl.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/ProjectsClientImpl.java new file mode 100644 index 000000000000..d0981a217313 --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/ProjectsClientImpl.java @@ -0,0 +1,958 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.mongodbatlas.fluent.ProjectsClient; +import com.azure.resourcemanager.mongodbatlas.fluent.models.ProjectInner; +import com.azure.resourcemanager.mongodbatlas.fluent.models.RegionsByTierResponseInner; +import com.azure.resourcemanager.mongodbatlas.fluent.models.TierLimitReachedResponseInner; +import com.azure.resourcemanager.mongodbatlas.implementation.models.ProjectListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ProjectsClient. + */ +public final class ProjectsClientImpl implements ProjectsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ProjectsService service; + + /** + * The service client containing this operation class. + */ + private final MongoDBAtlasManagementClientImpl client; + + /** + * Initializes an instance of ProjectsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProjectsClientImpl(MongoDBAtlasManagementClientImpl client) { + this.service = RestProxy.create(ProjectsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MongoDBAtlasManagementClientProjects to be used by the proxy service + * to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "MongoDBAtlasManagementClientProjects") + public interface ProjectsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/MongoDB.Atlas/organizations/{organizationName}/projects/{projectName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @PathParam("projectName") String projectName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/MongoDB.Atlas/organizations/{organizationName}/projects/{projectName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @PathParam("projectName") String projectName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/MongoDB.Atlas/organizations/{organizationName}/projects/{projectName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @PathParam("projectName") String projectName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ProjectInner resource, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/MongoDB.Atlas/organizations/{organizationName}/projects/{projectName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @PathParam("projectName") String projectName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ProjectInner resource, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/MongoDB.Atlas/organizations/{organizationName}/projects/{projectName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @PathParam("projectName") String projectName, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/MongoDB.Atlas/organizations/{organizationName}/projects/{projectName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @PathParam("projectName") String projectName, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/MongoDB.Atlas/organizations/{organizationName}/projects") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/MongoDB.Atlas/organizations/{organizationName}/projects") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/MongoDB.Atlas/organizations/{organizationName}/projects/{projectName}/tierLimitReached") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> tierLimitReached(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @PathParam("projectName") String projectName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/MongoDB.Atlas/organizations/{organizationName}/projects/{projectName}/tierLimitReached") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response tierLimitReachedSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @PathParam("projectName") String projectName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/MongoDB.Atlas/organizations/{organizationName}/projects/{projectName}/clusterTierRegions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listClusterTierRegions(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @PathParam("projectName") String projectName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/MongoDB.Atlas/organizations/{organizationName}/projects/{projectName}/clusterTierRegions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listClusterTierRegionsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("organizationName") String organizationName, @PathParam("projectName") String projectName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Project along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String organizationName, + String projectName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, projectName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Project on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String organizationName, String projectName) { + return getWithResponseAsync(resourceGroupName, organizationName, projectName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Project along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String organizationName, String projectName, + Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, organizationName, projectName, accept, context); + } + + /** + * Get a Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Project. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProjectInner get(String resourceGroupName, String organizationName, String projectName) { + return getWithResponse(resourceGroupName, organizationName, projectName, Context.NONE).getValue(); + } + + /** + * Create a Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the MongoDB Atlas Project resource type along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String organizationName, String projectName, ProjectInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, projectName, contentType, accept, + resource, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the MongoDB Atlas Project resource type along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String organizationName, + String projectName, ProjectInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, projectName, contentType, accept, + resource, Context.NONE); + } + + /** + * Create a Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the MongoDB Atlas Project resource type along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String organizationName, + String projectName, ProjectInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, projectName, contentType, accept, + resource, context); + } + + /** + * Create a Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the MongoDB Atlas Project resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProjectInner> beginCreateOrUpdateAsync(String resourceGroupName, + String organizationName, String projectName, ProjectInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, organizationName, projectName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ProjectInner.class, ProjectInner.class, this.client.getContext()); + } + + /** + * Create a Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the MongoDB Atlas Project resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProjectInner> beginCreateOrUpdate(String resourceGroupName, + String organizationName, String projectName, ProjectInner resource) { + Response response + = createOrUpdateWithResponse(resourceGroupName, organizationName, projectName, resource); + return this.client.getLroResult(response, ProjectInner.class, ProjectInner.class, + Context.NONE); + } + + /** + * Create a Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the MongoDB Atlas Project resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProjectInner> beginCreateOrUpdate(String resourceGroupName, + String organizationName, String projectName, ProjectInner resource, Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, organizationName, projectName, resource, context); + return this.client.getLroResult(response, ProjectInner.class, ProjectInner.class, + context); + } + + /** + * Create a Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the MongoDB Atlas Project resource type on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String organizationName, + String projectName, ProjectInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, organizationName, projectName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the MongoDB Atlas Project resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProjectInner createOrUpdate(String resourceGroupName, String organizationName, String projectName, + ProjectInner resource) { + return beginCreateOrUpdate(resourceGroupName, organizationName, projectName, resource).getFinalResult(); + } + + /** + * Create a Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the MongoDB Atlas Project resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProjectInner createOrUpdate(String resourceGroupName, String organizationName, String projectName, + ProjectInner resource, Context context) { + return beginCreateOrUpdate(resourceGroupName, organizationName, projectName, resource, context) + .getFinalResult(); + } + + /** + * Delete a Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String organizationName, + String projectName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, projectName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String organizationName, + String projectName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, projectName, Context.NONE); + } + + /** + * Delete a Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String organizationName, + String projectName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, projectName, context); + } + + /** + * Delete a Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project 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. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String organizationName, + String projectName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, organizationName, projectName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project 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. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String organizationName, + String projectName) { + Response response = deleteWithResponse(resourceGroupName, organizationName, projectName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete a Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String organizationName, + String projectName, Context context) { + Response response = deleteWithResponse(resourceGroupName, organizationName, projectName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete a Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String organizationName, String projectName) { + return beginDeleteAsync(resourceGroupName, organizationName, projectName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String organizationName, String projectName) { + beginDelete(resourceGroupName, organizationName, projectName).getFinalResult(); + } + + /** + * Delete a Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String organizationName, String projectName, Context context) { + beginDelete(resourceGroupName, organizationName, projectName, context).getFinalResult(); + } + + /** + * List Project resources by OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization 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 of a Project list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String organizationName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, 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 Project resources by OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization 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 of a Project list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String organizationName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, organizationName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List Project resources by OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization 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 of a Project list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String organizationName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List Project resources by OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Project list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String organizationName, + Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List Project resources by OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization 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 of a Project list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String organizationName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, organizationName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List Project resources by OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Project list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String organizationName, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, organizationName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Check if tier limit is reached for the project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project 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 response for tier limit check along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> tierLimitReachedWithResponseAsync(String resourceGroupName, + String organizationName, String projectName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.tierLimitReached(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, projectName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Check if tier limit is reached for the project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project 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 response for tier limit check on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono tierLimitReachedAsync(String resourceGroupName, String organizationName, + String projectName) { + return tierLimitReachedWithResponseAsync(resourceGroupName, organizationName, projectName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Check if tier limit is reached for the project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for tier limit check along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response tierLimitReachedWithResponse(String resourceGroupName, + String organizationName, String projectName, Context context) { + final String accept = "application/json"; + return service.tierLimitReachedSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, projectName, accept, context); + } + + /** + * Check if tier limit is reached for the project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project 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 response for tier limit check. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TierLimitReachedResponseInner tierLimitReached(String resourceGroupName, String organizationName, + String projectName) { + return tierLimitReachedWithResponse(resourceGroupName, organizationName, projectName, Context.NONE).getValue(); + } + + /** + * List available regions by cluster tier for the project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project 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 response for regions by cluster tier along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listClusterTierRegionsWithResponseAsync(String resourceGroupName, + String organizationName, String projectName) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listClusterTierRegions(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, projectName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List available regions by cluster tier for the project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project 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 response for regions by cluster tier on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listClusterTierRegionsAsync(String resourceGroupName, + String organizationName, String projectName) { + return listClusterTierRegionsWithResponseAsync(resourceGroupName, organizationName, projectName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * List available regions by cluster tier for the project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for regions by cluster tier along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listClusterTierRegionsWithResponse(String resourceGroupName, + String organizationName, String projectName, Context context) { + final String accept = "application/json"; + return service.listClusterTierRegionsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, organizationName, projectName, accept, context); + } + + /** + * List available regions by cluster tier for the project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project 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 response for regions by cluster tier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RegionsByTierResponseInner listClusterTierRegions(String resourceGroupName, String organizationName, + String projectName) { + return listClusterTierRegionsWithResponse(resourceGroupName, organizationName, projectName, Context.NONE) + .getValue(); + } + + /** + * 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 Project list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Project list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 Project list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/ProjectsImpl.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/ProjectsImpl.java new file mode 100644 index 000000000000..f4d120fb526d --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/ProjectsImpl.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mongodbatlas.fluent.ProjectsClient; +import com.azure.resourcemanager.mongodbatlas.fluent.models.ProjectInner; +import com.azure.resourcemanager.mongodbatlas.fluent.models.RegionsByTierResponseInner; +import com.azure.resourcemanager.mongodbatlas.fluent.models.TierLimitReachedResponseInner; +import com.azure.resourcemanager.mongodbatlas.models.Project; +import com.azure.resourcemanager.mongodbatlas.models.Projects; +import com.azure.resourcemanager.mongodbatlas.models.RegionsByTierResponse; +import com.azure.resourcemanager.mongodbatlas.models.TierLimitReachedResponse; + +public final class ProjectsImpl implements Projects { + private static final ClientLogger LOGGER = new ClientLogger(ProjectsImpl.class); + + private final ProjectsClient innerClient; + + private final com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager serviceManager; + + public ProjectsImpl(ProjectsClient innerClient, + com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String organizationName, String projectName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, organizationName, projectName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ProjectImpl(inner.getValue(), this.manager())); + } + + public Project get(String resourceGroupName, String organizationName, String projectName) { + ProjectInner inner = this.serviceClient().get(resourceGroupName, organizationName, projectName); + if (inner != null) { + return new ProjectImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String organizationName, String projectName) { + this.serviceClient().delete(resourceGroupName, organizationName, projectName); + } + + public void delete(String resourceGroupName, String organizationName, String projectName, Context context) { + this.serviceClient().delete(resourceGroupName, organizationName, projectName, context); + } + + public PagedIterable list(String resourceGroupName, String organizationName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, organizationName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ProjectImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String organizationName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, organizationName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ProjectImpl(inner1, this.manager())); + } + + public Response tierLimitReachedWithResponse(String resourceGroupName, + String organizationName, String projectName, Context context) { + Response inner = this.serviceClient() + .tierLimitReachedWithResponse(resourceGroupName, organizationName, projectName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new TierLimitReachedResponseImpl(inner.getValue(), this.manager())); + } + + public TierLimitReachedResponse tierLimitReached(String resourceGroupName, String organizationName, + String projectName) { + TierLimitReachedResponseInner inner + = this.serviceClient().tierLimitReached(resourceGroupName, organizationName, projectName); + if (inner != null) { + return new TierLimitReachedResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listClusterTierRegionsWithResponse(String resourceGroupName, + String organizationName, String projectName, Context context) { + Response inner = this.serviceClient() + .listClusterTierRegionsWithResponse(resourceGroupName, organizationName, projectName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RegionsByTierResponseImpl(inner.getValue(), this.manager())); + } + + public RegionsByTierResponse listClusterTierRegions(String resourceGroupName, String organizationName, + String projectName) { + RegionsByTierResponseInner inner + = this.serviceClient().listClusterTierRegions(resourceGroupName, organizationName, projectName); + if (inner != null) { + return new RegionsByTierResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Project getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String organizationName = ResourceManagerUtils.getValueFromIdByName(id, "organizations"); + if (organizationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'organizations'.", id))); + } + String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + return this.getWithResponse(resourceGroupName, organizationName, projectName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String organizationName = ResourceManagerUtils.getValueFromIdByName(id, "organizations"); + if (organizationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'organizations'.", id))); + } + String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + return this.getWithResponse(resourceGroupName, organizationName, projectName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String organizationName = ResourceManagerUtils.getValueFromIdByName(id, "organizations"); + if (organizationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'organizations'.", id))); + } + String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + this.delete(resourceGroupName, organizationName, projectName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String organizationName = ResourceManagerUtils.getValueFromIdByName(id, "organizations"); + if (organizationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'organizations'.", id))); + } + String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + this.delete(resourceGroupName, organizationName, projectName, context); + } + + private ProjectsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager manager() { + return this.serviceManager; + } + + public ProjectImpl define(String name) { + return new ProjectImpl(name, this.manager()); + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/RegionsByTierResponseImpl.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/RegionsByTierResponseImpl.java new file mode 100644 index 000000000000..37a971be921e --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/RegionsByTierResponseImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.implementation; + +import com.azure.resourcemanager.mongodbatlas.fluent.models.RegionsByTierResponseInner; +import com.azure.resourcemanager.mongodbatlas.models.RegionsByTierResponse; +import com.azure.resourcemanager.mongodbatlas.models.TierRegions; +import java.util.Collections; +import java.util.List; + +public final class RegionsByTierResponseImpl implements RegionsByTierResponse { + private RegionsByTierResponseInner innerObject; + + private final com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager serviceManager; + + RegionsByTierResponseImpl(RegionsByTierResponseInner innerObject, + com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String organizationId() { + return this.innerModel().organizationId(); + } + + public String projectId() { + return this.innerModel().projectId(); + } + + public List regionsByTier() { + List inner = this.innerModel().regionsByTier(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public RegionsByTierResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/TierLimitReachedResponseImpl.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/TierLimitReachedResponseImpl.java new file mode 100644 index 000000000000..752dd5a9abf1 --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/TierLimitReachedResponseImpl.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.implementation; + +import com.azure.resourcemanager.mongodbatlas.fluent.models.TierLimitReachedResponseInner; +import com.azure.resourcemanager.mongodbatlas.models.ProjectLimitStatus; +import com.azure.resourcemanager.mongodbatlas.models.TierLimitReachedResponse; +import java.util.Collections; +import java.util.List; + +public final class TierLimitReachedResponseImpl implements TierLimitReachedResponse { + private TierLimitReachedResponseInner innerObject; + + private final com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager serviceManager; + + TierLimitReachedResponseImpl(TierLimitReachedResponseInner innerObject, + com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List limits() { + List inner = this.innerModel().limits(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public TierLimitReachedResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/models/ClusterListResult.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/models/ClusterListResult.java new file mode 100644 index 000000000000..1cc99b0e72a8 --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/models/ClusterListResult.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.mongodbatlas.fluent.models.ClusterInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Cluster list operation. + */ +@Immutable +public final class ClusterListResult implements JsonSerializable { + /* + * The Cluster items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ClusterListResult class. + */ + private ClusterListResult() { + } + + /** + * Get the value property: The Cluster items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterListResult 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 ClusterListResult. + */ + public static ClusterListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterListResult deserializedClusterListResult = new ClusterListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> ClusterInner.fromJson(reader1)); + deserializedClusterListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedClusterListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterListResult; + }); + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/models/ProjectListResult.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/models/ProjectListResult.java new file mode 100644 index 000000000000..6cfd8629a1de --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/models/ProjectListResult.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.mongodbatlas.fluent.models.ProjectInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Project list operation. + */ +@Immutable +public final class ProjectListResult implements JsonSerializable { + /* + * The Project items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ProjectListResult class. + */ + private ProjectListResult() { + } + + /** + * Get the value property: The Project items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProjectListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProjectListResult 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 ProjectListResult. + */ + public static ProjectListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProjectListResult deserializedProjectListResult = new ProjectListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> ProjectInner.fromJson(reader1)); + deserializedProjectListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedProjectListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedProjectListResult; + }); + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/Cluster.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/Cluster.java new file mode 100644 index 000000000000..727418720f0b --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/Cluster.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mongodbatlas.fluent.models.ClusterInner; + +/** + * An immutable client-side representation of Cluster. + */ +public interface Cluster { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + ClusterProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.mongodbatlas.fluent.models.ClusterInner object. + * + * @return the inner object. + */ + ClusterInner innerModel(); + + /** + * The entirety of the Cluster definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The Cluster definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Cluster definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the Cluster definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, organizationName, projectName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @return the next definition stage. + */ + WithCreate withExistingProject(String resourceGroupName, String organizationName, String projectName); + } + + /** + * The stage of the Cluster definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + Cluster create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Cluster create(Context context); + } + + /** + * The stage of the Cluster definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(ClusterProperties properties); + } + } + + /** + * Begins update for the Cluster resource. + * + * @return the stage of resource update. + */ + Cluster.Update update(); + + /** + * The template for Cluster update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Cluster apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Cluster apply(Context context); + } + + /** + * The Cluster update stages. + */ + interface UpdateStages { + /** + * The stage of the Cluster update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + Update withProperties(ClusterProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Cluster refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Cluster refresh(Context context); +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/ClusterProperties.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/ClusterProperties.java new file mode 100644 index 000000000000..9fc3f3f6765c --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/ClusterProperties.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties specific to a MongoDB Atlas Cluster. + */ +@Fluent +public final class ClusterProperties implements JsonSerializable { + /* + * Name of the MongoDB Atlas Cluster. + */ + private String clusterName; + + /* + * Cluster tier (FREE, FLEX, M10, M30). + */ + private ClusterTier clusterTier; + + /* + * Azure region where the cluster is deployed. + */ + private String regionName; + + /* + * MongoDB version running on the cluster. + */ + private String mongoDbVersion; + + /* + * Whether backups are active for the cluster; null if undetermined. + */ + private Boolean backups; + + /* + * Current state of the cluster. + */ + private String state; + + /* + * Provisioning state of the resource. + */ + private ResourceProvisioningState provisioningState; + + /** + * Creates an instance of ClusterProperties class. + */ + public ClusterProperties() { + } + + /** + * Get the clusterName property: Name of the MongoDB Atlas Cluster. + * + * @return the clusterName value. + */ + public String clusterName() { + return this.clusterName; + } + + /** + * Get the clusterTier property: Cluster tier (FREE, FLEX, M10, M30). + * + * @return the clusterTier value. + */ + public ClusterTier clusterTier() { + return this.clusterTier; + } + + /** + * Set the clusterTier property: Cluster tier (FREE, FLEX, M10, M30). + * + * @param clusterTier the clusterTier value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withClusterTier(ClusterTier clusterTier) { + this.clusterTier = clusterTier; + return this; + } + + /** + * Get the regionName property: Azure region where the cluster is deployed. + * + * @return the regionName value. + */ + public String regionName() { + return this.regionName; + } + + /** + * Set the regionName property: Azure region where the cluster is deployed. + * + * @param regionName the regionName value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withRegionName(String regionName) { + this.regionName = regionName; + return this; + } + + /** + * Get the mongoDbVersion property: MongoDB version running on the cluster. + * + * @return the mongoDbVersion value. + */ + public String mongoDbVersion() { + return this.mongoDbVersion; + } + + /** + * Get the backups property: Whether backups are active for the cluster; null if undetermined. + * + * @return the backups value. + */ + public Boolean backups() { + return this.backups; + } + + /** + * Get the state property: Current state of the cluster. + * + * @return the state value. + */ + public String state() { + return this.state; + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ResourceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("clusterTier", this.clusterTier == null ? null : this.clusterTier.toString()); + jsonWriter.writeStringField("regionName", this.regionName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterProperties 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 ClusterProperties. + */ + public static ClusterProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterProperties deserializedClusterProperties = new ClusterProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clusterTier".equals(fieldName)) { + deserializedClusterProperties.clusterTier = ClusterTier.fromString(reader.getString()); + } else if ("regionName".equals(fieldName)) { + deserializedClusterProperties.regionName = reader.getString(); + } else if ("clusterName".equals(fieldName)) { + deserializedClusterProperties.clusterName = reader.getString(); + } else if ("mongoDbVersion".equals(fieldName)) { + deserializedClusterProperties.mongoDbVersion = reader.getString(); + } else if ("backups".equals(fieldName)) { + deserializedClusterProperties.backups = reader.getNullable(JsonReader::getBoolean); + } else if ("state".equals(fieldName)) { + deserializedClusterProperties.state = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedClusterProperties.provisioningState + = ResourceProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterProperties; + }); + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/ClusterTier.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/ClusterTier.java new file mode 100644 index 000000000000..69f338d710e2 --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/ClusterTier.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Cluster tier options for MongoDB Atlas. + */ +public final class ClusterTier extends ExpandableStringEnum { + /** + * Free tier cluster. + */ + public static final ClusterTier FREE = fromString("FREE"); + + /** + * Flex tier cluster. + */ + public static final ClusterTier FLEX = fromString("FLEX"); + + /** + * M10 tier cluster. + */ + public static final ClusterTier M10 = fromString("M10"); + + /** + * M30 tier cluster. + */ + public static final ClusterTier M30 = fromString("M30"); + + /** + * Creates a new instance of ClusterTier value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ClusterTier() { + } + + /** + * Creates or finds a ClusterTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterTier. + */ + public static ClusterTier fromString(String name) { + return fromString(name, ClusterTier.class); + } + + /** + * Gets known ClusterTier values. + * + * @return known ClusterTier values. + */ + public static Collection values() { + return values(ClusterTier.class); + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/Clusters.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/Clusters.java new file mode 100644 index 000000000000..c86b4817adb8 --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/Clusters.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Clusters. + */ +public interface Clusters { + /** + * Delete a Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param clusterName Name of the MongoDB Atlas Cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String organizationName, String projectName, String clusterName); + + /** + * Delete a Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param clusterName Name of the MongoDB Atlas Cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String organizationName, String projectName, String clusterName, + Context context); + + /** + * List Cluster resources by Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Cluster list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String organizationName, String projectName); + + /** + * List Cluster resources by Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Cluster list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String organizationName, String projectName, Context context); + + /** + * Get a Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param clusterName Name of the MongoDB Atlas Cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cluster along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String organizationName, String projectName, + String clusterName, Context context); + + /** + * Get a Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param clusterName Name of the MongoDB Atlas Cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cluster. + */ + Cluster get(String resourceGroupName, String organizationName, String projectName, String clusterName); + + /** + * Get a Cluster. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cluster along with {@link Response}. + */ + Cluster getById(String id); + + /** + * Get a Cluster. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Cluster along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Cluster. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Cluster. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Cluster resource. + * + * @param name resource name. + * @return the first stage of the new Cluster definition. + */ + Cluster.DefinitionStages.Blank define(String name); +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/Project.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/Project.java new file mode 100644 index 000000000000..8d0abfe0a233 --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/Project.java @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.mongodbatlas.fluent.models.ProjectInner; + +/** + * An immutable client-side representation of Project. + */ +public interface Project { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + ProjectProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.mongodbatlas.fluent.models.ProjectInner object. + * + * @return the inner object. + */ + ProjectInner innerModel(); + + /** + * The entirety of the Project definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The Project definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Project definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the Project definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, organizationName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @return the next definition stage. + */ + WithCreate withExistingOrganization(String resourceGroupName, String organizationName); + } + + /** + * The stage of the Project definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + Project create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Project create(Context context); + } + + /** + * The stage of the Project definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(ProjectProperties properties); + } + } + + /** + * Begins update for the Project resource. + * + * @return the stage of resource update. + */ + Project.Update update(); + + /** + * The template for Project update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Project apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Project apply(Context context); + } + + /** + * The Project update stages. + */ + interface UpdateStages { + /** + * The stage of the Project update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + Update withProperties(ProjectProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Project refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Project refresh(Context context); + + /** + * Check if tier limit is reached for the project. + * + * @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 response for tier limit check along with {@link Response}. + */ + Response tierLimitReachedWithResponse(Context context); + + /** + * Check if tier limit is reached for the project. + * + * @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 response for tier limit check. + */ + TierLimitReachedResponse tierLimitReached(); + + /** + * List available regions by cluster tier for the project. + * + * @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 response for regions by cluster tier along with {@link Response}. + */ + Response listClusterTierRegionsWithResponse(Context context); + + /** + * List available regions by cluster tier for the project. + * + * @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 response for regions by cluster tier. + */ + RegionsByTierResponse listClusterTierRegions(); +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/ProjectLimitStatus.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/ProjectLimitStatus.java new file mode 100644 index 000000000000..3fcbe616d4a3 --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/ProjectLimitStatus.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Usage and limit status for a resource quota in a MongoDB Atlas project. + */ +@Immutable +public final class ProjectLimitStatus implements JsonSerializable { + /* + * Type of the limit. + */ + private ClusterTier type; + + /* + * Maximum allowed value. + */ + private int maximum; + + /* + * Current value. + */ + private int current; + + /* + * Whether the limit has been reached. + */ + private boolean isReached; + + /** + * Creates an instance of ProjectLimitStatus class. + */ + private ProjectLimitStatus() { + } + + /** + * Get the type property: Type of the limit. + * + * @return the type value. + */ + public ClusterTier type() { + return this.type; + } + + /** + * Get the maximum property: Maximum allowed value. + * + * @return the maximum value. + */ + public int maximum() { + return this.maximum; + } + + /** + * Get the current property: Current value. + * + * @return the current value. + */ + public int current() { + return this.current; + } + + /** + * Get the isReached property: Whether the limit has been reached. + * + * @return the isReached value. + */ + public boolean isReached() { + return this.isReached; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeIntField("maximum", this.maximum); + jsonWriter.writeIntField("current", this.current); + jsonWriter.writeBooleanField("isReached", this.isReached); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProjectLimitStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProjectLimitStatus 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 ProjectLimitStatus. + */ + public static ProjectLimitStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProjectLimitStatus deserializedProjectLimitStatus = new ProjectLimitStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedProjectLimitStatus.type = ClusterTier.fromString(reader.getString()); + } else if ("maximum".equals(fieldName)) { + deserializedProjectLimitStatus.maximum = reader.getInt(); + } else if ("current".equals(fieldName)) { + deserializedProjectLimitStatus.current = reader.getInt(); + } else if ("isReached".equals(fieldName)) { + deserializedProjectLimitStatus.isReached = reader.getBoolean(); + } else { + reader.skipChildren(); + } + } + + return deserializedProjectLimitStatus; + }); + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/ProjectProperties.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/ProjectProperties.java new file mode 100644 index 000000000000..add785e5aaa2 --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/ProjectProperties.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties specific to a MongoDB Atlas Project. + */ +@Immutable +public final class ProjectProperties implements JsonSerializable { + /* + * Atlas project id. + */ + private String projectId; + + /* + * Atlas project name. + */ + private String projectName; + + /* + * Atlas organization id. + */ + private String organizationId; + + /* + * Number of clusters in the project. + */ + private Long clusterCount; + + /* + * Provisioning state of the resource. + */ + private ResourceProvisioningState provisioningState; + + /** + * Creates an instance of ProjectProperties class. + */ + public ProjectProperties() { + } + + /** + * Get the projectId property: Atlas project id. + * + * @return the projectId value. + */ + public String projectId() { + return this.projectId; + } + + /** + * Get the projectName property: Atlas project name. + * + * @return the projectName value. + */ + public String projectName() { + return this.projectName; + } + + /** + * Get the organizationId property: Atlas organization id. + * + * @return the organizationId value. + */ + public String organizationId() { + return this.organizationId; + } + + /** + * Get the clusterCount property: Number of clusters in the project. + * + * @return the clusterCount value. + */ + public Long clusterCount() { + return this.clusterCount; + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ResourceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProjectProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProjectProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ProjectProperties. + */ + public static ProjectProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProjectProperties deserializedProjectProperties = new ProjectProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("projectId".equals(fieldName)) { + deserializedProjectProperties.projectId = reader.getString(); + } else if ("projectName".equals(fieldName)) { + deserializedProjectProperties.projectName = reader.getString(); + } else if ("organizationId".equals(fieldName)) { + deserializedProjectProperties.organizationId = reader.getString(); + } else if ("clusterCount".equals(fieldName)) { + deserializedProjectProperties.clusterCount = reader.getNullable(JsonReader::getLong); + } else if ("provisioningState".equals(fieldName)) { + deserializedProjectProperties.provisioningState + = ResourceProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedProjectProperties; + }); + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/Projects.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/Projects.java new file mode 100644 index 000000000000..0b23bb3557a8 --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/Projects.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Projects. + */ +public interface Projects { + /** + * Get a Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Project along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String organizationName, String projectName, + Context context); + + /** + * Get a Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Project. + */ + Project get(String resourceGroupName, String organizationName, String projectName); + + /** + * Delete a Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String organizationName, String projectName); + + /** + * Delete a Project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String organizationName, String projectName, Context context); + + /** + * List Project resources by OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Project list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String organizationName); + + /** + * List Project resources by OrganizationResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Project list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String organizationName, Context context); + + /** + * Check if tier limit is reached for the project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for tier limit check along with {@link Response}. + */ + Response tierLimitReachedWithResponse(String resourceGroupName, String organizationName, + String projectName, Context context); + + /** + * Check if tier limit is reached for the project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for tier limit check. + */ + TierLimitReachedResponse tierLimitReached(String resourceGroupName, String organizationName, String projectName); + + /** + * List available regions by cluster tier for the project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for regions by cluster tier along with {@link Response}. + */ + Response listClusterTierRegionsWithResponse(String resourceGroupName, + String organizationName, String projectName, Context context); + + /** + * List available regions by cluster tier for the project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param organizationName Name of the Organization resource. + * @param projectName Name of the MongoDB Atlas Project resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for regions by cluster tier. + */ + RegionsByTierResponse listClusterTierRegions(String resourceGroupName, String organizationName, String projectName); + + /** + * Get a Project. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Project along with {@link Response}. + */ + Project getById(String id); + + /** + * Get a Project. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Project along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Project. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Project. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Project resource. + * + * @param name resource name. + * @return the first stage of the new Project definition. + */ + Project.DefinitionStages.Blank define(String name); +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/RegionsByTierResponse.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/RegionsByTierResponse.java new file mode 100644 index 000000000000..144ac9e99cf7 --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/RegionsByTierResponse.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.models; + +import com.azure.resourcemanager.mongodbatlas.fluent.models.RegionsByTierResponseInner; +import java.util.List; + +/** + * An immutable client-side representation of RegionsByTierResponse. + */ +public interface RegionsByTierResponse { + /** + * Gets the organizationId property: Atlas organization id. + * + * @return the organizationId value. + */ + String organizationId(); + + /** + * Gets the projectId property: Atlas project id. + * + * @return the projectId value. + */ + String projectId(); + + /** + * Gets the regionsByTier property: List of cluster tiers and their supported regions. + * + * @return the regionsByTier value. + */ + List regionsByTier(); + + /** + * Gets the inner com.azure.resourcemanager.mongodbatlas.fluent.models.RegionsByTierResponseInner object. + * + * @return the inner object. + */ + RegionsByTierResponseInner innerModel(); +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/TierLimitReachedResponse.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/TierLimitReachedResponse.java new file mode 100644 index 000000000000..9e1c72f35681 --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/TierLimitReachedResponse.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.models; + +import com.azure.resourcemanager.mongodbatlas.fluent.models.TierLimitReachedResponseInner; +import java.util.List; + +/** + * An immutable client-side representation of TierLimitReachedResponse. + */ +public interface TierLimitReachedResponse { + /** + * Gets the limits property: List of project limit statuses. + * + * @return the limits value. + */ + List limits(); + + /** + * Gets the inner com.azure.resourcemanager.mongodbatlas.fluent.models.TierLimitReachedResponseInner object. + * + * @return the inner object. + */ + TierLimitReachedResponseInner innerModel(); +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/TierRegions.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/TierRegions.java new file mode 100644 index 000000000000..3cef9bbc1798 --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/java/com/azure/resourcemanager/mongodbatlas/models/TierRegions.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Cluster tier and its supported regions. + */ +@Immutable +public final class TierRegions implements JsonSerializable { + /* + * Cluster tier name. + */ + private ClusterTier tier; + + /* + * Supported region names. + */ + private List regions; + + /** + * Creates an instance of TierRegions class. + */ + private TierRegions() { + } + + /** + * Get the tier property: Cluster tier name. + * + * @return the tier value. + */ + public ClusterTier tier() { + return this.tier; + } + + /** + * Get the regions property: Supported region names. + * + * @return the regions value. + */ + public List regions() { + return this.regions; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tier", this.tier == null ? null : this.tier.toString()); + jsonWriter.writeArrayField("regions", this.regions, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TierRegions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TierRegions 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 TierRegions. + */ + public static TierRegions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TierRegions deserializedTierRegions = new TierRegions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tier".equals(fieldName)) { + deserializedTierRegions.tier = ClusterTier.fromString(reader.getString()); + } else if ("regions".equals(fieldName)) { + List regions = reader.readArray(reader1 -> reader1.getString()); + deserializedTierRegions.regions = regions; + } else { + reader.skipChildren(); + } + } + + return deserializedTierRegions; + }); + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/resources/META-INF/azure-resourcemanager-mongodbatlas_metadata.json b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/resources/META-INF/azure-resourcemanager-mongodbatlas_metadata.json index ff9244219422..27df6a9ee754 100644 --- a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/resources/META-INF/azure-resourcemanager-mongodbatlas_metadata.json +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/resources/META-INF/azure-resourcemanager-mongodbatlas_metadata.json @@ -1 +1 @@ -{"flavor":"azure","apiVersions":{"MongoDB.Atlas":"2025-06-01"},"crossLanguageDefinitions":{"com.azure.resourcemanager.mongodbatlas.fluent.MongoDBAtlasManagementClient":"MongoDB.Atlas","com.azure.resourcemanager.mongodbatlas.fluent.OperationsClient":"MongoDB.Atlas.Operations","com.azure.resourcemanager.mongodbatlas.fluent.OperationsClient.list":"Azure.ResourceManager.Operations.list","com.azure.resourcemanager.mongodbatlas.fluent.OrganizationsClient":"MongoDB.Atlas.Organizations","com.azure.resourcemanager.mongodbatlas.fluent.OrganizationsClient.beginCreateOrUpdate":"MongoDB.Atlas.Organizations.createOrUpdate","com.azure.resourcemanager.mongodbatlas.fluent.OrganizationsClient.beginDelete":"MongoDB.Atlas.Organizations.delete","com.azure.resourcemanager.mongodbatlas.fluent.OrganizationsClient.beginUpdate":"MongoDB.Atlas.Organizations.update","com.azure.resourcemanager.mongodbatlas.fluent.OrganizationsClient.createOrUpdate":"MongoDB.Atlas.Organizations.createOrUpdate","com.azure.resourcemanager.mongodbatlas.fluent.OrganizationsClient.delete":"MongoDB.Atlas.Organizations.delete","com.azure.resourcemanager.mongodbatlas.fluent.OrganizationsClient.getByResourceGroup":"MongoDB.Atlas.Organizations.get","com.azure.resourcemanager.mongodbatlas.fluent.OrganizationsClient.getByResourceGroupWithResponse":"MongoDB.Atlas.Organizations.get","com.azure.resourcemanager.mongodbatlas.fluent.OrganizationsClient.list":"MongoDB.Atlas.Organizations.listBySubscription","com.azure.resourcemanager.mongodbatlas.fluent.OrganizationsClient.listByResourceGroup":"MongoDB.Atlas.Organizations.listByResourceGroup","com.azure.resourcemanager.mongodbatlas.fluent.OrganizationsClient.update":"MongoDB.Atlas.Organizations.update","com.azure.resourcemanager.mongodbatlas.fluent.models.OperationInner":"Azure.ResourceManager.CommonTypes.Operation","com.azure.resourcemanager.mongodbatlas.fluent.models.OrganizationResourceInner":"MongoDB.Atlas.OrganizationResource","com.azure.resourcemanager.mongodbatlas.implementation.MongoDBAtlasManagementClientBuilder":"MongoDB.Atlas","com.azure.resourcemanager.mongodbatlas.implementation.models.OperationListResult":"Azure.ResourceManager.CommonTypes.OperationListResult","com.azure.resourcemanager.mongodbatlas.implementation.models.OrganizationResourceListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.mongodbatlas.models.ActionType":"Azure.ResourceManager.CommonTypes.ActionType","com.azure.resourcemanager.mongodbatlas.models.ManagedServiceIdentity":"Azure.ResourceManager.CommonTypes.ManagedServiceIdentity","com.azure.resourcemanager.mongodbatlas.models.ManagedServiceIdentityType":"Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType","com.azure.resourcemanager.mongodbatlas.models.MarketplaceDetails":"LiftrBase.MarketplaceDetails","com.azure.resourcemanager.mongodbatlas.models.MarketplaceSubscriptionStatus":"LiftrBase.MarketplaceSubscriptionStatus","com.azure.resourcemanager.mongodbatlas.models.OfferDetails":"LiftrBase.OfferDetails","com.azure.resourcemanager.mongodbatlas.models.OperationDisplay":"Azure.ResourceManager.CommonTypes.OperationDisplay","com.azure.resourcemanager.mongodbatlas.models.OrganizationProperties":"MongoDB.Atlas.OrganizationProperties","com.azure.resourcemanager.mongodbatlas.models.OrganizationResourceUpdate":"Azure.ResourceManager.Foundations.ResourceUpdateModel","com.azure.resourcemanager.mongodbatlas.models.OrganizationResourceUpdateProperties":"Azure.ResourceManager.Foundations.ResourceUpdateModelProperties","com.azure.resourcemanager.mongodbatlas.models.Origin":"Azure.ResourceManager.CommonTypes.Origin","com.azure.resourcemanager.mongodbatlas.models.PartnerProperties":"MongoDB.Atlas.PartnerProperties","com.azure.resourcemanager.mongodbatlas.models.ResourceProvisioningState":"Azure.ResourceManager.ResourceProvisioningState","com.azure.resourcemanager.mongodbatlas.models.UserAssignedIdentity":"Azure.ResourceManager.CommonTypes.UserAssignedIdentity","com.azure.resourcemanager.mongodbatlas.models.UserDetails":"MongoDB.Atlas.UserDetails"},"generatedFiles":["src/main/java/com/azure/resourcemanager/mongodbatlas/MongoDBAtlasManager.java","src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/MongoDBAtlasManagementClient.java","src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/OrganizationsClient.java","src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/models/OperationInner.java","src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/models/OrganizationResourceInner.java","src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/package-info.java","src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/MongoDBAtlasManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/MongoDBAtlasManagementClientImpl.java","src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/OperationImpl.java","src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/OperationsImpl.java","src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/OrganizationResourceImpl.java","src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/OrganizationsClientImpl.java","src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/OrganizationsImpl.java","src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/models/OperationListResult.java","src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/models/OrganizationResourceListResult.java","src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/package-info.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/ActionType.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/ManagedServiceIdentity.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/ManagedServiceIdentityType.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/MarketplaceDetails.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/MarketplaceSubscriptionStatus.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/OfferDetails.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/Operation.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/OperationDisplay.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/Operations.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/OrganizationProperties.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/OrganizationResource.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/OrganizationResourceUpdate.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/OrganizationResourceUpdateProperties.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/Organizations.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/Origin.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/PartnerProperties.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/ResourceProvisioningState.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/UserAssignedIdentity.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/UserDetails.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/package-info.java","src/main/java/com/azure/resourcemanager/mongodbatlas/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file +{"flavor":"azure","apiVersions":{"MongoDB.Atlas":"2026-03-01-preview"},"crossLanguagePackageId":"MongoDB.Atlas","crossLanguageVersion":"ab11d5347e15","crossLanguageDefinitions":{"com.azure.resourcemanager.mongodbatlas.fluent.ClustersClient":"MongoDB.Atlas.Clusters","com.azure.resourcemanager.mongodbatlas.fluent.ClustersClient.beginCreateOrUpdate":"MongoDB.Atlas.Clusters.createOrUpdate","com.azure.resourcemanager.mongodbatlas.fluent.ClustersClient.beginDelete":"MongoDB.Atlas.Clusters.delete","com.azure.resourcemanager.mongodbatlas.fluent.ClustersClient.createOrUpdate":"MongoDB.Atlas.Clusters.createOrUpdate","com.azure.resourcemanager.mongodbatlas.fluent.ClustersClient.delete":"MongoDB.Atlas.Clusters.delete","com.azure.resourcemanager.mongodbatlas.fluent.ClustersClient.get":"MongoDB.Atlas.Clusters.get","com.azure.resourcemanager.mongodbatlas.fluent.ClustersClient.getWithResponse":"MongoDB.Atlas.Clusters.get","com.azure.resourcemanager.mongodbatlas.fluent.ClustersClient.list":"MongoDB.Atlas.Clusters.list","com.azure.resourcemanager.mongodbatlas.fluent.MongoDBAtlasManagementClient":"MongoDB.Atlas","com.azure.resourcemanager.mongodbatlas.fluent.OperationsClient":"MongoDB.Atlas.Operations","com.azure.resourcemanager.mongodbatlas.fluent.OperationsClient.list":"Azure.ResourceManager.Operations.list","com.azure.resourcemanager.mongodbatlas.fluent.OrganizationsClient":"MongoDB.Atlas.Organizations","com.azure.resourcemanager.mongodbatlas.fluent.OrganizationsClient.beginCreateOrUpdate":"MongoDB.Atlas.Organizations.createOrUpdate","com.azure.resourcemanager.mongodbatlas.fluent.OrganizationsClient.beginDelete":"MongoDB.Atlas.Organizations.delete","com.azure.resourcemanager.mongodbatlas.fluent.OrganizationsClient.beginUpdate":"MongoDB.Atlas.Organizations.update","com.azure.resourcemanager.mongodbatlas.fluent.OrganizationsClient.createOrUpdate":"MongoDB.Atlas.Organizations.createOrUpdate","com.azure.resourcemanager.mongodbatlas.fluent.OrganizationsClient.delete":"MongoDB.Atlas.Organizations.delete","com.azure.resourcemanager.mongodbatlas.fluent.OrganizationsClient.getByResourceGroup":"MongoDB.Atlas.Organizations.get","com.azure.resourcemanager.mongodbatlas.fluent.OrganizationsClient.getByResourceGroupWithResponse":"MongoDB.Atlas.Organizations.get","com.azure.resourcemanager.mongodbatlas.fluent.OrganizationsClient.list":"MongoDB.Atlas.Organizations.listBySubscription","com.azure.resourcemanager.mongodbatlas.fluent.OrganizationsClient.listByResourceGroup":"MongoDB.Atlas.Organizations.listByResourceGroup","com.azure.resourcemanager.mongodbatlas.fluent.OrganizationsClient.update":"MongoDB.Atlas.Organizations.update","com.azure.resourcemanager.mongodbatlas.fluent.ProjectsClient":"MongoDB.Atlas.Projects","com.azure.resourcemanager.mongodbatlas.fluent.ProjectsClient.beginCreateOrUpdate":"MongoDB.Atlas.Projects.createOrUpdate","com.azure.resourcemanager.mongodbatlas.fluent.ProjectsClient.beginDelete":"MongoDB.Atlas.Projects.delete","com.azure.resourcemanager.mongodbatlas.fluent.ProjectsClient.createOrUpdate":"MongoDB.Atlas.Projects.createOrUpdate","com.azure.resourcemanager.mongodbatlas.fluent.ProjectsClient.delete":"MongoDB.Atlas.Projects.delete","com.azure.resourcemanager.mongodbatlas.fluent.ProjectsClient.get":"MongoDB.Atlas.Projects.get","com.azure.resourcemanager.mongodbatlas.fluent.ProjectsClient.getWithResponse":"MongoDB.Atlas.Projects.get","com.azure.resourcemanager.mongodbatlas.fluent.ProjectsClient.list":"MongoDB.Atlas.Projects.list","com.azure.resourcemanager.mongodbatlas.fluent.ProjectsClient.listClusterTierRegions":"MongoDB.Atlas.Projects.listClusterTierRegions","com.azure.resourcemanager.mongodbatlas.fluent.ProjectsClient.listClusterTierRegionsWithResponse":"MongoDB.Atlas.Projects.listClusterTierRegions","com.azure.resourcemanager.mongodbatlas.fluent.ProjectsClient.tierLimitReached":"MongoDB.Atlas.Projects.tierLimitReached","com.azure.resourcemanager.mongodbatlas.fluent.ProjectsClient.tierLimitReachedWithResponse":"MongoDB.Atlas.Projects.tierLimitReached","com.azure.resourcemanager.mongodbatlas.fluent.models.ClusterInner":"MongoDB.Atlas.Cluster","com.azure.resourcemanager.mongodbatlas.fluent.models.OperationInner":"Azure.ResourceManager.CommonTypes.Operation","com.azure.resourcemanager.mongodbatlas.fluent.models.OrganizationResourceInner":"MongoDB.Atlas.OrganizationResource","com.azure.resourcemanager.mongodbatlas.fluent.models.ProjectInner":"MongoDB.Atlas.Project","com.azure.resourcemanager.mongodbatlas.fluent.models.RegionsByTierResponseInner":"MongoDB.Atlas.RegionsByTierResponse","com.azure.resourcemanager.mongodbatlas.fluent.models.TierLimitReachedResponseInner":"MongoDB.Atlas.TierLimitReachedResponse","com.azure.resourcemanager.mongodbatlas.implementation.MongoDBAtlasManagementClientBuilder":"MongoDB.Atlas","com.azure.resourcemanager.mongodbatlas.implementation.models.ClusterListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.mongodbatlas.implementation.models.OperationListResult":"Azure.ResourceManager.CommonTypes.OperationListResult","com.azure.resourcemanager.mongodbatlas.implementation.models.OrganizationResourceListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.mongodbatlas.implementation.models.ProjectListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.mongodbatlas.models.ActionType":"Azure.ResourceManager.CommonTypes.ActionType","com.azure.resourcemanager.mongodbatlas.models.ClusterProperties":"MongoDB.Atlas.ClusterProperties","com.azure.resourcemanager.mongodbatlas.models.ClusterTier":"MongoDB.Atlas.ClusterTier","com.azure.resourcemanager.mongodbatlas.models.ManagedServiceIdentity":"Azure.ResourceManager.CommonTypes.ManagedServiceIdentity","com.azure.resourcemanager.mongodbatlas.models.ManagedServiceIdentityType":"Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType","com.azure.resourcemanager.mongodbatlas.models.MarketplaceDetails":"LiftrBase.MarketplaceDetails","com.azure.resourcemanager.mongodbatlas.models.MarketplaceSubscriptionStatus":"LiftrBase.MarketplaceSubscriptionStatus","com.azure.resourcemanager.mongodbatlas.models.OfferDetails":"LiftrBase.OfferDetails","com.azure.resourcemanager.mongodbatlas.models.OperationDisplay":"Azure.ResourceManager.CommonTypes.OperationDisplay","com.azure.resourcemanager.mongodbatlas.models.OrganizationProperties":"MongoDB.Atlas.OrganizationProperties","com.azure.resourcemanager.mongodbatlas.models.OrganizationResourceUpdate":"Azure.ResourceManager.Foundations.ResourceUpdateModel","com.azure.resourcemanager.mongodbatlas.models.OrganizationResourceUpdateProperties":"Azure.ResourceManager.Foundations.ResourceUpdateModelProperties","com.azure.resourcemanager.mongodbatlas.models.Origin":"Azure.ResourceManager.CommonTypes.Origin","com.azure.resourcemanager.mongodbatlas.models.PartnerProperties":"MongoDB.Atlas.PartnerProperties","com.azure.resourcemanager.mongodbatlas.models.ProjectLimitStatus":"MongoDB.Atlas.ProjectLimitStatus","com.azure.resourcemanager.mongodbatlas.models.ProjectProperties":"MongoDB.Atlas.ProjectProperties","com.azure.resourcemanager.mongodbatlas.models.ResourceProvisioningState":"Azure.ResourceManager.ResourceProvisioningState","com.azure.resourcemanager.mongodbatlas.models.TierRegions":"MongoDB.Atlas.TierRegions","com.azure.resourcemanager.mongodbatlas.models.UserAssignedIdentity":"Azure.ResourceManager.CommonTypes.UserAssignedIdentity","com.azure.resourcemanager.mongodbatlas.models.UserDetails":"MongoDB.Atlas.UserDetails"},"generatedFiles":["src/main/java/com/azure/resourcemanager/mongodbatlas/MongoDBAtlasManager.java","src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/ClustersClient.java","src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/MongoDBAtlasManagementClient.java","src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/OrganizationsClient.java","src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/ProjectsClient.java","src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/models/ClusterInner.java","src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/models/OperationInner.java","src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/models/OrganizationResourceInner.java","src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/models/ProjectInner.java","src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/models/RegionsByTierResponseInner.java","src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/models/TierLimitReachedResponseInner.java","src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/mongodbatlas/fluent/package-info.java","src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/ClusterImpl.java","src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/ClustersClientImpl.java","src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/ClustersImpl.java","src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/MongoDBAtlasManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/MongoDBAtlasManagementClientImpl.java","src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/OperationImpl.java","src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/OperationsImpl.java","src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/OrganizationResourceImpl.java","src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/OrganizationsClientImpl.java","src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/OrganizationsImpl.java","src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/ProjectImpl.java","src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/ProjectsClientImpl.java","src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/ProjectsImpl.java","src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/RegionsByTierResponseImpl.java","src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/TierLimitReachedResponseImpl.java","src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/models/ClusterListResult.java","src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/models/OperationListResult.java","src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/models/OrganizationResourceListResult.java","src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/models/ProjectListResult.java","src/main/java/com/azure/resourcemanager/mongodbatlas/implementation/package-info.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/ActionType.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/Cluster.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/ClusterProperties.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/ClusterTier.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/Clusters.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/ManagedServiceIdentity.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/ManagedServiceIdentityType.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/MarketplaceDetails.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/MarketplaceSubscriptionStatus.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/OfferDetails.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/Operation.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/OperationDisplay.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/Operations.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/OrganizationProperties.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/OrganizationResource.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/OrganizationResourceUpdate.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/OrganizationResourceUpdateProperties.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/Organizations.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/Origin.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/PartnerProperties.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/Project.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/ProjectLimitStatus.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/ProjectProperties.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/Projects.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/RegionsByTierResponse.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/ResourceProvisioningState.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/TierLimitReachedResponse.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/TierRegions.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/UserAssignedIdentity.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/UserDetails.java","src/main/java/com/azure/resourcemanager/mongodbatlas/models/package-info.java","src/main/java/com/azure/resourcemanager/mongodbatlas/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-mongodbatlas/proxy-config.json b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-mongodbatlas/proxy-config.json index 432ca1b05c40..f7297fc92686 100644 --- a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-mongodbatlas/proxy-config.json +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-mongodbatlas/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.mongodbatlas.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.mongodbatlas.implementation.OrganizationsClientImpl$OrganizationsService"]] \ No newline at end of file +[["com.azure.resourcemanager.mongodbatlas.implementation.ClustersClientImpl$ClustersService"],["com.azure.resourcemanager.mongodbatlas.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.mongodbatlas.implementation.OrganizationsClientImpl$OrganizationsService"],["com.azure.resourcemanager.mongodbatlas.implementation.ProjectsClientImpl$ProjectsService"]] \ No newline at end of file diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/ClustersCreateOrUpdateSamples.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/ClustersCreateOrUpdateSamples.java new file mode 100644 index 000000000000..f7d2197295af --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/ClustersCreateOrUpdateSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.generated; + +import com.azure.resourcemanager.mongodbatlas.models.ClusterProperties; +import com.azure.resourcemanager.mongodbatlas.models.ClusterTier; + +/** + * Samples for Clusters CreateOrUpdate. + */ +public final class ClustersCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-03-01-preview/Clusters_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: Clusters_CreateOrUpdate_MaximumSet. + * + * @param manager Entry point to MongoDBAtlasManager. + */ + public static void + clustersCreateOrUpdateMaximumSet(com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager manager) { + manager.clusters() + .define("myCluster") + .withExistingProject("rgopenapi", "myOrganization", "myProject") + .withProperties(new ClusterProperties().withClusterTier(ClusterTier.FREE).withRegionName("eastus")) + .create(); + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/ClustersDeleteSamples.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/ClustersDeleteSamples.java new file mode 100644 index 000000000000..007df61d5ad6 --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/ClustersDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.generated; + +/** + * Samples for Clusters Delete. + */ +public final class ClustersDeleteSamples { + /* + * x-ms-original-file: 2026-03-01-preview/Clusters_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: Clusters_Delete_MaximumSet. + * + * @param manager Entry point to MongoDBAtlasManager. + */ + public static void clustersDeleteMaximumSet(com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager manager) { + manager.clusters() + .delete("rgopenapi", "myOrganization", "myProject", "myCluster", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/ClustersGetSamples.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/ClustersGetSamples.java new file mode 100644 index 000000000000..3b124274f523 --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/ClustersGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.generated; + +/** + * Samples for Clusters Get. + */ +public final class ClustersGetSamples { + /* + * x-ms-original-file: 2026-03-01-preview/Clusters_Get_MaximumSet_Gen.json + */ + /** + * Sample code: Clusters_Get_MaximumSet. + * + * @param manager Entry point to MongoDBAtlasManager. + */ + public static void clustersGetMaximumSet(com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager manager) { + manager.clusters() + .getWithResponse("rgopenapi", "myOrganization", "myProject", "myCluster", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/ClustersListSamples.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/ClustersListSamples.java new file mode 100644 index 000000000000..d5197af42fa9 --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/ClustersListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.generated; + +/** + * Samples for Clusters List. + */ +public final class ClustersListSamples { + /* + * x-ms-original-file: 2026-03-01-preview/Clusters_List_MaximumSet_Gen.json + */ + /** + * Sample code: Clusters_List_MaximumSet. + * + * @param manager Entry point to MongoDBAtlasManager. + */ + public static void clustersListMaximumSet(com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager manager) { + manager.clusters().list("rgopenapi", "myOrganization", "myProject", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/OperationsListSamples.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/OperationsListSamples.java index 44914930e037..d8ee295d7287 100644 --- a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/OperationsListSamples.java +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/OperationsListSamples.java @@ -9,7 +9,7 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: 2025-06-01/Operations_List_MinimumSet_Gen.json + * x-ms-original-file: 2026-03-01-preview/Operations_List_MinimumSet_Gen.json */ /** * Sample code: Operations_List_MinimumSet. @@ -21,7 +21,7 @@ public static void operationsListMinimumSet(com.azure.resourcemanager.mongodbatl } /* - * x-ms-original-file: 2025-06-01/Operations_List_MaximumSet_Gen.json + * x-ms-original-file: 2026-03-01-preview/Operations_List_MaximumSet_Gen.json */ /** * Sample code: Operations_List_MaximumSet. diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/OrganizationsCreateOrUpdateSamples.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/OrganizationsCreateOrUpdateSamples.java index daf1f19ec6a4..29dfac9ecf98 100644 --- a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/OrganizationsCreateOrUpdateSamples.java +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/OrganizationsCreateOrUpdateSamples.java @@ -19,7 +19,7 @@ */ public final class OrganizationsCreateOrUpdateSamples { /* - * x-ms-original-file: 2025-06-01/Organizations_CreateOrUpdate_MaximumSet_Gen.json + * x-ms-original-file: 2026-03-01-preview/Organizations_CreateOrUpdate_MaximumSet_Gen.json */ /** * Sample code: Organizations_CreateOrUpdate_MaximumSet. diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/OrganizationsDeleteSamples.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/OrganizationsDeleteSamples.java index 52f4ed4ee8a0..76207b034fb5 100644 --- a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/OrganizationsDeleteSamples.java +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/OrganizationsDeleteSamples.java @@ -9,7 +9,7 @@ */ public final class OrganizationsDeleteSamples { /* - * x-ms-original-file: 2025-06-01/Organizations_Delete_MaximumSet_Gen.json + * x-ms-original-file: 2026-03-01-preview/Organizations_Delete_MaximumSet_Gen.json */ /** * Sample code: Organizations_Delete_MaximumSet. diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/OrganizationsGetByResourceGroupSamples.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/OrganizationsGetByResourceGroupSamples.java index 55bcd0be4ea7..9869b18254b5 100644 --- a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/OrganizationsGetByResourceGroupSamples.java +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/OrganizationsGetByResourceGroupSamples.java @@ -9,7 +9,7 @@ */ public final class OrganizationsGetByResourceGroupSamples { /* - * x-ms-original-file: 2025-06-01/Organizations_Get_MaximumSet_Gen.json + * x-ms-original-file: 2026-03-01-preview/Organizations_Get_MaximumSet_Gen.json */ /** * Sample code: Organizations_Get_MaximumSet. diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/OrganizationsListByResourceGroupSamples.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/OrganizationsListByResourceGroupSamples.java index 6688eb750e68..a0f8150e369a 100644 --- a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/OrganizationsListByResourceGroupSamples.java +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/OrganizationsListByResourceGroupSamples.java @@ -9,7 +9,7 @@ */ public final class OrganizationsListByResourceGroupSamples { /* - * x-ms-original-file: 2025-06-01/Organizations_ListByResourceGroup_MaximumSet_Gen.json + * x-ms-original-file: 2026-03-01-preview/Organizations_ListByResourceGroup_MaximumSet_Gen.json */ /** * Sample code: Organizations_ListByResourceGroup_MaximumSet. @@ -22,7 +22,7 @@ public final class OrganizationsListByResourceGroupSamples { } /* - * x-ms-original-file: 2025-06-01/Organizations_ListByResourceGroup_MinimumSet_Gen.json + * x-ms-original-file: 2026-03-01-preview/Organizations_ListByResourceGroup_MinimumSet_Gen.json */ /** * Sample code: Organizations_ListByResourceGroup_MaximumSet - generated by [MinimumSet] rule. diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/OrganizationsListSamples.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/OrganizationsListSamples.java index aaa7137d2419..3f8e4b7211b8 100644 --- a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/OrganizationsListSamples.java +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/OrganizationsListSamples.java @@ -9,7 +9,7 @@ */ public final class OrganizationsListSamples { /* - * x-ms-original-file: 2025-06-01/Organizations_ListBySubscription_MaximumSet_Gen.json + * x-ms-original-file: 2026-03-01-preview/Organizations_ListBySubscription_MaximumSet_Gen.json */ /** * Sample code: Organizations_ListBySubscription_MaximumSet. @@ -22,7 +22,7 @@ public final class OrganizationsListSamples { } /* - * x-ms-original-file: 2025-06-01/Organizations_ListBySubscription_MinimumSet_Gen.json + * x-ms-original-file: 2026-03-01-preview/Organizations_ListBySubscription_MinimumSet_Gen.json */ /** * Sample code: Organizations_ListBySubscription_MaximumSet - generated by [MinimumSet] rule. diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/OrganizationsUpdateSamples.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/OrganizationsUpdateSamples.java index b1e5a14e6740..b81ad54db3a1 100644 --- a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/OrganizationsUpdateSamples.java +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/OrganizationsUpdateSamples.java @@ -18,7 +18,7 @@ */ public final class OrganizationsUpdateSamples { /* - * x-ms-original-file: 2025-06-01/Organizations_Update_MaximumSet_Gen.json + * x-ms-original-file: 2026-03-01-preview/Organizations_Update_MaximumSet_Gen.json */ /** * Sample code: Organizations_Update_MaximumSet. diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsCreateOrUpdateSamples.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..c5b96b4ab0a5 --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsCreateOrUpdateSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.generated; + +import com.azure.resourcemanager.mongodbatlas.models.ProjectProperties; + +/** + * Samples for Projects CreateOrUpdate. + */ +public final class ProjectsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-03-01-preview/Projects_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: Projects_CreateOrUpdate_MaximumSet. + * + * @param manager Entry point to MongoDBAtlasManager. + */ + public static void + projectsCreateOrUpdateMaximumSet(com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager manager) { + manager.projects() + .define("myProject") + .withExistingOrganization("rgopenapi", "myOrganization") + .withProperties(new ProjectProperties()) + .create(); + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsDeleteSamples.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsDeleteSamples.java new file mode 100644 index 000000000000..7f07367d2da4 --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.generated; + +/** + * Samples for Projects Delete. + */ +public final class ProjectsDeleteSamples { + /* + * x-ms-original-file: 2026-03-01-preview/Projects_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: Projects_Delete_MaximumSet. + * + * @param manager Entry point to MongoDBAtlasManager. + */ + public static void projectsDeleteMaximumSet(com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager manager) { + manager.projects().delete("rgopenapi", "myOrganization", "myProject", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsGetSamples.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsGetSamples.java new file mode 100644 index 000000000000..bb4a3d6a0a38 --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.generated; + +/** + * Samples for Projects Get. + */ +public final class ProjectsGetSamples { + /* + * x-ms-original-file: 2026-03-01-preview/Projects_Get_MaximumSet_Gen.json + */ + /** + * Sample code: Projects_Get_MaximumSet. + * + * @param manager Entry point to MongoDBAtlasManager. + */ + public static void projectsGetMaximumSet(com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager manager) { + manager.projects() + .getWithResponse("rgopenapi", "myOrganization", "myProject", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsListClusterTierRegionsSamples.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsListClusterTierRegionsSamples.java new file mode 100644 index 000000000000..87e47aa52c9c --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsListClusterTierRegionsSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.generated; + +/** + * Samples for Projects ListClusterTierRegions. + */ +public final class ProjectsListClusterTierRegionsSamples { + /* + * x-ms-original-file: 2026-03-01-preview/Projects_ListClusterTierRegions_MaximumSet_Gen.json + */ + /** + * Sample code: Projects_ListClusterTierRegions_MaximumSet. + * + * @param manager Entry point to MongoDBAtlasManager. + */ + public static void + projectsListClusterTierRegionsMaximumSet(com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager manager) { + manager.projects() + .listClusterTierRegionsWithResponse("rgopenapi", "myOrganization", "myProject", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsListSamples.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsListSamples.java new file mode 100644 index 000000000000..bbb496948df0 --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.generated; + +/** + * Samples for Projects List. + */ +public final class ProjectsListSamples { + /* + * x-ms-original-file: 2026-03-01-preview/Projects_List_MaximumSet_Gen.json + */ + /** + * Sample code: Projects_List_MaximumSet. + * + * @param manager Entry point to MongoDBAtlasManager. + */ + public static void projectsListMaximumSet(com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager manager) { + manager.projects().list("rgopenapi", "myOrganization", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsTierLimitReachedSamples.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsTierLimitReachedSamples.java new file mode 100644 index 000000000000..ae2415735440 --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/samples/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsTierLimitReachedSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.generated; + +/** + * Samples for Projects TierLimitReached. + */ +public final class ProjectsTierLimitReachedSamples { + /* + * x-ms-original-file: 2026-03-01-preview/Projects_TierLimitReached_MaximumSet_Gen.json + */ + /** + * Sample code: Projects_TierLimitReached_MaximumSet. + * + * @param manager Entry point to MongoDBAtlasManager. + */ + public static void + projectsTierLimitReachedMaximumSet(com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager manager) { + manager.projects() + .tierLimitReachedWithResponse("rgopenapi", "myOrganization", "myProject", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ClusterInnerTests.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ClusterInnerTests.java new file mode 100644 index 000000000000..bcb0dcaa478b --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ClusterInnerTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mongodbatlas.fluent.models.ClusterInner; +import com.azure.resourcemanager.mongodbatlas.models.ClusterProperties; +import com.azure.resourcemanager.mongodbatlas.models.ClusterTier; +import org.junit.jupiter.api.Assertions; + +public final class ClusterInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClusterInner model = BinaryData.fromString( + "{\"properties\":{\"clusterName\":\"h\",\"clusterTier\":\"FREE\",\"regionName\":\"pnvjtoqnermclf\",\"mongoDbVersion\":\"phoxus\",\"backups\":false,\"state\":\"bgyepsbj\",\"provisioningState\":\"Canceled\"},\"id\":\"ugxywpmueef\",\"name\":\"zwfqkqujidsuyon\",\"type\":\"bglaocqxtccm\"}") + .toObject(ClusterInner.class); + Assertions.assertEquals(ClusterTier.FREE, model.properties().clusterTier()); + Assertions.assertEquals("pnvjtoqnermclf", model.properties().regionName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ClusterInner model = new ClusterInner() + .withProperties(new ClusterProperties().withClusterTier(ClusterTier.FREE).withRegionName("pnvjtoqnermclf")); + model = BinaryData.fromObject(model).toObject(ClusterInner.class); + Assertions.assertEquals(ClusterTier.FREE, model.properties().clusterTier()); + Assertions.assertEquals("pnvjtoqnermclf", model.properties().regionName()); + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ClusterListResultTests.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ClusterListResultTests.java new file mode 100644 index 000000000000..21884bd929b0 --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ClusterListResultTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mongodbatlas.implementation.models.ClusterListResult; +import com.azure.resourcemanager.mongodbatlas.models.ClusterTier; +import org.junit.jupiter.api.Assertions; + +public final class ClusterListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClusterListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"clusterName\":\"uzbpzkafku\",\"clusterTier\":\"FREE\",\"regionName\":\"crnwbmeh\",\"mongoDbVersion\":\"eyvjusrtslhspkde\",\"backups\":true,\"state\":\"fm\",\"provisioningState\":\"Failed\"},\"id\":\"vt\",\"name\":\"elmqk\",\"type\":\"hahvljuahaq\"}],\"nextLink\":\"c\"}") + .toObject(ClusterListResult.class); + Assertions.assertEquals(ClusterTier.FREE, model.value().get(0).properties().clusterTier()); + Assertions.assertEquals("crnwbmeh", model.value().get(0).properties().regionName()); + Assertions.assertEquals("c", model.nextLink()); + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ClusterPropertiesTests.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ClusterPropertiesTests.java new file mode 100644 index 000000000000..09bfbcc3b24b --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ClusterPropertiesTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mongodbatlas.models.ClusterProperties; +import com.azure.resourcemanager.mongodbatlas.models.ClusterTier; +import org.junit.jupiter.api.Assertions; + +public final class ClusterPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClusterProperties model = BinaryData.fromString( + "{\"clusterName\":\"udxytlmoyrx\",\"clusterTier\":\"M30\",\"regionName\":\"fudwpznt\",\"mongoDbVersion\":\"dzhlrq\",\"backups\":true,\"state\":\"kfrlhrxsbky\",\"provisioningState\":\"Succeeded\"}") + .toObject(ClusterProperties.class); + Assertions.assertEquals(ClusterTier.M30, model.clusterTier()); + Assertions.assertEquals("fudwpznt", model.regionName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ClusterProperties model = new ClusterProperties().withClusterTier(ClusterTier.M30).withRegionName("fudwpznt"); + model = BinaryData.fromObject(model).toObject(ClusterProperties.class); + Assertions.assertEquals(ClusterTier.M30, model.clusterTier()); + Assertions.assertEquals("fudwpznt", model.regionName()); + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ClustersCreateOrUpdateMockTests.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ClustersCreateOrUpdateMockTests.java new file mode 100644 index 000000000000..31c246dfa321 --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ClustersCreateOrUpdateMockTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager; +import com.azure.resourcemanager.mongodbatlas.models.Cluster; +import com.azure.resourcemanager.mongodbatlas.models.ClusterProperties; +import com.azure.resourcemanager.mongodbatlas.models.ClusterTier; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ClustersCreateOrUpdateMockTests { + @Test + public void testCreateOrUpdate() throws Exception { + String responseStr + = "{\"properties\":{\"clusterName\":\"z\",\"clusterTier\":\"M30\",\"regionName\":\"yvpnqicvinvkjj\",\"mongoDbVersion\":\"xrbuukzclew\",\"backups\":false,\"state\":\"wp\",\"provisioningState\":\"Succeeded\"},\"id\":\"pofncck\",\"name\":\"yfzqwhxxbu\",\"type\":\"qa\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MongoDBAtlasManager manager = MongoDBAtlasManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Cluster response = manager.clusters() + .define("niodkooeb") + .withExistingProject("zwl", "nwxuqlcvydyp", "tdooaoj") + .withProperties(new ClusterProperties().withClusterTier(ClusterTier.M10).withRegionName("dkcrodt")) + .create(); + + Assertions.assertEquals(ClusterTier.M30, response.properties().clusterTier()); + Assertions.assertEquals("yvpnqicvinvkjj", response.properties().regionName()); + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ClustersGetWithResponseMockTests.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ClustersGetWithResponseMockTests.java new file mode 100644 index 000000000000..24c50c9f2ace --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ClustersGetWithResponseMockTests.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager; +import com.azure.resourcemanager.mongodbatlas.models.Cluster; +import com.azure.resourcemanager.mongodbatlas.models.ClusterTier; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ClustersGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"clusterName\":\"oibjudpfrxtrthz\",\"clusterTier\":\"M10\",\"regionName\":\"ytdw\",\"mongoDbVersion\":\"brqubp\",\"backups\":false,\"state\":\"xiilivpdtiirqt\",\"provisioningState\":\"Canceled\"},\"id\":\"xoruzfgsquyfxrx\",\"name\":\"l\",\"type\":\"ptramxj\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MongoDBAtlasManager manager = MongoDBAtlasManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Cluster response = manager.clusters() + .getWithResponse("yxbaaabjyvayf", "imrzrtuzqog", "exn", "vfdnwnwmewzsyyce", + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(ClusterTier.M10, response.properties().clusterTier()); + Assertions.assertEquals("ytdw", response.properties().regionName()); + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ClustersListMockTests.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ClustersListMockTests.java new file mode 100644 index 000000000000..3a3191d0a8d0 --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ClustersListMockTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager; +import com.azure.resourcemanager.mongodbatlas.models.Cluster; +import com.azure.resourcemanager.mongodbatlas.models.ClusterTier; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ClustersListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"clusterName\":\"m\",\"clusterTier\":\"M30\",\"regionName\":\"dmjsjqb\",\"mongoDbVersion\":\"hyxxrwlycoduhpk\",\"backups\":false,\"state\":\"mareqnajxqugj\",\"provisioningState\":\"Canceled\"},\"id\":\"ubeddg\",\"name\":\"sofwqmzqalkrmnji\",\"type\":\"pxacqqudfn\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MongoDBAtlasManager manager = MongoDBAtlasManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.clusters().list("idb", "fatpxllrxcyjmoa", "su", com.azure.core.util.Context.NONE); + + Assertions.assertEquals(ClusterTier.M30, response.iterator().next().properties().clusterTier()); + Assertions.assertEquals("dmjsjqb", response.iterator().next().properties().regionName()); + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/OperationsListMockTests.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/OperationsListMockTests.java index 97d9e9999c05..895f10addb32 100644 --- a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/OperationsListMockTests.java +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/OperationsListMockTests.java @@ -21,7 +21,7 @@ public final class OperationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"name\":\"dbhrbnlankxm\",\"isDataAction\":false,\"display\":{\"provider\":\"henbtkcxywnytn\",\"resource\":\"yn\",\"operation\":\"idybyxczf\",\"description\":\"haaxdbabphl\"},\"origin\":\"user\",\"actionType\":\"Internal\"}]}"; + = "{\"value\":[{\"name\":\"mdua\",\"isDataAction\":false,\"display\":{\"provider\":\"pvfadmwsrcr\",\"resource\":\"xpvgo\",\"operation\":\"lf\",\"description\":\"sgwbnbbeld\"},\"origin\":\"user\",\"actionType\":\"Internal\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/OrganizationsCreateOrUpdateMockTests.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/OrganizationsCreateOrUpdateMockTests.java index 47dfb04d982d..9ad34fc6e473 100644 --- a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/OrganizationsCreateOrUpdateMockTests.java +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/OrganizationsCreateOrUpdateMockTests.java @@ -31,7 +31,7 @@ public final class OrganizationsCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"marketplace\":{\"subscriptionId\":\"mwabnetshhszhedp\",\"subscriptionStatus\":\"Subscribed\",\"offerDetails\":{\"publisherId\":\"iwubmwmbesldnk\",\"offerId\":\"wtppjflcxogaoko\",\"planId\":\"z\",\"planName\":\"sikvmkqzeqqkdlt\",\"termUnit\":\"xmhhvhgureo\",\"termId\":\"wobdagxtibqdx\"}},\"user\":{\"firstName\":\"xwak\",\"lastName\":\"ogqxndlkzgxhuri\",\"emailAddress\":\"lbpodxunk\",\"upn\":\"bxmubyynt\",\"phoneNumber\":\"rbqtkoie\",\"companyName\":\"eotg\"},\"provisioningState\":\"Succeeded\",\"partnerProperties\":{\"organizationId\":\"muwlauwzizxbm\",\"redirectUrl\":\"cjefuzmu\",\"organizationName\":\"pbttdum\"}},\"identity\":{\"principalId\":\"pxebmnzbt\",\"tenantId\":\"jpglkfgohdne\",\"type\":\"None\",\"userAssignedIdentities\":{\"zfikd\":{\"principalId\":\"hsd\",\"clientId\":\"t\"},\"zx\":{\"principalId\":\"wq\",\"clientId\":\"v\"},\"osggbhc\":{\"principalId\":\"vithh\",\"clientId\":\"o\"},\"fgdkzzew\":{\"principalId\":\"fwdsj\",\"clientId\":\"aljutiiswac\"}}},\"location\":\"vhqcrail\",\"tags\":{\"wdmhdlxyjrxs\":\"ppfufl\"},\"id\":\"gafcnihgwqapnedg\",\"name\":\"bcvkcvqvpkeq\",\"type\":\"cvdrhvoodsot\"}"; + = "{\"properties\":{\"marketplace\":{\"subscriptionId\":\"gk\",\"subscriptionStatus\":\"Unsubscribed\",\"offerDetails\":{\"publisherId\":\"vmbmp\",\"offerId\":\"xmodf\",\"planId\":\"uefywsbpfvmwy\",\"planName\":\"fouyf\",\"termUnit\":\"akcp\",\"termId\":\"yzvqt\"}},\"user\":{\"firstName\":\"nubexk\",\"lastName\":\"zksmondj\",\"emailAddress\":\"quxvypomgkop\",\"upn\":\"hojvpajqgxysmocm\",\"phoneNumber\":\"fqvm\",\"companyName\":\"xozap\"},\"provisioningState\":\"Succeeded\",\"partnerProperties\":{\"organizationId\":\"prglya\",\"redirectUrl\":\"dckcbc\",\"organizationName\":\"ejrjxgciqibrho\"}},\"identity\":{\"principalId\":\"dqrhzoymib\",\"tenantId\":\"qyib\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"iwbwoenwashrtdtk\":{\"principalId\":\"uszdtmhrkwof\",\"clientId\":\"voqacpiexpbt\"},\"obyu\":{\"principalId\":\"qxwbpokulpiu\",\"clientId\":\"aasipqi\"}}},\"location\":\"rpqlp\",\"tags\":{\"t\":\"ciuqgbdb\",\"mhykojoxafnndl\":\"uvfbtkuwh\",\"kkpwdreqnovvq\":\"ichkoymkcdyhb\",\"syrsndsytgadgvra\":\"ovljxywsu\"},\"id\":\"aeneqnzarrwl\",\"name\":\"uu\",\"type\":\"jfqka\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -41,51 +41,51 @@ public void testCreateOrUpdate() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); OrganizationResource response = manager.organizations() - .define("bpvjymjhx") - .withRegion("zbn") - .withExistingResourceGroup("nrmfqjhhk") - .withTags(mapOf("cers", "ylpstdbhhxsrzdz", "wjmy", "dntnevf")) + .define("bdagxt") + .withRegion("afcnih") + .withExistingResourceGroup("fzxmhhvhgureodkw") + .withTags(mapOf("q", "apnedgfbcvkc", "sotbob", "pkeqdcvdrhvoo", "ld", "dopcjwvnh")) .withProperties(new OrganizationProperties() - .withMarketplace(new MarketplaceDetails().withSubscriptionId("yngudivk") - .withOfferDetails(new OfferDetails().withPublisherId("wbxqzvszjfau") - .withOfferId("j") - .withPlanId("dxxiv") - .withPlanName("vtcqaqtdo") - .withTermUnit("cbxvwvxyslqbh") - .withTermId("xoblytkbl"))) - .withUser(new UserDetails().withFirstName("pe") - .withLastName("wwfbkrvrnsvshq") - .withEmailAddress("ohxcrsbfova") - .withUpn("ruvw") - .withPhoneNumber("sqfsubcgjbirxb") - .withCompanyName("bsrfbj")) - .withPartnerProperties(new PartnerProperties().withOrganizationId("sotftpvj") - .withRedirectUrl("exilzznfqqnvwpmq") - .withOrganizationName("aruoujmkcjhwqyt"))) - .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) - .withUserAssignedIdentities(mapOf("gnayqigynduh", new UserAssignedIdentity(), "ertgccymva", - new UserAssignedIdentity(), "yhz", new UserAssignedIdentity(), "od", new UserAssignedIdentity()))) + .withMarketplace(new MarketplaceDetails().withSubscriptionId("qdxbxwa") + .withOfferDetails(new OfferDetails().withPublisherId("gqxndlkzgxhuripl") + .withOfferId("podxunkb") + .withPlanId("bxmubyynt") + .withPlanName("rbqtkoie") + .withTermUnit("eotg") + .withTermId("l"))) + .withUser(new UserDetails().withFirstName("tmuwlauwzi") + .withLastName("xbmp") + .withEmailAddress("cjefuzmu") + .withUpn("bttdumorppxe") + .withPhoneNumber("nzbtbhj") + .withCompanyName("lkfg")) + .withPartnerProperties(new PartnerProperties().withOrganizationId("uel") + .withRedirectUrl("hsd") + .withOrganizationName("htozfikdow"))) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf("swacffgdkzz", new UserAssignedIdentity(), "jrxs", new UserAssignedIdentity()))) .create(); - Assertions.assertEquals("vhqcrail", response.location()); - Assertions.assertEquals("ppfufl", response.tags().get("wdmhdlxyjrxs")); - Assertions.assertEquals("mwabnetshhszhedp", response.properties().marketplace().subscriptionId()); - Assertions.assertEquals("iwubmwmbesldnk", response.properties().marketplace().offerDetails().publisherId()); - Assertions.assertEquals("wtppjflcxogaoko", response.properties().marketplace().offerDetails().offerId()); - Assertions.assertEquals("z", response.properties().marketplace().offerDetails().planId()); - Assertions.assertEquals("sikvmkqzeqqkdlt", response.properties().marketplace().offerDetails().planName()); - Assertions.assertEquals("xmhhvhgureo", response.properties().marketplace().offerDetails().termUnit()); - Assertions.assertEquals("wobdagxtibqdx", response.properties().marketplace().offerDetails().termId()); - Assertions.assertEquals("xwak", response.properties().user().firstName()); - Assertions.assertEquals("ogqxndlkzgxhuri", response.properties().user().lastName()); - Assertions.assertEquals("lbpodxunk", response.properties().user().emailAddress()); - Assertions.assertEquals("bxmubyynt", response.properties().user().upn()); - Assertions.assertEquals("rbqtkoie", response.properties().user().phoneNumber()); - Assertions.assertEquals("eotg", response.properties().user().companyName()); - Assertions.assertEquals("muwlauwzizxbm", response.properties().partnerProperties().organizationId()); - Assertions.assertEquals("cjefuzmu", response.properties().partnerProperties().redirectUrl()); - Assertions.assertEquals("pbttdum", response.properties().partnerProperties().organizationName()); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, response.identity().type()); + Assertions.assertEquals("rpqlp", response.location()); + Assertions.assertEquals("ciuqgbdb", response.tags().get("t")); + Assertions.assertEquals("gk", response.properties().marketplace().subscriptionId()); + Assertions.assertEquals("vmbmp", response.properties().marketplace().offerDetails().publisherId()); + Assertions.assertEquals("xmodf", response.properties().marketplace().offerDetails().offerId()); + Assertions.assertEquals("uefywsbpfvmwy", response.properties().marketplace().offerDetails().planId()); + Assertions.assertEquals("fouyf", response.properties().marketplace().offerDetails().planName()); + Assertions.assertEquals("akcp", response.properties().marketplace().offerDetails().termUnit()); + Assertions.assertEquals("yzvqt", response.properties().marketplace().offerDetails().termId()); + Assertions.assertEquals("nubexk", response.properties().user().firstName()); + Assertions.assertEquals("zksmondj", response.properties().user().lastName()); + Assertions.assertEquals("quxvypomgkop", response.properties().user().emailAddress()); + Assertions.assertEquals("hojvpajqgxysmocm", response.properties().user().upn()); + Assertions.assertEquals("fqvm", response.properties().user().phoneNumber()); + Assertions.assertEquals("xozap", response.properties().user().companyName()); + Assertions.assertEquals("prglya", response.properties().partnerProperties().organizationId()); + Assertions.assertEquals("dckcbc", response.properties().partnerProperties().redirectUrl()); + Assertions.assertEquals("ejrjxgciqibrho", response.properties().partnerProperties().organizationName()); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, response.identity().type()); } // Use "Map.of" if available diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/OrganizationsGetByResourceGroupWithResponseMockTests.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/OrganizationsGetByResourceGroupWithResponseMockTests.java index 644481baa210..721e4a4d45ee 100644 --- a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/OrganizationsGetByResourceGroupWithResponseMockTests.java +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/OrganizationsGetByResourceGroupWithResponseMockTests.java @@ -22,7 +22,7 @@ public final class OrganizationsGetByResourceGroupWithResponseMockTests { @Test public void testGetByResourceGroupWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"marketplace\":{\"subscriptionId\":\"twwrqp\",\"subscriptionStatus\":\"Suspended\",\"offerDetails\":{\"publisherId\":\"ckzywbiexzfeyue\",\"offerId\":\"xibxujwbhqwalm\",\"planId\":\"zyoxaepdkzjan\",\"planName\":\"xrhdwbavxbniwdjs\",\"termUnit\":\"tsdbpgn\",\"termId\":\"txhp\"}},\"user\":{\"firstName\":\"xbzpfzab\",\"lastName\":\"lcuhxwtctyqiklb\",\"emailAddress\":\"ovplw\",\"upn\":\"hvgyuguosvmk\",\"phoneNumber\":\"sxqu\",\"companyName\":\"fpl\"},\"provisioningState\":\"Canceled\",\"partnerProperties\":{\"organizationId\":\"nkjzkdeslpvlop\",\"redirectUrl\":\"yighxpk\",\"organizationName\":\"wzbaiue\"}},\"identity\":{\"principalId\":\"umnyqu\",\"tenantId\":\"deoj\",\"type\":\"None\",\"userAssignedIdentities\":{\"jjdhtld\":{\"principalId\":\"hsmtxpsiebtfhvp\",\"clientId\":\"apskrdqm\"},\"vnm\":{\"principalId\":\"yzxuutkncw\",\"clientId\":\"wsvlxotogtwrupqs\"},\"dhbt\":{\"principalId\":\"ykvceoveil\",\"clientId\":\"notyfjfcnjbkcn\"}}},\"location\":\"phywpnvj\",\"tags\":{\"plpho\":\"nermcl\",\"tazqugxywpmueefj\":\"uscrpabgyepsb\",\"dsuyonobgla\":\"wfqkquj\",\"tcc\":\"cq\"},\"id\":\"g\",\"name\":\"udxytlmoyrx\",\"type\":\"wfudwpzntxhdzhl\"}"; + = "{\"properties\":{\"marketplace\":{\"subscriptionId\":\"ashsfwxos\",\"subscriptionStatus\":\"PendingFulfillmentStart\",\"offerDetails\":{\"publisherId\":\"xcug\",\"offerId\":\"cjooxdjebwpucwwf\",\"planId\":\"ovbvmeueciv\",\"planName\":\"zceuojgjrw\",\"termUnit\":\"eiotwmcdytdx\",\"termId\":\"txnrjaw\"}},\"user\":{\"firstName\":\"qwgxhniskx\",\"lastName\":\"bkpyc\",\"emailAddress\":\"klwndnhjdauwhv\",\"upn\":\"wzbtdhxu\",\"phoneNumber\":\"nbmpowuwprzq\",\"companyName\":\"eualupjmkhf\"},\"provisioningState\":\"Canceled\",\"partnerProperties\":{\"organizationId\":\"sw\",\"redirectUrl\":\"tjrip\",\"organizationName\":\"rbpbewtghfgblcg\"}},\"identity\":{\"principalId\":\"vlvqhjkbegi\",\"tenantId\":\"nmxiebwwaloayqc\",\"type\":\"None\",\"userAssignedIdentities\":{\"txon\":{\"principalId\":\"j\",\"clientId\":\"gwyzm\"},\"uvriuhprwm\":{\"principalId\":\"ts\",\"clientId\":\"jcbpwxqpsrknft\"},\"nmefqsgzvahapj\":{\"principalId\":\"vxqtayriwwroyqbe\",\"clientId\":\"mcqibycnojv\"},\"xkvugfhzov\":{\"principalId\":\"hpvgqz\",\"clientId\":\"rvxdjzlmw\"}}},\"location\":\"jvzunluthnnp\",\"tags\":{\"eilpjzuaejxdu\":\"i\",\"pwo\":\"tskzbbtdzumveek\",\"fpbsjyofdxl\":\"uh\",\"ttouwaboekqvkel\":\"us\"},\"id\":\"smv\",\"name\":\"xwyjsflhhc\",\"type\":\"aln\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,27 +32,27 @@ public void testGetByResourceGroupWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); OrganizationResource response = manager.organizations() - .getByResourceGroupWithResponse("ktsthsucocmny", "azt", com.azure.core.util.Context.NONE) + .getByResourceGroupWithResponse("ali", "urqhaka", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("phywpnvj", response.location()); - Assertions.assertEquals("nermcl", response.tags().get("plpho")); - Assertions.assertEquals("twwrqp", response.properties().marketplace().subscriptionId()); - Assertions.assertEquals("ckzywbiexzfeyue", response.properties().marketplace().offerDetails().publisherId()); - Assertions.assertEquals("xibxujwbhqwalm", response.properties().marketplace().offerDetails().offerId()); - Assertions.assertEquals("zyoxaepdkzjan", response.properties().marketplace().offerDetails().planId()); - Assertions.assertEquals("xrhdwbavxbniwdjs", response.properties().marketplace().offerDetails().planName()); - Assertions.assertEquals("tsdbpgn", response.properties().marketplace().offerDetails().termUnit()); - Assertions.assertEquals("txhp", response.properties().marketplace().offerDetails().termId()); - Assertions.assertEquals("xbzpfzab", response.properties().user().firstName()); - Assertions.assertEquals("lcuhxwtctyqiklb", response.properties().user().lastName()); - Assertions.assertEquals("ovplw", response.properties().user().emailAddress()); - Assertions.assertEquals("hvgyuguosvmk", response.properties().user().upn()); - Assertions.assertEquals("sxqu", response.properties().user().phoneNumber()); - Assertions.assertEquals("fpl", response.properties().user().companyName()); - Assertions.assertEquals("nkjzkdeslpvlop", response.properties().partnerProperties().organizationId()); - Assertions.assertEquals("yighxpk", response.properties().partnerProperties().redirectUrl()); - Assertions.assertEquals("wzbaiue", response.properties().partnerProperties().organizationName()); + Assertions.assertEquals("jvzunluthnnp", response.location()); + Assertions.assertEquals("i", response.tags().get("eilpjzuaejxdu")); + Assertions.assertEquals("ashsfwxos", response.properties().marketplace().subscriptionId()); + Assertions.assertEquals("xcug", response.properties().marketplace().offerDetails().publisherId()); + Assertions.assertEquals("cjooxdjebwpucwwf", response.properties().marketplace().offerDetails().offerId()); + Assertions.assertEquals("ovbvmeueciv", response.properties().marketplace().offerDetails().planId()); + Assertions.assertEquals("zceuojgjrw", response.properties().marketplace().offerDetails().planName()); + Assertions.assertEquals("eiotwmcdytdx", response.properties().marketplace().offerDetails().termUnit()); + Assertions.assertEquals("txnrjaw", response.properties().marketplace().offerDetails().termId()); + Assertions.assertEquals("qwgxhniskx", response.properties().user().firstName()); + Assertions.assertEquals("bkpyc", response.properties().user().lastName()); + Assertions.assertEquals("klwndnhjdauwhv", response.properties().user().emailAddress()); + Assertions.assertEquals("wzbtdhxu", response.properties().user().upn()); + Assertions.assertEquals("nbmpowuwprzq", response.properties().user().phoneNumber()); + Assertions.assertEquals("eualupjmkhf", response.properties().user().companyName()); + Assertions.assertEquals("sw", response.properties().partnerProperties().organizationId()); + Assertions.assertEquals("tjrip", response.properties().partnerProperties().redirectUrl()); + Assertions.assertEquals("rbpbewtghfgblcg", response.properties().partnerProperties().organizationName()); Assertions.assertEquals(ManagedServiceIdentityType.NONE, response.identity().type()); } } diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/OrganizationsListByResourceGroupMockTests.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/OrganizationsListByResourceGroupMockTests.java index 86a4cea9e3c5..22cfd44d779b 100644 --- a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/OrganizationsListByResourceGroupMockTests.java +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/OrganizationsListByResourceGroupMockTests.java @@ -23,7 +23,7 @@ public final class OrganizationsListByResourceGroupMockTests { @Test public void testListByResourceGroup() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"marketplace\":{\"subscriptionId\":\"ck\",\"subscriptionStatus\":\"Suspended\",\"offerDetails\":{\"publisherId\":\"hrxsbk\",\"offerId\":\"vpycanuzbp\",\"planId\":\"kafkuwbcrnwbm\",\"planName\":\"hseyvju\",\"termUnit\":\"tslhspkdeem\",\"termId\":\"fm\"}},\"user\":{\"firstName\":\"ag\",\"lastName\":\"vt\",\"emailAddress\":\"elmqk\",\"upn\":\"ahvljuaha\",\"phoneNumber\":\"hcdhmdual\",\"companyName\":\"xqpvfadmw\"},\"provisioningState\":\"Failed\",\"partnerProperties\":{\"organizationId\":\"vxpvgomz\",\"redirectUrl\":\"misgwbnb\",\"organizationName\":\"e\"}},\"identity\":{\"principalId\":\"wkz\",\"tenantId\":\"liourqhak\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"ucww\":{\"principalId\":\"hsfwxosowzxcug\",\"clientId\":\"jooxdjebw\"},\"ueiotwmcdyt\":{\"principalId\":\"ovbvmeueciv\",\"clientId\":\"zceuojgjrw\"},\"qwgxhniskx\":{\"principalId\":\"wit\",\"clientId\":\"rjaw\"}}},\"location\":\"kpycgklwndnhjd\",\"tags\":{\"h\":\"hvylwzbt\",\"pow\":\"ujznb\"},\"id\":\"wpr\",\"name\":\"qlveualupjmkh\",\"type\":\"xobbcswsrt\"}]}"; + = "{\"value\":[{\"properties\":{\"marketplace\":{\"subscriptionId\":\"cslyjpk\",\"subscriptionStatus\":\"Suspended\",\"offerDetails\":{\"publisherId\":\"zyexzn\",\"offerId\":\"lixhnrztfol\",\"planId\":\"bnxknalaulppg\",\"planName\":\"tpnapnyiropuhpig\",\"termUnit\":\"gylgqgitxmedjvcs\",\"termId\":\"n\"}},\"user\":{\"firstName\":\"wwncwzzhxgk\",\"lastName\":\"rmgucnap\",\"emailAddress\":\"t\",\"upn\":\"ellwptfdy\",\"phoneNumber\":\"fqbuaceopzf\",\"companyName\":\"hhuao\"},\"provisioningState\":\"Failed\",\"partnerProperties\":{\"organizationId\":\"eqx\",\"redirectUrl\":\"z\",\"organizationName\":\"ahzxctobgbk\"}},\"identity\":{\"principalId\":\"izpost\",\"tenantId\":\"rcfbunrm\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"u\":{\"principalId\":\"kxbpvj\",\"clientId\":\"jhxxjyn\"},\"j\":{\"principalId\":\"vkr\",\"clientId\":\"wbxqzvszjfau\"}}},\"location\":\"xxivetv\",\"tags\":{\"wvxysl\":\"aqtdoqmcbx\",\"ytkblmpew\":\"bhsfxob\",\"shqjohxcrsbf\":\"wfbkrvrns\",\"sqfsubcgjbirxb\":\"vasrruvwb\"},\"id\":\"ybsrfbjfdtwss\",\"name\":\"t\",\"type\":\"tpvjzbexilzznfqq\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -33,32 +33,32 @@ public void testListByResourceGroup() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.organizations().listByResourceGroup("qj", com.azure.core.util.Context.NONE); + = manager.organizations().listByResourceGroup("ixisxyawjoy", com.azure.core.util.Context.NONE); - Assertions.assertEquals("kpycgklwndnhjd", response.iterator().next().location()); - Assertions.assertEquals("hvylwzbt", response.iterator().next().tags().get("h")); - Assertions.assertEquals("ck", response.iterator().next().properties().marketplace().subscriptionId()); - Assertions.assertEquals("hrxsbk", + Assertions.assertEquals("xxivetv", response.iterator().next().location()); + Assertions.assertEquals("aqtdoqmcbx", response.iterator().next().tags().get("wvxysl")); + Assertions.assertEquals("cslyjpk", response.iterator().next().properties().marketplace().subscriptionId()); + Assertions.assertEquals("zyexzn", response.iterator().next().properties().marketplace().offerDetails().publisherId()); - Assertions.assertEquals("vpycanuzbp", + Assertions.assertEquals("lixhnrztfol", response.iterator().next().properties().marketplace().offerDetails().offerId()); - Assertions.assertEquals("kafkuwbcrnwbm", + Assertions.assertEquals("bnxknalaulppg", response.iterator().next().properties().marketplace().offerDetails().planId()); - Assertions.assertEquals("hseyvju", + Assertions.assertEquals("tpnapnyiropuhpig", response.iterator().next().properties().marketplace().offerDetails().planName()); - Assertions.assertEquals("tslhspkdeem", + Assertions.assertEquals("gylgqgitxmedjvcs", response.iterator().next().properties().marketplace().offerDetails().termUnit()); - Assertions.assertEquals("fm", response.iterator().next().properties().marketplace().offerDetails().termId()); - Assertions.assertEquals("ag", response.iterator().next().properties().user().firstName()); - Assertions.assertEquals("vt", response.iterator().next().properties().user().lastName()); - Assertions.assertEquals("elmqk", response.iterator().next().properties().user().emailAddress()); - Assertions.assertEquals("ahvljuaha", response.iterator().next().properties().user().upn()); - Assertions.assertEquals("hcdhmdual", response.iterator().next().properties().user().phoneNumber()); - Assertions.assertEquals("xqpvfadmw", response.iterator().next().properties().user().companyName()); - Assertions.assertEquals("vxpvgomz", - response.iterator().next().properties().partnerProperties().organizationId()); - Assertions.assertEquals("misgwbnb", response.iterator().next().properties().partnerProperties().redirectUrl()); - Assertions.assertEquals("e", response.iterator().next().properties().partnerProperties().organizationName()); + Assertions.assertEquals("n", response.iterator().next().properties().marketplace().offerDetails().termId()); + Assertions.assertEquals("wwncwzzhxgk", response.iterator().next().properties().user().firstName()); + Assertions.assertEquals("rmgucnap", response.iterator().next().properties().user().lastName()); + Assertions.assertEquals("t", response.iterator().next().properties().user().emailAddress()); + Assertions.assertEquals("ellwptfdy", response.iterator().next().properties().user().upn()); + Assertions.assertEquals("fqbuaceopzf", response.iterator().next().properties().user().phoneNumber()); + Assertions.assertEquals("hhuao", response.iterator().next().properties().user().companyName()); + Assertions.assertEquals("eqx", response.iterator().next().properties().partnerProperties().organizationId()); + Assertions.assertEquals("z", response.iterator().next().properties().partnerProperties().redirectUrl()); + Assertions.assertEquals("ahzxctobgbk", + response.iterator().next().properties().partnerProperties().organizationName()); Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, response.iterator().next().identity().type()); } } diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/OrganizationsListMockTests.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/OrganizationsListMockTests.java index db613d41c633..5bde721de66b 100644 --- a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/OrganizationsListMockTests.java +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/OrganizationsListMockTests.java @@ -23,7 +23,7 @@ public final class OrganizationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"marketplace\":{\"subscriptionId\":\"iplrbpbewtghfgb\",\"subscriptionStatus\":\"PendingFulfillmentStart\",\"offerDetails\":{\"publisherId\":\"wxzvlvqhjkb\",\"offerId\":\"gibtnm\",\"planId\":\"iebwwaloayqcgwrt\",\"planName\":\"uzgwyzmhtx\",\"termUnit\":\"gmtsavjcbpwxqpsr\",\"termId\":\"ftguv\"}},\"user\":{\"firstName\":\"iuhprwmdyvxqta\",\"lastName\":\"riwwroy\",\"emailAddress\":\"bexrmcq\",\"upn\":\"ycnojvknmefqsg\",\"phoneNumber\":\"ah\",\"companyName\":\"jyzhpvgq\"},\"provisioningState\":\"Canceled\",\"partnerProperties\":{\"organizationId\":\"xdjzlmwlxk\",\"redirectUrl\":\"gfhzovawjvzunlut\",\"organizationName\":\"nnprn\"}},\"identity\":{\"principalId\":\"eilpjzuaejxdu\",\"tenantId\":\"skzbb\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"waboe\":{\"principalId\":\"veekgpwozuhkfp\",\"clientId\":\"jyofdxluusdtto\"},\"vbxwyjsflhh\":{\"principalId\":\"v\",\"clientId\":\"lns\"},\"jpkiidzyexznelix\":{\"principalId\":\"aln\",\"clientId\":\"xisxyawjoyaqcsl\"},\"aulppggd\":{\"principalId\":\"rzt\",\"clientId\":\"lhbnxkna\"}}},\"location\":\"napnyiropuhpigv\",\"tags\":{\"txmedj\":\"lgqg\",\"lynqwwncwzzh\":\"c\",\"ellwptfdy\":\"gktrmgucnapkte\",\"rhhuaopppcqeqx\":\"pfqbuaceopzf\"},\"id\":\"lzdahzxctobgbkdm\",\"name\":\"izpost\",\"type\":\"grcfb\"}]}"; + = "{\"value\":[{\"properties\":{\"marketplace\":{\"subscriptionId\":\"wpmqt\",\"subscriptionStatus\":\"Suspended\",\"offerDetails\":{\"publisherId\":\"oujmkcjhwqytj\",\"offerId\":\"ybn\",\"planId\":\"jewgdrjerv\",\"planName\":\"enq\",\"termUnit\":\"hin\",\"termId\":\"ygmi\"}},\"user\":{\"firstName\":\"thnzd\",\"lastName\":\"dslgnayqigynduh\",\"emailAddress\":\"vhqlkthumaqo\",\"upn\":\"gycdu\",\"phoneNumber\":\"r\",\"companyName\":\"ccymvaolpsslql\"},\"provisioningState\":\"Succeeded\",\"partnerProperties\":{\"organizationId\":\"bbglzpswiydmc\",\"redirectUrl\":\"hzdxssadbzm\",\"organizationName\":\"vdfznudaodvxzb\"}},\"identity\":{\"principalId\":\"lylpstdb\",\"tenantId\":\"xsrz\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"evfiwjmygt\":{\"principalId\":\"rsc\",\"clientId\":\"t\"}}},\"location\":\"slswtm\",\"tags\":{\"yqsemwa\":\"iofz\",\"tshhszhedp\":\"n\",\"k\":\"vwiwubmwmbesld\"},\"id\":\"wtppjflcxogaoko\",\"name\":\"z\",\"type\":\"nsikvmkqzeqqkdl\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -34,33 +34,30 @@ public void testList() throws Exception { PagedIterable response = manager.organizations().list(com.azure.core.util.Context.NONE); - Assertions.assertEquals("napnyiropuhpigv", response.iterator().next().location()); - Assertions.assertEquals("lgqg", response.iterator().next().tags().get("txmedj")); - Assertions.assertEquals("iplrbpbewtghfgb", - response.iterator().next().properties().marketplace().subscriptionId()); - Assertions.assertEquals("wxzvlvqhjkb", + Assertions.assertEquals("slswtm", response.iterator().next().location()); + Assertions.assertEquals("iofz", response.iterator().next().tags().get("yqsemwa")); + Assertions.assertEquals("wpmqt", response.iterator().next().properties().marketplace().subscriptionId()); + Assertions.assertEquals("oujmkcjhwqytj", response.iterator().next().properties().marketplace().offerDetails().publisherId()); - Assertions.assertEquals("gibtnm", - response.iterator().next().properties().marketplace().offerDetails().offerId()); - Assertions.assertEquals("iebwwaloayqcgwrt", + Assertions.assertEquals("ybn", response.iterator().next().properties().marketplace().offerDetails().offerId()); + Assertions.assertEquals("jewgdrjerv", response.iterator().next().properties().marketplace().offerDetails().planId()); - Assertions.assertEquals("uzgwyzmhtx", - response.iterator().next().properties().marketplace().offerDetails().planName()); - Assertions.assertEquals("gmtsavjcbpwxqpsr", - response.iterator().next().properties().marketplace().offerDetails().termUnit()); - Assertions.assertEquals("ftguv", response.iterator().next().properties().marketplace().offerDetails().termId()); - Assertions.assertEquals("iuhprwmdyvxqta", response.iterator().next().properties().user().firstName()); - Assertions.assertEquals("riwwroy", response.iterator().next().properties().user().lastName()); - Assertions.assertEquals("bexrmcq", response.iterator().next().properties().user().emailAddress()); - Assertions.assertEquals("ycnojvknmefqsg", response.iterator().next().properties().user().upn()); - Assertions.assertEquals("ah", response.iterator().next().properties().user().phoneNumber()); - Assertions.assertEquals("jyzhpvgq", response.iterator().next().properties().user().companyName()); - Assertions.assertEquals("xdjzlmwlxk", + Assertions.assertEquals("enq", response.iterator().next().properties().marketplace().offerDetails().planName()); + Assertions.assertEquals("hin", response.iterator().next().properties().marketplace().offerDetails().termUnit()); + Assertions.assertEquals("ygmi", response.iterator().next().properties().marketplace().offerDetails().termId()); + Assertions.assertEquals("thnzd", response.iterator().next().properties().user().firstName()); + Assertions.assertEquals("dslgnayqigynduh", response.iterator().next().properties().user().lastName()); + Assertions.assertEquals("vhqlkthumaqo", response.iterator().next().properties().user().emailAddress()); + Assertions.assertEquals("gycdu", response.iterator().next().properties().user().upn()); + Assertions.assertEquals("r", response.iterator().next().properties().user().phoneNumber()); + Assertions.assertEquals("ccymvaolpsslql", response.iterator().next().properties().user().companyName()); + Assertions.assertEquals("bbglzpswiydmc", response.iterator().next().properties().partnerProperties().organizationId()); - Assertions.assertEquals("gfhzovawjvzunlut", + Assertions.assertEquals("hzdxssadbzm", response.iterator().next().properties().partnerProperties().redirectUrl()); - Assertions.assertEquals("nnprn", + Assertions.assertEquals("vdfznudaodvxzb", response.iterator().next().properties().partnerProperties().organizationName()); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, response.iterator().next().identity().type()); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, + response.iterator().next().identity().type()); } } diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectInnerTests.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectInnerTests.java new file mode 100644 index 000000000000..47e019052720 --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectInnerTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mongodbatlas.fluent.models.ProjectInner; +import com.azure.resourcemanager.mongodbatlas.models.ProjectProperties; + +public final class ProjectInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ProjectInner model = BinaryData.fromString( + "{\"properties\":{\"projectId\":\"bh\",\"projectName\":\"nlankxmyskpb\",\"organizationId\":\"nbtkcxywnytnr\",\"clusterCount\":3502767194143566423,\"provisioningState\":\"Succeeded\"},\"id\":\"ybyxc\",\"name\":\"fclhaaxdbabphlwr\",\"type\":\"lfktsths\"}") + .toObject(ProjectInner.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ProjectInner model = new ProjectInner().withProperties(new ProjectProperties()); + model = BinaryData.fromObject(model).toObject(ProjectInner.class); + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectLimitStatusTests.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectLimitStatusTests.java new file mode 100644 index 000000000000..f08488b703c7 --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectLimitStatusTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mongodbatlas.models.ClusterTier; +import com.azure.resourcemanager.mongodbatlas.models.ProjectLimitStatus; +import org.junit.jupiter.api.Assertions; + +public final class ProjectLimitStatusTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ProjectLimitStatus model = BinaryData + .fromString("{\"type\":\"M30\",\"maximum\":827449551,\"current\":1610345619,\"isReached\":true}") + .toObject(ProjectLimitStatus.class); + Assertions.assertEquals(ClusterTier.M30, model.type()); + Assertions.assertEquals(827449551, model.maximum()); + Assertions.assertEquals(1610345619, model.current()); + Assertions.assertTrue(model.isReached()); + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectListResultTests.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectListResultTests.java new file mode 100644 index 000000000000..5670bd8b1c8c --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectListResultTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mongodbatlas.implementation.models.ProjectListResult; +import org.junit.jupiter.api.Assertions; + +public final class ProjectListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ProjectListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"projectId\":\"yoxa\",\"projectName\":\"dkzjancuxrh\",\"organizationId\":\"bavxbniwdjswzt\",\"clusterCount\":2549290131288925367,\"provisioningState\":\"Canceled\"},\"id\":\"ytxhp\",\"name\":\"xbzpfzab\",\"type\":\"lcuhxwtctyqiklb\"},{\"properties\":{\"projectId\":\"plwzbhvgyugu\",\"projectName\":\"vmkfssxqu\",\"organizationId\":\"fpl\",\"clusterCount\":5850785611921356044,\"provisioningState\":\"Failed\"},\"id\":\"jzkdeslpvlopwi\",\"name\":\"ighxpk\",\"type\":\"wzbaiue\"},{\"properties\":{\"projectId\":\"umnyqu\",\"projectName\":\"deoj\",\"organizationId\":\"bckhsmtxpsi\",\"clusterCount\":8592172469751933163,\"provisioningState\":\"Succeeded\"},\"id\":\"esap\",\"name\":\"krdqmh\",\"type\":\"jdhtldwkyzxu\"}],\"nextLink\":\"kn\"}") + .toObject(ProjectListResult.class); + Assertions.assertEquals("kn", model.nextLink()); + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectPropertiesTests.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectPropertiesTests.java new file mode 100644 index 000000000000..678b95e34491 --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectPropertiesTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mongodbatlas.models.ProjectProperties; + +public final class ProjectPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ProjectProperties model = BinaryData.fromString( + "{\"projectId\":\"ocmnyyazttbtwwrq\",\"projectName\":\"edckzywbiexzfey\",\"organizationId\":\"axibxujw\",\"clusterCount\":6825122128576329936,\"provisioningState\":\"Failed\"}") + .toObject(ProjectProperties.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ProjectProperties model = new ProjectProperties(); + model = BinaryData.fromObject(model).toObject(ProjectProperties.class); + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsCreateOrUpdateMockTests.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsCreateOrUpdateMockTests.java new file mode 100644 index 000000000000..b97e907df2cf --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsCreateOrUpdateMockTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager; +import com.azure.resourcemanager.mongodbatlas.models.Project; +import com.azure.resourcemanager.mongodbatlas.models.ProjectProperties; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ProjectsCreateOrUpdateMockTests { + @Test + public void testCreateOrUpdate() throws Exception { + String responseStr + = "{\"properties\":{\"projectId\":\"zjosp\",\"projectName\":\"oulpjrv\",\"organizationId\":\"glrvimjwosytxi\",\"clusterCount\":3589572009865624969,\"provisioningState\":\"Succeeded\"},\"id\":\"tq\",\"name\":\"miekkezzikhlyfjh\",\"type\":\"gqggebdunygae\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MongoDBAtlasManager manager = MongoDBAtlasManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Project response = manager.projects() + .define("wi") + .withExistingOrganization("pkukghi", "dblx") + .withProperties(new ProjectProperties()) + .create(); + + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsGetWithResponseMockTests.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsGetWithResponseMockTests.java new file mode 100644 index 000000000000..8fd086d666e1 --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsGetWithResponseMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager; +import com.azure.resourcemanager.mongodbatlas.models.Project; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ProjectsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"projectId\":\"kvpuvksgplsaknyn\",\"projectName\":\"ynl\",\"organizationId\":\"huopxodlqiynto\",\"clusterCount\":6097205922586802941,\"provisioningState\":\"Succeeded\"},\"id\":\"sjswsrms\",\"name\":\"yzrpzbchckqqzq\",\"type\":\"ox\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MongoDBAtlasManager manager = MongoDBAtlasManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Project response = manager.projects() + .getWithResponse("e", "iipfpubj", "bwwift", com.azure.core.util.Context.NONE) + .getValue(); + + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsListClusterTierRegionsWithResponseMockTests.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsListClusterTierRegionsWithResponseMockTests.java new file mode 100644 index 000000000000..7b6fe56d3d3d --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsListClusterTierRegionsWithResponseMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager; +import com.azure.resourcemanager.mongodbatlas.models.RegionsByTierResponse; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ProjectsListClusterTierRegionsWithResponseMockTests { + @Test + public void testListClusterTierRegionsWithResponse() throws Exception { + String responseStr + = "{\"organizationId\":\"yrnxxmueedn\",\"projectId\":\"rdvstkwqqtch\",\"regionsByTier\":[{\"tier\":\"M10\",\"regions\":[\"fmtdaaygdvwvgp\",\"ohgwxrtfudxepxg\",\"qagvrvm\"]}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MongoDBAtlasManager manager = MongoDBAtlasManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + RegionsByTierResponse response = manager.projects() + .listClusterTierRegionsWithResponse("z", "v", "vvcnayr", com.azure.core.util.Context.NONE) + .getValue(); + + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsListMockTests.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsListMockTests.java new file mode 100644 index 000000000000..8b7bb6330dd8 --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsListMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager; +import com.azure.resourcemanager.mongodbatlas.models.Project; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ProjectsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"projectId\":\"ynpcdpumnzgmwznm\",\"projectName\":\"iknsorgjh\",\"organizationId\":\"ldtlwwr\",\"clusterCount\":5164469784309037154,\"provisioningState\":\"Failed\"},\"id\":\"vokotllxdyh\",\"name\":\"syocogjltdtbnnha\",\"type\":\"oocrkvcikhnv\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MongoDBAtlasManager manager = MongoDBAtlasManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.projects().list("ysuiizynkedya", "rwyhqmibzyhwitsm", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsTierLimitReachedWithResponseMockTests.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsTierLimitReachedWithResponseMockTests.java new file mode 100644 index 000000000000..73e76b95c13c --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/ProjectsTierLimitReachedWithResponseMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.mongodbatlas.MongoDBAtlasManager; +import com.azure.resourcemanager.mongodbatlas.models.TierLimitReachedResponse; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ProjectsTierLimitReachedWithResponseMockTests { + @Test + public void testTierLimitReachedWithResponse() throws Exception { + String responseStr + = "{\"limits\":[{\"type\":\"FLEX\",\"maximum\":1280357892,\"current\":1349569778,\"isReached\":true},{\"type\":\"FLEX\",\"maximum\":908050565,\"current\":1750624466,\"isReached\":true},{\"type\":\"M30\",\"maximum\":1198418421,\"current\":834190026,\"isReached\":true}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MongoDBAtlasManager manager = MongoDBAtlasManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + TierLimitReachedResponse response = manager.projects() + .tierLimitReachedWithResponse("amqgxqquezikyw", "gxk", "lla", com.azure.core.util.Context.NONE) + .getValue(); + + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/RegionsByTierResponseInnerTests.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/RegionsByTierResponseInnerTests.java new file mode 100644 index 000000000000..39fd48cf7de5 --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/RegionsByTierResponseInnerTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mongodbatlas.fluent.models.RegionsByTierResponseInner; + +public final class RegionsByTierResponseInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RegionsByTierResponseInner model = BinaryData.fromString( + "{\"organizationId\":\"togt\",\"projectId\":\"rupqsxvnmicy\",\"regionsByTier\":[{\"tier\":\"M10\",\"regions\":[\"o\",\"eil\",\"vnotyfjfcnj\",\"k\"]}]}") + .toObject(RegionsByTierResponseInner.class); + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/TierLimitReachedResponseInnerTests.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/TierLimitReachedResponseInnerTests.java new file mode 100644 index 000000000000..5e181303612e --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/TierLimitReachedResponseInnerTests.java @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mongodbatlas.fluent.models.TierLimitReachedResponseInner; + +public final class TierLimitReachedResponseInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TierLimitReachedResponseInner model = BinaryData + .fromString( + "{\"limits\":[{\"type\":\"FLEX\",\"maximum\":355088461,\"current\":1981561277,\"isReached\":true}]}") + .toObject(TierLimitReachedResponseInner.class); + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/TierRegionsTests.java b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/TierRegionsTests.java new file mode 100644 index 000000000000..20742ee9912f --- /dev/null +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/src/test/java/com/azure/resourcemanager/mongodbatlas/generated/TierRegionsTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.mongodbatlas.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.mongodbatlas.models.ClusterTier; +import com.azure.resourcemanager.mongodbatlas.models.TierRegions; +import org.junit.jupiter.api.Assertions; + +public final class TierRegionsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TierRegions model + = BinaryData.fromString("{\"tier\":\"FLEX\",\"regions\":[\"dhbt\"]}").toObject(TierRegions.class); + Assertions.assertEquals(ClusterTier.FLEX, model.tier()); + Assertions.assertEquals("dhbt", model.regions().get(0)); + } +} diff --git a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/tsp-location.yaml b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/tsp-location.yaml index 956b702e794b..a2053971da9a 100644 --- a/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/tsp-location.yaml +++ b/sdk/mongodbatlas/azure-resourcemanager-mongodbatlas/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/liftrmongodb/MongoDB.Atlas.Management -commit: 6267b64842af3d744c5b092a3f3beef49729ad6d +commit: 18ebae7ea8f6aefd83268aacdb1f480b24842726 repo: Azure/azure-rest-api-specs additionalDirectories: