// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // #nullable disable using System; using System.Collections.Generic; using Azure.ResourceManager.MongoCluster; namespace Azure.ResourceManager.MongoCluster.Models { /// The properties of a mongo cluster. public partial class MongoClusterProperties { /// Keeps track of any properties unknown to the library. private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . public MongoClusterProperties() { PrivateEndpointConnections = new ChangeTrackingList(); PreviewFeatures = new ChangeTrackingList(); } /// Initializes a new instance of . /// The mode to create a mongo cluster. /// The parameters to create a point-in-time restore mongo cluster. /// The parameters to create a replica mongo cluster. /// The local administrator properties for the mongo cluster. /// The Mongo DB server version. Defaults to the latest available version if not specified. /// The default mongo connection string for the cluster. /// The provisioning state of the mongo cluster. /// 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 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. /// The network bypass mode for the cluster. Setting to 'AzureCosmosDB' allows Azure Cosmos DB service to bypass network restrictions. /// 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, MongoClusterStorageProperties storage, ShardingProperties sharding, ComputeProperties compute, BackupProperties backup, DataApiProperties dataApi, IReadOnlyList privateEndpointConnections, IList previewFeatures, MongoClusterReplicationProperties replica, string infrastructureVersion, AuthConfigProperties authConfig, EncryptionProperties encryption, MongoClusterNetworkBypassMode? networkBypassMode, IDictionary additionalBinaryDataProperties) { CreateMode = createMode; RestoreParameters = restoreParameters; ReplicaParameters = replicaParameters; Administrator = administrator; ServerVersion = serverVersion; ConnectionString = connectionString; ProvisioningState = provisioningState; ClusterStatus = clusterStatus; PublicNetworkAccess = publicNetworkAccess; HighAvailability = highAvailability; Storage = storage; Sharding = sharding; Compute = compute; Backup = backup; DataApi = dataApi; PrivateEndpointConnections = privateEndpointConnections; PreviewFeatures = previewFeatures; Replica = replica; InfrastructureVersion = infrastructureVersion; AuthConfig = authConfig; Encryption = encryption; NetworkBypassMode = networkBypassMode; _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The mode to create a mongo cluster. public MongoClusterCreateMode? CreateMode { get; set; } /// The parameters to create a point-in-time restore mongo cluster. public MongoClusterRestoreContent RestoreParameters { get; set; } /// The parameters to create a replica mongo cluster. public MongoClusterReplicaContent ReplicaParameters { get; set; } /// The local administrator properties for the mongo cluster. public MongoClusterAdministratorProperties Administrator { get; set; } /// The Mongo DB server version. Defaults to the latest available version if not specified. public string ServerVersion { get; set; } /// The default mongo connection string for the cluster. public string ConnectionString { get; } /// The provisioning state of the mongo cluster. public MongoClusterProvisioningState? ProvisioningState { get; } /// The status of the mongo cluster. public MongoClusterStatus? ClusterStatus { get; } /// Whether or not public endpoint access is allowed for this mongo cluster. public MongoClusterPublicNetworkAccess? PublicNetworkAccess { get; set; } /// The high availability properties of the mongo cluster. internal HighAvailabilityProperties HighAvailability { get; set; } /// The storage properties of the mongo cluster. public MongoClusterStorageProperties Storage { get; set; } /// The sharding properties of the mongo cluster. internal ShardingProperties Sharding { get; set; } /// The compute properties of the mongo cluster. internal ComputeProperties Compute { get; set; } /// The backup properties of the mongo cluster. internal BackupProperties Backup { get; set; } /// The Data API properties of the mongo cluster. internal DataApiProperties DataApi { get; set; } /// List of private endpoint connections. public IReadOnlyList PrivateEndpointConnections { get; } /// List of private endpoint connections. public IList PreviewFeatures { get; } /// The replication properties for the mongo cluster. 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; } /// The encryption configuration for the cluster. Depends on identity being configured. internal EncryptionProperties Encryption { get; set; } /// The network bypass mode for the cluster. Setting to 'AzureCosmosDB' allows Azure Cosmos DB service to bypass network restrictions. public MongoClusterNetworkBypassMode? NetworkBypassMode { get; set; } /// The target high availability mode requested for the cluster. public HighAvailabilityMode? HighAvailabilityTargetMode { get { return HighAvailability is null ? default : HighAvailability.TargetMode; } set { if (HighAvailability is null) { HighAvailability = new HighAvailabilityProperties(); } HighAvailability.TargetMode = value; } } /// Number of shards to provision on the cluster. public int? ShardingShardCount { get { return Sharding is null ? default : Sharding.ShardCount; } set { if (Sharding is null) { Sharding = new ShardingProperties(); } Sharding.ShardCount = value; } } /// The compute tier to assign to the cluster, where each tier maps to a virtual-core and memory size. Example values: 'M30', 'M40'. public string ComputeTier { get { return Compute is null ? default : Compute.Tier; } set { if (Compute is null) { Compute = new ComputeProperties(); } Compute.Tier = value; } } /// Earliest restore timestamp in UTC ISO8601 format. public string BackupEarliestRestoreTime { get { return Backup is null ? default : Backup.EarliestRestoreTime; } } /// The mode to indicate whether the Mongo Data API is enabled for a cluster. public MongoClusterDataApiMode? DataApiMode { get { return DataApi is null ? default : DataApi.Mode; } set { if (DataApi is null) { DataApi = new DataApiProperties(); } DataApi.Mode = value; } } /// Allowed authentication modes for data access on the cluster. public IList AuthConfigAllowedModes { get { if (AuthConfig is null) { AuthConfig = new AuthConfigProperties(); } return AuthConfig.AllowedModes; } } /// Customer managed key encryption settings. public MongoClusterCmkEncryptionProperties CustomerManagedKeyEncryption { get { return Encryption is null ? default : Encryption.CustomerManagedKeyEncryption; } set { if (Encryption is null) { Encryption = new EncryptionProperties(); } Encryption.CustomerManagedKeyEncryption = value; } } } }