diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/api/Azure.ResourceManager.MongoCluster.net8.0.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/api/Azure.ResourceManager.MongoCluster.net8.0.cs index a644bbd20a8d..300b3b99b6a9 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/api/Azure.ResourceManager.MongoCluster.net8.0.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/api/Azure.ResourceManager.MongoCluster.net8.0.cs @@ -19,6 +19,7 @@ namespace Azure.ResourceManager.MongoCluster [System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(Azure.ResourceManager.MongoCluster.Models.MongoClusterRestoreContent))] [System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(Azure.ResourceManager.MongoCluster.Models.MongoClusterUpdateProperties))] [System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(Azure.ResourceManager.MongoCluster.Models.PromoteReplicaContent))] + [System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(Azure.ResourceManager.MongoCluster.Models.StorageProperties))] [System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(Azure.ResourceManager.MongoCluster.MongoClusterData))] [System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(Azure.ResourceManager.MongoCluster.MongoClusterFirewallRuleData))] [System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(Azure.ResourceManager.MongoCluster.MongoClusterFirewallRuleResource))] @@ -51,6 +52,7 @@ protected MongoClusterCollection() { } public partial class MongoClusterData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public MongoClusterData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.MongoCluster.Models.MongoClusterProperties Properties { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.MongoClusterData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -71,6 +73,7 @@ public static partial class MongoClusterExtensions public static Azure.ResourceManager.MongoCluster.MongoClusterCollection GetMongoClusters(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetMongoClusters(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetMongoClustersAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.MongoCluster.UserResource GetUserResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } } public partial class MongoClusterFirewallRuleCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { @@ -191,6 +194,9 @@ protected MongoClusterResource() { } public virtual Azure.AsyncPageable GetPrivateLinksAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetReplicasByParent(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetReplicasByParentAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetUser(string userName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetUserAsync(string userName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.MongoCluster.UserCollection GetUsers() { throw null; } public virtual Azure.ResourceManager.ArmOperation Promote(Azure.WaitUntil waitUntil, Azure.ResourceManager.MongoCluster.Models.PromoteReplicaContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task PromoteAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MongoCluster.Models.PromoteReplicaContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -205,6 +211,53 @@ protected MongoClusterResource() { } public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.MongoCluster.Models.MongoClusterPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MongoCluster.Models.MongoClusterPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } + public partial class UserCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected UserCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string userName, Azure.ResourceManager.MongoCluster.UserData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string userName, Azure.ResourceManager.MongoCluster.UserData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string userName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string userName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string userName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string userName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string userName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string userName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class UserData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public UserData() { } + public Azure.ResourceManager.MongoCluster.Models.UserProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MongoCluster.UserData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MongoCluster.UserData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class UserResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected UserResource() { } + public virtual Azure.ResourceManager.MongoCluster.UserData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string mongoClusterName, string userName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.MongoCluster.UserData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MongoCluster.UserData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.MongoCluster.UserData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MongoCluster.UserData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } } namespace Azure.ResourceManager.MongoCluster.Mocking { @@ -214,6 +267,7 @@ protected MockableMongoClusterArmClient() { } public virtual Azure.ResourceManager.MongoCluster.MongoClusterFirewallRuleResource GetMongoClusterFirewallRuleResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.MongoCluster.MongoClusterPrivateEndpointConnectionResource GetMongoClusterPrivateEndpointConnectionResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.MongoCluster.MongoClusterResource GetMongoClusterResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.MongoCluster.UserResource GetUserResource(Azure.Core.ResourceIdentifier id) { throw null; } } public partial class MockableMongoClusterResourceGroupResource : Azure.ResourceManager.ArmResource { @@ -237,7 +291,7 @@ public static partial class ArmMongoClusterModelFactory { public static Azure.ResourceManager.MongoCluster.Models.MongoClusterConnectionString MongoClusterConnectionString(string uri = null, string description = null, string name = null) { throw null; } public static Azure.ResourceManager.MongoCluster.Models.MongoClusterConnectionStringsResult MongoClusterConnectionStringsResult(System.Collections.Generic.IEnumerable connectionStrings = null) { throw null; } - public static Azure.ResourceManager.MongoCluster.MongoClusterData MongoClusterData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.MongoCluster.Models.MongoClusterProperties properties = null) { throw null; } + public static Azure.ResourceManager.MongoCluster.MongoClusterData MongoClusterData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.MongoCluster.Models.MongoClusterProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } public static Azure.ResourceManager.MongoCluster.MongoClusterFirewallRuleData MongoClusterFirewallRuleData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterFirewallRuleProperties properties = null) { throw null; } public static Azure.ResourceManager.MongoCluster.Models.MongoClusterFirewallRuleProperties MongoClusterFirewallRuleProperties(Azure.ResourceManager.MongoCluster.Models.MongoClusterProvisioningState? provisioningState = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterProvisioningState?), string startIPAddress = null, string endIPAddress = null) { throw null; } public static Azure.ResourceManager.MongoCluster.Models.MongoClusterNameAvailabilityResult MongoClusterNameAvailabilityResult(bool? isNameAvailable = default(bool?), Azure.ResourceManager.MongoCluster.Models.MongoClusterNameUnavailableReason? reason = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterNameUnavailableReason?), string message = null) { throw null; } @@ -246,10 +300,112 @@ public static partial class ArmMongoClusterModelFactory public static Azure.ResourceManager.MongoCluster.MongoClusterPrivateEndpointConnectionResourceData MongoClusterPrivateEndpointConnectionResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterPrivateEndpointConnectionProperties properties = null) { throw null; } public static Azure.ResourceManager.MongoCluster.Models.MongoClusterPrivateLinkResourceData MongoClusterPrivateLinkResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterPrivateLinkResourceProperties properties = null) { throw null; } public static Azure.ResourceManager.MongoCluster.Models.MongoClusterPrivateLinkResourceProperties MongoClusterPrivateLinkResourceProperties(string groupId = null, System.Collections.Generic.IEnumerable requiredMembers = null, System.Collections.Generic.IEnumerable requiredZoneNames = null) { throw null; } - public static Azure.ResourceManager.MongoCluster.Models.MongoClusterProperties MongoClusterProperties(Azure.ResourceManager.MongoCluster.Models.MongoClusterCreateMode? createMode = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterCreateMode?), Azure.ResourceManager.MongoCluster.Models.MongoClusterRestoreContent restoreParameters = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicaContent replicaParameters = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterAdministratorProperties administrator = null, string serverVersion = null, string connectionString = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterProvisioningState? provisioningState = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterProvisioningState?), Azure.ResourceManager.MongoCluster.Models.MongoClusterStatus? clusterStatus = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterStatus?), Azure.ResourceManager.MongoCluster.Models.MongoClusterPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterPublicNetworkAccess?), Azure.ResourceManager.MongoCluster.Models.HighAvailabilityMode? highAvailabilityTargetMode = default(Azure.ResourceManager.MongoCluster.Models.HighAvailabilityMode?), long? storageSizeGb = default(long?), int? shardingShardCount = default(int?), string computeTier = null, string backupEarliestRestoreTime = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, System.Collections.Generic.IEnumerable previewFeatures = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicationProperties replica = null, string infrastructureVersion = null) { throw null; } + public static Azure.ResourceManager.MongoCluster.Models.MongoClusterProperties MongoClusterProperties(Azure.ResourceManager.MongoCluster.Models.MongoClusterCreateMode? createMode = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterCreateMode?), Azure.ResourceManager.MongoCluster.Models.MongoClusterRestoreContent restoreParameters = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicaContent replicaParameters = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterAdministratorProperties administrator = null, string serverVersion = null, string connectionString = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterProvisioningState? provisioningState = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterProvisioningState?), Azure.ResourceManager.MongoCluster.Models.MongoClusterStatus? clusterStatus = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterStatus?), Azure.ResourceManager.MongoCluster.Models.MongoClusterPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterPublicNetworkAccess?), Azure.ResourceManager.MongoCluster.Models.HighAvailabilityMode? highAvailabilityTargetMode = default(Azure.ResourceManager.MongoCluster.Models.HighAvailabilityMode?), Azure.ResourceManager.MongoCluster.Models.StorageProperties storage = null, int? shardingShardCount = default(int?), string computeTier = null, string backupEarliestRestoreTime = null, Azure.ResourceManager.MongoCluster.Models.DataApiMode? dataApiMode = default(Azure.ResourceManager.MongoCluster.Models.DataApiMode?), System.Collections.Generic.IEnumerable privateEndpointConnections = null, System.Collections.Generic.IEnumerable previewFeatures = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicationProperties replica = null, string infrastructureVersion = null, System.Collections.Generic.IEnumerable authConfigAllowedModes = null, Azure.ResourceManager.MongoCluster.Models.CustomerManagedKeyEncryptionProperties customerManagedKeyEncryption = null) { throw null; } public static Azure.ResourceManager.MongoCluster.Models.MongoClusterReplica MongoClusterReplica(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterProperties properties = null) { throw null; } public static Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicationProperties MongoClusterReplicationProperties(Azure.Core.ResourceIdentifier sourceResourceId = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicationRole? role = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicationRole?), Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicationState? replicationState = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicationState?)) { throw null; } public static Azure.ResourceManager.MongoCluster.Models.PromoteReplicaContent PromoteReplicaContent(Azure.ResourceManager.MongoCluster.Models.MongoClusterPromoteOption promoteOption = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterPromoteOption), Azure.ResourceManager.MongoCluster.Models.MongoClusterPromoteMode? mode = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterPromoteMode?)) { throw null; } + public static Azure.ResourceManager.MongoCluster.UserData UserData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MongoCluster.Models.UserProperties properties = null) { throw null; } + public static Azure.ResourceManager.MongoCluster.Models.UserProperties UserProperties(Azure.ResourceManager.MongoCluster.Models.MongoClusterProvisioningState? provisioningState = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterProvisioningState?), Azure.ResourceManager.MongoCluster.Models.IdentityProvider identityProvider = null, System.Collections.Generic.IEnumerable roles = null) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AuthenticationMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AuthenticationMode(string value) { throw null; } + public static Azure.ResourceManager.MongoCluster.Models.AuthenticationMode MicrosoftEntraId { get { throw null; } } + public static Azure.ResourceManager.MongoCluster.Models.AuthenticationMode NativeAuth { get { throw null; } } + public bool Equals(Azure.ResourceManager.MongoCluster.Models.AuthenticationMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MongoCluster.Models.AuthenticationMode left, Azure.ResourceManager.MongoCluster.Models.AuthenticationMode right) { throw null; } + public static implicit operator Azure.ResourceManager.MongoCluster.Models.AuthenticationMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MongoCluster.Models.AuthenticationMode left, Azure.ResourceManager.MongoCluster.Models.AuthenticationMode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class CustomerManagedKeyEncryptionProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CustomerManagedKeyEncryptionProperties(Azure.ResourceManager.MongoCluster.Models.KeyEncryptionKeyIdentity keyEncryptionKeyIdentity, string keyEncryptionKeyUri) { } + public Azure.ResourceManager.MongoCluster.Models.KeyEncryptionKeyIdentity KeyEncryptionKeyIdentity { get { throw null; } set { } } + public string KeyEncryptionKeyUri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MongoCluster.Models.CustomerManagedKeyEncryptionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MongoCluster.Models.CustomerManagedKeyEncryptionProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataApiMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataApiMode(string value) { throw null; } + public static Azure.ResourceManager.MongoCluster.Models.DataApiMode Disabled { get { throw null; } } + public static Azure.ResourceManager.MongoCluster.Models.DataApiMode Enabled { get { throw null; } } + public bool Equals(Azure.ResourceManager.MongoCluster.Models.DataApiMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MongoCluster.Models.DataApiMode left, Azure.ResourceManager.MongoCluster.Models.DataApiMode right) { throw null; } + public static implicit operator Azure.ResourceManager.MongoCluster.Models.DataApiMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MongoCluster.Models.DataApiMode left, Azure.ResourceManager.MongoCluster.Models.DataApiMode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DatabaseRole : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DatabaseRole(string db, Azure.ResourceManager.MongoCluster.Models.UserRole role) { } + public string Db { get { throw null; } set { } } + public Azure.ResourceManager.MongoCluster.Models.UserRole Role { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MongoCluster.Models.DatabaseRole System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MongoCluster.Models.DatabaseRole System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EntraIdentityProvider : Azure.ResourceManager.MongoCluster.Models.IdentityProvider, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public EntraIdentityProvider(Azure.ResourceManager.MongoCluster.Models.EntraIdentityProviderProperties properties) { } + public Azure.ResourceManager.MongoCluster.Models.EntraPrincipalType? EntraIdentityProviderPrincipalType { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MongoCluster.Models.EntraIdentityProvider System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MongoCluster.Models.EntraIdentityProvider System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EntraIdentityProviderProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public EntraIdentityProviderProperties(Azure.ResourceManager.MongoCluster.Models.EntraPrincipalType principalType) { } + public Azure.ResourceManager.MongoCluster.Models.EntraPrincipalType PrincipalType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MongoCluster.Models.EntraIdentityProviderProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MongoCluster.Models.EntraIdentityProviderProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct EntraPrincipalType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public EntraPrincipalType(string value) { throw null; } + public static Azure.ResourceManager.MongoCluster.Models.EntraPrincipalType ServicePrincipal { get { throw null; } } + public static Azure.ResourceManager.MongoCluster.Models.EntraPrincipalType User { get { throw null; } } + public bool Equals(Azure.ResourceManager.MongoCluster.Models.EntraPrincipalType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MongoCluster.Models.EntraPrincipalType left, Azure.ResourceManager.MongoCluster.Models.EntraPrincipalType right) { throw null; } + public static implicit operator Azure.ResourceManager.MongoCluster.Models.EntraPrincipalType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MongoCluster.Models.EntraPrincipalType left, Azure.ResourceManager.MongoCluster.Models.EntraPrincipalType right) { throw null; } + public override string ToString() { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct HighAvailabilityMode : System.IEquatable @@ -270,6 +426,45 @@ public static partial class ArmMongoClusterModelFactory public static bool operator !=(Azure.ResourceManager.MongoCluster.Models.HighAvailabilityMode left, Azure.ResourceManager.MongoCluster.Models.HighAvailabilityMode right) { throw null; } public override string ToString() { throw null; } } + public abstract partial class IdentityProvider : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected IdentityProvider() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MongoCluster.Models.IdentityProvider System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MongoCluster.Models.IdentityProvider System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class KeyEncryptionKeyIdentity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public KeyEncryptionKeyIdentity(Azure.ResourceManager.MongoCluster.Models.KeyEncryptionKeyIdentityType identityType, string userAssignedIdentityResourceId) { } + public Azure.ResourceManager.MongoCluster.Models.KeyEncryptionKeyIdentityType IdentityType { get { throw null; } set { } } + public string UserAssignedIdentityResourceId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MongoCluster.Models.KeyEncryptionKeyIdentity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MongoCluster.Models.KeyEncryptionKeyIdentity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct KeyEncryptionKeyIdentityType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public KeyEncryptionKeyIdentityType(string value) { throw null; } + public static Azure.ResourceManager.MongoCluster.Models.KeyEncryptionKeyIdentityType UserAssignedIdentity { get { throw null; } } + public bool Equals(Azure.ResourceManager.MongoCluster.Models.KeyEncryptionKeyIdentityType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MongoCluster.Models.KeyEncryptionKeyIdentityType left, Azure.ResourceManager.MongoCluster.Models.KeyEncryptionKeyIdentityType right) { throw null; } + public static implicit operator Azure.ResourceManager.MongoCluster.Models.KeyEncryptionKeyIdentityType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MongoCluster.Models.KeyEncryptionKeyIdentityType left, Azure.ResourceManager.MongoCluster.Models.KeyEncryptionKeyIdentityType right) { throw null; } + public override string ToString() { throw null; } + } public partial class MongoClusterAdministratorProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public MongoClusterAdministratorProperties() { } @@ -385,6 +580,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class MongoClusterPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public MongoClusterPatch() { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.MongoCluster.Models.MongoClusterUpdateProperties Properties { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -550,11 +746,14 @@ public partial class MongoClusterProperties : System.ClientModel.Primitives.IJso { public MongoClusterProperties() { } public Azure.ResourceManager.MongoCluster.Models.MongoClusterAdministratorProperties Administrator { get { throw null; } set { } } + public System.Collections.Generic.IList AuthConfigAllowedModes { get { throw null; } } public string BackupEarliestRestoreTime { get { throw null; } } public Azure.ResourceManager.MongoCluster.Models.MongoClusterStatus? ClusterStatus { get { throw null; } } public string ComputeTier { get { throw null; } set { } } public string ConnectionString { get { throw null; } } public Azure.ResourceManager.MongoCluster.Models.MongoClusterCreateMode? CreateMode { get { throw null; } set { } } + public Azure.ResourceManager.MongoCluster.Models.CustomerManagedKeyEncryptionProperties CustomerManagedKeyEncryption { get { throw null; } set { } } + public Azure.ResourceManager.MongoCluster.Models.DataApiMode? DataApiMode { get { throw null; } set { } } public Azure.ResourceManager.MongoCluster.Models.HighAvailabilityMode? HighAvailabilityTargetMode { get { throw null; } set { } } public string InfrastructureVersion { get { throw null; } } public System.Collections.Generic.IList PreviewFeatures { get { throw null; } } @@ -566,7 +765,7 @@ public MongoClusterProperties() { } public Azure.ResourceManager.MongoCluster.Models.MongoClusterRestoreContent RestoreParameters { get { throw null; } set { } } public string ServerVersion { get { throw null; } set { } } public int? ShardingShardCount { get { throw null; } set { } } - public long? StorageSizeGb { get { throw null; } set { } } + public Azure.ResourceManager.MongoCluster.Models.StorageProperties Storage { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.MongoClusterProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -730,14 +929,16 @@ public partial class MongoClusterUpdateProperties : System.ClientModel.Primitive { public MongoClusterUpdateProperties() { } public Azure.ResourceManager.MongoCluster.Models.MongoClusterAdministratorProperties Administrator { get { throw null; } set { } } + public System.Collections.Generic.IList AuthConfigAllowedModes { get { throw null; } } public string BackupEarliestRestoreTime { get { throw null; } } public string ComputeTier { get { throw null; } set { } } + public Azure.ResourceManager.MongoCluster.Models.DataApiMode? DataApiMode { get { throw null; } set { } } public Azure.ResourceManager.MongoCluster.Models.HighAvailabilityMode? HighAvailabilityTargetMode { get { throw null; } set { } } public System.Collections.Generic.IList PreviewFeatures { get { throw null; } } public Azure.ResourceManager.MongoCluster.Models.MongoClusterPublicNetworkAccess? PublicNetworkAccess { get { throw null; } set { } } public string ServerVersion { get { throw null; } set { } } public int? ShardingShardCount { get { throw null; } set { } } - public long? StorageSizeGb { get { throw null; } set { } } + public Azure.ResourceManager.MongoCluster.Models.StorageProperties Storage { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.MongoClusterUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -757,4 +958,66 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class StorageProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public StorageProperties() { } + public long? Iops { get { throw null; } set { } } + public long? SizeGb { get { throw null; } set { } } + public long? Throughput { get { throw null; } set { } } + public Azure.ResourceManager.MongoCluster.Models.StorageType? Type { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MongoCluster.Models.StorageProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MongoCluster.Models.StorageProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct StorageType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public StorageType(string value) { throw null; } + public static Azure.ResourceManager.MongoCluster.Models.StorageType PremiumSSD { get { throw null; } } + public static Azure.ResourceManager.MongoCluster.Models.StorageType PremiumSSDv2 { get { throw null; } } + public bool Equals(Azure.ResourceManager.MongoCluster.Models.StorageType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MongoCluster.Models.StorageType left, Azure.ResourceManager.MongoCluster.Models.StorageType right) { throw null; } + public static implicit operator Azure.ResourceManager.MongoCluster.Models.StorageType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MongoCluster.Models.StorageType left, Azure.ResourceManager.MongoCluster.Models.StorageType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class UserProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public UserProperties() { } + public Azure.ResourceManager.MongoCluster.Models.IdentityProvider IdentityProvider { get { throw null; } set { } } + public Azure.ResourceManager.MongoCluster.Models.MongoClusterProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IList Roles { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MongoCluster.Models.UserProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MongoCluster.Models.UserProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct UserRole : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public UserRole(string value) { throw null; } + public static Azure.ResourceManager.MongoCluster.Models.UserRole Root { get { throw null; } } + public bool Equals(Azure.ResourceManager.MongoCluster.Models.UserRole other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MongoCluster.Models.UserRole left, Azure.ResourceManager.MongoCluster.Models.UserRole right) { throw null; } + public static implicit operator Azure.ResourceManager.MongoCluster.Models.UserRole (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MongoCluster.Models.UserRole left, Azure.ResourceManager.MongoCluster.Models.UserRole right) { throw null; } + public override string ToString() { throw null; } + } } diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/api/Azure.ResourceManager.MongoCluster.netstandard2.0.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/api/Azure.ResourceManager.MongoCluster.netstandard2.0.cs index a644bbd20a8d..300b3b99b6a9 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/api/Azure.ResourceManager.MongoCluster.netstandard2.0.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/api/Azure.ResourceManager.MongoCluster.netstandard2.0.cs @@ -19,6 +19,7 @@ namespace Azure.ResourceManager.MongoCluster [System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(Azure.ResourceManager.MongoCluster.Models.MongoClusterRestoreContent))] [System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(Azure.ResourceManager.MongoCluster.Models.MongoClusterUpdateProperties))] [System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(Azure.ResourceManager.MongoCluster.Models.PromoteReplicaContent))] + [System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(Azure.ResourceManager.MongoCluster.Models.StorageProperties))] [System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(Azure.ResourceManager.MongoCluster.MongoClusterData))] [System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(Azure.ResourceManager.MongoCluster.MongoClusterFirewallRuleData))] [System.ClientModel.Primitives.ModelReaderWriterBuildableAttribute(typeof(Azure.ResourceManager.MongoCluster.MongoClusterFirewallRuleResource))] @@ -51,6 +52,7 @@ protected MongoClusterCollection() { } public partial class MongoClusterData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public MongoClusterData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.MongoCluster.Models.MongoClusterProperties Properties { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.MongoClusterData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -71,6 +73,7 @@ public static partial class MongoClusterExtensions public static Azure.ResourceManager.MongoCluster.MongoClusterCollection GetMongoClusters(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetMongoClusters(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetMongoClustersAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.MongoCluster.UserResource GetUserResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } } public partial class MongoClusterFirewallRuleCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { @@ -191,6 +194,9 @@ protected MongoClusterResource() { } public virtual Azure.AsyncPageable GetPrivateLinksAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetReplicasByParent(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetReplicasByParentAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetUser(string userName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetUserAsync(string userName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.MongoCluster.UserCollection GetUsers() { throw null; } public virtual Azure.ResourceManager.ArmOperation Promote(Azure.WaitUntil waitUntil, Azure.ResourceManager.MongoCluster.Models.PromoteReplicaContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task PromoteAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MongoCluster.Models.PromoteReplicaContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -205,6 +211,53 @@ protected MongoClusterResource() { } public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.MongoCluster.Models.MongoClusterPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MongoCluster.Models.MongoClusterPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } + public partial class UserCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected UserCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string userName, Azure.ResourceManager.MongoCluster.UserData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string userName, Azure.ResourceManager.MongoCluster.UserData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string userName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string userName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string userName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string userName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string userName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string userName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class UserData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public UserData() { } + public Azure.ResourceManager.MongoCluster.Models.UserProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MongoCluster.UserData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MongoCluster.UserData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class UserResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected UserResource() { } + public virtual Azure.ResourceManager.MongoCluster.UserData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string mongoClusterName, string userName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.MongoCluster.UserData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MongoCluster.UserData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.MongoCluster.UserData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MongoCluster.UserData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } } namespace Azure.ResourceManager.MongoCluster.Mocking { @@ -214,6 +267,7 @@ protected MockableMongoClusterArmClient() { } public virtual Azure.ResourceManager.MongoCluster.MongoClusterFirewallRuleResource GetMongoClusterFirewallRuleResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.MongoCluster.MongoClusterPrivateEndpointConnectionResource GetMongoClusterPrivateEndpointConnectionResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.MongoCluster.MongoClusterResource GetMongoClusterResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.MongoCluster.UserResource GetUserResource(Azure.Core.ResourceIdentifier id) { throw null; } } public partial class MockableMongoClusterResourceGroupResource : Azure.ResourceManager.ArmResource { @@ -237,7 +291,7 @@ public static partial class ArmMongoClusterModelFactory { public static Azure.ResourceManager.MongoCluster.Models.MongoClusterConnectionString MongoClusterConnectionString(string uri = null, string description = null, string name = null) { throw null; } public static Azure.ResourceManager.MongoCluster.Models.MongoClusterConnectionStringsResult MongoClusterConnectionStringsResult(System.Collections.Generic.IEnumerable connectionStrings = null) { throw null; } - public static Azure.ResourceManager.MongoCluster.MongoClusterData MongoClusterData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.MongoCluster.Models.MongoClusterProperties properties = null) { throw null; } + public static Azure.ResourceManager.MongoCluster.MongoClusterData MongoClusterData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.MongoCluster.Models.MongoClusterProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } public static Azure.ResourceManager.MongoCluster.MongoClusterFirewallRuleData MongoClusterFirewallRuleData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterFirewallRuleProperties properties = null) { throw null; } public static Azure.ResourceManager.MongoCluster.Models.MongoClusterFirewallRuleProperties MongoClusterFirewallRuleProperties(Azure.ResourceManager.MongoCluster.Models.MongoClusterProvisioningState? provisioningState = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterProvisioningState?), string startIPAddress = null, string endIPAddress = null) { throw null; } public static Azure.ResourceManager.MongoCluster.Models.MongoClusterNameAvailabilityResult MongoClusterNameAvailabilityResult(bool? isNameAvailable = default(bool?), Azure.ResourceManager.MongoCluster.Models.MongoClusterNameUnavailableReason? reason = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterNameUnavailableReason?), string message = null) { throw null; } @@ -246,10 +300,112 @@ public static partial class ArmMongoClusterModelFactory public static Azure.ResourceManager.MongoCluster.MongoClusterPrivateEndpointConnectionResourceData MongoClusterPrivateEndpointConnectionResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterPrivateEndpointConnectionProperties properties = null) { throw null; } public static Azure.ResourceManager.MongoCluster.Models.MongoClusterPrivateLinkResourceData MongoClusterPrivateLinkResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterPrivateLinkResourceProperties properties = null) { throw null; } public static Azure.ResourceManager.MongoCluster.Models.MongoClusterPrivateLinkResourceProperties MongoClusterPrivateLinkResourceProperties(string groupId = null, System.Collections.Generic.IEnumerable requiredMembers = null, System.Collections.Generic.IEnumerable requiredZoneNames = null) { throw null; } - public static Azure.ResourceManager.MongoCluster.Models.MongoClusterProperties MongoClusterProperties(Azure.ResourceManager.MongoCluster.Models.MongoClusterCreateMode? createMode = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterCreateMode?), Azure.ResourceManager.MongoCluster.Models.MongoClusterRestoreContent restoreParameters = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicaContent replicaParameters = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterAdministratorProperties administrator = null, string serverVersion = null, string connectionString = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterProvisioningState? provisioningState = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterProvisioningState?), Azure.ResourceManager.MongoCluster.Models.MongoClusterStatus? clusterStatus = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterStatus?), Azure.ResourceManager.MongoCluster.Models.MongoClusterPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterPublicNetworkAccess?), Azure.ResourceManager.MongoCluster.Models.HighAvailabilityMode? highAvailabilityTargetMode = default(Azure.ResourceManager.MongoCluster.Models.HighAvailabilityMode?), long? storageSizeGb = default(long?), int? shardingShardCount = default(int?), string computeTier = null, string backupEarliestRestoreTime = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, System.Collections.Generic.IEnumerable previewFeatures = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicationProperties replica = null, string infrastructureVersion = null) { throw null; } + public static Azure.ResourceManager.MongoCluster.Models.MongoClusterProperties MongoClusterProperties(Azure.ResourceManager.MongoCluster.Models.MongoClusterCreateMode? createMode = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterCreateMode?), Azure.ResourceManager.MongoCluster.Models.MongoClusterRestoreContent restoreParameters = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicaContent replicaParameters = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterAdministratorProperties administrator = null, string serverVersion = null, string connectionString = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterProvisioningState? provisioningState = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterProvisioningState?), Azure.ResourceManager.MongoCluster.Models.MongoClusterStatus? clusterStatus = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterStatus?), Azure.ResourceManager.MongoCluster.Models.MongoClusterPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterPublicNetworkAccess?), Azure.ResourceManager.MongoCluster.Models.HighAvailabilityMode? highAvailabilityTargetMode = default(Azure.ResourceManager.MongoCluster.Models.HighAvailabilityMode?), Azure.ResourceManager.MongoCluster.Models.StorageProperties storage = null, int? shardingShardCount = default(int?), string computeTier = null, string backupEarliestRestoreTime = null, Azure.ResourceManager.MongoCluster.Models.DataApiMode? dataApiMode = default(Azure.ResourceManager.MongoCluster.Models.DataApiMode?), System.Collections.Generic.IEnumerable privateEndpointConnections = null, System.Collections.Generic.IEnumerable previewFeatures = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicationProperties replica = null, string infrastructureVersion = null, System.Collections.Generic.IEnumerable authConfigAllowedModes = null, Azure.ResourceManager.MongoCluster.Models.CustomerManagedKeyEncryptionProperties customerManagedKeyEncryption = null) { throw null; } public static Azure.ResourceManager.MongoCluster.Models.MongoClusterReplica MongoClusterReplica(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterProperties properties = null) { throw null; } public static Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicationProperties MongoClusterReplicationProperties(Azure.Core.ResourceIdentifier sourceResourceId = null, Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicationRole? role = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicationRole?), Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicationState? replicationState = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterReplicationState?)) { throw null; } public static Azure.ResourceManager.MongoCluster.Models.PromoteReplicaContent PromoteReplicaContent(Azure.ResourceManager.MongoCluster.Models.MongoClusterPromoteOption promoteOption = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterPromoteOption), Azure.ResourceManager.MongoCluster.Models.MongoClusterPromoteMode? mode = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterPromoteMode?)) { throw null; } + public static Azure.ResourceManager.MongoCluster.UserData UserData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MongoCluster.Models.UserProperties properties = null) { throw null; } + public static Azure.ResourceManager.MongoCluster.Models.UserProperties UserProperties(Azure.ResourceManager.MongoCluster.Models.MongoClusterProvisioningState? provisioningState = default(Azure.ResourceManager.MongoCluster.Models.MongoClusterProvisioningState?), Azure.ResourceManager.MongoCluster.Models.IdentityProvider identityProvider = null, System.Collections.Generic.IEnumerable roles = null) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AuthenticationMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AuthenticationMode(string value) { throw null; } + public static Azure.ResourceManager.MongoCluster.Models.AuthenticationMode MicrosoftEntraId { get { throw null; } } + public static Azure.ResourceManager.MongoCluster.Models.AuthenticationMode NativeAuth { get { throw null; } } + public bool Equals(Azure.ResourceManager.MongoCluster.Models.AuthenticationMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MongoCluster.Models.AuthenticationMode left, Azure.ResourceManager.MongoCluster.Models.AuthenticationMode right) { throw null; } + public static implicit operator Azure.ResourceManager.MongoCluster.Models.AuthenticationMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MongoCluster.Models.AuthenticationMode left, Azure.ResourceManager.MongoCluster.Models.AuthenticationMode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class CustomerManagedKeyEncryptionProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CustomerManagedKeyEncryptionProperties(Azure.ResourceManager.MongoCluster.Models.KeyEncryptionKeyIdentity keyEncryptionKeyIdentity, string keyEncryptionKeyUri) { } + public Azure.ResourceManager.MongoCluster.Models.KeyEncryptionKeyIdentity KeyEncryptionKeyIdentity { get { throw null; } set { } } + public string KeyEncryptionKeyUri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MongoCluster.Models.CustomerManagedKeyEncryptionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MongoCluster.Models.CustomerManagedKeyEncryptionProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataApiMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataApiMode(string value) { throw null; } + public static Azure.ResourceManager.MongoCluster.Models.DataApiMode Disabled { get { throw null; } } + public static Azure.ResourceManager.MongoCluster.Models.DataApiMode Enabled { get { throw null; } } + public bool Equals(Azure.ResourceManager.MongoCluster.Models.DataApiMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MongoCluster.Models.DataApiMode left, Azure.ResourceManager.MongoCluster.Models.DataApiMode right) { throw null; } + public static implicit operator Azure.ResourceManager.MongoCluster.Models.DataApiMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MongoCluster.Models.DataApiMode left, Azure.ResourceManager.MongoCluster.Models.DataApiMode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DatabaseRole : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DatabaseRole(string db, Azure.ResourceManager.MongoCluster.Models.UserRole role) { } + public string Db { get { throw null; } set { } } + public Azure.ResourceManager.MongoCluster.Models.UserRole Role { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MongoCluster.Models.DatabaseRole System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MongoCluster.Models.DatabaseRole System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EntraIdentityProvider : Azure.ResourceManager.MongoCluster.Models.IdentityProvider, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public EntraIdentityProvider(Azure.ResourceManager.MongoCluster.Models.EntraIdentityProviderProperties properties) { } + public Azure.ResourceManager.MongoCluster.Models.EntraPrincipalType? EntraIdentityProviderPrincipalType { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MongoCluster.Models.EntraIdentityProvider System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MongoCluster.Models.EntraIdentityProvider System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EntraIdentityProviderProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public EntraIdentityProviderProperties(Azure.ResourceManager.MongoCluster.Models.EntraPrincipalType principalType) { } + public Azure.ResourceManager.MongoCluster.Models.EntraPrincipalType PrincipalType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MongoCluster.Models.EntraIdentityProviderProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MongoCluster.Models.EntraIdentityProviderProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct EntraPrincipalType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public EntraPrincipalType(string value) { throw null; } + public static Azure.ResourceManager.MongoCluster.Models.EntraPrincipalType ServicePrincipal { get { throw null; } } + public static Azure.ResourceManager.MongoCluster.Models.EntraPrincipalType User { get { throw null; } } + public bool Equals(Azure.ResourceManager.MongoCluster.Models.EntraPrincipalType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MongoCluster.Models.EntraPrincipalType left, Azure.ResourceManager.MongoCluster.Models.EntraPrincipalType right) { throw null; } + public static implicit operator Azure.ResourceManager.MongoCluster.Models.EntraPrincipalType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MongoCluster.Models.EntraPrincipalType left, Azure.ResourceManager.MongoCluster.Models.EntraPrincipalType right) { throw null; } + public override string ToString() { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct HighAvailabilityMode : System.IEquatable @@ -270,6 +426,45 @@ public static partial class ArmMongoClusterModelFactory public static bool operator !=(Azure.ResourceManager.MongoCluster.Models.HighAvailabilityMode left, Azure.ResourceManager.MongoCluster.Models.HighAvailabilityMode right) { throw null; } public override string ToString() { throw null; } } + public abstract partial class IdentityProvider : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected IdentityProvider() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MongoCluster.Models.IdentityProvider System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MongoCluster.Models.IdentityProvider System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class KeyEncryptionKeyIdentity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public KeyEncryptionKeyIdentity(Azure.ResourceManager.MongoCluster.Models.KeyEncryptionKeyIdentityType identityType, string userAssignedIdentityResourceId) { } + public Azure.ResourceManager.MongoCluster.Models.KeyEncryptionKeyIdentityType IdentityType { get { throw null; } set { } } + public string UserAssignedIdentityResourceId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MongoCluster.Models.KeyEncryptionKeyIdentity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MongoCluster.Models.KeyEncryptionKeyIdentity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct KeyEncryptionKeyIdentityType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public KeyEncryptionKeyIdentityType(string value) { throw null; } + public static Azure.ResourceManager.MongoCluster.Models.KeyEncryptionKeyIdentityType UserAssignedIdentity { get { throw null; } } + public bool Equals(Azure.ResourceManager.MongoCluster.Models.KeyEncryptionKeyIdentityType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MongoCluster.Models.KeyEncryptionKeyIdentityType left, Azure.ResourceManager.MongoCluster.Models.KeyEncryptionKeyIdentityType right) { throw null; } + public static implicit operator Azure.ResourceManager.MongoCluster.Models.KeyEncryptionKeyIdentityType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MongoCluster.Models.KeyEncryptionKeyIdentityType left, Azure.ResourceManager.MongoCluster.Models.KeyEncryptionKeyIdentityType right) { throw null; } + public override string ToString() { throw null; } + } public partial class MongoClusterAdministratorProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public MongoClusterAdministratorProperties() { } @@ -385,6 +580,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class MongoClusterPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public MongoClusterPatch() { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.MongoCluster.Models.MongoClusterUpdateProperties Properties { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -550,11 +746,14 @@ public partial class MongoClusterProperties : System.ClientModel.Primitives.IJso { public MongoClusterProperties() { } public Azure.ResourceManager.MongoCluster.Models.MongoClusterAdministratorProperties Administrator { get { throw null; } set { } } + public System.Collections.Generic.IList AuthConfigAllowedModes { get { throw null; } } public string BackupEarliestRestoreTime { get { throw null; } } public Azure.ResourceManager.MongoCluster.Models.MongoClusterStatus? ClusterStatus { get { throw null; } } public string ComputeTier { get { throw null; } set { } } public string ConnectionString { get { throw null; } } public Azure.ResourceManager.MongoCluster.Models.MongoClusterCreateMode? CreateMode { get { throw null; } set { } } + public Azure.ResourceManager.MongoCluster.Models.CustomerManagedKeyEncryptionProperties CustomerManagedKeyEncryption { get { throw null; } set { } } + public Azure.ResourceManager.MongoCluster.Models.DataApiMode? DataApiMode { get { throw null; } set { } } public Azure.ResourceManager.MongoCluster.Models.HighAvailabilityMode? HighAvailabilityTargetMode { get { throw null; } set { } } public string InfrastructureVersion { get { throw null; } } public System.Collections.Generic.IList PreviewFeatures { get { throw null; } } @@ -566,7 +765,7 @@ public MongoClusterProperties() { } public Azure.ResourceManager.MongoCluster.Models.MongoClusterRestoreContent RestoreParameters { get { throw null; } set { } } public string ServerVersion { get { throw null; } set { } } public int? ShardingShardCount { get { throw null; } set { } } - public long? StorageSizeGb { get { throw null; } set { } } + public Azure.ResourceManager.MongoCluster.Models.StorageProperties Storage { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.MongoClusterProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -730,14 +929,16 @@ public partial class MongoClusterUpdateProperties : System.ClientModel.Primitive { public MongoClusterUpdateProperties() { } public Azure.ResourceManager.MongoCluster.Models.MongoClusterAdministratorProperties Administrator { get { throw null; } set { } } + public System.Collections.Generic.IList AuthConfigAllowedModes { get { throw null; } } public string BackupEarliestRestoreTime { get { throw null; } } public string ComputeTier { get { throw null; } set { } } + public Azure.ResourceManager.MongoCluster.Models.DataApiMode? DataApiMode { get { throw null; } set { } } public Azure.ResourceManager.MongoCluster.Models.HighAvailabilityMode? HighAvailabilityTargetMode { get { throw null; } set { } } public System.Collections.Generic.IList PreviewFeatures { get { throw null; } } public Azure.ResourceManager.MongoCluster.Models.MongoClusterPublicNetworkAccess? PublicNetworkAccess { get { throw null; } set { } } public string ServerVersion { get { throw null; } set { } } public int? ShardingShardCount { get { throw null; } set { } } - public long? StorageSizeGb { get { throw null; } set { } } + public Azure.ResourceManager.MongoCluster.Models.StorageProperties Storage { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MongoCluster.Models.MongoClusterUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -757,4 +958,66 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class StorageProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public StorageProperties() { } + public long? Iops { get { throw null; } set { } } + public long? SizeGb { get { throw null; } set { } } + public long? Throughput { get { throw null; } set { } } + public Azure.ResourceManager.MongoCluster.Models.StorageType? Type { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MongoCluster.Models.StorageProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MongoCluster.Models.StorageProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct StorageType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public StorageType(string value) { throw null; } + public static Azure.ResourceManager.MongoCluster.Models.StorageType PremiumSSD { get { throw null; } } + public static Azure.ResourceManager.MongoCluster.Models.StorageType PremiumSSDv2 { get { throw null; } } + public bool Equals(Azure.ResourceManager.MongoCluster.Models.StorageType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MongoCluster.Models.StorageType left, Azure.ResourceManager.MongoCluster.Models.StorageType right) { throw null; } + public static implicit operator Azure.ResourceManager.MongoCluster.Models.StorageType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MongoCluster.Models.StorageType left, Azure.ResourceManager.MongoCluster.Models.StorageType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class UserProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public UserProperties() { } + public Azure.ResourceManager.MongoCluster.Models.IdentityProvider IdentityProvider { get { throw null; } set { } } + public Azure.ResourceManager.MongoCluster.Models.MongoClusterProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IList Roles { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MongoCluster.Models.UserProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MongoCluster.Models.UserProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct UserRole : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public UserRole(string value) { throw null; } + public static Azure.ResourceManager.MongoCluster.Models.UserRole Root { get { throw null; } } + public bool Equals(Azure.ResourceManager.MongoCluster.Models.UserRole other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MongoCluster.Models.UserRole left, Azure.ResourceManager.MongoCluster.Models.UserRole right) { throw null; } + public static implicit operator Azure.ResourceManager.MongoCluster.Models.UserRole (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MongoCluster.Models.UserRole left, Azure.ResourceManager.MongoCluster.Models.UserRole right) { throw null; } + public override string ToString() { throw null; } + } } diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/ArmMongoClusterModelFactory.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/ArmMongoClusterModelFactory.cs index b9099c97c334..486b4f02318c 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/ArmMongoClusterModelFactory.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/ArmMongoClusterModelFactory.cs @@ -24,8 +24,9 @@ public static partial class ArmMongoClusterModelFactory /// The tags. /// The location. /// The resource-specific properties for this resource. + /// The managed service identities assigned to this resource. /// A new instance for mocking. - public static MongoClusterData MongoClusterData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, MongoClusterProperties properties = null) + public static MongoClusterData MongoClusterData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, MongoClusterProperties properties = null, ManagedServiceIdentity identity = null) { tags ??= new Dictionary(); @@ -37,6 +38,7 @@ public static MongoClusterData MongoClusterData(ResourceIdentifier id = null, st tags, location, properties, + identity, serializedAdditionalRawData: null); } @@ -51,19 +53,23 @@ public static MongoClusterData MongoClusterData(ResourceIdentifier id = null, st /// The status of the mongo cluster. /// Whether or not public endpoint access is allowed for this mongo cluster. /// The high availability properties of the mongo cluster. - /// The storage properties of the mongo cluster. + /// The storage properties of the mongo cluster. /// The sharding properties of the mongo cluster. /// The compute properties of the mongo cluster. /// The backup properties of the mongo cluster. + /// The Data API properties of the mongo cluster. /// List of private endpoint connections. /// List of private endpoint connections. /// The replication properties for the mongo cluster. /// The infrastructure version the cluster is provisioned on. + /// The authentication configuration for the cluster. + /// The encryption configuration for the cluster. Depends on identity being configured. /// A new instance for mocking. - public static MongoClusterProperties MongoClusterProperties(MongoClusterCreateMode? createMode = null, MongoClusterRestoreContent restoreParameters = null, MongoClusterReplicaContent replicaParameters = null, MongoClusterAdministratorProperties administrator = null, string serverVersion = null, string connectionString = null, MongoClusterProvisioningState? provisioningState = null, MongoClusterStatus? clusterStatus = null, MongoClusterPublicNetworkAccess? publicNetworkAccess = null, HighAvailabilityMode? highAvailabilityTargetMode = null, long? storageSizeGb = null, int? shardingShardCount = null, string computeTier = null, string backupEarliestRestoreTime = null, IEnumerable privateEndpointConnections = null, IEnumerable previewFeatures = null, MongoClusterReplicationProperties replica = null, string infrastructureVersion = null) + public static MongoClusterProperties MongoClusterProperties(MongoClusterCreateMode? createMode = null, MongoClusterRestoreContent restoreParameters = null, MongoClusterReplicaContent replicaParameters = null, MongoClusterAdministratorProperties administrator = null, string serverVersion = null, string connectionString = null, MongoClusterProvisioningState? provisioningState = null, MongoClusterStatus? clusterStatus = null, MongoClusterPublicNetworkAccess? publicNetworkAccess = null, HighAvailabilityMode? highAvailabilityTargetMode = null, StorageProperties storage = null, int? shardingShardCount = null, string computeTier = null, string backupEarliestRestoreTime = null, DataApiMode? dataApiMode = null, IEnumerable privateEndpointConnections = null, IEnumerable previewFeatures = null, MongoClusterReplicationProperties replica = null, string infrastructureVersion = null, IEnumerable authConfigAllowedModes = null, CustomerManagedKeyEncryptionProperties customerManagedKeyEncryption = null) { privateEndpointConnections ??= new List(); previewFeatures ??= new List(); + authConfigAllowedModes ??= new List(); return new MongoClusterProperties( createMode, @@ -76,14 +82,17 @@ public static MongoClusterProperties MongoClusterProperties(MongoClusterCreateMo clusterStatus, publicNetworkAccess, highAvailabilityTargetMode != null ? new HighAvailabilityProperties(highAvailabilityTargetMode, serializedAdditionalRawData: null) : null, - storageSizeGb != null ? new StorageProperties(storageSizeGb, serializedAdditionalRawData: null) : null, + storage, shardingShardCount != null ? new ShardingProperties(shardingShardCount, serializedAdditionalRawData: null) : null, computeTier != null ? new ComputeProperties(computeTier, serializedAdditionalRawData: null) : null, backupEarliestRestoreTime != null ? new BackupProperties(backupEarliestRestoreTime, serializedAdditionalRawData: null) : null, + dataApiMode != null ? new DataApiProperties(dataApiMode, serializedAdditionalRawData: null) : null, privateEndpointConnections?.ToList(), previewFeatures?.ToList(), replica, infrastructureVersion, + authConfigAllowedModes != null ? new AuthConfigProperties(authConfigAllowedModes?.ToList(), serializedAdditionalRawData: null) : null, + customerManagedKeyEncryption != null ? new EncryptionProperties(customerManagedKeyEncryption, serializedAdditionalRawData: null) : null, serializedAdditionalRawData: null); } @@ -261,5 +270,39 @@ public static MongoClusterReplica MongoClusterReplica(ResourceIdentifier id = nu properties, serializedAdditionalRawData: null); } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static UserData UserData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, UserProperties properties = null) + { + return new UserData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The provisioning state of the user. + /// + /// The user's identity provider definition. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + /// Database roles that are assigned to the user. + /// A new instance for mocking. + public static UserProperties UserProperties(MongoClusterProvisioningState? provisioningState = null, IdentityProvider identityProvider = null, IEnumerable roles = null) + { + roles ??= new List(); + + return new UserProperties(provisioningState, identityProvider, roles?.ToList(), serializedAdditionalRawData: null); + } } } diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Extensions/MockableMongoClusterArmClient.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Extensions/MockableMongoClusterArmClient.cs index 003eb2338558..d7d4f55dd489 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Extensions/MockableMongoClusterArmClient.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Extensions/MockableMongoClusterArmClient.cs @@ -69,5 +69,17 @@ public virtual MongoClusterPrivateEndpointConnectionResource GetMongoClusterPriv MongoClusterPrivateEndpointConnectionResource.ValidateResourceId(id); return new MongoClusterPrivateEndpointConnectionResource(Client, id); } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual UserResource GetUserResource(ResourceIdentifier id) + { + UserResource.ValidateResourceId(id); + return new UserResource(Client, id); + } } } diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Extensions/MockableMongoClusterResourceGroupResource.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Extensions/MockableMongoClusterResourceGroupResource.cs index 87e8ad903dcb..d67fa5f68356 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Extensions/MockableMongoClusterResourceGroupResource.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Extensions/MockableMongoClusterResourceGroupResource.cs @@ -53,7 +53,7 @@ public virtual MongoClusterCollection GetMongoClusters() /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -84,7 +84,7 @@ public virtual async Task> GetMongoClusterAsync(s /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Extensions/MockableMongoClusterSubscriptionResource.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Extensions/MockableMongoClusterSubscriptionResource.cs index bcba1d0d3f84..d61bdade0ed4 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Extensions/MockableMongoClusterSubscriptionResource.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Extensions/MockableMongoClusterSubscriptionResource.cs @@ -55,7 +55,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -85,7 +85,7 @@ public virtual AsyncPageable GetMongoClustersAsync(Cancell /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -115,7 +115,7 @@ public virtual Pageable GetMongoClusters(CancellationToken /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -158,7 +158,7 @@ public virtual async Task> CheckMon /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Extensions/MongoClusterExtensions.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Extensions/MongoClusterExtensions.cs index ee4d0e4ffd35..7da6654c04ff 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Extensions/MongoClusterExtensions.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Extensions/MongoClusterExtensions.cs @@ -90,6 +90,25 @@ public static MongoClusterPrivateEndpointConnectionResource GetMongoClusterPriva return GetMockableMongoClusterArmClient(client).GetMongoClusterPrivateEndpointConnectionResource(id); } + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static UserResource GetUserResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMongoClusterArmClient(client).GetUserResource(id); + } + /// /// Gets a collection of MongoClusterResources in the ResourceGroupResource. /// @@ -120,7 +139,7 @@ public static MongoClusterCollection GetMongoClusters(this ResourceGroupResource /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -158,7 +177,7 @@ public static async Task> GetMongoClusterAsync(th /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -196,7 +215,7 @@ public static Response GetMongoCluster(this ResourceGroupR /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -232,7 +251,7 @@ public static AsyncPageable GetMongoClustersAsync(this Sub /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -268,7 +287,7 @@ public static Pageable GetMongoClusters(this SubscriptionR /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -305,7 +324,7 @@ public static async Task> CheckMong /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/LongRunningOperation/UserOperationSource.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/LongRunningOperation/UserOperationSource.cs new file mode 100644 index 000000000000..39587f89970e --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/LongRunningOperation/UserOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.MongoCluster +{ + internal class UserOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal UserOperationSource(ArmClient client) + { + _client = client; + } + + UserResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerMongoClusterContext.Default); + return new UserResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerMongoClusterContext.Default); + return await Task.FromResult(new UserResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/AuthConfigProperties.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/AuthConfigProperties.Serialization.cs new file mode 100644 index 000000000000..868e3d5ed99f --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/AuthConfigProperties.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MongoCluster.Models +{ + internal partial class AuthConfigProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AuthConfigProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(AllowedModes)) + { + writer.WritePropertyName("allowedModes"u8); + writer.WriteStartArray(); + foreach (var item in AllowedModes) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AuthConfigProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AuthConfigProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAuthConfigProperties(document.RootElement, options); + } + + internal static AuthConfigProperties DeserializeAuthConfigProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList allowedModes = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("allowedModes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new AuthenticationMode(item.GetString())); + } + allowedModes = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AuthConfigProperties(allowedModes ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerMongoClusterContext.Default); + default: + throw new FormatException($"The model {nameof(AuthConfigProperties)} does not support writing '{options.Format}' format."); + } + } + + AuthConfigProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAuthConfigProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AuthConfigProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/AuthConfigProperties.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/AuthConfigProperties.cs new file mode 100644 index 000000000000..1548e8beb9c1 --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/AuthConfigProperties.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MongoCluster.Models +{ + /// The authentication configuration for the Mongo cluster. + internal partial class AuthConfigProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public AuthConfigProperties() + { + AllowedModes = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Allowed authentication modes for data access on the cluster. + /// Keeps track of any properties unknown to the library. + internal AuthConfigProperties(IList allowedModes, IDictionary serializedAdditionalRawData) + { + AllowedModes = allowedModes; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Allowed authentication modes for data access on the cluster. + public IList AllowedModes { get; } + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/AuthenticationMode.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/AuthenticationMode.cs new file mode 100644 index 000000000000..dd4f33b00d3f --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/AuthenticationMode.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MongoCluster.Models +{ + /// The authentication modes supporting on the Mongo cluster. + public readonly partial struct AuthenticationMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AuthenticationMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NativeAuthValue = "NativeAuth"; + private const string MicrosoftEntraIdValue = "MicrosoftEntraID"; + + /// Native mongo authentication mode using username and password with auth mechanism 'SCRAM-SHA-256'. + public static AuthenticationMode NativeAuth { get; } = new AuthenticationMode(NativeAuthValue); + /// Microsoft Entra ID authentication mode using Entra users assigned to the cluster and auth mechanism 'MONGODB-OIDC'. + public static AuthenticationMode MicrosoftEntraId { get; } = new AuthenticationMode(MicrosoftEntraIdValue); + /// Determines if two values are the same. + public static bool operator ==(AuthenticationMode left, AuthenticationMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AuthenticationMode left, AuthenticationMode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AuthenticationMode(string value) => new AuthenticationMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AuthenticationMode other && Equals(other); + /// + public bool Equals(AuthenticationMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/CustomerManagedKeyEncryptionProperties.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/CustomerManagedKeyEncryptionProperties.Serialization.cs new file mode 100644 index 000000000000..8946a9c049e5 --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/CustomerManagedKeyEncryptionProperties.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MongoCluster.Models +{ + public partial class CustomerManagedKeyEncryptionProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomerManagedKeyEncryptionProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("keyEncryptionKeyIdentity"u8); + writer.WriteObjectValue(KeyEncryptionKeyIdentity, options); + writer.WritePropertyName("keyEncryptionKeyUrl"u8); + writer.WriteStringValue(KeyEncryptionKeyUri); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CustomerManagedKeyEncryptionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomerManagedKeyEncryptionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCustomerManagedKeyEncryptionProperties(document.RootElement, options); + } + + internal static CustomerManagedKeyEncryptionProperties DeserializeCustomerManagedKeyEncryptionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + KeyEncryptionKeyIdentity keyEncryptionKeyIdentity = default; + string keyEncryptionKeyUrl = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("keyEncryptionKeyIdentity"u8)) + { + keyEncryptionKeyIdentity = KeyEncryptionKeyIdentity.DeserializeKeyEncryptionKeyIdentity(property.Value, options); + continue; + } + if (property.NameEquals("keyEncryptionKeyUrl"u8)) + { + keyEncryptionKeyUrl = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CustomerManagedKeyEncryptionProperties(keyEncryptionKeyIdentity, keyEncryptionKeyUrl, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerMongoClusterContext.Default); + default: + throw new FormatException($"The model {nameof(CustomerManagedKeyEncryptionProperties)} does not support writing '{options.Format}' format."); + } + } + + CustomerManagedKeyEncryptionProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCustomerManagedKeyEncryptionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CustomerManagedKeyEncryptionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/CustomerManagedKeyEncryptionProperties.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/CustomerManagedKeyEncryptionProperties.cs new file mode 100644 index 000000000000..fb5f2978ff6e --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/CustomerManagedKeyEncryptionProperties.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MongoCluster.Models +{ + /// Customer managed key encryption settings. + public partial class CustomerManagedKeyEncryptionProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The identity used to access the key encryption key. + /// The URI of the key vault key used for encryption. + /// or is null. + public CustomerManagedKeyEncryptionProperties(KeyEncryptionKeyIdentity keyEncryptionKeyIdentity, string keyEncryptionKeyUri) + { + Argument.AssertNotNull(keyEncryptionKeyIdentity, nameof(keyEncryptionKeyIdentity)); + Argument.AssertNotNull(keyEncryptionKeyUri, nameof(keyEncryptionKeyUri)); + + KeyEncryptionKeyIdentity = keyEncryptionKeyIdentity; + KeyEncryptionKeyUri = keyEncryptionKeyUri; + } + + /// Initializes a new instance of . + /// The identity used to access the key encryption key. + /// The URI of the key vault key used for encryption. + /// Keeps track of any properties unknown to the library. + internal CustomerManagedKeyEncryptionProperties(KeyEncryptionKeyIdentity keyEncryptionKeyIdentity, string keyEncryptionKeyUri, IDictionary serializedAdditionalRawData) + { + KeyEncryptionKeyIdentity = keyEncryptionKeyIdentity; + KeyEncryptionKeyUri = keyEncryptionKeyUri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CustomerManagedKeyEncryptionProperties() + { + } + + /// The identity used to access the key encryption key. + public KeyEncryptionKeyIdentity KeyEncryptionKeyIdentity { get; set; } + /// The URI of the key vault key used for encryption. + public string KeyEncryptionKeyUri { get; set; } + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/DataApiMode.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/DataApiMode.cs new file mode 100644 index 000000000000..72ce8ed51f95 --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/DataApiMode.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MongoCluster.Models +{ + /// The mode to apply to the Mongo Data API. + public readonly partial struct DataApiMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataApiMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + + /// Mongo Data API is enabled for the cluster. + public static DataApiMode Enabled { get; } = new DataApiMode(EnabledValue); + /// Mongo Data API is disabled for the cluster. + public static DataApiMode Disabled { get; } = new DataApiMode(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(DataApiMode left, DataApiMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataApiMode left, DataApiMode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataApiMode(string value) => new DataApiMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataApiMode other && Equals(other); + /// + public bool Equals(DataApiMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/DataApiProperties.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/DataApiProperties.Serialization.cs new file mode 100644 index 000000000000..361ce0411a5c --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/DataApiProperties.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MongoCluster.Models +{ + internal partial class DataApiProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataApiProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Mode)) + { + writer.WritePropertyName("mode"u8); + writer.WriteStringValue(Mode.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataApiProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataApiProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataApiProperties(document.RootElement, options); + } + + internal static DataApiProperties DeserializeDataApiProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataApiMode? mode = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("mode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + mode = new DataApiMode(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataApiProperties(mode, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerMongoClusterContext.Default); + default: + throw new FormatException($"The model {nameof(DataApiProperties)} does not support writing '{options.Format}' format."); + } + } + + DataApiProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataApiProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataApiProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/DataApiProperties.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/DataApiProperties.cs new file mode 100644 index 000000000000..5eccac330a35 --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/DataApiProperties.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MongoCluster.Models +{ + /// Data API properties. + internal partial class DataApiProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataApiProperties() + { + } + + /// Initializes a new instance of . + /// The mode to indicate whether the Mongo Data API is enabled for a cluster. + /// Keeps track of any properties unknown to the library. + internal DataApiProperties(DataApiMode? mode, IDictionary serializedAdditionalRawData) + { + Mode = mode; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The mode to indicate whether the Mongo Data API is enabled for a cluster. + public DataApiMode? Mode { get; set; } + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/DatabaseRole.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/DatabaseRole.Serialization.cs new file mode 100644 index 000000000000..160ba14bf9f6 --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/DatabaseRole.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MongoCluster.Models +{ + public partial class DatabaseRole : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DatabaseRole)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("db"u8); + writer.WriteStringValue(Db); + writer.WritePropertyName("role"u8); + writer.WriteStringValue(Role.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DatabaseRole IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DatabaseRole)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDatabaseRole(document.RootElement, options); + } + + internal static DatabaseRole DeserializeDatabaseRole(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string db = default; + UserRole role = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("db"u8)) + { + db = property.Value.GetString(); + continue; + } + if (property.NameEquals("role"u8)) + { + role = new UserRole(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DatabaseRole(db, role, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerMongoClusterContext.Default); + default: + throw new FormatException($"The model {nameof(DatabaseRole)} does not support writing '{options.Format}' format."); + } + } + + DatabaseRole IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDatabaseRole(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DatabaseRole)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/DatabaseRole.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/DatabaseRole.cs new file mode 100644 index 000000000000..1cc3019c250d --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/DatabaseRole.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MongoCluster.Models +{ + /// Database role definition that is assigned to a user. + public partial class DatabaseRole + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Database scope that the role is assigned to. + /// The role that is assigned to the user on the database scope. + /// is null. + public DatabaseRole(string db, UserRole role) + { + Argument.AssertNotNull(db, nameof(db)); + + Db = db; + Role = role; + } + + /// Initializes a new instance of . + /// Database scope that the role is assigned to. + /// The role that is assigned to the user on the database scope. + /// Keeps track of any properties unknown to the library. + internal DatabaseRole(string db, UserRole role, IDictionary serializedAdditionalRawData) + { + Db = db; + Role = role; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DatabaseRole() + { + } + + /// Database scope that the role is assigned to. + public string Db { get; set; } + /// The role that is assigned to the user on the database scope. + public UserRole Role { get; set; } + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/EncryptionProperties.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/EncryptionProperties.Serialization.cs new file mode 100644 index 000000000000..858c080c6049 --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/EncryptionProperties.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MongoCluster.Models +{ + internal partial class EncryptionProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EncryptionProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(CustomerManagedKeyEncryption)) + { + writer.WritePropertyName("customerManagedKeyEncryption"u8); + writer.WriteObjectValue(CustomerManagedKeyEncryption, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + EncryptionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EncryptionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEncryptionProperties(document.RootElement, options); + } + + internal static EncryptionProperties DeserializeEncryptionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CustomerManagedKeyEncryptionProperties customerManagedKeyEncryption = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("customerManagedKeyEncryption"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customerManagedKeyEncryption = CustomerManagedKeyEncryptionProperties.DeserializeCustomerManagedKeyEncryptionProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EncryptionProperties(customerManagedKeyEncryption, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerMongoClusterContext.Default); + default: + throw new FormatException($"The model {nameof(EncryptionProperties)} does not support writing '{options.Format}' format."); + } + } + + EncryptionProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeEncryptionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EncryptionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/EncryptionProperties.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/EncryptionProperties.cs new file mode 100644 index 000000000000..d54ab880ac4d --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/EncryptionProperties.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MongoCluster.Models +{ + /// The encryption configuration for the mongo cluster. + internal partial class EncryptionProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public EncryptionProperties() + { + } + + /// Initializes a new instance of . + /// Customer managed key encryption settings. + /// Keeps track of any properties unknown to the library. + internal EncryptionProperties(CustomerManagedKeyEncryptionProperties customerManagedKeyEncryption, IDictionary serializedAdditionalRawData) + { + CustomerManagedKeyEncryption = customerManagedKeyEncryption; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Customer managed key encryption settings. + public CustomerManagedKeyEncryptionProperties CustomerManagedKeyEncryption { get; set; } + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/EntraIdentityProvider.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/EntraIdentityProvider.Serialization.cs new file mode 100644 index 000000000000..298e2136bc3d --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/EntraIdentityProvider.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MongoCluster.Models +{ + public partial class EntraIdentityProvider : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EntraIdentityProvider)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + + EntraIdentityProvider IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EntraIdentityProvider)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEntraIdentityProvider(document.RootElement, options); + } + + internal static EntraIdentityProvider DeserializeEntraIdentityProvider(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EntraIdentityProviderProperties properties = default; + IdentityProviderType type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + properties = EntraIdentityProviderProperties.DeserializeEntraIdentityProviderProperties(property.Value, options); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new IdentityProviderType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EntraIdentityProvider(type, serializedAdditionalRawData, properties); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerMongoClusterContext.Default); + default: + throw new FormatException($"The model {nameof(EntraIdentityProvider)} does not support writing '{options.Format}' format."); + } + } + + EntraIdentityProvider IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeEntraIdentityProvider(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EntraIdentityProvider)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/EntraIdentityProvider.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/EntraIdentityProvider.cs new file mode 100644 index 000000000000..57795de93f2e --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/EntraIdentityProvider.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MongoCluster.Models +{ + /// Defines a Microsoft Entra ID Mongo user. + public partial class EntraIdentityProvider : IdentityProvider + { + /// Initializes a new instance of . + /// The Entra identity properties for the user. + /// is null. + public EntraIdentityProvider(EntraIdentityProviderProperties properties) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; + Type = IdentityProviderType.MicrosoftEntraId; + } + + /// Initializes a new instance of . + /// The type of identity provider that the user belongs to. + /// Keeps track of any properties unknown to the library. + /// The Entra identity properties for the user. + internal EntraIdentityProvider(IdentityProviderType type, IDictionary serializedAdditionalRawData, EntraIdentityProviderProperties properties) : base(type, serializedAdditionalRawData) + { + Properties = properties; + Type = type; + } + + /// Initializes a new instance of for deserialization. + internal EntraIdentityProvider() + { + } + + /// The Entra identity properties for the user. + internal EntraIdentityProviderProperties Properties { get; set; } + /// The principal type of the user. + public EntraPrincipalType? EntraIdentityProviderPrincipalType + { + get => Properties is null ? default(EntraPrincipalType?) : Properties.PrincipalType; + set + { + Properties = value.HasValue ? new EntraIdentityProviderProperties(value.Value) : null; + } + } + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/EntraIdentityProviderProperties.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/EntraIdentityProviderProperties.Serialization.cs new file mode 100644 index 000000000000..a46f30af78c2 --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/EntraIdentityProviderProperties.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MongoCluster.Models +{ + public partial class EntraIdentityProviderProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EntraIdentityProviderProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("principalType"u8); + writer.WriteStringValue(PrincipalType.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + EntraIdentityProviderProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EntraIdentityProviderProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEntraIdentityProviderProperties(document.RootElement, options); + } + + internal static EntraIdentityProviderProperties DeserializeEntraIdentityProviderProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EntraPrincipalType principalType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("principalType"u8)) + { + principalType = new EntraPrincipalType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EntraIdentityProviderProperties(principalType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerMongoClusterContext.Default); + default: + throw new FormatException($"The model {nameof(EntraIdentityProviderProperties)} does not support writing '{options.Format}' format."); + } + } + + EntraIdentityProviderProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeEntraIdentityProviderProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EntraIdentityProviderProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/EntraIdentityProviderProperties.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/EntraIdentityProviderProperties.cs new file mode 100644 index 000000000000..595ecee643a9 --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/EntraIdentityProviderProperties.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MongoCluster.Models +{ + /// Microsoft Entra ID provider properties. + public partial class EntraIdentityProviderProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The principal type of the user. + public EntraIdentityProviderProperties(EntraPrincipalType principalType) + { + PrincipalType = principalType; + } + + /// Initializes a new instance of . + /// The principal type of the user. + /// Keeps track of any properties unknown to the library. + internal EntraIdentityProviderProperties(EntraPrincipalType principalType, IDictionary serializedAdditionalRawData) + { + PrincipalType = principalType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal EntraIdentityProviderProperties() + { + } + + /// The principal type of the user. + public EntraPrincipalType PrincipalType { get; set; } + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/EntraPrincipalType.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/EntraPrincipalType.cs new file mode 100644 index 000000000000..4fb12a7dd98e --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/EntraPrincipalType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MongoCluster.Models +{ + /// Microsoft Entra ID principal types available for a Mongo user. + public readonly partial struct EntraPrincipalType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public EntraPrincipalType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UserValue = "user"; + private const string ServicePrincipalValue = "servicePrincipal"; + + /// Entra user type. + public static EntraPrincipalType User { get; } = new EntraPrincipalType(UserValue); + /// Entra service principal type. + public static EntraPrincipalType ServicePrincipal { get; } = new EntraPrincipalType(ServicePrincipalValue); + /// Determines if two values are the same. + public static bool operator ==(EntraPrincipalType left, EntraPrincipalType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(EntraPrincipalType left, EntraPrincipalType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator EntraPrincipalType(string value) => new EntraPrincipalType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is EntraPrincipalType other && Equals(other); + /// + public bool Equals(EntraPrincipalType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/IdentityProvider.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/IdentityProvider.Serialization.cs new file mode 100644 index 000000000000..6376e707fac0 --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/IdentityProvider.Serialization.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MongoCluster.Models +{ + [PersistableModelProxy(typeof(UnknownIdentityProvider))] + public partial class IdentityProvider : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IdentityProvider)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IdentityProvider IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IdentityProvider)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIdentityProvider(document.RootElement, options); + } + + internal static IdentityProvider DeserializeIdentityProvider(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("type", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "MicrosoftEntraID": return EntraIdentityProvider.DeserializeEntraIdentityProvider(element, options); + } + } + return UnknownIdentityProvider.DeserializeUnknownIdentityProvider(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerMongoClusterContext.Default); + default: + throw new FormatException($"The model {nameof(IdentityProvider)} does not support writing '{options.Format}' format."); + } + } + + IdentityProvider IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeIdentityProvider(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IdentityProvider)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/IdentityProvider.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/IdentityProvider.cs new file mode 100644 index 000000000000..d968ff1d9c03 --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/IdentityProvider.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MongoCluster.Models +{ + /// + /// Defines a user's identity provider definition. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + public abstract partial class IdentityProvider + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected IdentityProvider() + { + } + + /// Initializes a new instance of . + /// The type of identity provider that the user belongs to. + /// Keeps track of any properties unknown to the library. + internal IdentityProvider(IdentityProviderType type, IDictionary serializedAdditionalRawData) + { + Type = type; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The type of identity provider that the user belongs to. + internal IdentityProviderType Type { get; set; } + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/IdentityProviderType.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/IdentityProviderType.cs new file mode 100644 index 000000000000..5f56e6ea2b3c --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/IdentityProviderType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MongoCluster.Models +{ + /// Identity provider types that a a user identity can belong to. + internal readonly partial struct IdentityProviderType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public IdentityProviderType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string MicrosoftEntraIdValue = "MicrosoftEntraID"; + + /// Microsoft Entra ID provider. + public static IdentityProviderType MicrosoftEntraId { get; } = new IdentityProviderType(MicrosoftEntraIdValue); + /// Determines if two values are the same. + public static bool operator ==(IdentityProviderType left, IdentityProviderType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(IdentityProviderType left, IdentityProviderType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator IdentityProviderType(string value) => new IdentityProviderType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is IdentityProviderType other && Equals(other); + /// + public bool Equals(IdentityProviderType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/KeyEncryptionKeyIdentity.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/KeyEncryptionKeyIdentity.Serialization.cs new file mode 100644 index 000000000000..85164141e6ca --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/KeyEncryptionKeyIdentity.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MongoCluster.Models +{ + public partial class KeyEncryptionKeyIdentity : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(KeyEncryptionKeyIdentity)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("identityType"u8); + writer.WriteStringValue(IdentityType.ToString()); + writer.WritePropertyName("userAssignedIdentityResourceId"u8); + writer.WriteStringValue(UserAssignedIdentityResourceId); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + KeyEncryptionKeyIdentity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(KeyEncryptionKeyIdentity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeKeyEncryptionKeyIdentity(document.RootElement, options); + } + + internal static KeyEncryptionKeyIdentity DeserializeKeyEncryptionKeyIdentity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + KeyEncryptionKeyIdentityType identityType = default; + string userAssignedIdentityResourceId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("identityType"u8)) + { + identityType = new KeyEncryptionKeyIdentityType(property.Value.GetString()); + continue; + } + if (property.NameEquals("userAssignedIdentityResourceId"u8)) + { + userAssignedIdentityResourceId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new KeyEncryptionKeyIdentity(identityType, userAssignedIdentityResourceId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerMongoClusterContext.Default); + default: + throw new FormatException($"The model {nameof(KeyEncryptionKeyIdentity)} does not support writing '{options.Format}' format."); + } + } + + KeyEncryptionKeyIdentity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeKeyEncryptionKeyIdentity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(KeyEncryptionKeyIdentity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/KeyEncryptionKeyIdentity.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/KeyEncryptionKeyIdentity.cs new file mode 100644 index 000000000000..7cb4261ce8d8 --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/KeyEncryptionKeyIdentity.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MongoCluster.Models +{ + /// The identity used for key encryption key. + public partial class KeyEncryptionKeyIdentity + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The type of identity. Only 'UserAssignedIdentity' is supported. + /// The user assigned identity resource id. + /// is null. + public KeyEncryptionKeyIdentity(KeyEncryptionKeyIdentityType identityType, string userAssignedIdentityResourceId) + { + Argument.AssertNotNull(userAssignedIdentityResourceId, nameof(userAssignedIdentityResourceId)); + + IdentityType = identityType; + UserAssignedIdentityResourceId = userAssignedIdentityResourceId; + } + + /// Initializes a new instance of . + /// The type of identity. Only 'UserAssignedIdentity' is supported. + /// The user assigned identity resource id. + /// Keeps track of any properties unknown to the library. + internal KeyEncryptionKeyIdentity(KeyEncryptionKeyIdentityType identityType, string userAssignedIdentityResourceId, IDictionary serializedAdditionalRawData) + { + IdentityType = identityType; + UserAssignedIdentityResourceId = userAssignedIdentityResourceId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal KeyEncryptionKeyIdentity() + { + } + + /// The type of identity. Only 'UserAssignedIdentity' is supported. + public KeyEncryptionKeyIdentityType IdentityType { get; set; } + /// The user assigned identity resource id. + public string UserAssignedIdentityResourceId { get; set; } + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/KeyEncryptionKeyIdentityType.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/KeyEncryptionKeyIdentityType.cs new file mode 100644 index 000000000000..0dcf4956d4ef --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/KeyEncryptionKeyIdentityType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MongoCluster.Models +{ + /// The type of identity for key encryption key. + public readonly partial struct KeyEncryptionKeyIdentityType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public KeyEncryptionKeyIdentityType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UserAssignedIdentityValue = "UserAssignedIdentity"; + + /// User assigned identity. + public static KeyEncryptionKeyIdentityType UserAssignedIdentity { get; } = new KeyEncryptionKeyIdentityType(UserAssignedIdentityValue); + /// Determines if two values are the same. + public static bool operator ==(KeyEncryptionKeyIdentityType left, KeyEncryptionKeyIdentityType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(KeyEncryptionKeyIdentityType left, KeyEncryptionKeyIdentityType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator KeyEncryptionKeyIdentityType(string value) => new KeyEncryptionKeyIdentityType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is KeyEncryptionKeyIdentityType other && Equals(other); + /// + public bool Equals(KeyEncryptionKeyIdentityType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterPatch.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterPatch.Serialization.cs index 9b05ca393f38..3fb8fb0cd314 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterPatch.Serialization.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterPatch.Serialization.cs @@ -10,6 +10,7 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.Models; namespace Azure.ResourceManager.MongoCluster.Models { @@ -34,6 +35,12 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(MongoClusterPatch)} does not support writing '{format}' format."); } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + JsonSerializer.Serialize(writer, Identity, serializeOptions); + } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -87,12 +94,23 @@ internal static MongoClusterPatch DeserializeMongoClusterPatch(JsonElement eleme { return null; } + ManagedServiceIdentity identity = default; IDictionary tags = default; MongoClusterUpdateProperties properties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); + continue; + } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -122,7 +140,7 @@ internal static MongoClusterPatch DeserializeMongoClusterPatch(JsonElement eleme } } serializedAdditionalRawData = rawDataDictionary; - return new MongoClusterPatch(tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); + return new MongoClusterPatch(identity, tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterPatch.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterPatch.cs index d58fcc456a28..1ec6dffe6e4f 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterPatch.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterPatch.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using Azure.ResourceManager.Models; namespace Azure.ResourceManager.MongoCluster.Models { @@ -52,16 +53,20 @@ public MongoClusterPatch() } /// Initializes a new instance of . + /// The managed service identities assigned to this resource. /// Resource tags. /// The resource-specific properties for this resource. /// Keeps track of any properties unknown to the library. - internal MongoClusterPatch(IDictionary tags, MongoClusterUpdateProperties properties, IDictionary serializedAdditionalRawData) + internal MongoClusterPatch(ManagedServiceIdentity identity, IDictionary tags, MongoClusterUpdateProperties properties, IDictionary serializedAdditionalRawData) { + Identity = identity; Tags = tags; Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } + /// The managed service identities assigned to this resource. + public ManagedServiceIdentity Identity { get; set; } /// Resource tags. public IDictionary Tags { get; } /// The resource-specific properties for this resource. diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterProperties.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterProperties.Serialization.cs index 9054ba5fb44d..8c118a0dad9e 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterProperties.Serialization.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterProperties.Serialization.cs @@ -104,6 +104,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("backup"u8); writer.WriteObjectValue(Backup, options); } + if (Optional.IsDefined(DataApi)) + { + writer.WritePropertyName("dataApi"u8); + writer.WriteObjectValue(DataApi, options); + } if (options.Format != "W" && Optional.IsCollectionDefined(PrivateEndpointConnections)) { writer.WritePropertyName("privateEndpointConnections"u8); @@ -134,6 +139,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("infrastructureVersion"u8); writer.WriteStringValue(InfrastructureVersion); } + if (Optional.IsDefined(AuthConfig)) + { + writer.WritePropertyName("authConfig"u8); + writer.WriteObjectValue(AuthConfig, options); + } + if (Optional.IsDefined(Encryption)) + { + writer.WritePropertyName("encryption"u8); + writer.WriteObjectValue(Encryption, options); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -185,10 +200,13 @@ internal static MongoClusterProperties DeserializeMongoClusterProperties(JsonEle ShardingProperties sharding = default; ComputeProperties compute = default; BackupProperties backup = default; + DataApiProperties dataApi = default; IReadOnlyList privateEndpointConnections = default; IList previewFeatures = default; MongoClusterReplicationProperties replica = default; string infrastructureVersion = default; + AuthConfigProperties authConfig = default; + EncryptionProperties encryption = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -311,6 +329,15 @@ internal static MongoClusterProperties DeserializeMongoClusterProperties(JsonEle backup = BackupProperties.DeserializeBackupProperties(property.Value, options); continue; } + if (property.NameEquals("dataApi"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataApi = DataApiProperties.DeserializeDataApiProperties(property.Value, options); + continue; + } if (property.NameEquals("privateEndpointConnections"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -353,6 +380,24 @@ internal static MongoClusterProperties DeserializeMongoClusterProperties(JsonEle infrastructureVersion = property.Value.GetString(); continue; } + if (property.NameEquals("authConfig"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authConfig = AuthConfigProperties.DeserializeAuthConfigProperties(property.Value, options); + continue; + } + if (property.NameEquals("encryption"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + encryption = EncryptionProperties.DeserializeEncryptionProperties(property.Value, options); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -374,10 +419,13 @@ internal static MongoClusterProperties DeserializeMongoClusterProperties(JsonEle sharding, compute, backup, + dataApi, privateEndpointConnections ?? new ChangeTrackingList(), previewFeatures ?? new ChangeTrackingList(), replica, infrastructureVersion, + authConfig, + encryption, serializedAdditionalRawData); } diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterProperties.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterProperties.cs index 34981443c068..1983385a2426 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterProperties.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterProperties.cs @@ -67,12 +67,15 @@ public MongoClusterProperties() /// The sharding properties of the mongo cluster. /// The compute properties of the mongo cluster. /// The backup properties of the mongo cluster. + /// The Data API properties of the mongo cluster. /// List of private endpoint connections. /// List of private endpoint connections. /// The replication properties for the mongo cluster. /// The infrastructure version the cluster is provisioned on. + /// The authentication configuration for the cluster. + /// The encryption configuration for the cluster. Depends on identity being configured. /// Keeps track of any properties unknown to the library. - internal MongoClusterProperties(MongoClusterCreateMode? createMode, MongoClusterRestoreContent restoreParameters, MongoClusterReplicaContent replicaParameters, MongoClusterAdministratorProperties administrator, string serverVersion, string connectionString, MongoClusterProvisioningState? provisioningState, MongoClusterStatus? clusterStatus, MongoClusterPublicNetworkAccess? publicNetworkAccess, HighAvailabilityProperties highAvailability, StorageProperties storage, ShardingProperties sharding, ComputeProperties compute, BackupProperties backup, IReadOnlyList privateEndpointConnections, IList previewFeatures, MongoClusterReplicationProperties replica, string infrastructureVersion, IDictionary serializedAdditionalRawData) + internal MongoClusterProperties(MongoClusterCreateMode? createMode, MongoClusterRestoreContent restoreParameters, MongoClusterReplicaContent replicaParameters, MongoClusterAdministratorProperties administrator, string serverVersion, string connectionString, MongoClusterProvisioningState? provisioningState, MongoClusterStatus? clusterStatus, MongoClusterPublicNetworkAccess? publicNetworkAccess, HighAvailabilityProperties highAvailability, StorageProperties storage, ShardingProperties sharding, ComputeProperties compute, BackupProperties backup, DataApiProperties dataApi, IReadOnlyList privateEndpointConnections, IList previewFeatures, MongoClusterReplicationProperties replica, string infrastructureVersion, AuthConfigProperties authConfig, EncryptionProperties encryption, IDictionary serializedAdditionalRawData) { CreateMode = createMode; RestoreParameters = restoreParameters; @@ -88,10 +91,13 @@ internal MongoClusterProperties(MongoClusterCreateMode? createMode, MongoCluster Sharding = sharding; Compute = compute; Backup = backup; + DataApi = dataApi; PrivateEndpointConnections = privateEndpointConnections; PreviewFeatures = previewFeatures; Replica = replica; InfrastructureVersion = infrastructureVersion; + AuthConfig = authConfig; + Encryption = encryption; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -128,19 +134,7 @@ public HighAvailabilityMode? HighAvailabilityTargetMode } /// The storage properties of the mongo cluster. - internal StorageProperties Storage { get; set; } - /// The size of the data disk assigned to each server. - public long? StorageSizeGb - { - get => Storage is null ? default : Storage.SizeGb; - set - { - if (Storage is null) - Storage = new StorageProperties(); - Storage.SizeGb = value; - } - } - + public StorageProperties Storage { get; set; } /// The sharding properties of the mongo cluster. internal ShardingProperties Sharding { get; set; } /// Number of shards to provision on the cluster. @@ -177,6 +171,20 @@ public string BackupEarliestRestoreTime get => Backup is null ? default : Backup.EarliestRestoreTime; } + /// The Data API properties of the mongo cluster. + internal DataApiProperties DataApi { get; set; } + /// The mode to indicate whether the Mongo Data API is enabled for a cluster. + public DataApiMode? DataApiMode + { + get => DataApi is null ? default : DataApi.Mode; + set + { + if (DataApi is null) + DataApi = new DataApiProperties(); + DataApi.Mode = value; + } + } + /// List of private endpoint connections. public IReadOnlyList PrivateEndpointConnections { get; } /// List of private endpoint connections. @@ -185,5 +193,31 @@ public string BackupEarliestRestoreTime public MongoClusterReplicationProperties Replica { get; } /// The infrastructure version the cluster is provisioned on. public string InfrastructureVersion { get; } + /// The authentication configuration for the cluster. + internal AuthConfigProperties AuthConfig { get; set; } + /// Allowed authentication modes for data access on the cluster. + public IList AuthConfigAllowedModes + { + get + { + if (AuthConfig is null) + AuthConfig = new AuthConfigProperties(); + return AuthConfig.AllowedModes; + } + } + + /// The encryption configuration for the cluster. Depends on identity being configured. + internal EncryptionProperties Encryption { get; set; } + /// Customer managed key encryption settings. + public CustomerManagedKeyEncryptionProperties CustomerManagedKeyEncryption + { + get => Encryption is null ? default : Encryption.CustomerManagedKeyEncryption; + set + { + if (Encryption is null) + Encryption = new EncryptionProperties(); + Encryption.CustomerManagedKeyEncryption = value; + } + } } } diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterUpdateProperties.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterUpdateProperties.Serialization.cs index 45edbef1df2d..8c705abd922c 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterUpdateProperties.Serialization.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterUpdateProperties.Serialization.cs @@ -74,6 +74,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("backup"u8); writer.WriteObjectValue(Backup, options); } + if (Optional.IsDefined(DataApi)) + { + writer.WritePropertyName("dataApi"u8); + writer.WriteObjectValue(DataApi, options); + } if (Optional.IsCollectionDefined(PreviewFeatures)) { writer.WritePropertyName("previewFeatures"u8); @@ -84,6 +89,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WriteEndArray(); } + if (Optional.IsDefined(AuthConfig)) + { + writer.WritePropertyName("authConfig"u8); + writer.WriteObjectValue(AuthConfig, options); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -129,7 +139,9 @@ internal static MongoClusterUpdateProperties DeserializeMongoClusterUpdateProper ShardingProperties sharding = default; ComputeProperties compute = default; BackupProperties backup = default; + DataApiProperties dataApi = default; IList previewFeatures = default; + AuthConfigProperties authConfig = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -202,6 +214,15 @@ internal static MongoClusterUpdateProperties DeserializeMongoClusterUpdateProper backup = BackupProperties.DeserializeBackupProperties(property.Value, options); continue; } + if (property.NameEquals("dataApi"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataApi = DataApiProperties.DeserializeDataApiProperties(property.Value, options); + continue; + } if (property.NameEquals("previewFeatures"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -216,6 +237,15 @@ internal static MongoClusterUpdateProperties DeserializeMongoClusterUpdateProper previewFeatures = array; continue; } + if (property.NameEquals("authConfig"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authConfig = AuthConfigProperties.DeserializeAuthConfigProperties(property.Value, options); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -231,7 +261,9 @@ internal static MongoClusterUpdateProperties DeserializeMongoClusterUpdateProper sharding, compute, backup, + dataApi, previewFeatures ?? new ChangeTrackingList(), + authConfig, serializedAdditionalRawData); } diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterUpdateProperties.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterUpdateProperties.cs index 182cdb763b42..fd4f49562aaa 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterUpdateProperties.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/MongoClusterUpdateProperties.cs @@ -60,9 +60,11 @@ public MongoClusterUpdateProperties() /// The sharding properties of the mongo cluster. /// The compute properties of the mongo cluster. /// The backup properties of the mongo cluster. + /// The Data API properties of the mongo cluster. /// List of private endpoint connections. + /// The authentication configuration for the cluster. /// Keeps track of any properties unknown to the library. - internal MongoClusterUpdateProperties(MongoClusterAdministratorProperties administrator, string serverVersion, MongoClusterPublicNetworkAccess? publicNetworkAccess, HighAvailabilityProperties highAvailability, StorageProperties storage, ShardingProperties sharding, ComputeProperties compute, BackupProperties backup, IList previewFeatures, IDictionary serializedAdditionalRawData) + internal MongoClusterUpdateProperties(MongoClusterAdministratorProperties administrator, string serverVersion, MongoClusterPublicNetworkAccess? publicNetworkAccess, HighAvailabilityProperties highAvailability, StorageProperties storage, ShardingProperties sharding, ComputeProperties compute, BackupProperties backup, DataApiProperties dataApi, IList previewFeatures, AuthConfigProperties authConfig, IDictionary serializedAdditionalRawData) { Administrator = administrator; ServerVersion = serverVersion; @@ -72,7 +74,9 @@ internal MongoClusterUpdateProperties(MongoClusterAdministratorProperties admini Sharding = sharding; Compute = compute; Backup = backup; + DataApi = dataApi; PreviewFeatures = previewFeatures; + AuthConfig = authConfig; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -97,19 +101,7 @@ public HighAvailabilityMode? HighAvailabilityTargetMode } /// The storage properties of the mongo cluster. - internal StorageProperties Storage { get; set; } - /// The size of the data disk assigned to each server. - public long? StorageSizeGb - { - get => Storage is null ? default : Storage.SizeGb; - set - { - if (Storage is null) - Storage = new StorageProperties(); - Storage.SizeGb = value; - } - } - + public StorageProperties Storage { get; set; } /// The sharding properties of the mongo cluster. internal ShardingProperties Sharding { get; set; } /// Number of shards to provision on the cluster. @@ -146,7 +138,33 @@ public string BackupEarliestRestoreTime get => Backup is null ? default : Backup.EarliestRestoreTime; } + /// The Data API properties of the mongo cluster. + internal DataApiProperties DataApi { get; set; } + /// The mode to indicate whether the Mongo Data API is enabled for a cluster. + public DataApiMode? DataApiMode + { + get => DataApi is null ? default : DataApi.Mode; + set + { + if (DataApi is null) + DataApi = new DataApiProperties(); + DataApi.Mode = value; + } + } + /// List of private endpoint connections. public IList PreviewFeatures { get; } + /// The authentication configuration for the cluster. + internal AuthConfigProperties AuthConfig { get; set; } + /// Allowed authentication modes for data access on the cluster. + public IList AuthConfigAllowedModes + { + get + { + if (AuthConfig is null) + AuthConfig = new AuthConfigProperties(); + return AuthConfig.AllowedModes; + } + } } } diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/StorageProperties.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/StorageProperties.Serialization.cs index 07212c45464e..e5bd4b06b087 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/StorageProperties.Serialization.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/StorageProperties.Serialization.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.MongoCluster.Models { - internal partial class StorageProperties : IUtf8JsonSerializable, IJsonModel + public partial class StorageProperties : IUtf8JsonSerializable, IJsonModel { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); @@ -39,6 +39,21 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("sizeGb"u8); writer.WriteNumberValue(SizeGb.Value); } + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.Value.ToString()); + } + if (Optional.IsDefined(Iops)) + { + writer.WritePropertyName("iops"u8); + writer.WriteNumberValue(Iops.Value); + } + if (Optional.IsDefined(Throughput)) + { + writer.WritePropertyName("throughput"u8); + writer.WriteNumberValue(Throughput.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -77,6 +92,9 @@ internal static StorageProperties DeserializeStorageProperties(JsonElement eleme return null; } long? sizeGb = default; + StorageType? type = default; + long? iops = default; + long? throughput = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -90,13 +108,40 @@ internal static StorageProperties DeserializeStorageProperties(JsonElement eleme sizeGb = property.Value.GetInt64(); continue; } + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new StorageType(property.Value.GetString()); + continue; + } + if (property.NameEquals("iops"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + iops = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("throughput"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + throughput = property.Value.GetInt64(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new StorageProperties(sizeGb, serializedAdditionalRawData); + return new StorageProperties(sizeGb, type, iops, throughput, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/StorageProperties.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/StorageProperties.cs index fb650b8b8a99..712fb4ed611b 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/StorageProperties.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/StorageProperties.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.MongoCluster.Models { /// The storage properties of the cluster. This includes the data storage size and scaling applied to servers in the cluster. - internal partial class StorageProperties + public partial class StorageProperties { /// /// Keeps track of any properties unknown to the library. @@ -52,14 +52,26 @@ public StorageProperties() /// Initializes a new instance of . /// The size of the data disk assigned to each server. + /// The type of storage to provision the cluster servers with. + /// The IOPs of the storage assigned to each server. Only applicable if the type is 'PremiumSSDv2'. + /// The throughput of the storage assigned to each server. Only applicable if the type is 'PremiumSSDv2'. /// Keeps track of any properties unknown to the library. - internal StorageProperties(long? sizeGb, IDictionary serializedAdditionalRawData) + internal StorageProperties(long? sizeGb, StorageType? type, long? iops, long? throughput, IDictionary serializedAdditionalRawData) { SizeGb = sizeGb; + Type = type; + Iops = iops; + Throughput = throughput; _serializedAdditionalRawData = serializedAdditionalRawData; } /// The size of the data disk assigned to each server. public long? SizeGb { get; set; } + /// The type of storage to provision the cluster servers with. + public StorageType? Type { get; set; } + /// The IOPs of the storage assigned to each server. Only applicable if the type is 'PremiumSSDv2'. + public long? Iops { get; set; } + /// The throughput of the storage assigned to each server. Only applicable if the type is 'PremiumSSDv2'. + public long? Throughput { get; set; } } } diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/StorageType.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/StorageType.cs new file mode 100644 index 000000000000..bb0e85c796b3 --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/StorageType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MongoCluster.Models +{ + /// The type of storage that a mongo cluster can be provisioned with. + public readonly partial struct StorageType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public StorageType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PremiumSSDValue = "PremiumSSD"; + private const string PremiumSSDv2Value = "PremiumSSDv2"; + + /// Premium SSD for high performance workloads. + public static StorageType PremiumSSD { get; } = new StorageType(PremiumSSDValue); + /// Premium SSD v2 for very IO-intensive workloads. This is a preview option and has additional limitations. + public static StorageType PremiumSSDv2 { get; } = new StorageType(PremiumSSDv2Value); + /// Determines if two values are the same. + public static bool operator ==(StorageType left, StorageType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(StorageType left, StorageType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator StorageType(string value) => new StorageType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is StorageType other && Equals(other); + /// + public bool Equals(StorageType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/UnknownIdentityProvider.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/UnknownIdentityProvider.Serialization.cs new file mode 100644 index 000000000000..58f172d9b775 --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/UnknownIdentityProvider.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MongoCluster.Models +{ + internal partial class UnknownIdentityProvider : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IdentityProvider)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + IdentityProvider IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IdentityProvider)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIdentityProvider(document.RootElement, options); + } + + internal static UnknownIdentityProvider DeserializeUnknownIdentityProvider(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IdentityProviderType type = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = new IdentityProviderType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownIdentityProvider(type, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerMongoClusterContext.Default); + default: + throw new FormatException($"The model {nameof(IdentityProvider)} does not support writing '{options.Format}' format."); + } + } + + IdentityProvider IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeIdentityProvider(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IdentityProvider)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/UnknownIdentityProvider.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/UnknownIdentityProvider.cs new file mode 100644 index 000000000000..15fc720c67c4 --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/UnknownIdentityProvider.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MongoCluster.Models +{ + /// Unknown version of IdentityProvider. + internal partial class UnknownIdentityProvider : IdentityProvider + { + /// Initializes a new instance of . + /// The type of identity provider that the user belongs to. + /// Keeps track of any properties unknown to the library. + internal UnknownIdentityProvider(IdentityProviderType type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) + { + Type = type; + } + + /// Initializes a new instance of for deserialization. + internal UnknownIdentityProvider() + { + } + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/UserListResult.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/UserListResult.Serialization.cs new file mode 100644 index 000000000000..186c1cc614fe --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/UserListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MongoCluster.Models +{ + internal partial class UserListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UserListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + UserListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UserListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUserListResult(document.RootElement, options); + } + + internal static UserListResult DeserializeUserListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(UserData.DeserializeUserData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UserListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerMongoClusterContext.Default); + default: + throw new FormatException($"The model {nameof(UserListResult)} does not support writing '{options.Format}' format."); + } + } + + UserListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUserListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UserListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/UserListResult.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/UserListResult.cs new file mode 100644 index 000000000000..bc2a79d55c0a --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/UserListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.MongoCluster.Models +{ + /// The response of a User list operation. + internal partial class UserListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The User items on this page. + /// is null. + internal UserListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The User items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal UserListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal UserListResult() + { + } + + /// The User items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/UserProperties.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/UserProperties.Serialization.cs new file mode 100644 index 000000000000..f56e6da00e07 --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/UserProperties.Serialization.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MongoCluster.Models +{ + public partial class UserProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UserProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(IdentityProvider)) + { + writer.WritePropertyName("identityProvider"u8); + writer.WriteObjectValue(IdentityProvider, options); + } + if (Optional.IsCollectionDefined(Roles)) + { + writer.WritePropertyName("roles"u8); + writer.WriteStartArray(); + foreach (var item in Roles) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + UserProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UserProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUserProperties(document.RootElement, options); + } + + internal static UserProperties DeserializeUserProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MongoClusterProvisioningState? provisioningState = default; + IdentityProvider identityProvider = default; + IList roles = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new MongoClusterProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("identityProvider"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identityProvider = IdentityProvider.DeserializeIdentityProvider(property.Value, options); + continue; + } + if (property.NameEquals("roles"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DatabaseRole.DeserializeDatabaseRole(item, options)); + } + roles = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UserProperties(provisioningState, identityProvider, roles ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerMongoClusterContext.Default); + default: + throw new FormatException($"The model {nameof(UserProperties)} does not support writing '{options.Format}' format."); + } + } + + UserProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUserProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UserProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/UserProperties.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/UserProperties.cs new file mode 100644 index 000000000000..6730f6024974 --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/UserProperties.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MongoCluster.Models +{ + /// Definition of Mongo user resource on a cluster. + public partial class UserProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public UserProperties() + { + Roles = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The provisioning state of the user. + /// + /// The user's identity provider definition. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + /// Database roles that are assigned to the user. + /// Keeps track of any properties unknown to the library. + internal UserProperties(MongoClusterProvisioningState? provisioningState, IdentityProvider identityProvider, IList roles, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + IdentityProvider = identityProvider; + Roles = roles; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The provisioning state of the user. + public MongoClusterProvisioningState? ProvisioningState { get; } + /// + /// The user's identity provider definition. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + public IdentityProvider IdentityProvider { get; set; } + /// Database roles that are assigned to the user. + public IList Roles { get; } + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/UserRole.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/UserRole.cs new file mode 100644 index 000000000000..0765cd1a20c1 --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/Models/UserRole.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MongoCluster.Models +{ + /// Built-in database role that can be assigned to a user. + public readonly partial struct UserRole : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public UserRole(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string RootValue = "root"; + + /// Root role permissions on the target scope. + public static UserRole Root { get; } = new UserRole(RootValue); + /// Determines if two values are the same. + public static bool operator ==(UserRole left, UserRole right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(UserRole left, UserRole right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator UserRole(string value) => new UserRole(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is UserRole other && Equals(other); + /// + public bool Equals(UserRole other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterCollection.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterCollection.cs index c8d9efdce71d..e2cb8882eb02 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterCollection.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateAsyn /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitU /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string mongoC /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string mongoClusterName, Cance /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToken /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationToken cancellat /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string mongoClusterName, C /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string mongoClusterName, CancellationToken /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> GetIfExistsAsy /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterData.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterData.Serialization.cs index 3796cf4fd0b2..f4dce0ce07ca 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterData.Serialization.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterData.Serialization.cs @@ -42,6 +42,12 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + JsonSerializer.Serialize(writer, Identity, serializeOptions); + } } MongoClusterData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -65,6 +71,7 @@ internal static MongoClusterData DeserializeMongoClusterData(JsonElement element return null; } MongoClusterProperties properties = default; + ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -84,6 +91,16 @@ internal static MongoClusterData DeserializeMongoClusterData(JsonElement element properties = MongoClusterProperties.DeserializeMongoClusterProperties(property.Value, options); continue; } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); + continue; + } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -141,6 +158,7 @@ internal static MongoClusterData DeserializeMongoClusterData(JsonElement element tags ?? new ChangeTrackingDictionary(), location, properties, + identity, serializedAdditionalRawData); } diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterData.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterData.cs index 3b0a0ca51c84..8957c8d6213f 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterData.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterData.cs @@ -65,10 +65,12 @@ public MongoClusterData(AzureLocation location) : base(location) /// The tags. /// The location. /// The resource-specific properties for this resource. + /// The managed service identities assigned to this resource. /// Keeps track of any properties unknown to the library. - internal MongoClusterData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, MongoClusterProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal MongoClusterData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, MongoClusterProperties properties, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Properties = properties; + Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -79,5 +81,7 @@ internal MongoClusterData() /// The resource-specific properties for this resource. public MongoClusterProperties Properties { get; set; } + /// The managed service identities assigned to this resource. + public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterFirewallRuleCollection.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterFirewallRuleCollection.cs index 941f285a6a0f..6bf7280022bb 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterFirewallRuleCollection.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterFirewallRuleCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> Create /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate(Wai /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsync(s /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string firewallRul /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cance /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(CancellationTok /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string firewallRuleName, C /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string firewallRuleName, CancellationToken /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterFirewallRuleResource.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterFirewallRuleResource.cs index fd29a6f95f8d..b0c3b0117661 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterFirewallRuleResource.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterFirewallRuleResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(C /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -311,7 +311,7 @@ public virtual async Task> Update /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterPrivateEndpointConnectionResource.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterPrivateEndpointConnectionResource.cs index 07c1a1c07d42..0492ad5e44d6 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterPrivateEndpointConnectionResource.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterPrivateEndpointConnectionResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(Cance /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -311,7 +311,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterPrivateEndpointConnectionResourceCollection.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterPrivateEndpointConnectionResourceCollection.cs index 8136ff74d1d0..99a3c79f23d8 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterPrivateEndpointConnectionResourceCollection.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterPrivateEndpointConnectionResourceCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation Creat /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(strin /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetA /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(Ca /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string privateEndpointConn /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string privateEndpointConnectionName, Cance /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterResource.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterResource.cs index 6804c462bb87..cfac37bf4bd2 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterResource.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/MongoClusterResource.cs @@ -119,7 +119,7 @@ public virtual MongoClusterFirewallRuleCollection GetMongoClusterFirewallRules() /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -150,7 +150,7 @@ public virtual async Task> GetMongoCl /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -188,7 +188,7 @@ public virtual MongoClusterPrivateEndpointConnectionResourceCollection GetMongoC /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -219,7 +219,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -237,6 +237,75 @@ public virtual Response GetMongoC return GetMongoClusterPrivateEndpointConnectionResources().Get(privateEndpointConnectionName, cancellationToken); } + /// Gets a collection of UserResources in the MongoCluster. + /// An object representing collection of UserResources and their operations over a UserResource. + public virtual UserCollection GetUsers() + { + return GetCachedClient(client => new UserCollection(client, Id)); + } + + /// + /// Gets the defintion of a Mongo cluster user. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/users/{userName} + /// + /// + /// Operation Id + /// User_Get + /// + /// + /// Default Api Version + /// 2025-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the mongo cluster user. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetUserAsync(string userName, CancellationToken cancellationToken = default) + { + return await GetUsers().GetAsync(userName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the defintion of a Mongo cluster user. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/users/{userName} + /// + /// + /// Operation Id + /// User_Get + /// + /// + /// Default Api Version + /// 2025-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the mongo cluster user. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetUser(string userName, CancellationToken cancellationToken = default) + { + return GetUsers().Get(userName, cancellationToken); + } + /// /// Gets information about a mongo cluster. /// @@ -250,7 +319,7 @@ public virtual Response GetMongoC /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -290,7 +359,7 @@ public virtual async Task> GetAsync(CancellationT /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -330,7 +399,7 @@ public virtual Response Get(CancellationToken cancellation /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -372,7 +441,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -414,7 +483,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -460,7 +529,7 @@ public virtual async Task> UpdateAsync(WaitUn /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -506,7 +575,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, Mo /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -544,7 +613,7 @@ public virtual async Task> GetConn /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -582,7 +651,7 @@ public virtual Response GetConnectionString /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -628,7 +697,7 @@ public virtual async Task PromoteAsync(WaitUntil waitUntil, Promot /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -674,7 +743,7 @@ public virtual ArmOperation Promote(WaitUntil waitUntil, PromoteReplicaContent c /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// @@ -700,7 +769,7 @@ public virtual AsyncPageable GetPrivateLink /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// @@ -726,7 +795,7 @@ public virtual Pageable GetPrivateLinks(Can /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// @@ -752,7 +821,7 @@ public virtual AsyncPageable GetReplicasByParentAsync(Cance /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// @@ -778,7 +847,7 @@ public virtual Pageable GetReplicasByParent(CancellationTok /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -840,7 +909,7 @@ public virtual async Task> AddTagAsync(string key /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -902,7 +971,7 @@ public virtual Response AddTag(string key, string value, C /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -959,7 +1028,7 @@ public virtual async Task> SetTagsAsync(IDictiona /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -1016,7 +1085,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource @@ -1076,7 +1145,7 @@ public virtual async Task> RemoveTagAsync(string /// /// /// Default Api Version - /// 2024-07-01 + /// 2025-07-01-preview /// /// /// Resource diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/FirewallRulesRestOperations.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/FirewallRulesRestOperations.cs index 4d0d6ac3ecd6..f06e0ce5d6c3 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/FirewallRulesRestOperations.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/FirewallRulesRestOperations.cs @@ -32,7 +32,7 @@ public FirewallRulesRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-07-01"; + _apiVersion = apiVersion ?? "2025-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/MongoClustersRestOperations.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/MongoClustersRestOperations.cs index 159287b991d5..1098ed9d4afe 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/MongoClustersRestOperations.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/MongoClustersRestOperations.cs @@ -32,7 +32,7 @@ public MongoClustersRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-07-01"; + _apiVersion = apiVersion ?? "2025-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs index a25fc00275c0..a1abb4cf1cff 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs @@ -32,7 +32,7 @@ public PrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-07-01"; + _apiVersion = apiVersion ?? "2025-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/PrivateLinksRestOperations.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/PrivateLinksRestOperations.cs index 04d9d0daf17a..92d51f5f4eac 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/PrivateLinksRestOperations.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/PrivateLinksRestOperations.cs @@ -32,7 +32,7 @@ public PrivateLinksRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-07-01"; + _apiVersion = apiVersion ?? "2025-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/ReplicasRestOperations.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/ReplicasRestOperations.cs index c99a3c0e0d27..688d184e2840 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/ReplicasRestOperations.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/ReplicasRestOperations.cs @@ -32,7 +32,7 @@ public ReplicasRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-07-01"; + _apiVersion = apiVersion ?? "2025-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/UsersRestOperations.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/UsersRestOperations.cs new file mode 100644 index 000000000000..01ade498ad43 --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/RestOperations/UsersRestOperations.cs @@ -0,0 +1,513 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MongoCluster.Models; + +namespace Azure.ResourceManager.MongoCluster +{ + internal partial class UsersRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of UsersRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public UsersRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string mongoClusterName, string userName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/mongoClusters/", false); + uri.AppendPath(mongoClusterName, true); + uri.AppendPath("/users/", false); + uri.AppendPath(userName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string mongoClusterName, string userName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/mongoClusters/", false); + uri.AppendPath(mongoClusterName, true); + uri.AppendPath("/users/", false); + uri.AppendPath(userName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the defintion of a Mongo cluster user. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the mongo cluster. + /// The name of the mongo cluster user. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string mongoClusterName, string userName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mongoClusterName, nameof(mongoClusterName)); + Argument.AssertNotNullOrEmpty(userName, nameof(userName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, mongoClusterName, userName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + UserData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = UserData.DeserializeUserData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((UserData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the defintion of a Mongo cluster user. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the mongo cluster. + /// The name of the mongo cluster user. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string mongoClusterName, string userName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mongoClusterName, nameof(mongoClusterName)); + Argument.AssertNotNullOrEmpty(userName, nameof(userName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, mongoClusterName, userName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + UserData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = UserData.DeserializeUserData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((UserData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string mongoClusterName, string userName, UserData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/mongoClusters/", false); + uri.AppendPath(mongoClusterName, true); + uri.AppendPath("/users/", false); + uri.AppendPath(userName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string mongoClusterName, string userName, UserData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/mongoClusters/", false); + uri.AppendPath(mongoClusterName, true); + uri.AppendPath("/users/", false); + uri.AppendPath(userName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates a new user or updates an existing user on a mongo cluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the mongo cluster. + /// The name of the mongo cluster user. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string mongoClusterName, string userName, UserData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mongoClusterName, nameof(mongoClusterName)); + Argument.AssertNotNullOrEmpty(userName, nameof(userName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, mongoClusterName, userName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates a new user or updates an existing user on a mongo cluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the mongo cluster. + /// The name of the mongo cluster user. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string mongoClusterName, string userName, UserData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mongoClusterName, nameof(mongoClusterName)); + Argument.AssertNotNullOrEmpty(userName, nameof(userName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, mongoClusterName, userName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string mongoClusterName, string userName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/mongoClusters/", false); + uri.AppendPath(mongoClusterName, true); + uri.AppendPath("/users/", false); + uri.AppendPath(userName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string mongoClusterName, string userName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/mongoClusters/", false); + uri.AppendPath(mongoClusterName, true); + uri.AppendPath("/users/", false); + uri.AppendPath(userName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes a mongo cluster user. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the mongo cluster. + /// The name of the mongo cluster user. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string mongoClusterName, string userName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mongoClusterName, nameof(mongoClusterName)); + Argument.AssertNotNullOrEmpty(userName, nameof(userName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, mongoClusterName, userName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes a mongo cluster user. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the mongo cluster. + /// The name of the mongo cluster user. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string mongoClusterName, string userName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mongoClusterName, nameof(mongoClusterName)); + Argument.AssertNotNullOrEmpty(userName, nameof(userName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, mongoClusterName, userName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByMongoClusterRequestUri(string subscriptionId, string resourceGroupName, string mongoClusterName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/mongoClusters/", false); + uri.AppendPath(mongoClusterName, true); + uri.AppendPath("/users", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByMongoClusterRequest(string subscriptionId, string resourceGroupName, string mongoClusterName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/mongoClusters/", false); + uri.AppendPath(mongoClusterName, true); + uri.AppendPath("/users", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List all the users on a mongo cluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the mongo cluster. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByMongoClusterAsync(string subscriptionId, string resourceGroupName, string mongoClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mongoClusterName, nameof(mongoClusterName)); + + using var message = CreateListByMongoClusterRequest(subscriptionId, resourceGroupName, mongoClusterName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + UserListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = UserListResult.DeserializeUserListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List all the users on a mongo cluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the mongo cluster. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByMongoCluster(string subscriptionId, string resourceGroupName, string mongoClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mongoClusterName, nameof(mongoClusterName)); + + using var message = CreateListByMongoClusterRequest(subscriptionId, resourceGroupName, mongoClusterName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + UserListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = UserListResult.DeserializeUserListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByMongoClusterNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string mongoClusterName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByMongoClusterNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string mongoClusterName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List all the users on a mongo cluster. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the mongo cluster. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByMongoClusterNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string mongoClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mongoClusterName, nameof(mongoClusterName)); + + using var message = CreateListByMongoClusterNextPageRequest(nextLink, subscriptionId, resourceGroupName, mongoClusterName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + UserListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = UserListResult.DeserializeUserListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List all the users on a mongo cluster. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the mongo cluster. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByMongoClusterNextPage(string nextLink, string subscriptionId, string resourceGroupName, string mongoClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mongoClusterName, nameof(mongoClusterName)); + + using var message = CreateListByMongoClusterNextPageRequest(nextLink, subscriptionId, resourceGroupName, mongoClusterName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + UserListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = UserListResult.DeserializeUserListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/UserCollection.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/UserCollection.cs new file mode 100644 index 000000000000..b41b483d9d73 --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/UserCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MongoCluster +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetUsers method from an instance of . + /// + public partial class UserCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _userClientDiagnostics; + private readonly UsersRestOperations _userRestClient; + + /// Initializes a new instance of the class for mocking. + protected UserCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal UserCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _userClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MongoCluster", UserResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(UserResource.ResourceType, out string userApiVersion); + _userRestClient = new UsersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, userApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MongoClusterResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MongoClusterResource.ResourceType), nameof(id)); + } + + /// + /// Creates a new user or updates an existing user on a mongo cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/users/{userName} + /// + /// + /// Operation Id + /// User_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the mongo cluster user. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string userName, UserData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(userName, nameof(userName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _userClientDiagnostics.CreateScope("UserCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _userRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, userName, data, cancellationToken).ConfigureAwait(false); + var operation = new MongoClusterArmOperation(new UserOperationSource(Client), _userClientDiagnostics, Pipeline, _userRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, userName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates a new user or updates an existing user on a mongo cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/users/{userName} + /// + /// + /// Operation Id + /// User_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the mongo cluster user. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string userName, UserData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(userName, nameof(userName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _userClientDiagnostics.CreateScope("UserCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _userRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, userName, data, cancellationToken); + var operation = new MongoClusterArmOperation(new UserOperationSource(Client), _userClientDiagnostics, Pipeline, _userRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, userName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the defintion of a Mongo cluster user. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/users/{userName} + /// + /// + /// Operation Id + /// User_Get + /// + /// + /// Default Api Version + /// 2025-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the mongo cluster user. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string userName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(userName, nameof(userName)); + + using var scope = _userClientDiagnostics.CreateScope("UserCollection.Get"); + scope.Start(); + try + { + var response = await _userRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, userName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new UserResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the defintion of a Mongo cluster user. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/users/{userName} + /// + /// + /// Operation Id + /// User_Get + /// + /// + /// Default Api Version + /// 2025-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the mongo cluster user. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string userName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(userName, nameof(userName)); + + using var scope = _userClientDiagnostics.CreateScope("UserCollection.Get"); + scope.Start(); + try + { + var response = _userRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, userName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new UserResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List all the users on a mongo cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/users + /// + /// + /// Operation Id + /// User_ListByMongoCluster + /// + /// + /// Default Api Version + /// 2025-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _userRestClient.CreateListByMongoClusterRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _userRestClient.CreateListByMongoClusterNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new UserResource(Client, UserData.DeserializeUserData(e)), _userClientDiagnostics, Pipeline, "UserCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List all the users on a mongo cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/users + /// + /// + /// Operation Id + /// User_ListByMongoCluster + /// + /// + /// Default Api Version + /// 2025-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _userRestClient.CreateListByMongoClusterRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _userRestClient.CreateListByMongoClusterNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new UserResource(Client, UserData.DeserializeUserData(e)), _userClientDiagnostics, Pipeline, "UserCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/users/{userName} + /// + /// + /// Operation Id + /// User_Get + /// + /// + /// Default Api Version + /// 2025-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the mongo cluster user. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string userName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(userName, nameof(userName)); + + using var scope = _userClientDiagnostics.CreateScope("UserCollection.Exists"); + scope.Start(); + try + { + var response = await _userRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, userName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/users/{userName} + /// + /// + /// Operation Id + /// User_Get + /// + /// + /// Default Api Version + /// 2025-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the mongo cluster user. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string userName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(userName, nameof(userName)); + + using var scope = _userClientDiagnostics.CreateScope("UserCollection.Exists"); + scope.Start(); + try + { + var response = _userRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, userName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/users/{userName} + /// + /// + /// Operation Id + /// User_Get + /// + /// + /// Default Api Version + /// 2025-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the mongo cluster user. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string userName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(userName, nameof(userName)); + + using var scope = _userClientDiagnostics.CreateScope("UserCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _userRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, userName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new UserResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/users/{userName} + /// + /// + /// Operation Id + /// User_Get + /// + /// + /// Default Api Version + /// 2025-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the mongo cluster user. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string userName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(userName, nameof(userName)); + + using var scope = _userClientDiagnostics.CreateScope("UserCollection.GetIfExists"); + scope.Start(); + try + { + var response = _userRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, userName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new UserResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/UserData.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/UserData.Serialization.cs new file mode 100644 index 000000000000..abb580d9795c --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/UserData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.MongoCluster.Models; + +namespace Azure.ResourceManager.MongoCluster +{ + public partial class UserData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UserData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + UserData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UserData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUserData(document.RootElement, options); + } + + internal static UserData DeserializeUserData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + UserProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = UserProperties.DeserializeUserProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UserData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerMongoClusterContext.Default); + default: + throw new FormatException($"The model {nameof(UserData)} does not support writing '{options.Format}' format."); + } + } + + UserData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUserData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UserData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/UserData.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/UserData.cs new file mode 100644 index 000000000000..181befb637d8 --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/UserData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.MongoCluster.Models; + +namespace Azure.ResourceManager.MongoCluster +{ + /// + /// A class representing the User data model. + /// Represents a Mongo cluster user. + /// + public partial class UserData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public UserData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal UserData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, UserProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public UserProperties Properties { get; set; } + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/UserResource.Serialization.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/UserResource.Serialization.cs new file mode 100644 index 000000000000..e4d3107ca44e --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/UserResource.Serialization.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.MongoCluster +{ + public partial class UserResource : IJsonModel + { + private static UserData s_dataDeserializationInstance; + private static UserData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + UserData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerMongoClusterContext.Default); + + UserData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerMongoClusterContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/UserResource.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/UserResource.cs new file mode 100644 index 000000000000..b130fdd8903f --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Generated/UserResource.cs @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MongoCluster +{ + /// + /// A Class representing an User along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetUserResource method. + /// Otherwise you can get one from its parent resource using the GetUser method. + /// + public partial class UserResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The mongoClusterName. + /// The userName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string mongoClusterName, string userName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/users/{userName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _userClientDiagnostics; + private readonly UsersRestOperations _userRestClient; + private readonly UserData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DocumentDB/mongoClusters/users"; + + /// Initializes a new instance of the class for mocking. + protected UserResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal UserResource(ArmClient client, UserData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal UserResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _userClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MongoCluster", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string userApiVersion); + _userRestClient = new UsersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, userApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual UserData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the defintion of a Mongo cluster user. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/users/{userName} + /// + /// + /// Operation Id + /// User_Get + /// + /// + /// Default Api Version + /// 2025-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _userClientDiagnostics.CreateScope("UserResource.Get"); + scope.Start(); + try + { + var response = await _userRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new UserResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the defintion of a Mongo cluster user. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/users/{userName} + /// + /// + /// Operation Id + /// User_Get + /// + /// + /// Default Api Version + /// 2025-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _userClientDiagnostics.CreateScope("UserResource.Get"); + scope.Start(); + try + { + var response = _userRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new UserResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a mongo cluster user. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/users/{userName} + /// + /// + /// Operation Id + /// User_Delete + /// + /// + /// Default Api Version + /// 2025-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _userClientDiagnostics.CreateScope("UserResource.Delete"); + scope.Start(); + try + { + var response = await _userRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new MongoClusterArmOperation(_userClientDiagnostics, Pipeline, _userRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a mongo cluster user. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/users/{userName} + /// + /// + /// Operation Id + /// User_Delete + /// + /// + /// Default Api Version + /// 2025-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _userClientDiagnostics.CreateScope("UserResource.Delete"); + scope.Start(); + try + { + var response = _userRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new MongoClusterArmOperation(_userClientDiagnostics, Pipeline, _userRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates a new user or updates an existing user on a mongo cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/users/{userName} + /// + /// + /// Operation Id + /// User_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, UserData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _userClientDiagnostics.CreateScope("UserResource.Update"); + scope.Start(); + try + { + var response = await _userRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new MongoClusterArmOperation(new UserOperationSource(Client), _userClientDiagnostics, Pipeline, _userRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates a new user or updates an existing user on a mongo cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/users/{userName} + /// + /// + /// Operation Id + /// User_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, UserData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _userClientDiagnostics.CreateScope("UserResource.Update"); + scope.Start(); + try + { + var response = _userRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new MongoClusterArmOperation(new UserOperationSource(Client), _userClientDiagnostics, Pipeline, _userRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tests/Generated/Samples/Sample_MongoClusterCollection.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tests/Generated/Samples/Sample_MongoClusterCollection.cs index 3a1dea587e91..4b826fa2dc8f 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tests/Generated/Samples/Sample_MongoClusterCollection.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tests/Generated/Samples/Sample_MongoClusterCollection.cs @@ -9,6 +9,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; +using Azure.ResourceManager.Models; using Azure.ResourceManager.MongoCluster.Models; using Azure.ResourceManager.Resources; using NUnit.Framework; @@ -21,7 +22,7 @@ public partial class Sample_MongoClusterCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreatesANewMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_Create.json + // Generated from example definition: 2025-07-01-preview/MongoClusters_Create.json // this example is just showing the usage of "MongoCluster_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,10 +52,14 @@ public async Task CreateOrUpdate_CreatesANewMongoClusterResource() Password = "password", }, ServerVersion = "5.0", - HighAvailabilityTargetMode = HighAvailabilityMode.SameZone, - StorageSizeGb = 128L, + HighAvailabilityTargetMode = HighAvailabilityMode.ZoneRedundantPreferred, + Storage = new StorageProperties + { + SizeGb = 128L, + }, ShardingShardCount = 1, ComputeTier = "M30", + AuthConfigAllowedModes = { AuthenticationMode.NativeAuth }, }, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, mongoClusterName, data); @@ -71,7 +76,49 @@ public async Task CreateOrUpdate_CreatesANewMongoClusterResource() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreatesAReplicaMongoClusterResourceFromASourceResource() { - // Generated from example definition: 2024-07-01/MongoClusters_CreateGeoReplica.json + // Generated from example definition: 2025-07-01-preview/MongoClusters_CreateGeoReplica.json + // this example is just showing the usage of "MongoCluster_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "TestResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MongoClusterResource + MongoClusterCollection collection = resourceGroupResource.GetMongoClusters(); + + // invoke the operation + string mongoClusterName = "myReplicaMongoCluster"; + MongoClusterData data = new MongoClusterData(new AzureLocation("centralus")) + { + Properties = new MongoClusterProperties + { + CreateMode = MongoClusterCreateMode.GeoReplica, + ReplicaParameters = new MongoClusterReplicaContent(new ResourceIdentifier("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/mySourceMongoCluster"), new AzureLocation("eastus")), + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, mongoClusterName, data); + MongoClusterResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MongoClusterData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreatesAReplicaMongoClusterResourceWithCustomerManagedKeyEncryptionFromASourceResource() + { + // Generated from example definition: 2025-07-01-preview/MongoClusters_CreateGeoReplica_CMK.json // this example is just showing the usage of "MongoCluster_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -97,6 +144,14 @@ public async Task CreateOrUpdate_CreatesAReplicaMongoClusterResourceFromASourceR { CreateMode = MongoClusterCreateMode.GeoReplica, ReplicaParameters = new MongoClusterReplicaContent(new ResourceIdentifier("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/mySourceMongoCluster"), new AzureLocation("eastus")), + CustomerManagedKeyEncryption = new CustomerManagedKeyEncryptionProperties(new KeyEncryptionKeyIdentity(KeyEncryptionKeyIdentityType.UserAssignedIdentity, "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity"), "https://myVault.vault.azure.net/keys/myKey"), + }, + Identity = new ManagedServiceIdentity("UserAssigned") + { + UserAssignedIdentities = +{ +[new ResourceIdentifier("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity")] = new UserAssignedIdentity() +}, }, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, mongoClusterName, data); @@ -113,7 +168,7 @@ public async Task CreateOrUpdate_CreatesAReplicaMongoClusterResourceFromASourceR [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreatesAMongoClusterResourceFromAPointInTimeRestore() { - // Generated from example definition: 2024-07-01/MongoClusters_CreatePITR.json + // Generated from example definition: 2025-07-01-preview/MongoClusters_CreatePITR.json // this example is just showing the usage of "MongoCluster_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -155,11 +210,182 @@ public async Task CreateOrUpdate_CreatesAMongoClusterResourceFromAPointInTimeRes Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreatesAMongoClusterResourceWithCustomerManagedKeyEncryptionFromAPointInTimeRestore() + { + // Generated from example definition: 2025-07-01-preview/MongoClusters_CreatePITR_CMK.json + // this example is just showing the usage of "MongoCluster_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "TestResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MongoClusterResource + MongoClusterCollection collection = resourceGroupResource.GetMongoClusters(); + + // invoke the operation + string mongoClusterName = "myMongoCluster"; + MongoClusterData data = new MongoClusterData(new AzureLocation("westus2")) + { + Properties = new MongoClusterProperties + { + CreateMode = MongoClusterCreateMode.PointInTimeRestore, + RestoreParameters = new MongoClusterRestoreContent + { + PointInTimeUTC = DateTimeOffset.Parse("2023-01-13T20:07:35Z"), + SourceResourceId = new ResourceIdentifier("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DocumentDB/mongoClusters/myOtherMongoCluster"), + }, + CustomerManagedKeyEncryption = new CustomerManagedKeyEncryptionProperties(new KeyEncryptionKeyIdentity(KeyEncryptionKeyIdentityType.UserAssignedIdentity, "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity"), "https://myVault.vault.azure.net/keys/myKey"), + }, + Identity = new ManagedServiceIdentity("UserAssigned") + { + UserAssignedIdentities = +{ +[new ResourceIdentifier("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity")] = new UserAssignedIdentity() +}, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, mongoClusterName, data); + MongoClusterResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MongoClusterData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreatesANewMongoClusterResourceWithCustomerManagedKeyEncryption() + { + // Generated from example definition: 2025-07-01-preview/MongoClusters_Create_CMK.json + // this example is just showing the usage of "MongoCluster_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "TestResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MongoClusterResource + MongoClusterCollection collection = resourceGroupResource.GetMongoClusters(); + + // invoke the operation + string mongoClusterName = "myMongoCluster"; + MongoClusterData data = new MongoClusterData(new AzureLocation("westus2")) + { + Properties = new MongoClusterProperties + { + Administrator = new MongoClusterAdministratorProperties + { + UserName = "mongoAdmin", + Password = "password", + }, + HighAvailabilityTargetMode = HighAvailabilityMode.Disabled, + Storage = new StorageProperties + { + SizeGb = 32L, + }, + ShardingShardCount = 1, + ComputeTier = "M30", + CustomerManagedKeyEncryption = new CustomerManagedKeyEncryptionProperties(new KeyEncryptionKeyIdentity(KeyEncryptionKeyIdentityType.UserAssignedIdentity, "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity"), "https://myVault.vault.azure.net/keys/myKey"), + }, + Identity = new ManagedServiceIdentity("UserAssigned") + { + UserAssignedIdentities = +{ +[new ResourceIdentifier("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity")] = new UserAssignedIdentity() +}, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, mongoClusterName, data); + MongoClusterResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MongoClusterData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreatesANewMongoClusterResourceWithPremiumSSDv2Storage() + { + // Generated from example definition: 2025-07-01-preview/MongoClusters_Create_SSDv2.json + // this example is just showing the usage of "MongoCluster_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "TestResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MongoClusterResource + MongoClusterCollection collection = resourceGroupResource.GetMongoClusters(); + + // invoke the operation + string mongoClusterName = "myMongoCluster"; + MongoClusterData data = new MongoClusterData(new AzureLocation("westus2")) + { + Properties = new MongoClusterProperties + { + Administrator = new MongoClusterAdministratorProperties + { + UserName = "mongoAdmin", + Password = "password", + }, + ServerVersion = "5.0", + HighAvailabilityTargetMode = HighAvailabilityMode.ZoneRedundantPreferred, + Storage = new StorageProperties + { + SizeGb = 32L, + Type = StorageType.PremiumSSDv2, + Iops = 3000L, + Throughput = 125L, + }, + ShardingShardCount = 1, + ComputeTier = "M30", + AuthConfigAllowedModes = { AuthenticationMode.NativeAuth }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, mongoClusterName, data); + MongoClusterResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MongoClusterData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + [Test] [Ignore("Only validating compilation of examples")] public async Task Get_GetsAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_Get.json + // Generated from example definition: 2025-07-01-preview/MongoClusters_Get.json // this example is just showing the usage of "MongoCluster_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -192,7 +418,7 @@ public async Task Get_GetsAMongoClusterResource() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListsTheMongoClusterResourcesInAResourceGroup() { - // Generated from example definition: 2024-07-01/MongoClusters_ListByResourceGroup.json + // Generated from example definition: 2025-07-01-preview/MongoClusters_ListByResourceGroup.json // this example is just showing the usage of "MongoCluster_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -227,7 +453,7 @@ public async Task GetAll_ListsTheMongoClusterResourcesInAResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_GetsAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_Get.json + // Generated from example definition: 2025-07-01-preview/MongoClusters_Get.json // this example is just showing the usage of "MongoCluster_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -256,7 +482,7 @@ public async Task Exists_GetsAMongoClusterResource() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetsAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_Get.json + // Generated from example definition: 2025-07-01-preview/MongoClusters_Get.json // this example is just showing the usage of "MongoCluster_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tests/Generated/Samples/Sample_MongoClusterFirewallRuleCollection.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tests/Generated/Samples/Sample_MongoClusterFirewallRuleCollection.cs index f95bd4dccd14..6b2726c66539 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tests/Generated/Samples/Sample_MongoClusterFirewallRuleCollection.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tests/Generated/Samples/Sample_MongoClusterFirewallRuleCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoClusterFirewallRuleCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreatesAFirewallRuleOnAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_FirewallRuleCreate.json + // Generated from example definition: 2025-07-01-preview/MongoClusters_FirewallRuleCreate.json // this example is just showing the usage of "FirewallRule_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +59,7 @@ public async Task CreateOrUpdate_CreatesAFirewallRuleOnAMongoClusterResource() [Ignore("Only validating compilation of examples")] public async Task Get_GetsAFirewallRuleOnAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_FirewallRuleGet.json + // Generated from example definition: 2025-07-01-preview/MongoClusters_FirewallRuleGet.json // this example is just showing the usage of "FirewallRule_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -93,7 +93,7 @@ public async Task Get_GetsAFirewallRuleOnAMongoClusterResource() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListTheFirewallRulesOnAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_FirewallRuleList.json + // Generated from example definition: 2025-07-01-preview/MongoClusters_FirewallRuleList.json // this example is just showing the usage of "FirewallRule_ListByMongoCluster" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -129,7 +129,7 @@ public async Task GetAll_ListTheFirewallRulesOnAMongoClusterResource() [Ignore("Only validating compilation of examples")] public async Task Exists_GetsAFirewallRuleOnAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_FirewallRuleGet.json + // Generated from example definition: 2025-07-01-preview/MongoClusters_FirewallRuleGet.json // this example is just showing the usage of "FirewallRule_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -159,7 +159,7 @@ public async Task Exists_GetsAFirewallRuleOnAMongoClusterResource() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetsAFirewallRuleOnAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_FirewallRuleGet.json + // Generated from example definition: 2025-07-01-preview/MongoClusters_FirewallRuleGet.json // this example is just showing the usage of "FirewallRule_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tests/Generated/Samples/Sample_MongoClusterFirewallRuleResource.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tests/Generated/Samples/Sample_MongoClusterFirewallRuleResource.cs index d4aa354b7aaf..195b4832592f 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tests/Generated/Samples/Sample_MongoClusterFirewallRuleResource.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tests/Generated/Samples/Sample_MongoClusterFirewallRuleResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoClusterFirewallRuleResource [Ignore("Only validating compilation of examples")] public async Task Get_GetsAFirewallRuleOnAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_FirewallRuleGet.json + // Generated from example definition: 2025-07-01-preview/MongoClusters_FirewallRuleGet.json // this example is just showing the usage of "FirewallRule_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_GetsAFirewallRuleOnAMongoClusterResource() [Ignore("Only validating compilation of examples")] public async Task Delete_DeletesAFirewallRuleOnAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_FirewallRuleDelete.json + // Generated from example definition: 2025-07-01-preview/MongoClusters_FirewallRuleDelete.json // this example is just showing the usage of "FirewallRule_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_DeletesAFirewallRuleOnAMongoClusterResource() [Ignore("Only validating compilation of examples")] public async Task Update_CreatesAFirewallRuleOnAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_FirewallRuleCreate.json + // Generated from example definition: 2025-07-01-preview/MongoClusters_FirewallRuleCreate.json // this example is just showing the usage of "FirewallRule_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tests/Generated/Samples/Sample_MongoClusterPrivateEndpointConnectionResource.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tests/Generated/Samples/Sample_MongoClusterPrivateEndpointConnectionResource.cs index b613f615940e..daefc2d19622 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tests/Generated/Samples/Sample_MongoClusterPrivateEndpointConnectionResource.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tests/Generated/Samples/Sample_MongoClusterPrivateEndpointConnectionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoClusterPrivateEndpointConnectionResource [Ignore("Only validating compilation of examples")] public async Task Get_GetAPrivateEndpointConnectionOnAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_PrivateEndpointConnectionGet.json + // Generated from example definition: 2025-07-01-preview/MongoClusters_PrivateEndpointConnectionGet.json // this example is just showing the usage of "PrivateEndpointConnectionResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_GetAPrivateEndpointConnectionOnAMongoClusterResource() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteAPrivateEndpointConnectionOnAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_PrivateEndpointConnectionDelete.json + // Generated from example definition: 2025-07-01-preview/MongoClusters_PrivateEndpointConnectionDelete.json // this example is just showing the usage of "PrivateEndpointConnectionResource_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_DeleteAPrivateEndpointConnectionOnAMongoClusterResource [Ignore("Only validating compilation of examples")] public async Task Update_ApprovesAPrivateEndpointConnectionOnAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_PrivateEndpointConnectionPut.json + // Generated from example definition: 2025-07-01-preview/MongoClusters_PrivateEndpointConnectionPut.json // this example is just showing the usage of "PrivateEndpointConnectionResource_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tests/Generated/Samples/Sample_MongoClusterPrivateEndpointConnectionResourceCollection.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tests/Generated/Samples/Sample_MongoClusterPrivateEndpointConnectionResourceCollection.cs index f0480e5f2648..04e5d4457361 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tests/Generated/Samples/Sample_MongoClusterPrivateEndpointConnectionResourceCollection.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tests/Generated/Samples/Sample_MongoClusterPrivateEndpointConnectionResourceCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoClusterPrivateEndpointConnectionResourceCollect [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_ApprovesAPrivateEndpointConnectionOnAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_PrivateEndpointConnectionPut.json + // Generated from example definition: 2025-07-01-preview/MongoClusters_PrivateEndpointConnectionPut.json // this example is just showing the usage of "PrivateEndpointConnectionResource_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -63,7 +63,7 @@ public async Task CreateOrUpdate_ApprovesAPrivateEndpointConnectionOnAMongoClust [Ignore("Only validating compilation of examples")] public async Task Get_GetAPrivateEndpointConnectionOnAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_PrivateEndpointConnectionGet.json + // Generated from example definition: 2025-07-01-preview/MongoClusters_PrivateEndpointConnectionGet.json // this example is just showing the usage of "PrivateEndpointConnectionResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -97,7 +97,7 @@ public async Task Get_GetAPrivateEndpointConnectionOnAMongoClusterResource() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListsThePrivateEndpointConnectionResourcesOnAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_PrivateEndpointConnectionList.json + // Generated from example definition: 2025-07-01-preview/MongoClusters_PrivateEndpointConnectionList.json // this example is just showing the usage of "PrivateEndpointConnectionResource_ListByMongoCluster" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -133,7 +133,7 @@ public async Task GetAll_ListsThePrivateEndpointConnectionResourcesOnAMongoClust [Ignore("Only validating compilation of examples")] public async Task Exists_GetAPrivateEndpointConnectionOnAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_PrivateEndpointConnectionGet.json + // Generated from example definition: 2025-07-01-preview/MongoClusters_PrivateEndpointConnectionGet.json // this example is just showing the usage of "PrivateEndpointConnectionResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -163,7 +163,7 @@ public async Task Exists_GetAPrivateEndpointConnectionOnAMongoClusterResource() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetAPrivateEndpointConnectionOnAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_PrivateEndpointConnectionGet.json + // Generated from example definition: 2025-07-01-preview/MongoClusters_PrivateEndpointConnectionGet.json // this example is just showing the usage of "PrivateEndpointConnectionResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tests/Generated/Samples/Sample_MongoClusterResource.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tests/Generated/Samples/Sample_MongoClusterResource.cs index 89dc0e9ea8fe..5f5be7a02673 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tests/Generated/Samples/Sample_MongoClusterResource.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tests/Generated/Samples/Sample_MongoClusterResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoClusterResource [Ignore("Only validating compilation of examples")] public async Task Get_GetsAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_Get.json + // Generated from example definition: 2025-07-01-preview/MongoClusters_Get.json // this example is just showing the usage of "MongoCluster_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task Get_GetsAMongoClusterResource() [Ignore("Only validating compilation of examples")] public async Task Delete_DeletesAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_Delete.json + // Generated from example definition: 2025-07-01-preview/MongoClusters_Delete.json // this example is just showing the usage of "MongoCluster_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -72,11 +72,49 @@ public async Task Delete_DeletesAMongoClusterResource() Console.WriteLine("Succeeded"); } + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_EnablesDataAPIOnAMongoClusterResource() + { + // Generated from example definition: 2025-07-01-preview/MongoClusters_PatchDataApi.json + // this example is just showing the usage of "MongoCluster_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MongoClusterResource created on azure + // for more information of creating MongoClusterResource, please refer to the document of MongoClusterResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "TestResourceGroup"; + string mongoClusterName = "myMongoCluster"; + ResourceIdentifier mongoClusterResourceId = MongoClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, mongoClusterName); + MongoClusterResource mongoCluster = client.GetMongoClusterResource(mongoClusterResourceId); + + // invoke the operation + MongoClusterPatch patch = new MongoClusterPatch + { + Properties = new MongoClusterUpdateProperties + { + DataApiMode = DataApiMode.Enabled, + }, + }; + ArmOperation lro = await mongoCluster.UpdateAsync(WaitUntil.Completed, patch); + MongoClusterResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MongoClusterData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + [Test] [Ignore("Only validating compilation of examples")] public async Task Update_UpdatesTheDiskSizeOnAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_PatchDiskSize.json + // Generated from example definition: 2025-07-01-preview/MongoClusters_PatchDiskSize.json // this example is just showing the usage of "MongoCluster_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -97,7 +135,48 @@ public async Task Update_UpdatesTheDiskSizeOnAMongoClusterResource() { Properties = new MongoClusterUpdateProperties { - StorageSizeGb = 256L, + Storage = new StorageProperties + { + SizeGb = 256L, + }, + }, + }; + ArmOperation lro = await mongoCluster.UpdateAsync(WaitUntil.Completed, patch); + MongoClusterResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MongoClusterData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_UpdatesTheAllowedAuthenticationModesToIncludeMicrosoftEntraIDAuthentication() + { + // Generated from example definition: 2025-07-01-preview/MongoClusters_PatchEnableEntraIDAuth.json + // this example is just showing the usage of "MongoCluster_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MongoClusterResource created on azure + // for more information of creating MongoClusterResource, please refer to the document of MongoClusterResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "TestResourceGroup"; + string mongoClusterName = "myMongoCluster"; + ResourceIdentifier mongoClusterResourceId = MongoClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, mongoClusterName); + MongoClusterResource mongoCluster = client.GetMongoClusterResource(mongoClusterResourceId); + + // invoke the operation + MongoClusterPatch patch = new MongoClusterPatch + { + Properties = new MongoClusterUpdateProperties + { + AuthConfigAllowedModes = { AuthenticationMode.NativeAuth, AuthenticationMode.MicrosoftEntraId }, }, }; ArmOperation lro = await mongoCluster.UpdateAsync(WaitUntil.Completed, patch); @@ -114,7 +193,7 @@ public async Task Update_UpdatesTheDiskSizeOnAMongoClusterResource() [Ignore("Only validating compilation of examples")] public async Task Update_DisablesPublicNetworkAccessOnAMongoClusterResourceWithAPrivateEndpointConnection() { - // Generated from example definition: 2024-07-01/MongoClusters_PatchPrivateNetworkAccess.json + // Generated from example definition: 2025-07-01-preview/MongoClusters_PatchPrivateNetworkAccess.json // this example is just showing the usage of "MongoCluster_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -148,11 +227,55 @@ public async Task Update_DisablesPublicNetworkAccessOnAMongoClusterResourceWithA Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_UpdatesThePremiumSSDv2SizeIOPSAndThroughputOnAMongoClusterResource() + { + // Generated from example definition: 2025-07-01-preview/MongoClusters_PatchSSDv2.json + // this example is just showing the usage of "MongoCluster_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MongoClusterResource created on azure + // for more information of creating MongoClusterResource, please refer to the document of MongoClusterResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "TestResourceGroup"; + string mongoClusterName = "myMongoCluster"; + ResourceIdentifier mongoClusterResourceId = MongoClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, mongoClusterName); + MongoClusterResource mongoCluster = client.GetMongoClusterResource(mongoClusterResourceId); + + // invoke the operation + MongoClusterPatch patch = new MongoClusterPatch + { + Properties = new MongoClusterUpdateProperties + { + Storage = new StorageProperties + { + SizeGb = 128L, + Type = StorageType.PremiumSSDv2, + Iops = 5000L, + Throughput = 1000L, + }, + }, + }; + ArmOperation lro = await mongoCluster.UpdateAsync(WaitUntil.Completed, patch); + MongoClusterResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MongoClusterData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + [Test] [Ignore("Only validating compilation of examples")] public async Task Update_ResetsTheAdministratorLoginPassword() { - // Generated from example definition: 2024-07-01/MongoClusters_ResetPassword.json + // Generated from example definition: 2025-07-01-preview/MongoClusters_ResetPassword.json // this example is just showing the usage of "MongoCluster_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -194,7 +317,7 @@ public async Task Update_ResetsTheAdministratorLoginPassword() [Ignore("Only validating compilation of examples")] public async Task Update_UpdatesAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_Update.json + // Generated from example definition: 2025-07-01-preview/MongoClusters_Update.json // this example is just showing the usage of "MongoCluster_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -222,10 +345,16 @@ public async Task Update_UpdatesAMongoClusterResource() ServerVersion = "5.0", PublicNetworkAccess = MongoClusterPublicNetworkAccess.Enabled, HighAvailabilityTargetMode = HighAvailabilityMode.SameZone, - StorageSizeGb = 256L, + Storage = new StorageProperties + { + SizeGb = 256L, + Type = StorageType.PremiumSSD, + }, ShardingShardCount = 4, ComputeTier = "M50", + DataApiMode = DataApiMode.Disabled, PreviewFeatures = { }, + AuthConfigAllowedModes = { AuthenticationMode.NativeAuth }, }, }; ArmOperation lro = await mongoCluster.UpdateAsync(WaitUntil.Completed, patch); @@ -242,7 +371,7 @@ public async Task Update_UpdatesAMongoClusterResource() [Ignore("Only validating compilation of examples")] public async Task GetConnectionStrings_ListTheAvailableConnectionStringsForTheMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_ListConnectionStrings.json + // Generated from example definition: 2025-07-01-preview/MongoClusters_ListConnectionStrings.json // this example is just showing the usage of "MongoClusters_ListConnectionStrings" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -268,7 +397,7 @@ public async Task GetConnectionStrings_ListTheAvailableConnectionStringsForTheMo [Ignore("Only validating compilation of examples")] public async Task Promote_PromotesAReplicaMongoClusterResourceToAPrimaryRole() { - // Generated from example definition: 2024-07-01/MongoClusters_ForcePromoteReplica.json + // Generated from example definition: 2025-07-01-preview/MongoClusters_ForcePromoteReplica.json // this example is just showing the usage of "MongoClusters_Promote" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -298,7 +427,7 @@ public async Task Promote_PromotesAReplicaMongoClusterResourceToAPrimaryRole() [Ignore("Only validating compilation of examples")] public async Task GetPrivateLinks_ListsThePrivateLinkResourcesAvailableOnAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_PrivateLinkResourceList.json + // Generated from example definition: 2025-07-01-preview/MongoClusters_PrivateLinkResourceList.json // this example is just showing the usage of "PrivateLinkResource_ListByMongoCluster" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -327,7 +456,7 @@ public async Task GetPrivateLinks_ListsThePrivateLinkResourcesAvailableOnAMongoC [Ignore("Only validating compilation of examples")] public async Task GetReplicasByParent_ListTheReplicasLinkedToAMongoClusterResource() { - // Generated from example definition: 2024-07-01/MongoClusters_ReplicaList.json + // Generated from example definition: 2025-07-01-preview/MongoClusters_ReplicaList.json // this example is just showing the usage of "Replica_ListByParent" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index 30d2c455dea6..0cf6d8cbde6c 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -21,7 +21,7 @@ public partial class Sample_SubscriptionResourceExtensions [Ignore("Only validating compilation of examples")] public async Task GetMongoClusters_ListsTheMongoClusterResourcesInASubscription() { - // Generated from example definition: 2024-07-01/MongoClusters_List.json + // Generated from example definition: 2025-07-01-preview/MongoClusters_List.json // this example is just showing the usage of "MongoCluster_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task GetMongoClusters_ListsTheMongoClusterResourcesInASubscription( [Ignore("Only validating compilation of examples")] public async Task CheckMongoClusterNameAvailability_ChecksAndConfirmsTheMongoClusterNameIsAvailabilityForUse() { - // Generated from example definition: 2024-07-01/MongoClusters_NameAvailability.json + // Generated from example definition: 2025-07-01-preview/MongoClusters_NameAvailability.json // this example is just showing the usage of "MongoClusters_CheckMongoClusterNameAvailability" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +82,7 @@ public async Task CheckMongoClusterNameAvailability_ChecksAndConfirmsTheMongoClu [Ignore("Only validating compilation of examples")] public async Task CheckMongoClusterNameAvailability_ChecksAndReturnsThatTheMongoClusterNameIsAlreadyInUse() { - // Generated from example definition: 2024-07-01/MongoClusters_NameAvailability_AlreadyExists.json + // Generated from example definition: 2025-07-01-preview/MongoClusters_NameAvailability_AlreadyExists.json // this example is just showing the usage of "MongoClusters_CheckMongoClusterNameAvailability" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tests/Generated/Samples/Sample_UserCollection.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tests/Generated/Samples/Sample_UserCollection.cs new file mode 100644 index 000000000000..a5781a68de36 --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tests/Generated/Samples/Sample_UserCollection.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MongoCluster.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.MongoCluster.Samples +{ + public partial class Sample_UserCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreatesAUserOnAMongoClusterResource() + { + // Generated from example definition: 2025-07-01-preview/MongoClusters_UserCreateOrUpdate.json + // this example is just showing the usage of "User_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MongoClusterResource created on azure + // for more information of creating MongoClusterResource, please refer to the document of MongoClusterResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "TestGroup"; + string mongoClusterName = "myMongoCluster"; + ResourceIdentifier mongoClusterResourceId = MongoClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, mongoClusterName); + MongoClusterResource mongoCluster = client.GetMongoClusterResource(mongoClusterResourceId); + + // get the collection of this UserResource + UserCollection collection = mongoCluster.GetUsers(); + + // invoke the operation + string userName = "uuuuuuuu-uuuu-uuuu-uuuu-uuuuuuuuuuuu"; + UserData data = new UserData + { + Properties = new UserProperties + { + IdentityProvider = new EntraIdentityProvider(new EntraIdentityProviderProperties(EntraPrincipalType.User)), + Roles = { new DatabaseRole("admin", UserRole.Root) }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, userName, data); + UserResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + UserData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsAUserOnAMongoClusterResource() + { + // Generated from example definition: 2025-07-01-preview/MongoClusters_UserGet.json + // this example is just showing the usage of "User_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MongoClusterResource created on azure + // for more information of creating MongoClusterResource, please refer to the document of MongoClusterResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "TestGroup"; + string mongoClusterName = "myMongoCluster"; + ResourceIdentifier mongoClusterResourceId = MongoClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, mongoClusterName); + MongoClusterResource mongoCluster = client.GetMongoClusterResource(mongoClusterResourceId); + + // get the collection of this UserResource + UserCollection collection = mongoCluster.GetUsers(); + + // invoke the operation + string userName = "uuuuuuuu-uuuu-uuuu-uuuu-uuuuuuuuuuuu"; + UserResource result = await collection.GetAsync(userName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + UserData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListTheUsersOnAMongoClusterResource() + { + // Generated from example definition: 2025-07-01-preview/MongoClusters_UserList.json + // this example is just showing the usage of "User_ListByMongoCluster" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MongoClusterResource created on azure + // for more information of creating MongoClusterResource, please refer to the document of MongoClusterResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "TestGroup"; + string mongoClusterName = "myMongoCluster"; + ResourceIdentifier mongoClusterResourceId = MongoClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, mongoClusterName); + MongoClusterResource mongoCluster = client.GetMongoClusterResource(mongoClusterResourceId); + + // get the collection of this UserResource + UserCollection collection = mongoCluster.GetUsers(); + + // invoke the operation and iterate over the result + await foreach (UserResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + UserData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetsAUserOnAMongoClusterResource() + { + // Generated from example definition: 2025-07-01-preview/MongoClusters_UserGet.json + // this example is just showing the usage of "User_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MongoClusterResource created on azure + // for more information of creating MongoClusterResource, please refer to the document of MongoClusterResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "TestGroup"; + string mongoClusterName = "myMongoCluster"; + ResourceIdentifier mongoClusterResourceId = MongoClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, mongoClusterName); + MongoClusterResource mongoCluster = client.GetMongoClusterResource(mongoClusterResourceId); + + // get the collection of this UserResource + UserCollection collection = mongoCluster.GetUsers(); + + // invoke the operation + string userName = "uuuuuuuu-uuuu-uuuu-uuuu-uuuuuuuuuuuu"; + bool result = await collection.ExistsAsync(userName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsAUserOnAMongoClusterResource() + { + // Generated from example definition: 2025-07-01-preview/MongoClusters_UserGet.json + // this example is just showing the usage of "User_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MongoClusterResource created on azure + // for more information of creating MongoClusterResource, please refer to the document of MongoClusterResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "TestGroup"; + string mongoClusterName = "myMongoCluster"; + ResourceIdentifier mongoClusterResourceId = MongoClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, mongoClusterName); + MongoClusterResource mongoCluster = client.GetMongoClusterResource(mongoClusterResourceId); + + // get the collection of this UserResource + UserCollection collection = mongoCluster.GetUsers(); + + // invoke the operation + string userName = "uuuuuuuu-uuuu-uuuu-uuuu-uuuuuuuuuuuu"; + NullableResponse response = await collection.GetIfExistsAsync(userName); + UserResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + UserData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tests/Generated/Samples/Sample_UserResource.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tests/Generated/Samples/Sample_UserResource.cs new file mode 100644 index 000000000000..8db25ca33db7 --- /dev/null +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tests/Generated/Samples/Sample_UserResource.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MongoCluster.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.MongoCluster.Samples +{ + public partial class Sample_UserResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsAUserOnAMongoClusterResource() + { + // Generated from example definition: 2025-07-01-preview/MongoClusters_UserGet.json + // this example is just showing the usage of "User_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this UserResource created on azure + // for more information of creating UserResource, please refer to the document of UserResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "TestGroup"; + string mongoClusterName = "myMongoCluster"; + string userName = "uuuuuuuu-uuuu-uuuu-uuuu-uuuuuuuuuuuu"; + ResourceIdentifier userResourceId = UserResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, mongoClusterName, userName); + UserResource user = client.GetUserResource(userResourceId); + + // invoke the operation + UserResource result = await user.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + UserData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeletesAUserOnAMongoClusterResource() + { + // Generated from example definition: 2025-07-01-preview/MongoClusters_UserDelete.json + // this example is just showing the usage of "User_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this UserResource created on azure + // for more information of creating UserResource, please refer to the document of UserResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "TestGroup"; + string mongoClusterName = "myMongoCluster"; + string userName = "uuuuuuuu-uuuu-uuuu-uuuu-uuuuuuuuuuuu"; + ResourceIdentifier userResourceId = UserResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, mongoClusterName, userName); + UserResource user = client.GetUserResource(userResourceId); + + // invoke the operation + await user.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CreatesAUserOnAMongoClusterResource() + { + // Generated from example definition: 2025-07-01-preview/MongoClusters_UserCreateOrUpdate.json + // this example is just showing the usage of "User_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this UserResource created on azure + // for more information of creating UserResource, please refer to the document of UserResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "TestGroup"; + string mongoClusterName = "myMongoCluster"; + string userName = "uuuuuuuu-uuuu-uuuu-uuuu-uuuuuuuuuuuu"; + ResourceIdentifier userResourceId = UserResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, mongoClusterName, userName); + UserResource user = client.GetUserResource(userResourceId); + + // invoke the operation + UserData data = new UserData + { + Properties = new UserProperties + { + IdentityProvider = new EntraIdentityProvider(new EntraIdentityProviderProperties(EntraPrincipalType.User)), + Roles = { new DatabaseRole("admin", UserRole.Root) }, + }, + }; + ArmOperation lro = await user.UpdateAsync(WaitUntil.Completed, data); + UserResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + UserData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tsp-location.yaml b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tsp-location.yaml index 1d7ced7e41b4..1d35c60ea786 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tsp-location.yaml +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/tsp-location.yaml @@ -1,3 +1,4 @@ -directory: specification\mongocluster\DocumentDB.MongoCluster.Management -commit: a105688c303677e1bd3b0968b977b924f2cbbcb8 -repo: Azure/azure-rest-api-specs \ No newline at end of file +directory: specification/mongocluster/DocumentDB.MongoCluster.Management +commit: d87bb60b4d37394472fd03c39b26f29baac130bf +repo: Azure/azure-rest-api-specs +additionalDirectories: