Skip to content

Commit

Permalink
CodeGen from PR 31071 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 9ea124b3fc2141fdf22285c78d688ea6e1b29eaf into a7c4ee8a7f36ff5e653cf1d0b0a02fad7735c2c0
  • Loading branch information
SDKAuto committed Nov 15, 2024
1 parent 86971ec commit 5cd42f3
Show file tree
Hide file tree
Showing 58 changed files with 476 additions and 193 deletions.
18 changes: 14 additions & 4 deletions sdk/mongocluster/azure-resourcemanager-mongocluster/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
# Release History

## 1.1.0-beta.1 (Unreleased)
## 1.0.0-beta.1 (2024-11-15)

- Azure Resource Manager Mongo Cluster client library for Java. This package contains Microsoft Azure SDK for Mongo Cluster Management SDK. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure Cosmos DB for MongoDB vCore resources including clusters and firewall rules. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).

### Features Added

### Breaking Changes
* `models.DataApiMode` was added

* `models.DataApiProperties` was added

### Bugs Fixed
#### `models.MongoClusterProperties` was modified

* `withDataApi(models.DataApiProperties)` was added
* `dataApi()` was added

#### `models.MongoClusterUpdateProperties` was modified

### Other Changes
* `dataApi()` was added
* `withDataApi(models.DataApiProperties)` was added

## 1.0.0 (2024-09-25)

Expand Down
21 changes: 10 additions & 11 deletions sdk/mongocluster/azure-resourcemanager-mongocluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Various documentation is available to help you get started
<dependency>
<groupId>com.azure.resourcemanager</groupId>
<artifactId>azure-resourcemanager-mongocluster</artifactId>
<version>1.0.0</version>
<version>1.1.0-beta.1</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down Expand Up @@ -75,16 +75,15 @@ mongoCluster = mongoClusterManager.mongoClusters()
.define(clusterName)
.withRegion(REGION)
.withExistingResourceGroup(resourceGroupName)
.withProperties(
new MongoClusterProperties()
.withAdministrator(new AdministratorProperties().withUserName(loginUser).withPassword(loginPwd))
.withPublicNetworkAccess(PublicNetworkAccess.ENABLED)
.withStorage(new StorageProperties().withSizeGb(128L))
.withCompute(new ComputeProperties().withTier("M30"))
.withHighAvailability(new HighAvailabilityProperties().withTargetMode(HighAvailabilityMode.DISABLED))
.withSharding(new ShardingProperties().withShardCount(1))
.withServerVersion("7.0")
)
.withProperties(new MongoClusterProperties()
.withAdministrator(new AdministratorProperties().withUserName(loginUser).withPassword(loginPwd))
.withPublicNetworkAccess(PublicNetworkAccess.ENABLED)
.withStorage(new StorageProperties().withSizeGb(128L))
.withCompute(new ComputeProperties().withTier("M30"))
.withHighAvailability(
new HighAvailabilityProperties().withTargetMode(HighAvailabilityMode.DISABLED))
.withSharding(new ShardingProperties().withShardCount(1))
.withServerVersion("7.0"))
.create();
```
[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/mongocluster/azure-resourcemanager-mongocluster/SAMPLE.md)
Expand Down
73 changes: 47 additions & 26 deletions sdk/mongocluster/azure-resourcemanager-mongocluster/SAMPLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import com.azure.resourcemanager.mongocluster.models.FirewallRuleProperties;
*/
public final class FirewallRulesCreateOrUpdateSamples {
/*
* x-ms-original-file: 2024-07-01/MongoClusters_FirewallRuleCreate.json
* x-ms-original-file: 2024-10-01-preview/MongoClusters_FirewallRuleCreate.json
*/
/**
* Sample code: Creates a firewall rule on a Mongo Cluster resource.
Expand All @@ -75,7 +75,7 @@ public final class FirewallRulesCreateOrUpdateSamples {
*/
public final class FirewallRulesDeleteSamples {
/*
* x-ms-original-file: 2024-07-01/MongoClusters_FirewallRuleDelete.json
* x-ms-original-file: 2024-10-01-preview/MongoClusters_FirewallRuleDelete.json
*/
/**
* Sample code: Deletes a firewall rule on a Mongo Cluster resource.
Expand All @@ -97,7 +97,7 @@ public final class FirewallRulesDeleteSamples {
*/
public final class FirewallRulesGetSamples {
/*
* x-ms-original-file: 2024-07-01/MongoClusters_FirewallRuleGet.json
* x-ms-original-file: 2024-10-01-preview/MongoClusters_FirewallRuleGet.json
*/
/**
* Sample code: Gets a firewall rule on a Mongo Cluster resource.
Expand All @@ -120,7 +120,7 @@ public final class FirewallRulesGetSamples {
*/
public final class FirewallRulesListByMongoClusterSamples {
/*
* x-ms-original-file: 2024-07-01/MongoClusters_FirewallRuleList.json
* x-ms-original-file: 2024-10-01-preview/MongoClusters_FirewallRuleList.json
*/
/**
* Sample code: List the firewall rules on a Mongo Cluster resource.
Expand All @@ -144,7 +144,7 @@ import com.azure.resourcemanager.mongocluster.models.CheckNameAvailabilityReques
*/
public final class MongoClustersCheckNameAvailabilitySamples {
/*
* x-ms-original-file: 2024-07-01/MongoClusters_NameAvailability.json
* x-ms-original-file: 2024-10-01-preview/MongoClusters_NameAvailability.json
*/
/**
* Sample code: Checks and confirms the Mongo Cluster name is availability for use.
Expand All @@ -159,7 +159,7 @@ public final class MongoClustersCheckNameAvailabilitySamples {
}

/*
* x-ms-original-file: 2024-07-01/MongoClusters_NameAvailability_AlreadyExists.json
* x-ms-original-file: 2024-10-01-preview/MongoClusters_NameAvailability_AlreadyExists.json
*/
/**
* Sample code: Checks and returns that the Mongo Cluster name is already in-use.
Expand Down Expand Up @@ -197,7 +197,7 @@ import java.time.OffsetDateTime;
*/
public final class MongoClustersCreateOrUpdateSamples {
/*
* x-ms-original-file: 2024-07-01/MongoClusters_CreateGeoReplica.json
* x-ms-original-file: 2024-10-01-preview/MongoClusters_CreateGeoReplica.json
*/
/**
* Sample code: Creates a replica Mongo Cluster resource from a source resource.
Expand All @@ -218,7 +218,7 @@ public final class MongoClustersCreateOrUpdateSamples {
}

/*
* x-ms-original-file: 2024-07-01/MongoClusters_CreatePITR.json
* x-ms-original-file: 2024-10-01-preview/MongoClusters_CreatePITR.json
*/
/**
* Sample code: Creates a Mongo Cluster resource from a point in time restore.
Expand All @@ -240,7 +240,7 @@ public final class MongoClustersCreateOrUpdateSamples {
}

/*
* x-ms-original-file: 2024-07-01/MongoClusters_Create.json
* x-ms-original-file: 2024-10-01-preview/MongoClusters_Create.json
*/
/**
* Sample code: Creates a new Mongo Cluster resource.
Expand Down Expand Up @@ -274,7 +274,7 @@ public final class MongoClustersCreateOrUpdateSamples {
*/
public final class MongoClustersDeleteSamples {
/*
* x-ms-original-file: 2024-07-01/MongoClusters_Delete.json
* x-ms-original-file: 2024-10-01-preview/MongoClusters_Delete.json
*/
/**
* Sample code: Deletes a Mongo Cluster resource.
Expand All @@ -296,7 +296,7 @@ public final class MongoClustersDeleteSamples {
*/
public final class MongoClustersGetByResourceGroupSamples {
/*
* x-ms-original-file: 2024-07-01/MongoClusters_Get.json
* x-ms-original-file: 2024-10-01-preview/MongoClusters_Get.json
*/
/**
* Sample code: Gets a Mongo Cluster resource.
Expand All @@ -318,7 +318,7 @@ public final class MongoClustersGetByResourceGroupSamples {
*/
public final class MongoClustersListSamples {
/*
* x-ms-original-file: 2024-07-01/MongoClusters_List.json
* x-ms-original-file: 2024-10-01-preview/MongoClusters_List.json
*/
/**
* Sample code: Lists the Mongo Cluster resources in a subscription.
Expand All @@ -340,7 +340,7 @@ public final class MongoClustersListSamples {
*/
public final class MongoClustersListByResourceGroupSamples {
/*
* x-ms-original-file: 2024-07-01/MongoClusters_ListByResourceGroup.json
* x-ms-original-file: 2024-10-01-preview/MongoClusters_ListByResourceGroup.json
*/
/**
* Sample code: Lists the Mongo Cluster resources in a resource group.
Expand All @@ -362,7 +362,7 @@ public final class MongoClustersListByResourceGroupSamples {
*/
public final class MongoClustersListConnectionStringsSamples {
/*
* x-ms-original-file: 2024-07-01/MongoClusters_ListConnectionStrings.json
* x-ms-original-file: 2024-10-01-preview/MongoClusters_ListConnectionStrings.json
*/
/**
* Sample code: List the available connection strings for the Mongo Cluster resource.
Expand All @@ -389,7 +389,7 @@ import com.azure.resourcemanager.mongocluster.models.PromoteReplicaRequest;
*/
public final class MongoClustersPromoteSamples {
/*
* x-ms-original-file: 2024-07-01/MongoClusters_ForcePromoteReplica.json
* x-ms-original-file: 2024-10-01-preview/MongoClusters_ForcePromoteReplica.json
*/
/**
* Sample code: Promotes a replica Mongo Cluster resource to a primary role.
Expand All @@ -411,6 +411,8 @@ public final class MongoClustersPromoteSamples {
```java
import com.azure.resourcemanager.mongocluster.models.AdministratorProperties;
import com.azure.resourcemanager.mongocluster.models.ComputeProperties;
import com.azure.resourcemanager.mongocluster.models.DataApiMode;
import com.azure.resourcemanager.mongocluster.models.DataApiProperties;
import com.azure.resourcemanager.mongocluster.models.HighAvailabilityMode;
import com.azure.resourcemanager.mongocluster.models.HighAvailabilityProperties;
import com.azure.resourcemanager.mongocluster.models.MongoCluster;
Expand All @@ -425,7 +427,7 @@ import java.util.Arrays;
*/
public final class MongoClustersUpdateSamples {
/*
* x-ms-original-file: 2024-07-01/MongoClusters_ResetPassword.json
* x-ms-original-file: 2024-10-01-preview/MongoClusters_ResetPassword.json
*/
/**
* Sample code: Resets the administrator login password.
Expand All @@ -444,7 +446,7 @@ public final class MongoClustersUpdateSamples {
}

/*
* x-ms-original-file: 2024-07-01/MongoClusters_PatchDiskSize.json
* x-ms-original-file: 2024-10-01-preview/MongoClusters_PatchDiskSize.json
*/
/**
* Sample code: Updates the disk size on a Mongo Cluster resource.
Expand All @@ -462,7 +464,7 @@ public final class MongoClustersUpdateSamples {
}

/*
* x-ms-original-file: 2024-07-01/MongoClusters_PatchPrivateNetworkAccess.json
* x-ms-original-file: 2024-10-01-preview/MongoClusters_PatchPrivateNetworkAccess.json
*/
/**
* Sample code: Disables public network access on a Mongo Cluster resource with a private endpoint connection.
Expand All @@ -480,7 +482,26 @@ public final class MongoClustersUpdateSamples {
}

/*
* x-ms-original-file: 2024-07-01/MongoClusters_Update.json
* x-ms-original-file: 2024-10-01-preview/MongoClusters_PatchDataApi.json
*/
/**
* Sample code: Enables data API on a mongo cluster resource.
*
* @param manager Entry point to MongoClusterManager.
*/
public static void
enablesDataAPIOnAMongoClusterResource(com.azure.resourcemanager.mongocluster.MongoClusterManager manager) {
MongoCluster resource = manager.mongoClusters()
.getByResourceGroupWithResponse("TestResourceGroup", "myMongoCluster", com.azure.core.util.Context.NONE)
.getValue();
resource.update()
.withProperties(
new MongoClusterUpdateProperties().withDataApi(new DataApiProperties().withMode(DataApiMode.ENABLED)))
.apply();
}

/*
* x-ms-original-file: 2024-10-01-preview/MongoClusters_Update.json
*/
/**
* Sample code: Updates a Mongo Cluster resource.
Expand Down Expand Up @@ -515,7 +536,7 @@ public final class MongoClustersUpdateSamples {
*/
public final class OperationsListSamples {
/*
* x-ms-original-file: 2024-07-01/Operations_List.json
* x-ms-original-file: 2024-10-01-preview/Operations_List.json
*/
/**
* Sample code: Operations_List.
Expand All @@ -540,7 +561,7 @@ import com.azure.resourcemanager.mongocluster.models.PrivateLinkServiceConnectio
*/
public final class PrivateEndpointConnectionsCreateSamples {
/*
* x-ms-original-file: 2024-07-01/MongoClusters_PrivateEndpointConnectionPut.json
* x-ms-original-file: 2024-10-01-preview/MongoClusters_PrivateEndpointConnectionPut.json
*/
/**
* Sample code: Approves a private endpoint connection on a Mongo Cluster resource.
Expand Down Expand Up @@ -568,7 +589,7 @@ public final class PrivateEndpointConnectionsCreateSamples {
*/
public final class PrivateEndpointConnectionsDeleteSamples {
/*
* x-ms-original-file: 2024-07-01/MongoClusters_PrivateEndpointConnectionDelete.json
* x-ms-original-file: 2024-10-01-preview/MongoClusters_PrivateEndpointConnectionDelete.json
*/
/**
* Sample code: Delete a private endpoint connection on a Mongo Cluster resource.
Expand All @@ -592,7 +613,7 @@ public final class PrivateEndpointConnectionsDeleteSamples {
*/
public final class PrivateEndpointConnectionsGetSamples {
/*
* x-ms-original-file: 2024-07-01/MongoClusters_PrivateEndpointConnectionGet.json
* x-ms-original-file: 2024-10-01-preview/MongoClusters_PrivateEndpointConnectionGet.json
*/
/**
* Sample code: Get a private endpoint connection on a Mongo Cluster resource.
Expand All @@ -616,7 +637,7 @@ public final class PrivateEndpointConnectionsGetSamples {
*/
public final class PrivateEndpointConnectionsListByMongoClusterSamples {
/*
* x-ms-original-file: 2024-07-01/MongoClusters_PrivateEndpointConnectionList.json
* x-ms-original-file: 2024-10-01-preview/MongoClusters_PrivateEndpointConnectionList.json
*/
/**
* Sample code: Lists the private endpoint connection resources on a Mongo Cluster resource.
Expand All @@ -639,7 +660,7 @@ public final class PrivateEndpointConnectionsListByMongoClusterSamples {
*/
public final class PrivateLinksListByMongoClusterSamples {
/*
* x-ms-original-file: 2024-07-01/MongoClusters_PrivateLinkResourceList.json
* x-ms-original-file: 2024-10-01-preview/MongoClusters_PrivateLinkResourceList.json
*/
/**
* Sample code: Lists the private link resources available on a Mongo Cluster resource.
Expand All @@ -661,7 +682,7 @@ public final class PrivateLinksListByMongoClusterSamples {
*/
public final class ReplicasListByParentSamples {
/*
* x-ms-original-file: 2024-07-01/MongoClusters_ReplicaList.json
* x-ms-original-file: 2024-10-01-preview/MongoClusters_ReplicaList.json
*/
/**
* Sample code: List the replicas linked to a Mongo Cluster resource.
Expand Down
5 changes: 3 additions & 2 deletions sdk/mongocluster/azure-resourcemanager-mongocluster/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--
~ Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License.
Code generated by Microsoft (R) TypeSpec Code Generator.
~ Licensed under the MIT License.
~ Code generated by Microsoft (R) TypeSpec Code Generator.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
Expand Down Expand Up @@ -46,6 +46,7 @@ Code generated by Microsoft (R) TypeSpec Code Generator.
<jacoco.min.linecoverage>0</jacoco.min.linecoverage>
<jacoco.min.branchcoverage>0</jacoco.min.branchcoverage>
<revapi.skip>true</revapi.skip>
<spotless.skip>false</spotless.skip>
</properties>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public ReplicasClient getReplicas() {
this.defaultPollInterval = defaultPollInterval;
this.endpoint = endpoint;
this.subscriptionId = subscriptionId;
this.apiVersion = "2024-07-01";
this.apiVersion = "2024-10-01-preview";
this.operations = new OperationsClientImpl(this);
this.mongoClusters = new MongoClustersClientImpl(this);
this.firewallRules = new FirewallRulesClientImpl(this);
Expand Down
Loading

0 comments on commit 5cd42f3

Please sign in to comment.