diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/api/Azure.ResourceManager.Sql.netstandard2.0.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/api/Azure.ResourceManager.Sql.netstandard2.0.cs index 74a6da02aede..3ef51868e5f2 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/api/Azure.ResourceManager.Sql.netstandard2.0.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/api/Azure.ResourceManager.Sql.netstandard2.0.cs @@ -287,16 +287,17 @@ protected DistributedAvailabilityGroupCollection() { } public partial class DistributedAvailabilityGroupData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public DistributedAvailabilityGroupData() { } + public System.Collections.Generic.IList Databases { get { throw null; } } public System.Guid? DistributedAvailabilityGroupId { get { throw null; } } - public string LastHardenedLsn { get { throw null; } } - public string LinkState { get { throw null; } } - public string PrimaryAvailabilityGroupName { get { throw null; } set { } } - public Azure.ResourceManager.Sql.Models.DistributedAvailabilityGroupReplicationMode? ReplicationMode { get { throw null; } set { } } - public string SecondaryAvailabilityGroupName { get { throw null; } set { } } - public string SourceEndpoint { get { throw null; } set { } } - public System.Guid? SourceReplicaId { get { throw null; } } - public string TargetDatabase { get { throw null; } set { } } - public System.Guid? TargetReplicaId { get { throw null; } } + public string DistributedAvailabilityGroupName { get { throw null; } } + public Azure.ResourceManager.Sql.Models.FailoverModeType? FailoverMode { get { throw null; } set { } } + public string InstanceAvailabilityGroupName { get { throw null; } set { } } + public Azure.ResourceManager.Sql.Models.LinkRole? InstanceLinkRole { get { throw null; } set { } } + public string PartnerAvailabilityGroupName { get { throw null; } set { } } + public string PartnerEndpoint { get { throw null; } set { } } + public Azure.ResourceManager.Sql.Models.LinkRole? PartnerLinkRole { get { throw null; } } + public Azure.ResourceManager.Sql.Models.ReplicationModeType? ReplicationMode { get { throw null; } set { } } + public Azure.ResourceManager.Sql.Models.SeedingModeType? SeedingMode { get { throw null; } set { } } Azure.ResourceManager.Sql.DistributedAvailabilityGroupData 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.Sql.DistributedAvailabilityGroupData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -312,8 +313,12 @@ protected DistributedAvailabilityGroupResource() { } public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string managedInstanceName, string distributedAvailabilityGroupName) { 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.ResourceManager.ArmOperation Failover(Azure.WaitUntil waitUntil, Azure.ResourceManager.Sql.Models.DistributedAvailabilityGroupsFailoverContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> FailoverAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Sql.Models.DistributedAvailabilityGroupsFailoverContent content, 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; } + public virtual Azure.ResourceManager.ArmOperation SetRole(Azure.WaitUntil waitUntil, Azure.ResourceManager.Sql.Models.DistributedAvailabilityGroupSetRole distributedAvailabilityGroupSetRole, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetRoleAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Sql.Models.DistributedAvailabilityGroupSetRole distributedAvailabilityGroupSetRole, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } Azure.ResourceManager.Sql.DistributedAvailabilityGroupData 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.Sql.DistributedAvailabilityGroupData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -636,6 +641,7 @@ public FailoverGroupData() { } public Azure.ResourceManager.Sql.Models.FailoverGroupReadWriteEndpoint ReadWriteEndpoint { get { throw null; } set { } } public Azure.ResourceManager.Sql.Models.FailoverGroupReplicationRole? ReplicationRole { get { throw null; } } public string ReplicationState { get { throw null; } } + public Azure.ResourceManager.Sql.Models.FailoverGroupDatabasesSecondaryType? SecondaryType { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } Azure.ResourceManager.Sql.FailoverGroupData 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) { } @@ -1835,15 +1841,22 @@ public ManagedInstanceData(Azure.Core.AzureLocation location) { } public string AdministratorLogin { get { throw null; } set { } } public string AdministratorLoginPassword { get { throw null; } set { } } public Azure.ResourceManager.Sql.Models.ManagedInstanceExternalAdministrator Administrators { get { throw null; } set { } } + public Azure.ResourceManager.Sql.Models.AuthMetadataLookupMode? AuthenticationMetadata { get { throw null; } set { } } public string Collation { get { throw null; } set { } } + public System.DateTimeOffset? CreateOn { get { throw null; } } public Azure.ResourceManager.Sql.Models.SqlBackupStorageRedundancy? CurrentBackupStorageRedundancy { get { throw null; } } + public Azure.ResourceManager.Sql.Models.ManagedInstanceDatabaseFormat? DatabaseFormat { get { throw null; } set { } } public string DnsZone { get { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("This method is obsolete and will be removed in a future release", false)] public string DnsZonePartner { get { throw null; } set { } } + public Azure.ResourceManager.Sql.Models.ExternalGovernanceStatus? ExternalGovernanceStatus { get { throw null; } } public string FullyQualifiedDomainName { get { throw null; } } + public Azure.ResourceManager.Sql.Models.HybridSecondaryUsage? HybridSecondaryUsage { get { throw null; } set { } } + public Azure.ResourceManager.Sql.Models.HybridSecondaryUsageDetected? HybridSecondaryUsageDetected { get { throw null; } } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.Core.ResourceIdentifier InstancePoolId { get { throw null; } set { } } + public bool? IsGeneralPurposeV2 { get { throw null; } set { } } public bool? IsPublicDataEndpointEnabled { get { throw null; } set { } } public bool? IsZoneRedundant { get { throw null; } set { } } public System.Uri KeyId { get { throw null; } set { } } @@ -1852,9 +1865,10 @@ public ManagedInstanceData(Azure.Core.AzureLocation location) { } public Azure.Core.ResourceIdentifier ManagedDnsZonePartner { get { throw null; } set { } } public Azure.ResourceManager.Sql.Models.ManagedServerCreateMode? ManagedInstanceCreateMode { get { throw null; } set { } } public string MinimalTlsVersion { get { throw null; } set { } } + public Azure.ResourceManager.Sql.Models.FreemiumType? PricingModel { get { throw null; } set { } } public Azure.Core.ResourceIdentifier PrimaryUserAssignedIdentityId { get { throw null; } set { } } public System.Collections.Generic.IReadOnlyList PrivateEndpointConnections { get { throw null; } } - public Azure.ResourceManager.Sql.Models.ManagedInstancePropertiesProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.Sql.Models.JobExecutionProvisioningState? ProvisioningState { get { throw null; } } public Azure.ResourceManager.Sql.Models.ManagedInstanceProxyOverride? ProxyOverride { get { throw null; } set { } } public Azure.ResourceManager.Sql.Models.SqlBackupStorageRedundancy? RequestedBackupStorageRedundancy { get { throw null; } set { } } public System.DateTimeOffset? RestorePointInTime { get { throw null; } set { } } @@ -1862,10 +1876,13 @@ public ManagedInstanceData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.Sql.Models.SqlSku Sku { get { throw null; } set { } } public Azure.Core.ResourceIdentifier SourceManagedInstanceId { get { throw null; } set { } } public string State { get { throw null; } } + public int? StorageIOps { get { throw null; } set { } } public int? StorageSizeInGB { get { throw null; } set { } } + public int? StorageThroughputMBps { get { throw null; } set { } } public Azure.Core.ResourceIdentifier SubnetId { get { throw null; } set { } } public string TimezoneId { get { throw null; } set { } } public int? VCores { get { throw null; } set { } } + public string VirtualClusterId { get { throw null; } } Azure.ResourceManager.Sql.ManagedInstanceData 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.Sql.ManagedInstanceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2317,14 +2334,16 @@ protected ManagedInstanceResource() { } public virtual Azure.Pageable GetTopQueries(int? numberOfQueries = default(int?), string databases = null, string startTime = null, string endTime = null, Azure.ResourceManager.Sql.Models.QueryTimeGrainType? interval = default(Azure.ResourceManager.Sql.Models.QueryTimeGrainType?), Azure.ResourceManager.Sql.Models.AggregationFunctionType? aggregationFunction = default(Azure.ResourceManager.Sql.Models.AggregationFunctionType?), Azure.ResourceManager.Sql.Models.SqlMetricType? observationMetric = default(Azure.ResourceManager.Sql.Models.SqlMetricType?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetTopQueriesAsync(Azure.ResourceManager.Sql.Models.ManagedInstanceResourceGetTopQueriesOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetTopQueriesAsync(int? numberOfQueries = default(int?), string databases = null, string startTime = null, string endTime = null, Azure.ResourceManager.Sql.Models.QueryTimeGrainType? interval = default(Azure.ResourceManager.Sql.Models.QueryTimeGrainType?), Azure.ResourceManager.Sql.Models.AggregationFunctionType? aggregationFunction = default(Azure.ResourceManager.Sql.Models.AggregationFunctionType?), Azure.ResourceManager.Sql.Models.SqlMetricType? observationMetric = default(Azure.ResourceManager.Sql.Models.SqlMetricType?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation RefreshStatus(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RefreshStatusAsync(Azure.WaitUntil waitUntil, 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; } public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Start(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task StartAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Stop(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task StopAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Start(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> StartAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Stop(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> StopAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } Azure.ResourceManager.Sql.ManagedInstanceData 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.Sql.ManagedInstanceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4847,6 +4866,8 @@ public SqlServerData(Azure.Core.AzureLocation location) { } public partial class SqlServerDatabaseReplicationLinkCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected SqlServerDatabaseReplicationLinkCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string linkId, Azure.ResourceManager.Sql.SqlServerDatabaseReplicationLinkData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string linkId, Azure.ResourceManager.Sql.SqlServerDatabaseReplicationLinkData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Exists(string linkId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> ExistsAsync(string linkId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(string linkId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -4863,8 +4884,9 @@ public partial class SqlServerDatabaseReplicationLinkData : Azure.ResourceManage { public SqlServerDatabaseReplicationLinkData() { } public bool? IsTerminationAllowed { get { throw null; } } - public Azure.ResourceManager.Sql.Models.ReplicationLinkType? LinkType { get { throw null; } } + public Azure.ResourceManager.Sql.Models.ReplicationLinkType? LinkType { get { throw null; } set { } } public string PartnerDatabase { get { throw null; } } + public string PartnerDatabaseId { get { throw null; } } public Azure.Core.AzureLocation? PartnerLocation { get { throw null; } } public Azure.ResourceManager.Sql.Models.SqlServerDatabaseReplicationRole? PartnerRole { get { throw null; } } public string PartnerServer { get { throw null; } } @@ -4899,6 +4921,8 @@ protected SqlServerDatabaseReplicationLinkResource() { } Azure.ResourceManager.Sql.SqlServerDatabaseReplicationLinkData 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.Sql.Models.SqlServerDatabaseReplicationLinkPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Sql.Models.SqlServerDatabaseReplicationLinkPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class SqlServerDatabaseRestorePointCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { @@ -6986,12 +7010,13 @@ public static partial class ArmSqlModelFactory public static Azure.ResourceManager.Sql.Models.AutomaticTuningServerOptions AutomaticTuningServerOptions(Azure.ResourceManager.Sql.Models.AutomaticTuningOptionModeDesired? desiredState = default(Azure.ResourceManager.Sql.Models.AutomaticTuningOptionModeDesired?), Azure.ResourceManager.Sql.Models.AutomaticTuningOptionModeActual? actualState = default(Azure.ResourceManager.Sql.Models.AutomaticTuningOptionModeActual?), int? reasonCode = default(int?), Azure.ResourceManager.Sql.Models.AutomaticTuningServerReason? reasonDesc = default(Azure.ResourceManager.Sql.Models.AutomaticTuningServerReason?)) { throw null; } public static Azure.ResourceManager.Sql.Models.AutoPauseDelayTimeRange AutoPauseDelayTimeRange(int? minValue = default(int?), int? maxValue = default(int?), int? stepSize = default(int?), int? @default = default(int?), Azure.ResourceManager.Sql.Models.PauseDelayTimeUnit? unit = default(Azure.ResourceManager.Sql.Models.PauseDelayTimeUnit?), int? doNotPauseValue = default(int?)) { throw null; } public static Azure.ResourceManager.Sql.BackupShortTermRetentionPolicyData BackupShortTermRetentionPolicyData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, int? retentionDays = default(int?), Azure.ResourceManager.Sql.Models.DiffBackupIntervalInHours? diffBackupIntervalInHours = default(Azure.ResourceManager.Sql.Models.DiffBackupIntervalInHours?)) { throw null; } + public static Azure.ResourceManager.Sql.Models.CertificateInfo CertificateInfo(string certificateName = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?)) { throw null; } public static Azure.ResourceManager.Sql.DatabaseAdvancedThreatProtectionData DatabaseAdvancedThreatProtectionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Sql.Models.AdvancedThreatProtectionState? state = default(Azure.ResourceManager.Sql.Models.AdvancedThreatProtectionState?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?)) { throw null; } public static Azure.ResourceManager.Sql.DatabaseColumnData DatabaseColumnData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Sql.Models.SqlColumnDataType? columnType = default(Azure.ResourceManager.Sql.Models.SqlColumnDataType?), Azure.ResourceManager.Sql.Models.TableTemporalType? temporalType = default(Azure.ResourceManager.Sql.Models.TableTemporalType?), bool? isMemoryOptimized = default(bool?), bool? isComputed = default(bool?)) { throw null; } public static Azure.ResourceManager.Sql.Models.DatabaseExportDefinition DatabaseExportDefinition(Azure.ResourceManager.Sql.Models.StorageKeyType storageKeyType = default(Azure.ResourceManager.Sql.Models.StorageKeyType), string storageKey = null, System.Uri storageUri = null, string administratorLogin = null, string administratorLoginPassword = null, string authenticationType = null, Azure.ResourceManager.Sql.Models.NetworkIsolationSettings networkIsolation = null) { throw null; } public static Azure.ResourceManager.Sql.Models.DatabaseIdentity DatabaseIdentity(Azure.ResourceManager.Sql.Models.DatabaseIdentityType? identityType = default(Azure.ResourceManager.Sql.Models.DatabaseIdentityType?), System.Guid? tenantId = default(System.Guid?), System.Collections.Generic.IDictionary userAssignedIdentities = null) { throw null; } public static Azure.ResourceManager.Sql.Models.DatabaseImportDefinition DatabaseImportDefinition(string databaseName = null, string edition = null, string serviceObjectiveName = null, string maxSizeBytes = null, Azure.ResourceManager.Sql.Models.StorageKeyType storageKeyType = default(Azure.ResourceManager.Sql.Models.StorageKeyType), string storageKey = null, System.Uri storageUri = null, string administratorLogin = null, string administratorLoginPassword = null, string authenticationType = null, Azure.ResourceManager.Sql.Models.NetworkIsolationSettings networkIsolation = null) { throw null; } - public static Azure.ResourceManager.Sql.Models.DatabaseOperationData DatabaseOperationData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string databaseName = null, string operation = null, string operationFriendlyName = null, int? percentComplete = default(int?), string serverName = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), Azure.ResourceManager.Sql.Models.ManagementOperationState? state = default(Azure.ResourceManager.Sql.Models.ManagementOperationState?), int? errorCode = default(int?), string errorDescription = null, int? errorSeverity = default(int?), bool? isUserError = default(bool?), System.DateTimeOffset? estimatedCompleteOn = default(System.DateTimeOffset?), string description = null, bool? isCancellable = default(bool?)) { throw null; } + public static Azure.ResourceManager.Sql.Models.DatabaseOperationData DatabaseOperationData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string databaseName = null, string operation = null, string operationFriendlyName = null, int? percentComplete = default(int?), string serverName = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), Azure.ResourceManager.Sql.Models.ManagementOperationState? state = default(Azure.ResourceManager.Sql.Models.ManagementOperationState?), int? errorCode = default(int?), string errorDescription = null, int? errorSeverity = default(int?), bool? isUserError = default(bool?), System.DateTimeOffset? estimatedCompleteOn = default(System.DateTimeOffset?), string description = null, bool? isCancellable = default(bool?), Azure.ResourceManager.Sql.Models.PhaseDetails operationPhaseDetails = null) { throw null; } public static Azure.ResourceManager.Sql.DatabaseSchemaData DatabaseSchemaData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null) { throw null; } public static Azure.ResourceManager.Sql.DatabaseTableData DatabaseTableData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Sql.Models.TableTemporalType? temporalType = default(Azure.ResourceManager.Sql.Models.TableTemporalType?), bool? isMemoryOptimized = default(bool?)) { throw null; } public static Azure.ResourceManager.Sql.Models.DatabaseUsage DatabaseUsage(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string displayName = null, double? currentValue = default(double?), double? limit = default(double?), string unit = null) { throw null; } @@ -7002,7 +7027,8 @@ public static partial class ArmSqlModelFactory public static Azure.ResourceManager.Sql.Models.DataMaskingRule DataMaskingRule(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), string kind = null, string aliasName = null, Azure.ResourceManager.Sql.Models.DataMaskingRuleState? ruleState = default(Azure.ResourceManager.Sql.Models.DataMaskingRuleState?), string schemaName = null, string tableName = null, string columnName = null, Azure.ResourceManager.Sql.Models.DataMaskingFunction? maskingFunction = default(Azure.ResourceManager.Sql.Models.DataMaskingFunction?), string numberFrom = null, string numberTo = null, string prefixSize = null, string suffixSize = null, string replacementString = null) { throw null; } public static Azure.ResourceManager.Sql.DataWarehouseUserActivityData DataWarehouseUserActivityData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, int? activeQueriesCount = default(int?)) { throw null; } public static Azure.ResourceManager.Sql.DeletedServerData DeletedServerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string version = null, System.DateTimeOffset? deletedOn = default(System.DateTimeOffset?), Azure.Core.ResourceIdentifier originalId = null, string fullyQualifiedDomainName = null) { throw null; } - public static Azure.ResourceManager.Sql.DistributedAvailabilityGroupData DistributedAvailabilityGroupData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string targetDatabase = null, string sourceEndpoint = null, string primaryAvailabilityGroupName = null, string secondaryAvailabilityGroupName = null, Azure.ResourceManager.Sql.Models.DistributedAvailabilityGroupReplicationMode? replicationMode = default(Azure.ResourceManager.Sql.Models.DistributedAvailabilityGroupReplicationMode?), System.Guid? distributedAvailabilityGroupId = default(System.Guid?), System.Guid? sourceReplicaId = default(System.Guid?), System.Guid? targetReplicaId = default(System.Guid?), string linkState = null, string lastHardenedLsn = null) { throw null; } + public static Azure.ResourceManager.Sql.DistributedAvailabilityGroupData DistributedAvailabilityGroupData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string distributedAvailabilityGroupName = null, System.Guid? distributedAvailabilityGroupId = default(System.Guid?), Azure.ResourceManager.Sql.Models.ReplicationModeType? replicationMode = default(Azure.ResourceManager.Sql.Models.ReplicationModeType?), Azure.ResourceManager.Sql.Models.LinkRole? partnerLinkRole = default(Azure.ResourceManager.Sql.Models.LinkRole?), string partnerAvailabilityGroupName = null, string partnerEndpoint = null, Azure.ResourceManager.Sql.Models.LinkRole? instanceLinkRole = default(Azure.ResourceManager.Sql.Models.LinkRole?), string instanceAvailabilityGroupName = null, Azure.ResourceManager.Sql.Models.FailoverModeType? failoverMode = default(Azure.ResourceManager.Sql.Models.FailoverModeType?), Azure.ResourceManager.Sql.Models.SeedingModeType? seedingMode = default(Azure.ResourceManager.Sql.Models.SeedingModeType?), System.Collections.Generic.IEnumerable databases = null) { throw null; } + public static Azure.ResourceManager.Sql.Models.DistributedAvailabilityGroupDatabase DistributedAvailabilityGroupDatabase(string databaseName = null, System.Guid? instanceReplicaId = default(System.Guid?), System.Guid? partnerReplicaId = default(System.Guid?), string replicaState = null, string seedingProgress = null, Azure.ResourceManager.Sql.Models.ReplicaSynchronizationHealth? synchronizationHealth = default(Azure.ResourceManager.Sql.Models.ReplicaSynchronizationHealth?), Azure.ResourceManager.Sql.Models.ReplicaConnectedState? connectedState = default(Azure.ResourceManager.Sql.Models.ReplicaConnectedState?), string lastReceivedLsn = null, System.DateTimeOffset? lastReceivedOn = default(System.DateTimeOffset?), string lastSentLsn = null, System.DateTimeOffset? lastSentOn = default(System.DateTimeOffset?), string lastCommitLsn = null, System.DateTimeOffset? lastCommitOn = default(System.DateTimeOffset?), string lastHardenedLsn = null, System.DateTimeOffset? lastHardenedOn = default(System.DateTimeOffset?), string lastBackupLsn = null, System.DateTimeOffset? lastBackupOn = default(System.DateTimeOffset?), string mostRecentLinkError = null, Azure.ResourceManager.Sql.Models.CertificateInfo partnerAuthCertValidity = null, int? instanceSendReplicationLagSeconds = default(int?), int? instanceRedoReplicationLagSeconds = default(int?)) { throw null; } public static Azure.ResourceManager.Sql.Models.EditionCapability EditionCapability(string name = null, System.Collections.Generic.IEnumerable supportedServiceLevelObjectives = null, bool? isZoneRedundant = default(bool?), Azure.ResourceManager.Sql.Models.ReadScaleCapability readScale = null, System.Collections.Generic.IEnumerable supportedStorageCapabilities = null, Azure.ResourceManager.Sql.Models.SqlCapabilityStatus? status = default(Azure.ResourceManager.Sql.Models.SqlCapabilityStatus?), string reason = null) { throw null; } public static Azure.ResourceManager.Sql.Models.ElasticPoolActivity ElasticPoolActivity(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), int? errorCode = default(int?), string errorMessage = null, int? errorSeverity = default(int?), string operation = null, System.Guid? operationId = default(System.Guid?), int? percentComplete = default(int?), int? requestedDatabaseDtuMax = default(int?), int? requestedDatabaseDtuMin = default(int?), int? requestedDtu = default(int?), string requestedElasticPoolName = null, long? requestedStorageLimitInGB = default(long?), string elasticPoolName = null, string serverName = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), string state = null, int? requestedStorageLimitInMB = default(int?), int? requestedDatabaseDtuGuarantee = default(int?), int? requestedDatabaseDtuCap = default(int?), int? requestedDtuGuarantee = default(int?)) { throw null; } public static Azure.ResourceManager.Sql.ElasticPoolData ElasticPoolData(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.Sql.Models.SqlSku sku = null, string kind = null, Azure.ResourceManager.Sql.Models.ElasticPoolState? state = default(Azure.ResourceManager.Sql.Models.ElasticPoolState?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), long? maxSizeBytes = default(long?), double? minCapacity = default(double?), Azure.ResourceManager.Sql.Models.ElasticPoolPerDatabaseSettings perDatabaseSettings = null, bool? isZoneRedundant = default(bool?), Azure.ResourceManager.Sql.Models.ElasticPoolLicenseType? licenseType = default(Azure.ResourceManager.Sql.Models.ElasticPoolLicenseType?), Azure.Core.ResourceIdentifier maintenanceConfigurationId = null, int? highAvailabilityReplicaCount = default(int?), Azure.ResourceManager.Sql.Models.SqlAlwaysEncryptedEnclaveType? preferredEnclaveType = default(Azure.ResourceManager.Sql.Models.SqlAlwaysEncryptedEnclaveType?), Azure.ResourceManager.Sql.Models.SqlAvailabilityZoneType? availabilityZone = default(Azure.ResourceManager.Sql.Models.SqlAvailabilityZoneType?)) { throw null; } @@ -7016,7 +7042,7 @@ public static partial class ArmSqlModelFactory public static Azure.ResourceManager.Sql.EndpointCertificateData EndpointCertificateData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string publicBlob = null) { throw null; } public static Azure.ResourceManager.Sql.ExtendedDatabaseBlobAuditingPolicyData ExtendedDatabaseBlobAuditingPolicyData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string predicateExpression = null, int? retentionDays = default(int?), System.Collections.Generic.IEnumerable auditActionsAndGroups = null, bool? isStorageSecondaryKeyInUse = default(bool?), bool? isAzureMonitorTargetEnabled = default(bool?), int? queueDelayMs = default(int?), bool? isManagedIdentityInUse = default(bool?), Azure.ResourceManager.Sql.Models.BlobAuditingPolicyState? state = default(Azure.ResourceManager.Sql.Models.BlobAuditingPolicyState?), string storageEndpoint = null, string storageAccountAccessKey = null, System.Guid? storageAccountSubscriptionId = default(System.Guid?)) { throw null; } public static Azure.ResourceManager.Sql.ExtendedServerBlobAuditingPolicyData ExtendedServerBlobAuditingPolicyData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, bool? isDevopsAuditEnabled = default(bool?), string predicateExpression = null, int? retentionDays = default(int?), System.Collections.Generic.IEnumerable auditActionsAndGroups = null, bool? isStorageSecondaryKeyInUse = default(bool?), bool? isAzureMonitorTargetEnabled = default(bool?), int? queueDelayMs = default(int?), bool? isManagedIdentityInUse = default(bool?), Azure.ResourceManager.Sql.Models.BlobAuditingPolicyState? state = default(Azure.ResourceManager.Sql.Models.BlobAuditingPolicyState?), string storageEndpoint = null, string storageAccountAccessKey = null, System.Guid? storageAccountSubscriptionId = default(System.Guid?)) { throw null; } - public static Azure.ResourceManager.Sql.FailoverGroupData FailoverGroupData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.Sql.Models.FailoverGroupReadWriteEndpoint readWriteEndpoint = null, Azure.ResourceManager.Sql.Models.FailoverGroupReadOnlyEndpoint readOnlyEndpoint = null, Azure.ResourceManager.Sql.Models.FailoverGroupReplicationRole? replicationRole = default(Azure.ResourceManager.Sql.Models.FailoverGroupReplicationRole?), string replicationState = null, System.Collections.Generic.IEnumerable partnerServers = null, System.Collections.Generic.IEnumerable failoverDatabases = null) { throw null; } + public static Azure.ResourceManager.Sql.FailoverGroupData FailoverGroupData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.Sql.Models.FailoverGroupReadWriteEndpoint readWriteEndpoint = null, Azure.ResourceManager.Sql.Models.FailoverGroupReadOnlyEndpoint readOnlyEndpoint = null, Azure.ResourceManager.Sql.Models.FailoverGroupReplicationRole? replicationRole = default(Azure.ResourceManager.Sql.Models.FailoverGroupReplicationRole?), string replicationState = null, System.Collections.Generic.IEnumerable partnerServers = null, System.Collections.Generic.IEnumerable failoverDatabases = null, Azure.ResourceManager.Sql.Models.FailoverGroupDatabasesSecondaryType? secondaryType = default(Azure.ResourceManager.Sql.Models.FailoverGroupDatabasesSecondaryType?)) { throw null; } public static Azure.ResourceManager.Sql.GeoBackupPolicyData GeoBackupPolicyData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string kind = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.Sql.Models.GeoBackupPolicyState state = Azure.ResourceManager.Sql.Models.GeoBackupPolicyState.Disabled, string storageType = null) { throw null; } public static Azure.ResourceManager.Sql.Models.ImportExistingDatabaseDefinition ImportExistingDatabaseDefinition(Azure.ResourceManager.Sql.Models.StorageKeyType storageKeyType = default(Azure.ResourceManager.Sql.Models.StorageKeyType), string storageKey = null, System.Uri storageUri = null, string administratorLogin = null, string administratorLoginPassword = null, string authenticationType = null, Azure.ResourceManager.Sql.Models.NetworkIsolationSettings networkIsolation = null) { throw null; } public static Azure.ResourceManager.Sql.Models.ImportExportExtensionsOperationResult ImportExportExtensionsOperationResult(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Guid? requestId = default(System.Guid?), string requestType = null, string lastModifiedTime = null, string serverName = null, string databaseName = null, string status = null, string errorMessage = null) { throw null; } @@ -7053,7 +7079,7 @@ public static partial class ArmSqlModelFactory public static Azure.ResourceManager.Sql.ManagedInstanceAdministratorData ManagedInstanceAdministratorData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Sql.Models.ManagedInstanceAdministratorType? administratorType = default(Azure.ResourceManager.Sql.Models.ManagedInstanceAdministratorType?), string login = null, System.Guid? sid = default(System.Guid?), System.Guid? tenantId = default(System.Guid?)) { throw null; } public static Azure.ResourceManager.Sql.ManagedInstanceAdvancedThreatProtectionData ManagedInstanceAdvancedThreatProtectionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Sql.Models.AdvancedThreatProtectionState? state = default(Azure.ResourceManager.Sql.Models.AdvancedThreatProtectionState?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?)) { throw null; } public static Azure.ResourceManager.Sql.ManagedInstanceAzureADOnlyAuthenticationData ManagedInstanceAzureADOnlyAuthenticationData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, bool? isAzureADOnlyAuthenticationEnabled = default(bool?)) { throw null; } - public static Azure.ResourceManager.Sql.ManagedInstanceData ManagedInstanceData(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.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.Sql.Models.SqlSku sku = null, Azure.ResourceManager.Sql.Models.ManagedInstancePropertiesProvisioningState? provisioningState = default(Azure.ResourceManager.Sql.Models.ManagedInstancePropertiesProvisioningState?), Azure.ResourceManager.Sql.Models.ManagedServerCreateMode? managedInstanceCreateMode = default(Azure.ResourceManager.Sql.Models.ManagedServerCreateMode?), string fullyQualifiedDomainName = null, string administratorLogin = null, string administratorLoginPassword = null, Azure.Core.ResourceIdentifier subnetId = null, string state = null, Azure.ResourceManager.Sql.Models.ManagedInstanceLicenseType? licenseType = default(Azure.ResourceManager.Sql.Models.ManagedInstanceLicenseType?), int? vCores = default(int?), int? storageSizeInGB = default(int?), string collation = null, string dnsZone = null, Azure.Core.ResourceIdentifier managedDnsZonePartner = null, bool? isPublicDataEndpointEnabled = default(bool?), Azure.Core.ResourceIdentifier sourceManagedInstanceId = null, System.DateTimeOffset? restorePointInTime = default(System.DateTimeOffset?), Azure.ResourceManager.Sql.Models.ManagedInstanceProxyOverride? proxyOverride = default(Azure.ResourceManager.Sql.Models.ManagedInstanceProxyOverride?), string timezoneId = null, Azure.Core.ResourceIdentifier instancePoolId = null, Azure.Core.ResourceIdentifier maintenanceConfigurationId = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, string minimalTlsVersion = null, Azure.ResourceManager.Sql.Models.SqlBackupStorageRedundancy? currentBackupStorageRedundancy = default(Azure.ResourceManager.Sql.Models.SqlBackupStorageRedundancy?), Azure.ResourceManager.Sql.Models.SqlBackupStorageRedundancy? requestedBackupStorageRedundancy = default(Azure.ResourceManager.Sql.Models.SqlBackupStorageRedundancy?), bool? isZoneRedundant = default(bool?), Azure.Core.ResourceIdentifier primaryUserAssignedIdentityId = null, System.Uri keyId = null, Azure.ResourceManager.Sql.Models.ManagedInstanceExternalAdministrator administrators = null, Azure.ResourceManager.Sql.Models.SqlServicePrincipal servicePrincipal = null) { throw null; } + public static Azure.ResourceManager.Sql.ManagedInstanceData ManagedInstanceData(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.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.Sql.Models.SqlSku sku = null, Azure.ResourceManager.Sql.Models.JobExecutionProvisioningState? provisioningState = default(Azure.ResourceManager.Sql.Models.JobExecutionProvisioningState?), Azure.ResourceManager.Sql.Models.ManagedServerCreateMode? managedInstanceCreateMode = default(Azure.ResourceManager.Sql.Models.ManagedServerCreateMode?), string fullyQualifiedDomainName = null, bool? isGeneralPurposeV2 = default(bool?), string administratorLogin = null, string administratorLoginPassword = null, Azure.Core.ResourceIdentifier subnetId = null, string state = null, Azure.ResourceManager.Sql.Models.ManagedInstanceLicenseType? licenseType = default(Azure.ResourceManager.Sql.Models.ManagedInstanceLicenseType?), Azure.ResourceManager.Sql.Models.HybridSecondaryUsage? hybridSecondaryUsage = default(Azure.ResourceManager.Sql.Models.HybridSecondaryUsage?), Azure.ResourceManager.Sql.Models.HybridSecondaryUsageDetected? hybridSecondaryUsageDetected = default(Azure.ResourceManager.Sql.Models.HybridSecondaryUsageDetected?), int? vCores = default(int?), int? storageSizeInGB = default(int?), int? storageIOps = default(int?), int? storageThroughputMBps = default(int?), string collation = null, string dnsZone = null, Azure.Core.ResourceIdentifier managedDnsZonePartner = null, bool? isPublicDataEndpointEnabled = default(bool?), Azure.Core.ResourceIdentifier sourceManagedInstanceId = null, System.DateTimeOffset? restorePointInTime = default(System.DateTimeOffset?), Azure.ResourceManager.Sql.Models.ManagedInstanceProxyOverride? proxyOverride = default(Azure.ResourceManager.Sql.Models.ManagedInstanceProxyOverride?), string timezoneId = null, Azure.Core.ResourceIdentifier instancePoolId = null, Azure.Core.ResourceIdentifier maintenanceConfigurationId = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, string minimalTlsVersion = null, Azure.ResourceManager.Sql.Models.SqlBackupStorageRedundancy? currentBackupStorageRedundancy = default(Azure.ResourceManager.Sql.Models.SqlBackupStorageRedundancy?), Azure.ResourceManager.Sql.Models.SqlBackupStorageRedundancy? requestedBackupStorageRedundancy = default(Azure.ResourceManager.Sql.Models.SqlBackupStorageRedundancy?), bool? isZoneRedundant = default(bool?), Azure.Core.ResourceIdentifier primaryUserAssignedIdentityId = null, System.Uri keyId = null, Azure.ResourceManager.Sql.Models.ManagedInstanceExternalAdministrator administrators = null, Azure.ResourceManager.Sql.Models.SqlServicePrincipal servicePrincipal = null, string virtualClusterId = null, Azure.ResourceManager.Sql.Models.ExternalGovernanceStatus? externalGovernanceStatus = default(Azure.ResourceManager.Sql.Models.ExternalGovernanceStatus?), Azure.ResourceManager.Sql.Models.FreemiumType? pricingModel = default(Azure.ResourceManager.Sql.Models.FreemiumType?), System.DateTimeOffset? createOn = default(System.DateTimeOffset?), Azure.ResourceManager.Sql.Models.AuthMetadataLookupMode? authenticationMetadata = default(Azure.ResourceManager.Sql.Models.AuthMetadataLookupMode?), Azure.ResourceManager.Sql.Models.ManagedInstanceDatabaseFormat? databaseFormat = default(Azure.ResourceManager.Sql.Models.ManagedInstanceDatabaseFormat?)) { throw null; } public static Azure.ResourceManager.Sql.ManagedInstanceDtcData ManagedInstanceDtcData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, bool? dtcEnabled = default(bool?), Azure.ResourceManager.Sql.Models.ManagedInstanceDtcSecuritySettings securitySettings = null, System.Collections.Generic.IEnumerable externalDnsSuffixSearchList = null, string dtcHostNameDnsSuffix = null, Azure.ResourceManager.Sql.Models.JobExecutionProvisioningState? provisioningState = default(Azure.ResourceManager.Sql.Models.JobExecutionProvisioningState?)) { throw null; } public static Azure.ResourceManager.Sql.Models.ManagedInstanceEditionCapability ManagedInstanceEditionCapability(string name = null, System.Collections.Generic.IEnumerable supportedFamilies = null, System.Collections.Generic.IEnumerable supportedStorageCapabilities = null, bool? isZoneRedundant = default(bool?), Azure.ResourceManager.Sql.Models.SqlCapabilityStatus? status = default(Azure.ResourceManager.Sql.Models.SqlCapabilityStatus?), string reason = null) { throw null; } public static Azure.ResourceManager.Sql.ManagedInstanceEncryptionProtectorData ManagedInstanceEncryptionProtectorData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string kind = null, string serverKeyName = null, Azure.ResourceManager.Sql.Models.SqlServerKeyType? serverKeyType = default(Azure.ResourceManager.Sql.Models.SqlServerKeyType?), System.Uri uri = null, string thumbprint = null, bool? isAutoRotationEnabled = default(bool?)) { throw null; } @@ -7067,7 +7093,7 @@ public static partial class ArmSqlModelFactory public static Azure.ResourceManager.Sql.ManagedInstanceOperationData ManagedInstanceOperationData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string managedInstanceName = null, string operation = null, string operationFriendlyName = null, int? percentComplete = default(int?), System.DateTimeOffset? startOn = default(System.DateTimeOffset?), Azure.ResourceManager.Sql.Models.ManagementOperationState? state = default(Azure.ResourceManager.Sql.Models.ManagementOperationState?), int? errorCode = default(int?), string errorDescription = null, int? errorSeverity = default(int?), bool? isUserError = default(bool?), System.DateTimeOffset? estimatedCompleteOn = default(System.DateTimeOffset?), string description = null, bool? isCancellable = default(bool?), Azure.ResourceManager.Sql.Models.ManagedInstanceOperationParametersPair operationParameters = null, Azure.ResourceManager.Sql.Models.ManagedInstanceOperationSteps operationSteps = null) { throw null; } public static Azure.ResourceManager.Sql.Models.ManagedInstanceOperationParametersPair ManagedInstanceOperationParametersPair(Azure.ResourceManager.Sql.Models.UpsertManagedServerOperationParameters currentParameters = null, Azure.ResourceManager.Sql.Models.UpsertManagedServerOperationParameters requestedParameters = null) { throw null; } public static Azure.ResourceManager.Sql.Models.ManagedInstanceOperationSteps ManagedInstanceOperationSteps(string totalSteps = null, int? currentStep = default(int?), System.Collections.Generic.IEnumerable stepsList = null) { throw null; } - public static Azure.ResourceManager.Sql.Models.ManagedInstancePatch ManagedInstancePatch(Azure.ResourceManager.Sql.Models.SqlSku sku = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.Sql.Models.ManagedInstancePropertiesProvisioningState? provisioningState = default(Azure.ResourceManager.Sql.Models.ManagedInstancePropertiesProvisioningState?), Azure.ResourceManager.Sql.Models.ManagedServerCreateMode? managedInstanceCreateMode = default(Azure.ResourceManager.Sql.Models.ManagedServerCreateMode?), string fullyQualifiedDomainName = null, string administratorLogin = null, string administratorLoginPassword = null, Azure.Core.ResourceIdentifier subnetId = null, string state = null, Azure.ResourceManager.Sql.Models.ManagedInstanceLicenseType? licenseType = default(Azure.ResourceManager.Sql.Models.ManagedInstanceLicenseType?), int? vCores = default(int?), int? storageSizeInGB = default(int?), string collation = null, string dnsZone = null, Azure.Core.ResourceIdentifier managedDnsZonePartner = null, bool? isPublicDataEndpointEnabled = default(bool?), Azure.Core.ResourceIdentifier sourceManagedInstanceId = null, System.DateTimeOffset? restorePointInTime = default(System.DateTimeOffset?), Azure.ResourceManager.Sql.Models.ManagedInstanceProxyOverride? proxyOverride = default(Azure.ResourceManager.Sql.Models.ManagedInstanceProxyOverride?), string timezoneId = null, Azure.Core.ResourceIdentifier instancePoolId = null, Azure.Core.ResourceIdentifier maintenanceConfigurationId = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, string minimalTlsVersion = null, Azure.ResourceManager.Sql.Models.SqlBackupStorageRedundancy? currentBackupStorageRedundancy = default(Azure.ResourceManager.Sql.Models.SqlBackupStorageRedundancy?), Azure.ResourceManager.Sql.Models.SqlBackupStorageRedundancy? requestedBackupStorageRedundancy = default(Azure.ResourceManager.Sql.Models.SqlBackupStorageRedundancy?), bool? isZoneRedundant = default(bool?), Azure.Core.ResourceIdentifier primaryUserAssignedIdentityId = null, System.Uri keyId = null, Azure.ResourceManager.Sql.Models.ManagedInstanceExternalAdministrator administrators = null, Azure.ResourceManager.Sql.Models.SqlServicePrincipal servicePrincipal = null) { throw null; } + public static Azure.ResourceManager.Sql.Models.ManagedInstancePatch ManagedInstancePatch(Azure.ResourceManager.Sql.Models.SqlSku sku = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.Sql.Models.JobExecutionProvisioningState? provisioningState = default(Azure.ResourceManager.Sql.Models.JobExecutionProvisioningState?), Azure.ResourceManager.Sql.Models.ManagedServerCreateMode? managedInstanceCreateMode = default(Azure.ResourceManager.Sql.Models.ManagedServerCreateMode?), string fullyQualifiedDomainName = null, bool? isGeneralPurposeV2 = default(bool?), string administratorLogin = null, string administratorLoginPassword = null, Azure.Core.ResourceIdentifier subnetId = null, string state = null, Azure.ResourceManager.Sql.Models.ManagedInstanceLicenseType? licenseType = default(Azure.ResourceManager.Sql.Models.ManagedInstanceLicenseType?), Azure.ResourceManager.Sql.Models.HybridSecondaryUsage? hybridSecondaryUsage = default(Azure.ResourceManager.Sql.Models.HybridSecondaryUsage?), Azure.ResourceManager.Sql.Models.HybridSecondaryUsageDetected? hybridSecondaryUsageDetected = default(Azure.ResourceManager.Sql.Models.HybridSecondaryUsageDetected?), int? vCores = default(int?), int? storageSizeInGB = default(int?), int? storageIOps = default(int?), int? storageThroughputMBps = default(int?), string collation = null, string dnsZone = null, Azure.Core.ResourceIdentifier managedDnsZonePartner = null, bool? isPublicDataEndpointEnabled = default(bool?), Azure.Core.ResourceIdentifier sourceManagedInstanceId = null, System.DateTimeOffset? restorePointInTime = default(System.DateTimeOffset?), Azure.ResourceManager.Sql.Models.ManagedInstanceProxyOverride? proxyOverride = default(Azure.ResourceManager.Sql.Models.ManagedInstanceProxyOverride?), string timezoneId = null, Azure.Core.ResourceIdentifier instancePoolId = null, Azure.Core.ResourceIdentifier maintenanceConfigurationId = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, string minimalTlsVersion = null, Azure.ResourceManager.Sql.Models.SqlBackupStorageRedundancy? currentBackupStorageRedundancy = default(Azure.ResourceManager.Sql.Models.SqlBackupStorageRedundancy?), Azure.ResourceManager.Sql.Models.SqlBackupStorageRedundancy? requestedBackupStorageRedundancy = default(Azure.ResourceManager.Sql.Models.SqlBackupStorageRedundancy?), bool? isZoneRedundant = default(bool?), Azure.Core.ResourceIdentifier primaryUserAssignedIdentityId = null, System.Uri keyId = null, Azure.ResourceManager.Sql.Models.ManagedInstanceExternalAdministrator administrators = null, Azure.ResourceManager.Sql.Models.SqlServicePrincipal servicePrincipal = null, string virtualClusterId = null, Azure.ResourceManager.Sql.Models.ExternalGovernanceStatus? externalGovernanceStatus = default(Azure.ResourceManager.Sql.Models.ExternalGovernanceStatus?), Azure.ResourceManager.Sql.Models.FreemiumType? pricingModel = default(Azure.ResourceManager.Sql.Models.FreemiumType?), System.DateTimeOffset? createOn = default(System.DateTimeOffset?), Azure.ResourceManager.Sql.Models.AuthMetadataLookupMode? authenticationMetadata = default(Azure.ResourceManager.Sql.Models.AuthMetadataLookupMode?), Azure.ResourceManager.Sql.Models.ManagedInstanceDatabaseFormat? databaseFormat = default(Azure.ResourceManager.Sql.Models.ManagedInstanceDatabaseFormat?)) { throw null; } public static Azure.ResourceManager.Sql.Models.ManagedInstancePecProperty ManagedInstancePecProperty(Azure.Core.ResourceIdentifier id = null, Azure.ResourceManager.Sql.Models.ManagedInstancePrivateEndpointConnectionProperties properties = null) { throw null; } public static Azure.ResourceManager.Sql.ManagedInstancePrivateEndpointConnectionData ManagedInstancePrivateEndpointConnectionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.Sql.Models.ManagedInstancePrivateLinkServiceConnectionStateProperty connectionState = null, string provisioningState = null) { throw null; } public static Azure.ResourceManager.Sql.Models.ManagedInstancePrivateEndpointConnectionProperties ManagedInstancePrivateEndpointConnectionProperties(Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.Sql.Models.ManagedInstancePrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState = null, string provisioningState = null) { throw null; } @@ -7092,12 +7118,14 @@ public static partial class ArmSqlModelFactory public static Azure.ResourceManager.Sql.Models.PartnerRegionInfo PartnerRegionInfo(Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.Sql.Models.InstanceFailoverGroupReplicationRole? replicationRole = default(Azure.ResourceManager.Sql.Models.InstanceFailoverGroupReplicationRole?)) { throw null; } public static Azure.ResourceManager.Sql.Models.PartnerServerInfo PartnerServerInfo(Azure.Core.ResourceIdentifier id = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.Sql.Models.FailoverGroupReplicationRole? replicationRole = default(Azure.ResourceManager.Sql.Models.FailoverGroupReplicationRole?)) { throw null; } public static Azure.ResourceManager.Sql.Models.PerformanceLevelCapability PerformanceLevelCapability(double? value = default(double?), Azure.ResourceManager.Sql.Models.PerformanceLevelUnit? unit = default(Azure.ResourceManager.Sql.Models.PerformanceLevelUnit?)) { throw null; } + public static Azure.ResourceManager.Sql.Models.PhaseDetails PhaseDetails(Azure.ResourceManager.Sql.Models.Phase? phase = default(Azure.ResourceManager.Sql.Models.Phase?), System.Collections.Generic.IReadOnlyDictionary phaseInformation = null) { throw null; } public static Azure.ResourceManager.Sql.Models.PrivateEndpointConnectionRequestStatus PrivateEndpointConnectionRequestStatus(Azure.Core.ResourceIdentifier privateLinkServiceId = null, string privateEndpointConnectionName = null, string status = null) { throw null; } public static Azure.ResourceManager.Sql.Models.ProxyResourceWithWritableName ProxyResourceWithWritableName(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?)) { throw null; } public static Azure.ResourceManager.Sql.Models.QueryMetricInterval QueryMetricInterval(string intervalStartTime = null, Azure.ResourceManager.Sql.Models.QueryTimeGrainType? intervalType = default(Azure.ResourceManager.Sql.Models.QueryTimeGrainType?), long? executionCount = default(long?), System.Collections.Generic.IEnumerable metrics = null) { throw null; } + public static Azure.ResourceManager.Sql.Models.QueryMetricIntervalAutoGenerated QueryMetricIntervalAutoGenerated(string intervalStartTime = null, Azure.ResourceManager.Sql.Models.QueryTimeGrainType? intervalType = default(Azure.ResourceManager.Sql.Models.QueryTimeGrainType?), long? executionCount = default(long?), System.Collections.Generic.IEnumerable metrics = null) { throw null; } public static Azure.ResourceManager.Sql.Models.QueryMetricProperties QueryMetricProperties(string name = null, string displayName = null, Azure.ResourceManager.Sql.Models.QueryMetricUnitType? unit = default(Azure.ResourceManager.Sql.Models.QueryMetricUnitType?), double? value = default(double?), double? min = default(double?), double? max = default(double?), double? avg = default(double?), double? sum = default(double?), double? stdev = default(double?)) { throw null; } public static Azure.ResourceManager.Sql.Models.QueryStatistics QueryStatistics(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string databaseName = null, string queryId = null, string startTime = null, string endTime = null, System.Collections.Generic.IEnumerable intervals = null) { throw null; } - public static Azure.ResourceManager.Sql.Models.QueryStatisticsProperties QueryStatisticsProperties(string databaseName = null, string queryId = null, string startTime = null, string endTime = null, System.Collections.Generic.IEnumerable intervals = null) { throw null; } + public static Azure.ResourceManager.Sql.Models.QueryStatisticsProperties QueryStatisticsProperties(string databaseName = null, string queryId = null, string startTime = null, string endTime = null, System.Collections.Generic.IEnumerable intervals = null) { throw null; } public static Azure.ResourceManager.Sql.Models.ReadScaleCapability ReadScaleCapability(int? maxNumberOfReplicas = default(int?), Azure.ResourceManager.Sql.Models.SqlCapabilityStatus? status = default(Azure.ResourceManager.Sql.Models.SqlCapabilityStatus?), string reason = null) { throw null; } public static Azure.ResourceManager.Sql.RecommendedActionData RecommendedActionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string kind = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), string recommendationReason = null, System.DateTimeOffset? validSince = default(System.DateTimeOffset?), System.DateTimeOffset? lastRefresh = default(System.DateTimeOffset?), Azure.ResourceManager.Sql.Models.RecommendedActionStateInfo state = null, bool? isExecutableAction = default(bool?), bool? isRevertableAction = default(bool?), bool? isArchivedAction = default(bool?), System.DateTimeOffset? executeActionStartOn = default(System.DateTimeOffset?), System.TimeSpan? executeActionDuration = default(System.TimeSpan?), System.DateTimeOffset? revertActionStartOn = default(System.DateTimeOffset?), System.TimeSpan? revertActionDuration = default(System.TimeSpan?), Azure.ResourceManager.Sql.Models.RecommendedActionInitiatedBy? executeActionInitiatedBy = default(Azure.ResourceManager.Sql.Models.RecommendedActionInitiatedBy?), System.DateTimeOffset? executeActionInitiatedOn = default(System.DateTimeOffset?), Azure.ResourceManager.Sql.Models.RecommendedActionInitiatedBy? revertActionInitiatedBy = default(Azure.ResourceManager.Sql.Models.RecommendedActionInitiatedBy?), System.DateTimeOffset? revertActionInitiatedOn = default(System.DateTimeOffset?), int? score = default(int?), Azure.ResourceManager.Sql.Models.RecommendedActionImplementationInfo implementationDetails = null, Azure.ResourceManager.Sql.Models.RecommendedActionErrorInfo errorDetails = null, System.Collections.Generic.IEnumerable estimatedImpact = null, System.Collections.Generic.IEnumerable observedImpact = null, System.Collections.Generic.IEnumerable timeSeries = null, System.Collections.Generic.IEnumerable linkedObjects = null, System.Collections.Generic.IReadOnlyDictionary details = null) { throw null; } public static Azure.ResourceManager.Sql.Models.RecommendedActionErrorInfo RecommendedActionErrorInfo(string errorCode = null, Azure.ResourceManager.Sql.Models.ActionRetryableState? isRetryable = default(Azure.ResourceManager.Sql.Models.ActionRetryableState?)) { throw null; } @@ -7109,6 +7137,7 @@ public static partial class ArmSqlModelFactory public static Azure.ResourceManager.Sql.RecoverableDatabaseData RecoverableDatabaseData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string edition = null, string serviceLevelObjective = null, string elasticPoolName = null, System.DateTimeOffset? lastAvailableBackupOn = default(System.DateTimeOffset?), System.Collections.Generic.IDictionary keys = null) { throw null; } public static Azure.ResourceManager.Sql.RecoverableManagedDatabaseData RecoverableManagedDatabaseData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string lastAvailableBackupDate = null) { throw null; } public static Azure.ResourceManager.Sql.Models.RefreshExternalGovernanceStatusOperationResult RefreshExternalGovernanceStatusOperationResult(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Guid? requestId = default(System.Guid?), string requestType = null, string queuedTime = null, string serverName = null, string status = null, string errorMessage = null) { throw null; } + public static Azure.ResourceManager.Sql.Models.RefreshExternalGovernanceStatusOperationResultMI RefreshExternalGovernanceStatusOperationResultMI(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Guid? requestId = default(System.Guid?), string requestType = null, string queuedTime = null, string managedInstanceName = null, string status = null, string errorMessage = null) { throw null; } public static Azure.ResourceManager.Sql.Models.ResourceWithWritableName ResourceWithWritableName(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?)) { throw null; } public static Azure.ResourceManager.Sql.RestorableDroppedDatabaseData RestorableDroppedDatabaseData(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.Sql.Models.SqlSku sku = null, string databaseName = null, long? maxSizeBytes = default(long?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? deletedOn = default(System.DateTimeOffset?), System.DateTimeOffset? earliestRestoreOn = default(System.DateTimeOffset?), Azure.ResourceManager.Sql.Models.SqlBackupStorageRedundancy? backupStorageRedundancy = default(Azure.ResourceManager.Sql.Models.SqlBackupStorageRedundancy?), System.Collections.Generic.IDictionary keys = null) { throw null; } public static Azure.ResourceManager.Sql.RestorableDroppedManagedDatabaseData RestorableDroppedManagedDatabaseData(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), string databaseName = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? deletedOn = default(System.DateTimeOffset?), System.DateTimeOffset? earliestRestoreOn = default(System.DateTimeOffset?)) { throw null; } @@ -7152,7 +7181,8 @@ public static partial class ArmSqlModelFactory public static Azure.ResourceManager.Sql.SqlServerCommunicationLinkData SqlServerCommunicationLinkData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), string kind = null, string state = null, string partnerServer = null) { throw null; } public static Azure.ResourceManager.Sql.SqlServerConnectionPolicyData SqlServerConnectionPolicyData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), string kind = null, Azure.ResourceManager.Sql.Models.ServerConnectionType? connectionType = default(Azure.ResourceManager.Sql.Models.ServerConnectionType?)) { throw null; } public static Azure.ResourceManager.Sql.SqlServerData SqlServerData(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.Models.ManagedServiceIdentity identity = null, string kind = null, string administratorLogin = null, string administratorLoginPassword = null, string version = null, string state = null, string fullyQualifiedDomainName = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, Azure.ResourceManager.Sql.Models.SqlMinimalTlsVersion? minTlsVersion = default(Azure.ResourceManager.Sql.Models.SqlMinimalTlsVersion?), Azure.ResourceManager.Sql.Models.ServerNetworkAccessFlag? publicNetworkAccess = default(Azure.ResourceManager.Sql.Models.ServerNetworkAccessFlag?), Azure.ResourceManager.Sql.Models.ServerWorkspaceFeature? workspaceFeature = default(Azure.ResourceManager.Sql.Models.ServerWorkspaceFeature?), Azure.Core.ResourceIdentifier primaryUserAssignedIdentityId = null, System.Guid? federatedClientId = default(System.Guid?), System.Uri keyId = null, Azure.ResourceManager.Sql.Models.ServerExternalAdministrator administrators = null, Azure.ResourceManager.Sql.Models.ServerNetworkAccessFlag? restrictOutboundNetworkAccess = default(Azure.ResourceManager.Sql.Models.ServerNetworkAccessFlag?), Azure.ResourceManager.Sql.Models.ServerNetworkAccessFlag? isIPv6Enabled = default(Azure.ResourceManager.Sql.Models.ServerNetworkAccessFlag?), Azure.ResourceManager.Sql.Models.ExternalGovernanceStatus? externalGovernanceStatus = default(Azure.ResourceManager.Sql.Models.ExternalGovernanceStatus?)) { throw null; } - public static Azure.ResourceManager.Sql.SqlServerDatabaseReplicationLinkData SqlServerDatabaseReplicationLinkData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string partnerServer = null, string partnerDatabase = null, Azure.Core.AzureLocation? partnerLocation = default(Azure.Core.AzureLocation?), Azure.ResourceManager.Sql.Models.SqlServerDatabaseReplicationRole? role = default(Azure.ResourceManager.Sql.Models.SqlServerDatabaseReplicationRole?), Azure.ResourceManager.Sql.Models.SqlServerDatabaseReplicationRole? partnerRole = default(Azure.ResourceManager.Sql.Models.SqlServerDatabaseReplicationRole?), string replicationMode = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), int? percentComplete = default(int?), Azure.ResourceManager.Sql.Models.ReplicationLinkState? replicationState = default(Azure.ResourceManager.Sql.Models.ReplicationLinkState?), bool? isTerminationAllowed = default(bool?), Azure.ResourceManager.Sql.Models.ReplicationLinkType? linkType = default(Azure.ResourceManager.Sql.Models.ReplicationLinkType?)) { throw null; } + public static Azure.ResourceManager.Sql.SqlServerDatabaseReplicationLinkData SqlServerDatabaseReplicationLinkData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string partnerServer = null, string partnerDatabase = null, string partnerDatabaseId = null, Azure.Core.AzureLocation? partnerLocation = default(Azure.Core.AzureLocation?), Azure.ResourceManager.Sql.Models.SqlServerDatabaseReplicationRole? role = default(Azure.ResourceManager.Sql.Models.SqlServerDatabaseReplicationRole?), Azure.ResourceManager.Sql.Models.SqlServerDatabaseReplicationRole? partnerRole = default(Azure.ResourceManager.Sql.Models.SqlServerDatabaseReplicationRole?), string replicationMode = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), int? percentComplete = default(int?), Azure.ResourceManager.Sql.Models.ReplicationLinkState? replicationState = default(Azure.ResourceManager.Sql.Models.ReplicationLinkState?), bool? isTerminationAllowed = default(bool?), Azure.ResourceManager.Sql.Models.ReplicationLinkType? linkType = default(Azure.ResourceManager.Sql.Models.ReplicationLinkType?)) { throw null; } + public static Azure.ResourceManager.Sql.Models.SqlServerDatabaseReplicationLinkPatch SqlServerDatabaseReplicationLinkPatch(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Sql.Models.ReplicationLinkType? linkType = default(Azure.ResourceManager.Sql.Models.ReplicationLinkType?)) { throw null; } public static Azure.ResourceManager.Sql.SqlServerDatabaseRestorePointData SqlServerDatabaseRestorePointData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.Sql.Models.RestorePointType? restorePointType = default(Azure.ResourceManager.Sql.Models.RestorePointType?), System.DateTimeOffset? earliestRestoreOn = default(System.DateTimeOffset?), System.DateTimeOffset? restorePointCreatedOn = default(System.DateTimeOffset?), string restorePointLabel = null) { throw null; } public static Azure.ResourceManager.Sql.SqlServerDevOpsAuditingSettingData SqlServerDevOpsAuditingSettingData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, bool? isAzureMonitorTargetEnabled = default(bool?), bool? isManagedIdentityInUse = default(bool?), Azure.ResourceManager.Sql.Models.BlobAuditingPolicyState? state = default(Azure.ResourceManager.Sql.Models.BlobAuditingPolicyState?), string storageEndpoint = null, string storageAccountAccessKey = null, System.Guid? storageAccountSubscriptionId = default(System.Guid?)) { throw null; } public static Azure.ResourceManager.Sql.SqlServerDnsAliasData SqlServerDnsAliasData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string azureDnsRecord = null) { throw null; } @@ -7228,6 +7258,25 @@ public static partial class ArmSqlModelFactory public static bool operator !=(Azure.ResourceManager.Sql.Models.AuthenticationName left, Azure.ResourceManager.Sql.Models.AuthenticationName right) { throw null; } public override string ToString() { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AuthMetadataLookupMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AuthMetadataLookupMode(string value) { throw null; } + public static Azure.ResourceManager.Sql.Models.AuthMetadataLookupMode AzureAD { get { throw null; } } + public static Azure.ResourceManager.Sql.Models.AuthMetadataLookupMode Paired { get { throw null; } } + public static Azure.ResourceManager.Sql.Models.AuthMetadataLookupMode Windows { get { throw null; } } + public bool Equals(Azure.ResourceManager.Sql.Models.AuthMetadataLookupMode 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.Sql.Models.AuthMetadataLookupMode left, Azure.ResourceManager.Sql.Models.AuthMetadataLookupMode right) { throw null; } + public static implicit operator Azure.ResourceManager.Sql.Models.AuthMetadataLookupMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Sql.Models.AuthMetadataLookupMode left, Azure.ResourceManager.Sql.Models.AuthMetadataLookupMode right) { throw null; } + public override string ToString() { throw null; } + } public enum AutoExecuteStatus { Default = 0, @@ -7363,6 +7412,17 @@ public enum BlobAuditingPolicyState public static bool operator !=(Azure.ResourceManager.Sql.Models.CatalogCollationType left, Azure.ResourceManager.Sql.Models.CatalogCollationType right) { throw null; } public override string ToString() { throw null; } } + public partial class CertificateInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CertificateInfo() { } + public string CertificateName { get { throw null; } } + public System.DateTimeOffset? ExpiryOn { get { throw null; } } + Azure.ResourceManager.Sql.Models.CertificateInfo 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.Sql.Models.CertificateInfo 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 ChangeLongTermRetentionBackupAccessTierParameters : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ChangeLongTermRetentionBackupAccessTierParameters(string backupStorageAccessTier, string operationMode) { } @@ -7540,6 +7600,7 @@ public DatabaseOperationData() { } public bool? IsUserError { get { throw null; } } public string Operation { get { throw null; } } public string OperationFriendlyName { get { throw null; } } + public Azure.ResourceManager.Sql.Models.PhaseDetails OperationPhaseDetails { get { throw null; } } public int? PercentComplete { get { throw null; } } public string ServerName { get { throw null; } } public System.DateTimeOffset? StartOn { get { throw null; } } @@ -7676,23 +7737,56 @@ public enum DataMaskingState public static bool operator !=(Azure.ResourceManager.Sql.Models.DiffBackupIntervalInHours left, Azure.ResourceManager.Sql.Models.DiffBackupIntervalInHours right) { throw null; } public override string ToString() { throw null; } } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct DistributedAvailabilityGroupReplicationMode : System.IEquatable + public partial class DistributedAvailabilityGroupDatabase : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public DistributedAvailabilityGroupReplicationMode(string value) { throw null; } - public static Azure.ResourceManager.Sql.Models.DistributedAvailabilityGroupReplicationMode Async { get { throw null; } } - public static Azure.ResourceManager.Sql.Models.DistributedAvailabilityGroupReplicationMode Sync { get { throw null; } } - public bool Equals(Azure.ResourceManager.Sql.Models.DistributedAvailabilityGroupReplicationMode 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.Sql.Models.DistributedAvailabilityGroupReplicationMode left, Azure.ResourceManager.Sql.Models.DistributedAvailabilityGroupReplicationMode right) { throw null; } - public static implicit operator Azure.ResourceManager.Sql.Models.DistributedAvailabilityGroupReplicationMode (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.Sql.Models.DistributedAvailabilityGroupReplicationMode left, Azure.ResourceManager.Sql.Models.DistributedAvailabilityGroupReplicationMode right) { throw null; } - public override string ToString() { throw null; } + public DistributedAvailabilityGroupDatabase() { } + public Azure.ResourceManager.Sql.Models.ReplicaConnectedState? ConnectedState { get { throw null; } } + public string DatabaseName { get { throw null; } set { } } + public int? InstanceRedoReplicationLagSeconds { get { throw null; } } + public System.Guid? InstanceReplicaId { get { throw null; } } + public int? InstanceSendReplicationLagSeconds { get { throw null; } } + public string LastBackupLsn { get { throw null; } } + public System.DateTimeOffset? LastBackupOn { get { throw null; } } + public string LastCommitLsn { get { throw null; } } + public System.DateTimeOffset? LastCommitOn { get { throw null; } } + public string LastHardenedLsn { get { throw null; } } + public System.DateTimeOffset? LastHardenedOn { get { throw null; } } + public string LastReceivedLsn { get { throw null; } } + public System.DateTimeOffset? LastReceivedOn { get { throw null; } } + public string LastSentLsn { get { throw null; } } + public System.DateTimeOffset? LastSentOn { get { throw null; } } + public string MostRecentLinkError { get { throw null; } } + public Azure.ResourceManager.Sql.Models.CertificateInfo PartnerAuthCertValidity { get { throw null; } } + public System.Guid? PartnerReplicaId { get { throw null; } } + public string ReplicaState { get { throw null; } } + public string SeedingProgress { get { throw null; } } + public Azure.ResourceManager.Sql.Models.ReplicaSynchronizationHealth? SynchronizationHealth { get { throw null; } } + Azure.ResourceManager.Sql.Models.DistributedAvailabilityGroupDatabase 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.Sql.Models.DistributedAvailabilityGroupDatabase 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 DistributedAvailabilityGroupSetRole : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DistributedAvailabilityGroupSetRole(Azure.ResourceManager.Sql.Models.InstanceRole instanceRole, Azure.ResourceManager.Sql.Models.RoleChangeType roleChangeType) { } + public Azure.ResourceManager.Sql.Models.InstanceRole InstanceRole { get { throw null; } } + public Azure.ResourceManager.Sql.Models.RoleChangeType RoleChangeType { get { throw null; } } + Azure.ResourceManager.Sql.Models.DistributedAvailabilityGroupSetRole 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.Sql.Models.DistributedAvailabilityGroupSetRole 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 DistributedAvailabilityGroupsFailoverContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DistributedAvailabilityGroupsFailoverContent(Azure.ResourceManager.Sql.Models.FailoverType failoverType) { } + public Azure.ResourceManager.Sql.Models.FailoverType FailoverType { get { throw null; } } + Azure.ResourceManager.Sql.Models.DistributedAvailabilityGroupsFailoverContent 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.Sql.Models.DistributedAvailabilityGroupsFailoverContent 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 DnsRefreshConfigurationPropertiesStatus : System.IEquatable @@ -7989,6 +8083,24 @@ internal ElasticPoolPerformanceLevelCapability() { } public static bool operator !=(Azure.ResourceManager.Sql.Models.ExternalGovernanceStatus left, Azure.ResourceManager.Sql.Models.ExternalGovernanceStatus right) { throw null; } public override string ToString() { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct FailoverGroupDatabasesSecondaryType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public FailoverGroupDatabasesSecondaryType(string value) { throw null; } + public static Azure.ResourceManager.Sql.Models.FailoverGroupDatabasesSecondaryType Geo { get { throw null; } } + public static Azure.ResourceManager.Sql.Models.FailoverGroupDatabasesSecondaryType Standby { get { throw null; } } + public bool Equals(Azure.ResourceManager.Sql.Models.FailoverGroupDatabasesSecondaryType 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.Sql.Models.FailoverGroupDatabasesSecondaryType left, Azure.ResourceManager.Sql.Models.FailoverGroupDatabasesSecondaryType right) { throw null; } + public static implicit operator Azure.ResourceManager.Sql.Models.FailoverGroupDatabasesSecondaryType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Sql.Models.FailoverGroupDatabasesSecondaryType left, Azure.ResourceManager.Sql.Models.FailoverGroupDatabasesSecondaryType right) { throw null; } + public override string ToString() { throw null; } + } public partial class FailoverGroupPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public FailoverGroupPatch() { } @@ -8001,6 +8113,7 @@ public FailoverGroupPatch() { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.ResourceManager.Sql.Models.ReadOnlyEndpointFailoverPolicy? ReadOnlyEndpointFailoverPolicy { get { throw null; } set { } } public Azure.ResourceManager.Sql.Models.FailoverGroupReadWriteEndpoint ReadWriteEndpoint { get { throw null; } set { } } + public Azure.ResourceManager.Sql.Models.FailoverGroupDatabasesSecondaryType? SecondaryType { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } Azure.ResourceManager.Sql.Models.FailoverGroupPatch 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) { } @@ -8049,6 +8162,42 @@ public FailoverGroupReadWriteEndpoint(Azure.ResourceManager.Sql.Models.ReadWrite public override string ToString() { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct FailoverModeType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public FailoverModeType(string value) { throw null; } + public static Azure.ResourceManager.Sql.Models.FailoverModeType Manual { get { throw null; } } + public static Azure.ResourceManager.Sql.Models.FailoverModeType None { get { throw null; } } + public bool Equals(Azure.ResourceManager.Sql.Models.FailoverModeType 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.Sql.Models.FailoverModeType left, Azure.ResourceManager.Sql.Models.FailoverModeType right) { throw null; } + public static implicit operator Azure.ResourceManager.Sql.Models.FailoverModeType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Sql.Models.FailoverModeType left, Azure.ResourceManager.Sql.Models.FailoverModeType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct FailoverType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public FailoverType(string value) { throw null; } + public static Azure.ResourceManager.Sql.Models.FailoverType ForcedAllowDataLoss { get { throw null; } } + public static Azure.ResourceManager.Sql.Models.FailoverType Planned { get { throw null; } } + public bool Equals(Azure.ResourceManager.Sql.Models.FailoverType 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.Sql.Models.FailoverType left, Azure.ResourceManager.Sql.Models.FailoverType right) { throw null; } + public static implicit operator Azure.ResourceManager.Sql.Models.FailoverType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Sql.Models.FailoverType left, Azure.ResourceManager.Sql.Models.FailoverType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct FreeLimitExhaustionBehavior : System.IEquatable { private readonly object _dummy; @@ -8067,6 +8216,24 @@ public FailoverGroupReadWriteEndpoint(Azure.ResourceManager.Sql.Models.ReadWrite public override string ToString() { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct FreemiumType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public FreemiumType(string value) { throw null; } + public static Azure.ResourceManager.Sql.Models.FreemiumType Freemium { get { throw null; } } + public static Azure.ResourceManager.Sql.Models.FreemiumType Regular { get { throw null; } } + public bool Equals(Azure.ResourceManager.Sql.Models.FreemiumType 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.Sql.Models.FreemiumType left, Azure.ResourceManager.Sql.Models.FreemiumType right) { throw null; } + public static implicit operator Azure.ResourceManager.Sql.Models.FreemiumType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Sql.Models.FreemiumType left, Azure.ResourceManager.Sql.Models.FreemiumType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct GeoBackupPolicyName : System.IEquatable { private readonly object _dummy; @@ -8106,6 +8273,42 @@ public enum GeoBackupPolicyState public static bool operator !=(Azure.ResourceManager.Sql.Models.GeoSecondaryInstanceType left, Azure.ResourceManager.Sql.Models.GeoSecondaryInstanceType right) { throw null; } public override string ToString() { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct HybridSecondaryUsage : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public HybridSecondaryUsage(string value) { throw null; } + public static Azure.ResourceManager.Sql.Models.HybridSecondaryUsage Active { get { throw null; } } + public static Azure.ResourceManager.Sql.Models.HybridSecondaryUsage Passive { get { throw null; } } + public bool Equals(Azure.ResourceManager.Sql.Models.HybridSecondaryUsage 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.Sql.Models.HybridSecondaryUsage left, Azure.ResourceManager.Sql.Models.HybridSecondaryUsage right) { throw null; } + public static implicit operator Azure.ResourceManager.Sql.Models.HybridSecondaryUsage (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Sql.Models.HybridSecondaryUsage left, Azure.ResourceManager.Sql.Models.HybridSecondaryUsage right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct HybridSecondaryUsageDetected : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public HybridSecondaryUsageDetected(string value) { throw null; } + public static Azure.ResourceManager.Sql.Models.HybridSecondaryUsageDetected Active { get { throw null; } } + public static Azure.ResourceManager.Sql.Models.HybridSecondaryUsageDetected Passive { get { throw null; } } + public bool Equals(Azure.ResourceManager.Sql.Models.HybridSecondaryUsageDetected 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.Sql.Models.HybridSecondaryUsageDetected left, Azure.ResourceManager.Sql.Models.HybridSecondaryUsageDetected right) { throw null; } + public static implicit operator Azure.ResourceManager.Sql.Models.HybridSecondaryUsageDetected (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Sql.Models.HybridSecondaryUsageDetected left, Azure.ResourceManager.Sql.Models.HybridSecondaryUsageDetected right) { throw null; } + public override string ToString() { throw null; } + } public enum ImplementationMethod { TSql = 0, @@ -8294,6 +8497,24 @@ internal InstancePoolVcoresCapability() { } 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 InstanceRole : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public InstanceRole(string value) { throw null; } + public static Azure.ResourceManager.Sql.Models.InstanceRole Primary { get { throw null; } } + public static Azure.ResourceManager.Sql.Models.InstanceRole Secondary { get { throw null; } } + public bool Equals(Azure.ResourceManager.Sql.Models.InstanceRole 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.Sql.Models.InstanceRole left, Azure.ResourceManager.Sql.Models.InstanceRole right) { throw null; } + public static implicit operator Azure.ResourceManager.Sql.Models.InstanceRole (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Sql.Models.InstanceRole left, Azure.ResourceManager.Sql.Models.InstanceRole right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct JobAgentState : System.IEquatable { private readonly object _dummy; @@ -8543,6 +8764,24 @@ internal LicenseTypeCapability() { } 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 LinkRole : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public LinkRole(string value) { throw null; } + public static Azure.ResourceManager.Sql.Models.LinkRole Primary { get { throw null; } } + public static Azure.ResourceManager.Sql.Models.LinkRole Secondary { get { throw null; } } + public bool Equals(Azure.ResourceManager.Sql.Models.LinkRole 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.Sql.Models.LinkRole left, Azure.ResourceManager.Sql.Models.LinkRole right) { throw null; } + public static implicit operator Azure.ResourceManager.Sql.Models.LinkRole (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Sql.Models.LinkRole left, Azure.ResourceManager.Sql.Models.LinkRole right) { throw null; } + public override string ToString() { throw null; } + } public partial class LogSizeCapability : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal LogSizeCapability() { } @@ -8795,6 +9034,24 @@ public ManagedDatabaseStartMoveDefinition(Azure.Core.ResourceIdentifier destinat public static bool operator !=(Azure.ResourceManager.Sql.Models.ManagedInstanceAdministratorType left, Azure.ResourceManager.Sql.Models.ManagedInstanceAdministratorType right) { throw null; } public override string ToString() { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ManagedInstanceDatabaseFormat : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ManagedInstanceDatabaseFormat(string value) { throw null; } + public static Azure.ResourceManager.Sql.Models.ManagedInstanceDatabaseFormat AlwaysUpToDate { get { throw null; } } + public static Azure.ResourceManager.Sql.Models.ManagedInstanceDatabaseFormat SqlServer2022 { get { throw null; } } + public bool Equals(Azure.ResourceManager.Sql.Models.ManagedInstanceDatabaseFormat 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.Sql.Models.ManagedInstanceDatabaseFormat left, Azure.ResourceManager.Sql.Models.ManagedInstanceDatabaseFormat right) { throw null; } + public static implicit operator Azure.ResourceManager.Sql.Models.ManagedInstanceDatabaseFormat (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Sql.Models.ManagedInstanceDatabaseFormat left, Azure.ResourceManager.Sql.Models.ManagedInstanceDatabaseFormat right) { throw null; } + public override string ToString() { throw null; } + } public partial class ManagedInstanceDtcSecuritySettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ManagedInstanceDtcSecuritySettings() { } @@ -8977,13 +9234,20 @@ public ManagedInstancePatch() { } public string AdministratorLogin { get { throw null; } set { } } public string AdministratorLoginPassword { get { throw null; } set { } } public Azure.ResourceManager.Sql.Models.ManagedInstanceExternalAdministrator Administrators { get { throw null; } set { } } + public Azure.ResourceManager.Sql.Models.AuthMetadataLookupMode? AuthenticationMetadata { get { throw null; } set { } } public string Collation { get { throw null; } set { } } + public System.DateTimeOffset? CreateOn { get { throw null; } } public Azure.ResourceManager.Sql.Models.SqlBackupStorageRedundancy? CurrentBackupStorageRedundancy { get { throw null; } } + public Azure.ResourceManager.Sql.Models.ManagedInstanceDatabaseFormat? DatabaseFormat { get { throw null; } set { } } public string DnsZone { get { throw null; } } public string DnsZonePartner { get { throw null; } set { } } + public Azure.ResourceManager.Sql.Models.ExternalGovernanceStatus? ExternalGovernanceStatus { get { throw null; } } public string FullyQualifiedDomainName { get { throw null; } } + public Azure.ResourceManager.Sql.Models.HybridSecondaryUsage? HybridSecondaryUsage { get { throw null; } set { } } + public Azure.ResourceManager.Sql.Models.HybridSecondaryUsageDetected? HybridSecondaryUsageDetected { get { throw null; } } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.Core.ResourceIdentifier InstancePoolId { get { throw null; } set { } } + public bool? IsGeneralPurposeV2 { get { throw null; } set { } } public bool? IsPublicDataEndpointEnabled { get { throw null; } set { } } public bool? IsZoneRedundant { get { throw null; } set { } } public System.Uri KeyId { get { throw null; } set { } } @@ -8992,9 +9256,10 @@ public ManagedInstancePatch() { } public Azure.Core.ResourceIdentifier ManagedDnsZonePartner { get { throw null; } set { } } public Azure.ResourceManager.Sql.Models.ManagedServerCreateMode? ManagedInstanceCreateMode { get { throw null; } set { } } public string MinimalTlsVersion { get { throw null; } set { } } + public Azure.ResourceManager.Sql.Models.FreemiumType? PricingModel { get { throw null; } set { } } public Azure.Core.ResourceIdentifier PrimaryUserAssignedIdentityId { get { throw null; } set { } } public System.Collections.Generic.IReadOnlyList PrivateEndpointConnections { get { throw null; } } - public Azure.ResourceManager.Sql.Models.ManagedInstancePropertiesProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.Sql.Models.JobExecutionProvisioningState? ProvisioningState { get { throw null; } } public Azure.ResourceManager.Sql.Models.ManagedInstanceProxyOverride? ProxyOverride { get { throw null; } set { } } public Azure.ResourceManager.Sql.Models.SqlBackupStorageRedundancy? RequestedBackupStorageRedundancy { get { throw null; } set { } } public System.DateTimeOffset? RestorePointInTime { get { throw null; } set { } } @@ -9002,11 +9267,14 @@ public ManagedInstancePatch() { } public Azure.ResourceManager.Sql.Models.SqlSku Sku { get { throw null; } set { } } public Azure.Core.ResourceIdentifier SourceManagedInstanceId { get { throw null; } set { } } public string State { get { throw null; } } + public int? StorageIOps { get { throw null; } set { } } public int? StorageSizeInGB { get { throw null; } set { } } + public int? StorageThroughputMBps { get { throw null; } set { } } public Azure.Core.ResourceIdentifier SubnetId { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } public string TimezoneId { get { throw null; } set { } } public int? VCores { get { throw null; } set { } } + public string VirtualClusterId { get { throw null; } } Azure.ResourceManager.Sql.Models.ManagedInstancePatch 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.Sql.Models.ManagedInstancePatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -9060,37 +9328,6 @@ public ManagedInstancePrivateLinkServiceConnectionStateProperty(string status, s 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 ManagedInstancePropertiesProvisioningState : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public ManagedInstancePropertiesProvisioningState(string value) { throw null; } - public static Azure.ResourceManager.Sql.Models.ManagedInstancePropertiesProvisioningState Accepted { get { throw null; } } - public static Azure.ResourceManager.Sql.Models.ManagedInstancePropertiesProvisioningState Canceled { get { throw null; } } - public static Azure.ResourceManager.Sql.Models.ManagedInstancePropertiesProvisioningState Created { get { throw null; } } - public static Azure.ResourceManager.Sql.Models.ManagedInstancePropertiesProvisioningState Creating { get { throw null; } } - public static Azure.ResourceManager.Sql.Models.ManagedInstancePropertiesProvisioningState Deleted { get { throw null; } } - public static Azure.ResourceManager.Sql.Models.ManagedInstancePropertiesProvisioningState Deleting { get { throw null; } } - public static Azure.ResourceManager.Sql.Models.ManagedInstancePropertiesProvisioningState Failed { get { throw null; } } - public static Azure.ResourceManager.Sql.Models.ManagedInstancePropertiesProvisioningState NotSpecified { get { throw null; } } - public static Azure.ResourceManager.Sql.Models.ManagedInstancePropertiesProvisioningState Registering { get { throw null; } } - public static Azure.ResourceManager.Sql.Models.ManagedInstancePropertiesProvisioningState Running { get { throw null; } } - public static Azure.ResourceManager.Sql.Models.ManagedInstancePropertiesProvisioningState Succeeded { get { throw null; } } - public static Azure.ResourceManager.Sql.Models.ManagedInstancePropertiesProvisioningState TimedOut { get { throw null; } } - public static Azure.ResourceManager.Sql.Models.ManagedInstancePropertiesProvisioningState Unknown { get { throw null; } } - public static Azure.ResourceManager.Sql.Models.ManagedInstancePropertiesProvisioningState Unrecognized { get { throw null; } } - public static Azure.ResourceManager.Sql.Models.ManagedInstancePropertiesProvisioningState Updating { get { throw null; } } - public bool Equals(Azure.ResourceManager.Sql.Models.ManagedInstancePropertiesProvisioningState 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.Sql.Models.ManagedInstancePropertiesProvisioningState left, Azure.ResourceManager.Sql.Models.ManagedInstancePropertiesProvisioningState right) { throw null; } - public static implicit operator Azure.ResourceManager.Sql.Models.ManagedInstancePropertiesProvisioningState (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.Sql.Models.ManagedInstancePropertiesProvisioningState left, Azure.ResourceManager.Sql.Models.ManagedInstancePropertiesProvisioningState right) { throw null; } - public override string ToString() { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ManagedInstanceProxyOverride : System.IEquatable { private readonly object _dummy; @@ -9456,6 +9693,37 @@ internal PerformanceLevelCapability() { } public static bool operator !=(Azure.ResourceManager.Sql.Models.PerformanceLevelUnit left, Azure.ResourceManager.Sql.Models.PerformanceLevelUnit right) { throw null; } public override string ToString() { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct Phase : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public Phase(string value) { throw null; } + public static Azure.ResourceManager.Sql.Models.Phase Catchup { get { throw null; } } + public static Azure.ResourceManager.Sql.Models.Phase Copying { get { throw null; } } + public static Azure.ResourceManager.Sql.Models.Phase CutoverInProgress { get { throw null; } } + public static Azure.ResourceManager.Sql.Models.Phase WaitingForCutover { get { throw null; } } + public bool Equals(Azure.ResourceManager.Sql.Models.Phase 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.Sql.Models.Phase left, Azure.ResourceManager.Sql.Models.Phase right) { throw null; } + public static implicit operator Azure.ResourceManager.Sql.Models.Phase (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Sql.Models.Phase left, Azure.ResourceManager.Sql.Models.Phase right) { throw null; } + public override string ToString() { throw null; } + } + public partial class PhaseDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal PhaseDetails() { } + public Azure.ResourceManager.Sql.Models.Phase? Phase { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary PhaseInformation { get { throw null; } } + Azure.ResourceManager.Sql.Models.PhaseDetails 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.Sql.Models.PhaseDetails 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 PrivateEndpointConnectionRequestStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal PrivateEndpointConnectionRequestStatus() { } @@ -9490,6 +9758,19 @@ public QueryMetricInterval() { } 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 QueryMetricIntervalAutoGenerated : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal QueryMetricIntervalAutoGenerated() { } + public long? ExecutionCount { get { throw null; } } + public string IntervalStartTime { get { throw null; } } + public Azure.ResourceManager.Sql.Models.QueryTimeGrainType? IntervalType { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Metrics { get { throw null; } } + Azure.ResourceManager.Sql.Models.QueryMetricIntervalAutoGenerated 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.Sql.Models.QueryMetricIntervalAutoGenerated 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 QueryMetricProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public QueryMetricProperties() { } @@ -9547,7 +9828,7 @@ public partial class QueryStatisticsProperties : System.ClientModel.Primitives.I internal QueryStatisticsProperties() { } public string DatabaseName { get { throw null; } } public string EndTime { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Intervals { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Intervals { get { throw null; } } public string QueryId { get { throw null; } } public string StartTime { get { throw null; } } Azure.ResourceManager.Sql.Models.QueryStatisticsProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -9762,6 +10043,58 @@ public RefreshExternalGovernanceStatusOperationResult() { } 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 RefreshExternalGovernanceStatusOperationResultMI : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RefreshExternalGovernanceStatusOperationResultMI() { } + public string ErrorMessage { get { throw null; } } + public string ManagedInstanceName { get { throw null; } } + public string QueuedTime { get { throw null; } } + public System.Guid? RequestId { get { throw null; } } + public string RequestType { get { throw null; } } + public string Status { get { throw null; } } + Azure.ResourceManager.Sql.Models.RefreshExternalGovernanceStatusOperationResultMI 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.Sql.Models.RefreshExternalGovernanceStatusOperationResultMI 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 ReplicaConnectedState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ReplicaConnectedState(string value) { throw null; } + public static Azure.ResourceManager.Sql.Models.ReplicaConnectedState Connected { get { throw null; } } + public static Azure.ResourceManager.Sql.Models.ReplicaConnectedState Disconnected { get { throw null; } } + public bool Equals(Azure.ResourceManager.Sql.Models.ReplicaConnectedState 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.Sql.Models.ReplicaConnectedState left, Azure.ResourceManager.Sql.Models.ReplicaConnectedState right) { throw null; } + public static implicit operator Azure.ResourceManager.Sql.Models.ReplicaConnectedState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Sql.Models.ReplicaConnectedState left, Azure.ResourceManager.Sql.Models.ReplicaConnectedState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ReplicaSynchronizationHealth : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ReplicaSynchronizationHealth(string value) { throw null; } + public static Azure.ResourceManager.Sql.Models.ReplicaSynchronizationHealth Healthy { get { throw null; } } + public static Azure.ResourceManager.Sql.Models.ReplicaSynchronizationHealth NOTHealthy { get { throw null; } } + public static Azure.ResourceManager.Sql.Models.ReplicaSynchronizationHealth PartiallyHealthy { get { throw null; } } + public bool Equals(Azure.ResourceManager.Sql.Models.ReplicaSynchronizationHealth 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.Sql.Models.ReplicaSynchronizationHealth left, Azure.ResourceManager.Sql.Models.ReplicaSynchronizationHealth right) { throw null; } + public static implicit operator Azure.ResourceManager.Sql.Models.ReplicaSynchronizationHealth (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Sql.Models.ReplicaSynchronizationHealth left, Azure.ResourceManager.Sql.Models.ReplicaSynchronizationHealth right) { throw null; } + public override string ToString() { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ReplicationLinkState : System.IEquatable { @@ -9802,6 +10135,24 @@ public RefreshExternalGovernanceStatusOperationResult() { } public override string ToString() { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ReplicationModeType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ReplicationModeType(string value) { throw null; } + public static Azure.ResourceManager.Sql.Models.ReplicationModeType Async { get { throw null; } } + public static Azure.ResourceManager.Sql.Models.ReplicationModeType Sync { get { throw null; } } + public bool Equals(Azure.ResourceManager.Sql.Models.ReplicationModeType 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.Sql.Models.ReplicationModeType left, Azure.ResourceManager.Sql.Models.ReplicationModeType right) { throw null; } + public static implicit operator Azure.ResourceManager.Sql.Models.ReplicationModeType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Sql.Models.ReplicationModeType left, Azure.ResourceManager.Sql.Models.ReplicationModeType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ReplicaType : System.IEquatable { private readonly object _dummy; @@ -9854,6 +10205,24 @@ public enum RestorePointType Discrete = 1, } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct RoleChangeType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public RoleChangeType(string value) { throw null; } + public static Azure.ResourceManager.Sql.Models.RoleChangeType Forced { get { throw null; } } + public static Azure.ResourceManager.Sql.Models.RoleChangeType Planned { get { throw null; } } + public bool Equals(Azure.ResourceManager.Sql.Models.RoleChangeType 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.Sql.Models.RoleChangeType left, Azure.ResourceManager.Sql.Models.RoleChangeType right) { throw null; } + public static implicit operator Azure.ResourceManager.Sql.Models.RoleChangeType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Sql.Models.RoleChangeType left, Azure.ResourceManager.Sql.Models.RoleChangeType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct SampleSchemaName : System.IEquatable { private readonly object _dummy; @@ -9942,6 +10311,24 @@ public enum SecurityEventType SqlInjectionVulnerability = 1, SqlInjectionExploit = 2, } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SeedingModeType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SeedingModeType(string value) { throw null; } + public static Azure.ResourceManager.Sql.Models.SeedingModeType Automatic { get { throw null; } } + public static Azure.ResourceManager.Sql.Models.SeedingModeType Manual { get { throw null; } } + public bool Equals(Azure.ResourceManager.Sql.Models.SeedingModeType 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.Sql.Models.SeedingModeType left, Azure.ResourceManager.Sql.Models.SeedingModeType right) { throw null; } + public static implicit operator Azure.ResourceManager.Sql.Models.SeedingModeType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Sql.Models.SeedingModeType left, Azure.ResourceManager.Sql.Models.SeedingModeType right) { throw null; } + public override string ToString() { throw null; } + } public enum SensitivityLabelRank { None = 0, @@ -10960,6 +11347,16 @@ public SqlScheduleItem(Azure.ResourceManager.Sql.Models.SqlDayOfWeek startDay, s public static bool operator !=(Azure.ResourceManager.Sql.Models.SqlSecurityAlertPolicyName left, Azure.ResourceManager.Sql.Models.SqlSecurityAlertPolicyName right) { throw null; } public override string ToString() { throw null; } } + public partial class SqlServerDatabaseReplicationLinkPatch : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SqlServerDatabaseReplicationLinkPatch() { } + public Azure.ResourceManager.Sql.Models.ReplicationLinkType? LinkType { get { throw null; } set { } } + Azure.ResourceManager.Sql.Models.SqlServerDatabaseReplicationLinkPatch 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.Sql.Models.SqlServerDatabaseReplicationLinkPatch 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 enum SqlServerDatabaseReplicationRole { Primary = 0, diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_DistributedAvailabilityGroupCollection.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_DistributedAvailabilityGroupCollection.cs index cbdff4b4a6cf..0436ad2d1b7e 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_DistributedAvailabilityGroupCollection.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_DistributedAvailabilityGroupCollection.cs @@ -9,6 +9,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; +using Azure.ResourceManager.Sql.Models; namespace Azure.ResourceManager.Sql.Samples { @@ -19,7 +20,7 @@ public partial class Sample_DistributedAvailabilityGroupCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListsAllDistributedAvailabilityGroupsInInstance() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsListByInstance.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-08-01-preview/examples/DistributedAvailabilityGroupsListByInstance.json // this example is just showing the usage of "DistributedAvailabilityGroups_ListByInstance" 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 @@ -56,7 +57,7 @@ public async Task GetAll_ListsAllDistributedAvailabilityGroupsInInstance() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsTheDistributedAvailabilityGroupInfo() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsGet.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-08-01-preview/examples/DistributedAvailabilityGroupsGet.json // this example is just showing the usage of "DistributedAvailabilityGroups_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 @@ -66,7 +67,7 @@ public async Task Get_GetsTheDistributedAvailabilityGroupInfo() // this example assumes you already have this ManagedInstanceResource created on azure // for more information of creating ManagedInstanceResource, please refer to the document of ManagedInstanceResource - string subscriptionId = "f2669dff-5f08-45dd-b857-b2a60b72cdc9"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "testrg"; string managedInstanceName = "testcl"; ResourceIdentifier managedInstanceResourceId = ManagedInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, managedInstanceName); @@ -91,7 +92,7 @@ public async Task Get_GetsTheDistributedAvailabilityGroupInfo() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetsTheDistributedAvailabilityGroupInfo() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsGet.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-08-01-preview/examples/DistributedAvailabilityGroupsGet.json // this example is just showing the usage of "DistributedAvailabilityGroups_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 @@ -101,7 +102,7 @@ public async Task Exists_GetsTheDistributedAvailabilityGroupInfo() // this example assumes you already have this ManagedInstanceResource created on azure // for more information of creating ManagedInstanceResource, please refer to the document of ManagedInstanceResource - string subscriptionId = "f2669dff-5f08-45dd-b857-b2a60b72cdc9"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "testrg"; string managedInstanceName = "testcl"; ResourceIdentifier managedInstanceResourceId = ManagedInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, managedInstanceName); @@ -122,7 +123,7 @@ public async Task Exists_GetsTheDistributedAvailabilityGroupInfo() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetsTheDistributedAvailabilityGroupInfo() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsGet.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-08-01-preview/examples/DistributedAvailabilityGroupsGet.json // this example is just showing the usage of "DistributedAvailabilityGroups_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 @@ -132,7 +133,7 @@ public async Task GetIfExists_GetsTheDistributedAvailabilityGroupInfo() // this example assumes you already have this ManagedInstanceResource created on azure // for more information of creating ManagedInstanceResource, please refer to the document of ManagedInstanceResource - string subscriptionId = "f2669dff-5f08-45dd-b857-b2a60b72cdc9"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "testrg"; string managedInstanceName = "testcl"; ResourceIdentifier managedInstanceResourceId = ManagedInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, managedInstanceName); @@ -160,12 +161,12 @@ public async Task GetIfExists_GetsTheDistributedAvailabilityGroupInfo() } } - // Create a distributed availability group. + // Create a distributed availability group with all properties. [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateADistributedAvailabilityGroup() + public async Task CreateOrUpdate_CreateADistributedAvailabilityGroupWithAllProperties() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsCreate.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-08-01-preview/examples/DistributedAvailabilityGroupsCreateMax.json // this example is just showing the usage of "DistributedAvailabilityGroups_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 @@ -188,10 +189,68 @@ public async Task CreateOrUpdate_CreateADistributedAvailabilityGroup() string distributedAvailabilityGroupName = "dag"; DistributedAvailabilityGroupData data = new DistributedAvailabilityGroupData() { - TargetDatabase = "testdb", - SourceEndpoint = "TCP://SERVER:7022", - PrimaryAvailabilityGroupName = "BoxLocalAg1", - SecondaryAvailabilityGroupName = "testcl", + PartnerAvailabilityGroupName = "BoxLocalAg1", + PartnerEndpoint = "TCP://SERVER:7022", + InstanceLinkRole = LinkRole.Primary, + InstanceAvailabilityGroupName = "testcl", + FailoverMode = FailoverModeType.None, + SeedingMode = SeedingModeType.Automatic, + Databases = +{ +new DistributedAvailabilityGroupDatabase() +{ +DatabaseName = "testdb", +} +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, distributedAvailabilityGroupName, data); + DistributedAvailabilityGroupResource 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 + DistributedAvailabilityGroupData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create a distributed availability group with minimal properties. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateADistributedAvailabilityGroupWithMinimalProperties() + { + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-08-01-preview/examples/DistributedAvailabilityGroupsCreateMin.json + // this example is just showing the usage of "DistributedAvailabilityGroups_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 ManagedInstanceResource created on azure + // for more information of creating ManagedInstanceResource, please refer to the document of ManagedInstanceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "testrg"; + string managedInstanceName = "testcl"; + ResourceIdentifier managedInstanceResourceId = ManagedInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, managedInstanceName); + ManagedInstanceResource managedInstance = client.GetManagedInstanceResource(managedInstanceResourceId); + + // get the collection of this DistributedAvailabilityGroupResource + DistributedAvailabilityGroupCollection collection = managedInstance.GetDistributedAvailabilityGroups(); + + // invoke the operation + string distributedAvailabilityGroupName = "dag"; + DistributedAvailabilityGroupData data = new DistributedAvailabilityGroupData() + { + PartnerAvailabilityGroupName = "BoxLocalAg1", + PartnerEndpoint = "TCP://SERVER:7022", + InstanceAvailabilityGroupName = "testcl", + Databases = +{ +new DistributedAvailabilityGroupDatabase() +{ +DatabaseName = "testdb", +} +}, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, distributedAvailabilityGroupName, data); DistributedAvailabilityGroupResource result = lro.Value; diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_DistributedAvailabilityGroupResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_DistributedAvailabilityGroupResource.cs index 55bf8f6ee62d..4e1476674b56 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_DistributedAvailabilityGroupResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_DistributedAvailabilityGroupResource.cs @@ -20,7 +20,7 @@ public partial class Sample_DistributedAvailabilityGroupResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsTheDistributedAvailabilityGroupInfo() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsGet.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-08-01-preview/examples/DistributedAvailabilityGroupsGet.json // this example is just showing the usage of "DistributedAvailabilityGroups_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 @@ -30,7 +30,7 @@ public async Task Get_GetsTheDistributedAvailabilityGroupInfo() // this example assumes you already have this DistributedAvailabilityGroupResource created on azure // for more information of creating DistributedAvailabilityGroupResource, please refer to the document of DistributedAvailabilityGroupResource - string subscriptionId = "f2669dff-5f08-45dd-b857-b2a60b72cdc9"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "testrg"; string managedInstanceName = "testcl"; string distributedAvailabilityGroupName = "dag"; @@ -52,7 +52,7 @@ public async Task Get_GetsTheDistributedAvailabilityGroupInfo() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_InitiateADistributedAvailabilityGroupDrop() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsDelete.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-08-01-preview/examples/DistributedAvailabilityGroupsDelete.json // this example is just showing the usage of "DistributedAvailabilityGroups_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 @@ -62,7 +62,7 @@ public async Task Delete_InitiateADistributedAvailabilityGroupDrop() // this example assumes you already have this DistributedAvailabilityGroupResource created on azure // for more information of creating DistributedAvailabilityGroupResource, please refer to the document of DistributedAvailabilityGroupResource - string subscriptionId = "f2669dff-5f08-45dd-b857-b2a60b72cdc9"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "testrg"; string managedInstanceName = "testcl"; string distributedAvailabilityGroupName = "dag"; @@ -80,7 +80,7 @@ public async Task Delete_InitiateADistributedAvailabilityGroupDrop() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateTheDistributedAvailabilityGroupReplicationModeBeforeDeletingIt() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsUpdate.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-08-01-preview/examples/DistributedAvailabilityGroupsUpdate.json // this example is just showing the usage of "DistributedAvailabilityGroups_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 @@ -100,7 +100,7 @@ public async Task Update_UpdateTheDistributedAvailabilityGroupReplicationModeBef // invoke the operation DistributedAvailabilityGroupData data = new DistributedAvailabilityGroupData() { - ReplicationMode = DistributedAvailabilityGroupReplicationMode.Sync, + ReplicationMode = ReplicationModeType.Sync, }; ArmOperation lro = await distributedAvailabilityGroup.UpdateAsync(WaitUntil.Completed, data); DistributedAvailabilityGroupResource result = lro.Value; @@ -111,5 +111,73 @@ public async Task Update_UpdateTheDistributedAvailabilityGroupReplicationModeBef // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + + // Failover a distributed availability group. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Failover_FailoverADistributedAvailabilityGroup() + { + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-08-01-preview/examples/DistributedAvailabilityGroupsFailover.json + // this example is just showing the usage of "DistributedAvailabilityGroups_Failover" 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 DistributedAvailabilityGroupResource created on azure + // for more information of creating DistributedAvailabilityGroupResource, please refer to the document of DistributedAvailabilityGroupResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "testrg"; + string managedInstanceName = "testcl"; + string distributedAvailabilityGroupName = "dag"; + ResourceIdentifier distributedAvailabilityGroupResourceId = DistributedAvailabilityGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, managedInstanceName, distributedAvailabilityGroupName); + DistributedAvailabilityGroupResource distributedAvailabilityGroup = client.GetDistributedAvailabilityGroupResource(distributedAvailabilityGroupResourceId); + + // invoke the operation + DistributedAvailabilityGroupsFailoverContent content = new DistributedAvailabilityGroupsFailoverContent(FailoverType.ForcedAllowDataLoss); + ArmOperation lro = await distributedAvailabilityGroup.FailoverAsync(WaitUntil.Completed, content); + DistributedAvailabilityGroupResource 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 + DistributedAvailabilityGroupData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Set distributed availability group primary replica to managed instance. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task SetRole_SetDistributedAvailabilityGroupPrimaryReplicaToManagedInstance() + { + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-08-01-preview/examples/DistributedAvailabilityGroupsSetRole.json + // this example is just showing the usage of "DistributedAvailabilityGroups_SetRole" 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 DistributedAvailabilityGroupResource created on azure + // for more information of creating DistributedAvailabilityGroupResource, please refer to the document of DistributedAvailabilityGroupResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "testrg"; + string managedInstanceName = "testcl"; + string distributedAvailabilityGroupName = "dag"; + ResourceIdentifier distributedAvailabilityGroupResourceId = DistributedAvailabilityGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, managedInstanceName, distributedAvailabilityGroupName); + DistributedAvailabilityGroupResource distributedAvailabilityGroup = client.GetDistributedAvailabilityGroupResource(distributedAvailabilityGroupResourceId); + + // invoke the operation + DistributedAvailabilityGroupSetRole distributedAvailabilityGroupSetRole = new DistributedAvailabilityGroupSetRole(InstanceRole.Primary, RoleChangeType.Forced); + ArmOperation lro = await distributedAvailabilityGroup.SetRoleAsync(WaitUntil.Completed, distributedAvailabilityGroupSetRole); + DistributedAvailabilityGroupResource 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 + DistributedAvailabilityGroupData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } } } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_FailoverGroupCollection.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_FailoverGroupCollection.cs index d89edac6b97b..8ef1b245ddce 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_FailoverGroupCollection.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_FailoverGroupCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_FailoverGroupCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListFailoverGroup() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/FailoverGroupList.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/FailoverGroupList.json // this example is just showing the usage of "FailoverGroups_ListByServer" 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 @@ -57,7 +57,7 @@ public async Task GetAll_ListFailoverGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetFailoverGroup() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/FailoverGroupGet.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/FailoverGroupGet.json // this example is just showing the usage of "FailoverGroups_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 @@ -92,7 +92,7 @@ public async Task Get_GetFailoverGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetFailoverGroup() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/FailoverGroupGet.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/FailoverGroupGet.json // this example is just showing the usage of "FailoverGroups_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 @@ -123,7 +123,7 @@ public async Task Exists_GetFailoverGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetFailoverGroup() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/FailoverGroupGet.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/FailoverGroupGet.json // this example is just showing the usage of "FailoverGroups_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 @@ -166,7 +166,7 @@ public async Task GetIfExists_GetFailoverGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateFailoverGroup() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/FailoverGroupCreateOrUpdate.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/FailoverGroupCreateOrUpdate.json // this example is just showing the usage of "FailoverGroups_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 @@ -215,5 +215,61 @@ public async Task CreateOrUpdate_CreateFailoverGroup() // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + + // Create failover group with standby secondary database on partner server. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateFailoverGroupWithStandbySecondaryDatabaseOnPartnerServer() + { + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/FailoverGroupCreateOrUpdateStandbySecondary.json + // this example is just showing the usage of "FailoverGroups_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 SqlServerResource created on azure + // for more information of creating SqlServerResource, please refer to the document of SqlServerResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "Default"; + string serverName = "failover-group-primary-server"; + ResourceIdentifier sqlServerResourceId = SqlServerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName); + SqlServerResource sqlServer = client.GetSqlServerResource(sqlServerResourceId); + + // get the collection of this FailoverGroupResource + FailoverGroupCollection collection = sqlServer.GetFailoverGroups(); + + // invoke the operation + string failoverGroupName = "failover-group-test-3"; + FailoverGroupData data = new FailoverGroupData() + { + ReadWriteEndpoint = new FailoverGroupReadWriteEndpoint(ReadWriteEndpointFailoverPolicy.Automatic) + { + FailoverWithDataLossGracePeriodMinutes = 480, + }, + ReadOnlyEndpoint = new FailoverGroupReadOnlyEndpoint() + { + FailoverPolicy = ReadOnlyEndpointFailoverPolicy.Disabled, + }, + PartnerServers = +{ +new PartnerServerInfo(new ResourceIdentifier("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-secondary-server")) +}, + FailoverDatabases = +{ +new ResourceIdentifier("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server/databases/testdb-1"),new ResourceIdentifier("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server/databases/testdb-2") +}, + SecondaryType = FailoverGroupDatabasesSecondaryType.Standby, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, failoverGroupName, data); + FailoverGroupResource 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 + FailoverGroupData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } } } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_FailoverGroupResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_FailoverGroupResource.cs index ce916de1687f..871e0e5e48d1 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_FailoverGroupResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_FailoverGroupResource.cs @@ -20,7 +20,7 @@ public partial class Sample_FailoverGroupResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetFailoverGroup() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/FailoverGroupGet.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/FailoverGroupGet.json // this example is just showing the usage of "FailoverGroups_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 @@ -52,7 +52,7 @@ public async Task Get_GetFailoverGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteFailoverGroup() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/FailoverGroupDelete.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/FailoverGroupDelete.json // this example is just showing the usage of "FailoverGroups_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 @@ -75,12 +75,57 @@ public async Task Delete_DeleteFailoverGroup() Console.WriteLine($"Succeeded"); } + // Add database to failover group with standby secondary on partner server. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_AddDatabaseToFailoverGroupWithStandbySecondaryOnPartnerServer() + { + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/FailoverGroupUpdateStandbySecondary.json + // this example is just showing the usage of "FailoverGroups_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 FailoverGroupResource created on azure + // for more information of creating FailoverGroupResource, please refer to the document of FailoverGroupResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "Default"; + string serverName = "failover-group-primary-server"; + string failoverGroupName = "failover-group-test-1"; + ResourceIdentifier failoverGroupResourceId = FailoverGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName, failoverGroupName); + FailoverGroupResource failoverGroup = client.GetFailoverGroupResource(failoverGroupResourceId); + + // invoke the operation + FailoverGroupPatch patch = new FailoverGroupPatch() + { + ReadWriteEndpoint = new FailoverGroupReadWriteEndpoint(ReadWriteEndpointFailoverPolicy.Automatic) + { + FailoverWithDataLossGracePeriodMinutes = 120, + }, + FailoverDatabases = +{ +new ResourceIdentifier("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server/databases/testdb-1") +}, + SecondaryType = FailoverGroupDatabasesSecondaryType.Standby, + }; + ArmOperation lro = await failoverGroup.UpdateAsync(WaitUntil.Completed, patch); + FailoverGroupResource 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 + FailoverGroupData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + // Update failover group [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateFailoverGroup() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/FailoverGroupUpdate.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/FailoverGroupUpdate.json // this example is just showing the usage of "FailoverGroups_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 @@ -124,7 +169,7 @@ public async Task Update_UpdateFailoverGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Failover_PlannedFailoverOfAFailoverGroup() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/FailoverGroupFailover.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/FailoverGroupFailover.json // this example is just showing the usage of "FailoverGroups_Failover" 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 @@ -157,7 +202,7 @@ public async Task Failover_PlannedFailoverOfAFailoverGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task ForceFailoverAllowDataLoss_ForcedFailoverOfAFailoverGroupAllowingDataLoss() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/FailoverGroupForceFailoverAllowDataLoss.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/FailoverGroupForceFailoverAllowDataLoss.json // this example is just showing the usage of "FailoverGroups_ForceFailoverAllowDataLoss" 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 @@ -190,7 +235,7 @@ public async Task ForceFailoverAllowDataLoss_ForcedFailoverOfAFailoverGroupAllow [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task TryPlannedBeforeForcedFailover_TryPlannedBeforeForcedFailoverOfAFailoverGroup() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/FailoverGroupTryPlannedBeforeForcedFailover.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/FailoverGroupTryPlannedBeforeForcedFailover.json // this example is just showing the usage of "FailoverGroups_TryPlannedBeforeForcedFailover" 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/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_InstancePoolResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_InstancePoolResource.cs index ecd2bcd24d29..0c2a7fa9ce30 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_InstancePoolResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_InstancePoolResource.cs @@ -77,74 +77,6 @@ public async Task GetUsages_ListInstancePoolUsages() Console.WriteLine($"Succeeded"); } - // List managed instances by instance pool - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetManagedInstances_ListManagedInstancesByInstancePool() - { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceListByInstancePool.json - // this example is just showing the usage of "ManagedInstances_ListByInstancePool" 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 InstancePoolResource created on azure - // for more information of creating InstancePoolResource, please refer to the document of InstancePoolResource - string subscriptionId = "20D7082A-0FC7-4468-82BD-542694D5042B"; - string resourceGroupName = "Test1"; - string instancePoolName = "pool1"; - ResourceIdentifier instancePoolResourceId = InstancePoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instancePoolName); - InstancePoolResource instancePool = client.GetInstancePoolResource(instancePoolResourceId); - - // invoke the operation and iterate over the result - await foreach (ManagedInstanceResource item in instancePool.GetManagedInstancesAsync()) - { - // 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 - ManagedInstanceData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // List managed instances by instance pool with $expand=administrators/activedirectory - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetManagedInstances_ListManagedInstancesByInstancePoolWithExpandAdministratorsActivedirectory() - { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceListByInstancePoolWithExpandEqualsAdministrators.json - // this example is just showing the usage of "ManagedInstances_ListByInstancePool" 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 InstancePoolResource created on azure - // for more information of creating InstancePoolResource, please refer to the document of InstancePoolResource - string subscriptionId = "20D7082A-0FC7-4468-82BD-542694D5042B"; - string resourceGroupName = "Test1"; - string instancePoolName = "pool1"; - ResourceIdentifier instancePoolResourceId = InstancePoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instancePoolName); - InstancePoolResource instancePool = client.GetInstancePoolResource(instancePoolResourceId); - - // invoke the operation and iterate over the result - await foreach (ManagedInstanceResource item in instancePool.GetManagedInstancesAsync()) - { - // 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 - ManagedInstanceData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - // List instance pools in the subscription [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] @@ -273,5 +205,73 @@ public async Task Update_PatchAnInstancePool() // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + + // List managed instances by instance pool + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetManagedInstances_ListManagedInstancesByInstancePool() + { + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceListByInstancePool.json + // this example is just showing the usage of "ManagedInstances_ListByInstancePool" 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 InstancePoolResource created on azure + // for more information of creating InstancePoolResource, please refer to the document of InstancePoolResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "Test1"; + string instancePoolName = "pool1"; + ResourceIdentifier instancePoolResourceId = InstancePoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instancePoolName); + InstancePoolResource instancePool = client.GetInstancePoolResource(instancePoolResourceId); + + // invoke the operation and iterate over the result + await foreach (ManagedInstanceResource item in instancePool.GetManagedInstancesAsync()) + { + // 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 + ManagedInstanceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // List managed instances by instance pool with $expand=administrators/activedirectory + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetManagedInstances_ListManagedInstancesByInstancePoolWithExpandAdministratorsActivedirectory() + { + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceListByInstancePoolWithExpandEqualsAdministrators.json + // this example is just showing the usage of "ManagedInstances_ListByInstancePool" 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 InstancePoolResource created on azure + // for more information of creating InstancePoolResource, please refer to the document of InstancePoolResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "Test1"; + string instancePoolName = "pool1"; + ResourceIdentifier instancePoolResourceId = InstancePoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, instancePoolName); + InstancePoolResource instancePool = client.GetInstancePoolResource(instancePoolResourceId); + + // invoke the operation and iterate over the result + await foreach (ManagedInstanceResource item in instancePool.GetManagedInstancesAsync()) + { + // 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 + ManagedInstanceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } } } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_ManagedInstanceCollection.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_ManagedInstanceCollection.cs index bb914e201861..c1a6ee6c16d5 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_ManagedInstanceCollection.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_ManagedInstanceCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_ManagedInstanceCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListManagedInstancesByResourceGroup() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceListByResourceGroup.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceListByResourceGroup.json // this example is just showing the usage of "ManagedInstances_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 @@ -31,7 +31,7 @@ public async Task GetAll_ListManagedInstancesByResourceGroup() // 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 = "20D7082A-0FC7-4468-82BD-542694D5042B"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "Test1"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -57,7 +57,7 @@ public async Task GetAll_ListManagedInstancesByResourceGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListManagedInstancesByResourceGroupWithExpandAdministratorsActivedirectory() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceListByResourceGroupWithExpandEqualsAdministrators.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceListByResourceGroupWithExpandEqualsAdministrators.json // this example is just showing the usage of "ManagedInstances_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 @@ -67,7 +67,7 @@ public async Task GetAll_ListManagedInstancesByResourceGroupWithExpandAdministra // 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 = "20D7082A-0FC7-4468-82BD-542694D5042B"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "Test1"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -93,7 +93,7 @@ public async Task GetAll_ListManagedInstancesByResourceGroupWithExpandAdministra [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetManagedInstance() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceGet.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceGet.json // this example is just showing the usage of "ManagedInstances_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 @@ -103,7 +103,7 @@ public async Task Get_GetManagedInstance() // 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 = "20d7082a-0fc7-4468-82bd-542694d5042b"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "testrg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -127,7 +127,7 @@ public async Task Get_GetManagedInstance() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetManagedInstance() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceGet.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceGet.json // this example is just showing the usage of "ManagedInstances_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 @@ -137,7 +137,7 @@ public async Task Exists_GetManagedInstance() // 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 = "20d7082a-0fc7-4468-82bd-542694d5042b"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "testrg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -157,7 +157,7 @@ public async Task Exists_GetManagedInstance() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetManagedInstance() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceGet.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceGet.json // this example is just showing the usage of "ManagedInstances_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 @@ -167,7 +167,113 @@ public async Task GetIfExists_GetManagedInstance() // 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 = "20d7082a-0fc7-4468-82bd-542694d5042b"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "testrg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ManagedInstanceResource + ManagedInstanceCollection collection = resourceGroupResource.GetManagedInstances(); + + // invoke the operation + string managedInstanceName = "testinstance"; + NullableResponse response = await collection.GetIfExistsAsync(managedInstanceName); + ManagedInstanceResource 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 + ManagedInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Get managed instance while resource is updating + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetManagedInstanceWhileResourceIsUpdating() + { + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceGetWhileUpdating.json + // this example is just showing the usage of "ManagedInstances_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 ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "testrg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ManagedInstanceResource + ManagedInstanceCollection collection = resourceGroupResource.GetManagedInstances(); + + // invoke the operation + string managedInstanceName = "testinstance"; + ManagedInstanceResource result = await collection.GetAsync(managedInstanceName); + + // 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 + ManagedInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get managed instance while resource is updating + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetManagedInstanceWhileResourceIsUpdating() + { + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceGetWhileUpdating.json + // this example is just showing the usage of "ManagedInstances_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 ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "testrg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ManagedInstanceResource + ManagedInstanceCollection collection = resourceGroupResource.GetManagedInstances(); + + // invoke the operation + string managedInstanceName = "testinstance"; + bool result = await collection.ExistsAsync(managedInstanceName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get managed instance while resource is updating + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetManagedInstanceWhileResourceIsUpdating() + { + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceGetWhileUpdating.json + // this example is just showing the usage of "ManagedInstances_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 ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "testrg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -199,7 +305,7 @@ public async Task GetIfExists_GetManagedInstance() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetManagedInstanceWithExpandAdministratorsActivedirectory() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceGetWithExpandEqualsAdministrators.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceGetWithExpandEqualsAdministrators.json // this example is just showing the usage of "ManagedInstances_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 @@ -209,7 +315,7 @@ public async Task Get_GetManagedInstanceWithExpandAdministratorsActivedirectory( // 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 = "20d7082a-0fc7-4468-82bd-542694d5042b"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "testrg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -233,7 +339,7 @@ public async Task Get_GetManagedInstanceWithExpandAdministratorsActivedirectory( [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetManagedInstanceWithExpandAdministratorsActivedirectory() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceGetWithExpandEqualsAdministrators.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceGetWithExpandEqualsAdministrators.json // this example is just showing the usage of "ManagedInstances_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 @@ -243,7 +349,7 @@ public async Task Exists_GetManagedInstanceWithExpandAdministratorsActivedirecto // 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 = "20d7082a-0fc7-4468-82bd-542694d5042b"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "testrg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -263,7 +369,7 @@ public async Task Exists_GetManagedInstanceWithExpandAdministratorsActivedirecto [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetManagedInstanceWithExpandAdministratorsActivedirectory() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceGetWithExpandEqualsAdministrators.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceGetWithExpandEqualsAdministrators.json // this example is just showing the usage of "ManagedInstances_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 @@ -273,7 +379,7 @@ public async Task GetIfExists_GetManagedInstanceWithExpandAdministratorsActivedi // 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 = "20d7082a-0fc7-4468-82bd-542694d5042b"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "testrg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -305,7 +411,7 @@ public async Task GetIfExists_GetManagedInstanceWithExpandAdministratorsActivedi [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateManagedInstanceWithAllProperties() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceCreateMax.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceCreateMax.json // this example is just showing the usage of "ManagedInstances_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 @@ -335,6 +441,7 @@ public async Task CreateOrUpdate_CreateManagedInstanceWithAllProperties() AdministratorLoginPassword = "PLACEHOLDER", SubnetId = new ResourceIdentifier("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), LicenseType = ManagedInstanceLicenseType.LicenseIncluded, + HybridSecondaryUsage = HybridSecondaryUsage.Passive, VCores = 8, StorageSizeInGB = 1024, Collation = "SQL_Latin1_General_CP1_CI_AS", @@ -358,6 +465,7 @@ public async Task CreateOrUpdate_CreateManagedInstanceWithAllProperties() { PrincipalType = SqlServicePrincipalType.SystemAssigned, }, + DatabaseFormat = ManagedInstanceDatabaseFormat.AlwaysUpToDate, Tags = { ["tagKey1"] = "TagValue1", @@ -378,7 +486,7 @@ public async Task CreateOrUpdate_CreateManagedInstanceWithAllProperties() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateManagedInstanceWithMinimalProperties() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceCreateMin.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceCreateMin.json // this example is just showing the usage of "ManagedInstances_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 @@ -400,7 +508,7 @@ public async Task CreateOrUpdate_CreateManagedInstanceWithMinimalProperties() string managedInstanceName = "testinstance"; ManagedInstanceData data = new ManagedInstanceData(new AzureLocation("Japan East")) { - Sku = new SqlSku("GP_Gen4") + Sku = new SqlSku("GP_Gen5") { Tier = "GeneralPurpose", }, diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_ManagedInstanceResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_ManagedInstanceResource.cs index 8c4bd55cdd16..288ddd35395d 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_ManagedInstanceResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_ManagedInstanceResource.cs @@ -120,7 +120,7 @@ public async Task GetInaccessibleManagedDatabases_ListInaccessibleManagedDatabas [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetManagedInstances_ListManagedInstances() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceList.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceList.json // this example is just showing the usage of "ManagedInstances_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 @@ -130,7 +130,7 @@ public async Task GetManagedInstances_ListManagedInstances() // this example assumes you already have this SubscriptionResource created on azure // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "20D7082A-0FC7-4468-82BD-542694D5042B"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); @@ -152,7 +152,7 @@ public async Task GetManagedInstances_ListManagedInstances() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetManagedInstances_ListManagedInstancesWithExpandAdministratorsActivedirectory() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceListWithExpandEqualsAdministrators.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceListWithExpandEqualsAdministrators.json // this example is just showing the usage of "ManagedInstances_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 @@ -162,7 +162,7 @@ public async Task GetManagedInstances_ListManagedInstancesWithExpandAdministrato // this example assumes you already have this SubscriptionResource created on azure // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "20D7082A-0FC7-4468-82BD-542694D5042B"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); @@ -184,7 +184,7 @@ public async Task GetManagedInstances_ListManagedInstancesWithExpandAdministrato [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetManagedInstance() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceGet.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceGet.json // this example is just showing the usage of "ManagedInstances_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 @@ -194,7 +194,38 @@ public async Task Get_GetManagedInstance() // this example assumes you already have this ManagedInstanceResource created on azure // for more information of creating ManagedInstanceResource, please refer to the document of ManagedInstanceResource - string subscriptionId = "20d7082a-0fc7-4468-82bd-542694d5042b"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "testrg"; + string managedInstanceName = "testinstance"; + ResourceIdentifier managedInstanceResourceId = ManagedInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, managedInstanceName); + ManagedInstanceResource managedInstance = client.GetManagedInstanceResource(managedInstanceResourceId); + + // invoke the operation + ManagedInstanceResource result = await managedInstance.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 + ManagedInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get managed instance while resource is updating + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetManagedInstanceWhileResourceIsUpdating() + { + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceGetWhileUpdating.json + // this example is just showing the usage of "ManagedInstances_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 ManagedInstanceResource created on azure + // for more information of creating ManagedInstanceResource, please refer to the document of ManagedInstanceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "testrg"; string managedInstanceName = "testinstance"; ResourceIdentifier managedInstanceResourceId = ManagedInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, managedInstanceName); @@ -215,7 +246,7 @@ public async Task Get_GetManagedInstance() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetManagedInstanceWithExpandAdministratorsActivedirectory() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceGetWithExpandEqualsAdministrators.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceGetWithExpandEqualsAdministrators.json // this example is just showing the usage of "ManagedInstances_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 @@ -225,7 +256,7 @@ public async Task Get_GetManagedInstanceWithExpandAdministratorsActivedirectory( // this example assumes you already have this ManagedInstanceResource created on azure // for more information of creating ManagedInstanceResource, please refer to the document of ManagedInstanceResource - string subscriptionId = "20d7082a-0fc7-4468-82bd-542694d5042b"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "testrg"; string managedInstanceName = "testinstance"; ResourceIdentifier managedInstanceResourceId = ManagedInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, managedInstanceName); @@ -246,7 +277,7 @@ public async Task Get_GetManagedInstanceWithExpandAdministratorsActivedirectory( [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteManagedInstance() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceDelete.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceDelete.json // this example is just showing the usage of "ManagedInstances_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 @@ -256,7 +287,7 @@ public async Task Delete_DeleteManagedInstance() // this example assumes you already have this ManagedInstanceResource created on azure // for more information of creating ManagedInstanceResource, please refer to the document of ManagedInstanceResource - string subscriptionId = "20D7082A-0FC7-4468-82BD-542694D5042B"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "testrg"; string managedInstanceName = "testinstance"; ResourceIdentifier managedInstanceResourceId = ManagedInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, managedInstanceName); @@ -273,7 +304,7 @@ public async Task Delete_DeleteManagedInstance() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_RemoveMaintenancePolicyFromManagedInstanceSelectDefaultMaintenancePolicy() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceRemoveMaintenanceConfiguration.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceRemoveMaintenanceConfiguration.json // this example is just showing the usage of "ManagedInstances_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 @@ -283,7 +314,7 @@ public async Task Update_RemoveMaintenancePolicyFromManagedInstanceSelectDefault // this example assumes you already have this ManagedInstanceResource created on azure // for more information of creating ManagedInstanceResource, please refer to the document of ManagedInstanceResource - string subscriptionId = "20D7082A-0FC7-4468-82BD-542694D5042B"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "testrg"; string managedInstanceName = "testinstance"; ResourceIdentifier managedInstanceResourceId = ManagedInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, managedInstanceName); @@ -292,7 +323,7 @@ public async Task Update_RemoveMaintenancePolicyFromManagedInstanceSelectDefault // invoke the operation ManagedInstancePatch patch = new ManagedInstancePatch() { - MaintenanceConfigurationId = new ResourceIdentifier("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default"), + MaintenanceConfigurationId = new ResourceIdentifier("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default"), }; ArmOperation lro = await managedInstance.UpdateAsync(WaitUntil.Completed, patch); ManagedInstanceResource result = lro.Value; @@ -309,7 +340,7 @@ public async Task Update_RemoveMaintenancePolicyFromManagedInstanceSelectDefault [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateManagedInstanceWithAllProperties() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceUpdateMax.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceUpdateMax.json // this example is just showing the usage of "ManagedInstances_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 @@ -319,7 +350,7 @@ public async Task Update_UpdateManagedInstanceWithAllProperties() // this example assumes you already have this ManagedInstanceResource created on azure // for more information of creating ManagedInstanceResource, please refer to the document of ManagedInstanceResource - string subscriptionId = "20D7082A-0FC7-4468-82BD-542694D5042B"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "testrg"; string managedInstanceName = "testinstance"; ResourceIdentifier managedInstanceResourceId = ManagedInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, managedInstanceName); @@ -328,7 +359,7 @@ public async Task Update_UpdateManagedInstanceWithAllProperties() // invoke the operation ManagedInstancePatch patch = new ManagedInstancePatch() { - Sku = new SqlSku("GP_Gen4") + Sku = new SqlSku("GP_Gen5") { Tier = "GeneralPurpose", Capacity = 8, @@ -340,14 +371,17 @@ public async Task Update_UpdateManagedInstanceWithAllProperties() AdministratorLogin = "dummylogin", AdministratorLoginPassword = "PLACEHOLDER", LicenseType = ManagedInstanceLicenseType.BasePrice, + HybridSecondaryUsage = HybridSecondaryUsage.Passive, VCores = 8, StorageSizeInGB = 448, Collation = "SQL_Latin1_General_CP1_CI_AS", IsPublicDataEndpointEnabled = false, ProxyOverride = ManagedInstanceProxyOverride.Redirect, - MaintenanceConfigurationId = new ResourceIdentifier("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"), + MaintenanceConfigurationId = new ResourceIdentifier("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"), MinimalTlsVersion = "1.2", RequestedBackupStorageRedundancy = SqlBackupStorageRedundancy.Geo, + AuthenticationMetadata = AuthMetadataLookupMode.Windows, + DatabaseFormat = ManagedInstanceDatabaseFormat.AlwaysUpToDate, }; ArmOperation lro = await managedInstance.UpdateAsync(WaitUntil.Completed, patch); ManagedInstanceResource result = lro.Value; @@ -364,7 +398,7 @@ public async Task Update_UpdateManagedInstanceWithAllProperties() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateManagedInstanceWithMinimalProperties() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceUpdateMin.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceUpdateMin.json // this example is just showing the usage of "ManagedInstances_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 @@ -374,7 +408,7 @@ public async Task Update_UpdateManagedInstanceWithMinimalProperties() // this example assumes you already have this ManagedInstanceResource created on azure // for more information of creating ManagedInstanceResource, please refer to the document of ManagedInstanceResource - string subscriptionId = "20D7082A-0FC7-4468-82BD-542694D5042B"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "testrg"; string managedInstanceName = "testinstance"; ResourceIdentifier managedInstanceResourceId = ManagedInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, managedInstanceName); @@ -403,7 +437,7 @@ public async Task Update_UpdateManagedInstanceWithMinimalProperties() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Failover_FailoverAManagedInstance() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/FailoverManagedInstance.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/FailoverManagedInstance.json // this example is just showing the usage of "ManagedInstances_Failover" 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 @@ -431,7 +465,7 @@ public async Task Failover_FailoverAManagedInstance() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetOutboundNetworkDependencies_GetsTheCollectionOfOutboundNetworkDependenciesForTheGivenManagedInstance() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ListOutboundNetworkDependenciesByManagedInstance.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ListOutboundNetworkDependenciesByManagedInstance.json // this example is just showing the usage of "ManagedInstances_ListOutboundNetworkDependenciesByManagedInstance" 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 @@ -456,12 +490,40 @@ public async Task GetOutboundNetworkDependencies_GetsTheCollectionOfOutboundNetw Console.WriteLine($"Succeeded"); } + // Refresh external governance enablement status. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task RefreshStatus_RefreshExternalGovernanceEnablementStatus() + { + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceRefreshExternalGovernanceStatus.json + // this example is just showing the usage of "ManagedInstances_RefreshStatus" 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 ManagedInstanceResource created on azure + // for more information of creating ManagedInstanceResource, please refer to the document of ManagedInstanceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "sqlcrudtest-7398"; + string managedInstanceName = "sqlcrudtest-4645"; + ResourceIdentifier managedInstanceResourceId = ManagedInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, managedInstanceName); + ManagedInstanceResource managedInstance = client.GetManagedInstanceResource(managedInstanceResourceId); + + // invoke the operation + ArmOperation lro = await managedInstance.RefreshStatusAsync(WaitUntil.Completed); + RefreshExternalGovernanceStatusOperationResultMI result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + // Starts the managed instance. [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Start_StartsTheManagedInstance() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/StartManagedInstance.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/StartManagedInstance.json // this example is just showing the usage of "ManagedInstances_Start" 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 @@ -478,9 +540,14 @@ public async Task Start_StartsTheManagedInstance() ManagedInstanceResource managedInstance = client.GetManagedInstanceResource(managedInstanceResourceId); // invoke the operation - await managedInstance.StartAsync(WaitUntil.Completed); + ArmOperation lro = await managedInstance.StartAsync(WaitUntil.Completed); + ManagedInstanceResource result = lro.Value; - Console.WriteLine($"Succeeded"); + // 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 + ManagedInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } // Stops the managed instance. @@ -488,7 +555,7 @@ public async Task Start_StartsTheManagedInstance() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Stop_StopsTheManagedInstance() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/StopManagedInstance.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/StopManagedInstance.json // this example is just showing the usage of "ManagedInstances_Stop" 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 @@ -505,9 +572,14 @@ public async Task Stop_StopsTheManagedInstance() ManagedInstanceResource managedInstance = client.GetManagedInstanceResource(managedInstanceResourceId); // invoke the operation - await managedInstance.StopAsync(WaitUntil.Completed); + ArmOperation lro = await managedInstance.StopAsync(WaitUntil.Completed); + ManagedInstanceResource result = lro.Value; - Console.WriteLine($"Succeeded"); + // 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 + ManagedInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } // Obtain list of instance's top resource consuming queries. @@ -515,7 +587,7 @@ public async Task Stop_StopsTheManagedInstance() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetTopQueries_ObtainListOfInstanceSTopResourceConsumingQueries() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceTopQueriesList.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceTopQueriesList.json // this example is just showing the usage of "ManagedInstances_ListByManagedInstance" 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 @@ -546,7 +618,7 @@ public async Task GetTopQueries_ObtainListOfInstanceSTopResourceConsumingQueries [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetTopQueries_ObtainListOfInstanceSTopResourceConsumingQueriesFullBlownRequestAndResponse() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceTopQueriesListMax.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceTopQueriesListMax.json // this example is just showing the usage of "ManagedInstances_ListByManagedInstance" 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 @@ -577,7 +649,7 @@ public async Task GetTopQueries_ObtainListOfInstanceSTopResourceConsumingQueries [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetTopQueries_ObtainListOfInstanceSTopResourceConsumingQueriesMinimalRequestAndResponse() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceTopQueriesListMin.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceTopQueriesListMin.json // this example is just showing the usage of "ManagedInstances_ListByManagedInstance" 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/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_SqlDatabaseResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_SqlDatabaseResource.cs index a5cfc582e8d5..fa4730591372 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_SqlDatabaseResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_SqlDatabaseResource.cs @@ -268,66 +268,6 @@ public async Task GetDatabaseExtensions_ListDatabaseExtensions() Console.WriteLine($"Succeeded"); } - // Cancel the database management operation - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CancelDatabaseOperation_CancelTheDatabaseManagementOperation() - { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/CancelDatabaseOperation.json - // this example is just showing the usage of "DatabaseOperations_Cancel" 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 SqlDatabaseResource created on azure - // for more information of creating SqlDatabaseResource, please refer to the document of SqlDatabaseResource - string subscriptionId = "00000000-1111-2222-3333-444444444444"; - string resourceGroupName = "sqlcrudtest-7398"; - string serverName = "sqlcrudtest-6661"; - string databaseName = "testdb"; - ResourceIdentifier sqlDatabaseResourceId = SqlDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName, databaseName); - SqlDatabaseResource sqlDatabase = client.GetSqlDatabaseResource(sqlDatabaseResourceId); - - // invoke the operation - Guid operationId = Guid.Parse("f779414b-e748-4925-8cfe-c8598f7660ae"); - await sqlDatabase.CancelDatabaseOperationAsync(operationId); - - Console.WriteLine($"Succeeded"); - } - - // List the database management operations - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetDatabaseOperations_ListTheDatabaseManagementOperations() - { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ListDatabaseOperations.json - // this example is just showing the usage of "DatabaseOperations_ListByDatabase" 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 SqlDatabaseResource created on azure - // for more information of creating SqlDatabaseResource, please refer to the document of SqlDatabaseResource - string subscriptionId = "00000000-1111-2222-3333-444444444444"; - string resourceGroupName = "sqlcrudtest-7398"; - string serverName = "sqlcrudtest-4645"; - string databaseName = "testdb"; - ResourceIdentifier sqlDatabaseResourceId = SqlDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName, databaseName); - SqlDatabaseResource sqlDatabase = client.GetSqlDatabaseResource(sqlDatabaseResourceId); - - // invoke the operation and iterate over the result - await foreach (DatabaseOperationData item in sqlDatabase.GetDatabaseOperationsAsync()) - { - Console.WriteLine($"Succeeded: {item}"); - } - - Console.WriteLine($"Succeeded"); - } - // Gets database usages. [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] @@ -1366,5 +1306,65 @@ public async Task UpgradeDataWarehouse_UpgradesADataWarehouse() Console.WriteLine($"Succeeded"); } + + // List the database management operations + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetDatabaseOperations_ListTheDatabaseManagementOperations() + { + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/ListDatabaseOperations.json + // this example is just showing the usage of "DatabaseOperations_ListByDatabase" 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 SqlDatabaseResource created on azure + // for more information of creating SqlDatabaseResource, please refer to the document of SqlDatabaseResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "Default-SQL-SouthEastAsia"; + string serverName = "testsvr"; + string databaseName = "testdb"; + ResourceIdentifier sqlDatabaseResourceId = SqlDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName, databaseName); + SqlDatabaseResource sqlDatabase = client.GetSqlDatabaseResource(sqlDatabaseResourceId); + + // invoke the operation and iterate over the result + await foreach (DatabaseOperationData item in sqlDatabase.GetDatabaseOperationsAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Cancel the database management operation + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CancelDatabaseOperation_CancelTheDatabaseManagementOperation() + { + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/CancelDatabaseOperation.json + // this example is just showing the usage of "DatabaseOperations_Cancel" 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 SqlDatabaseResource created on azure + // for more information of creating SqlDatabaseResource, please refer to the document of SqlDatabaseResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "sqlcrudtest-7398"; + string serverName = "sqlcrudtest-6661"; + string databaseName = "testdb"; + ResourceIdentifier sqlDatabaseResourceId = SqlDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName, databaseName); + SqlDatabaseResource sqlDatabase = client.GetSqlDatabaseResource(sqlDatabaseResourceId); + + // invoke the operation + Guid operationId = Guid.Parse("f779414b-e748-4925-8cfe-c8598f7660ae"); + await sqlDatabase.CancelDatabaseOperationAsync(operationId); + + Console.WriteLine($"Succeeded"); + } } } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_SqlServerDatabaseReplicationLinkCollection.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_SqlServerDatabaseReplicationLinkCollection.cs index 1e48f5e0ddbb..fd83d4e4d8c5 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_SqlServerDatabaseReplicationLinkCollection.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_SqlServerDatabaseReplicationLinkCollection.cs @@ -9,6 +9,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; +using Azure.ResourceManager.Sql.Models; namespace Azure.ResourceManager.Sql.Samples { @@ -19,7 +20,7 @@ public partial class Sample_SqlServerDatabaseReplicationLinkCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListReplicationLinksOnServerOnDatabase() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ReplicationLinkListByDatabase.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ReplicationLinkListByDatabase.json // this example is just showing the usage of "ReplicationLinks_ListByDatabase" 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 @@ -57,7 +58,7 @@ public async Task GetAll_ListReplicationLinksOnServerOnDatabase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsTheReplicationLink() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ReplicationLinkGet.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ReplicationLinkGet.json // this example is just showing the usage of "ReplicationLinks_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 +94,7 @@ public async Task Get_GetsTheReplicationLink() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetsTheReplicationLink() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ReplicationLinkGet.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ReplicationLinkGet.json // this example is just showing the usage of "ReplicationLinks_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 @@ -125,7 +126,7 @@ public async Task Exists_GetsTheReplicationLink() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetsTheReplicationLink() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ReplicationLinkGet.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ReplicationLinkGet.json // this example is just showing the usage of "ReplicationLinks_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,5 +164,46 @@ public async Task GetIfExists_GetsTheReplicationLink() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } } + + // Updates Replication Link + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_UpdatesReplicationLink() + { + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ReplicationLinkCreateOrUpdate.json + // this example is just showing the usage of "ReplicationLinks_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 SqlDatabaseResource created on azure + // for more information of creating SqlDatabaseResource, please refer to the document of SqlDatabaseResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "Default"; + string serverName = "sourcesvr"; + string databaseName = "gamma-db"; + ResourceIdentifier sqlDatabaseResourceId = SqlDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName, databaseName); + SqlDatabaseResource sqlDatabase = client.GetSqlDatabaseResource(sqlDatabaseResourceId); + + // get the collection of this SqlServerDatabaseReplicationLinkResource + SqlServerDatabaseReplicationLinkCollection collection = sqlDatabase.GetSqlServerDatabaseReplicationLinks(); + + // invoke the operation + string linkId = "00000000-1111-2222-3333-666666666666"; + SqlServerDatabaseReplicationLinkData data = new SqlServerDatabaseReplicationLinkData() + { + LinkType = ReplicationLinkType.Standby, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, linkId, data); + SqlServerDatabaseReplicationLinkResource 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 + SqlServerDatabaseReplicationLinkData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } } } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_SqlServerDatabaseReplicationLinkResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_SqlServerDatabaseReplicationLinkResource.cs index 284a4b19c55d..2da4ae0d65d4 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_SqlServerDatabaseReplicationLinkResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_SqlServerDatabaseReplicationLinkResource.cs @@ -9,6 +9,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; +using Azure.ResourceManager.Sql.Models; namespace Azure.ResourceManager.Sql.Samples { @@ -19,7 +20,7 @@ public partial class Sample_SqlServerDatabaseReplicationLinkResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsTheReplicationLink() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ReplicationLinkGet.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ReplicationLinkGet.json // this example is just showing the usage of "ReplicationLinks_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 @@ -52,7 +53,7 @@ public async Task Get_GetsTheReplicationLink() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteReplicationLinkOnServer() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ReplicationLinkDelete.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ReplicationLinkDelete.json // this example is just showing the usage of "ReplicationLinks_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 @@ -76,12 +77,50 @@ public async Task Delete_DeleteReplicationLinkOnServer() Console.WriteLine($"Succeeded"); } + // Update Replication Link + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_UpdateReplicationLink() + { + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ReplicationLinkUpdate.json + // this example is just showing the usage of "ReplicationLinks_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 SqlServerDatabaseReplicationLinkResource created on azure + // for more information of creating SqlServerDatabaseReplicationLinkResource, please refer to the document of SqlServerDatabaseReplicationLinkResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "Default"; + string serverName = "sourcesvr"; + string databaseName = "gamma-db"; + string linkId = "00000000-1111-2222-3333-666666666666"; + ResourceIdentifier sqlServerDatabaseReplicationLinkResourceId = SqlServerDatabaseReplicationLinkResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName, databaseName, linkId); + SqlServerDatabaseReplicationLinkResource sqlServerDatabaseReplicationLink = client.GetSqlServerDatabaseReplicationLinkResource(sqlServerDatabaseReplicationLinkResourceId); + + // invoke the operation + SqlServerDatabaseReplicationLinkPatch patch = new SqlServerDatabaseReplicationLinkPatch() + { + LinkType = ReplicationLinkType.Standby, + }; + ArmOperation lro = await sqlServerDatabaseReplicationLink.UpdateAsync(WaitUntil.Completed, patch); + SqlServerDatabaseReplicationLinkResource 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 + SqlServerDatabaseReplicationLinkData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + // Planned failover of a replication link [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Failover_PlannedFailoverOfAReplicationLink() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ReplicationLinkFailover.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ReplicationLinkFailover.json // this example is just showing the usage of "ReplicationLinks_Failover" 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 @@ -115,7 +154,7 @@ public async Task Failover_PlannedFailoverOfAReplicationLink() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task FailoverAllowDataLoss_ForcedFailoverOfAReplicationLink() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ReplicationLinkFailoverAllowDataLoss.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ReplicationLinkFailoverAllowDataLoss.json // this example is just showing the usage of "ReplicationLinks_FailoverAllowDataLoss" 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/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_SqlServerResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_SqlServerResource.cs index de810029f838..c7408ec4a04a 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_SqlServerResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_SqlServerResource.cs @@ -107,40 +107,6 @@ public async Task CreateTdeCertificate_UploadATDECertificate() Console.WriteLine($"Succeeded"); } - // List replication links on server - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetReplicationLinks_ListReplicationLinksOnServer() - { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ReplicationLinkListByServer.json - // this example is just showing the usage of "ReplicationLinks_ListByServer" 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 SqlServerResource created on azure - // for more information of creating SqlServerResource, please refer to the document of SqlServerResource - string subscriptionId = "00000000-1111-2222-3333-444444444444"; - string resourceGroupName = "Default"; - string serverName = "sourcesvr"; - ResourceIdentifier sqlServerResourceId = SqlServerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName); - SqlServerResource sqlServer = client.GetSqlServerResource(sqlServerResourceId); - - // invoke the operation and iterate over the result - await foreach (SqlServerDatabaseReplicationLinkResource item in sqlServer.GetReplicationLinksAsync()) - { - // 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 - SqlServerDatabaseReplicationLinkData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - // Gets a list of inaccessible databases in a logical server [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] @@ -544,5 +510,39 @@ public async Task RefreshStatus_RefreshExternalGovernanceEnablementStatus() Console.WriteLine($"Succeeded: {result}"); } + + // List replication links on server + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetReplicationLinks_ListReplicationLinksOnServer() + { + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ReplicationLinkListByServer.json + // this example is just showing the usage of "ReplicationLinks_ListByServer" 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 SqlServerResource created on azure + // for more information of creating SqlServerResource, please refer to the document of SqlServerResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "Default"; + string serverName = "sourcesvr"; + ResourceIdentifier sqlServerResourceId = SqlServerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName); + SqlServerResource sqlServer = client.GetSqlServerResource(sqlServerResourceId); + + // invoke the operation and iterate over the result + await foreach (SqlServerDatabaseReplicationLinkResource item in sqlServer.GetReplicationLinksAsync()) + { + // 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 + SqlServerDatabaseReplicationLinkData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } } } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ArmSqlModelFactory.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ArmSqlModelFactory.cs index 4d5f5138622c..96101f361c78 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ArmSqlModelFactory.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ArmSqlModelFactory.cs @@ -1695,26 +1695,6 @@ public static QueryStatistics QueryStatistics(ResourceIdentifier id = null, stri serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Database name of the database in which this query was executed. - /// Unique query id (unique within one database). - /// The start time for the metric (ISO-8601 format). - /// The end time for the metric (ISO-8601 format). - /// List of intervals with appropriate metric data. - /// A new instance for mocking. - public static QueryStatisticsProperties QueryStatisticsProperties(string databaseName = null, string queryId = null, string startTime = null, string endTime = null, IEnumerable intervals = null) - { - intervals ??= new List(); - - return new QueryStatisticsProperties( - databaseName, - queryId, - startTime, - endTime, - intervals?.ToList(), - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The start time for the metric interval (ISO-8601 format). /// Interval type (length). @@ -3080,50 +3060,6 @@ public static ImportExportExtensionsOperationResult ImportExportExtensionsOperat serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The name of the database the operation is being performed on. - /// The name of operation. - /// The friendly name of operation. - /// The percentage of the operation completed. - /// The name of the server. - /// The operation start time. - /// The operation state. - /// The operation error code. - /// The operation error description. - /// The operation error severity. - /// Whether or not the error is a user error. - /// The estimated completion time of the operation. - /// The operation description. - /// Whether the operation can be cancelled. - /// A new instance for mocking. - public static DatabaseOperationData DatabaseOperationData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string databaseName = null, string operation = null, string operationFriendlyName = null, int? percentComplete = null, string serverName = null, DateTimeOffset? startOn = null, ManagementOperationState? state = null, int? errorCode = null, string errorDescription = null, int? errorSeverity = null, bool? isUserError = null, DateTimeOffset? estimatedCompleteOn = null, string description = null, bool? isCancellable = null) - { - return new DatabaseOperationData( - id, - name, - resourceType, - systemData, - databaseName, - operation, - operationFriendlyName, - percentComplete, - serverName, - startOn, - state, - errorCode, - errorDescription, - errorSeverity, - isUserError, - estimatedCompleteOn, - description, - isCancellable, - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The id. /// The name. @@ -3304,37 +3240,100 @@ public static SqlServerConnectionPolicyData SqlServerConnectionPolicyData(Resour /// The name. /// The resourceType. /// The systemData. - /// The name of the target database. - /// The source endpoint. - /// The primary availability group name. - /// The secondary availability group name. - /// The replication mode of a distributed availability group. Parameter will be ignored during link creation. - /// The distributed availability group id. - /// The source replica id. - /// The target replica id. - /// The link state. - /// The last hardened lsn. + /// Name of the distributed availability group. + /// ID of the distributed availability group. + /// Replication mode of the link. + /// SQL server side link role. + /// SQL server side availability group name. + /// SQL server side endpoint - IP or DNS resolvable name. + /// Managed instance side link role. + /// Managed instance side availability group name. + /// The link failover mode - can be Manual if intended to be used for two-way failover with a supported SQL Server, or None for one-way failover to Azure. + /// Database seeding mode – can be Automatic (default), or Manual for supported scenarios. + /// Databases in the distributed availability group. /// A new instance for mocking. - public static DistributedAvailabilityGroupData DistributedAvailabilityGroupData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string targetDatabase = null, string sourceEndpoint = null, string primaryAvailabilityGroupName = null, string secondaryAvailabilityGroupName = null, DistributedAvailabilityGroupReplicationMode? replicationMode = null, Guid? distributedAvailabilityGroupId = null, Guid? sourceReplicaId = null, Guid? targetReplicaId = null, string linkState = null, string lastHardenedLsn = null) + public static DistributedAvailabilityGroupData DistributedAvailabilityGroupData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string distributedAvailabilityGroupName = null, Guid? distributedAvailabilityGroupId = null, ReplicationModeType? replicationMode = null, LinkRole? partnerLinkRole = null, string partnerAvailabilityGroupName = null, string partnerEndpoint = null, LinkRole? instanceLinkRole = null, string instanceAvailabilityGroupName = null, FailoverModeType? failoverMode = null, SeedingModeType? seedingMode = null, IEnumerable databases = null) { + databases ??= new List(); + return new DistributedAvailabilityGroupData( id, name, resourceType, systemData, - targetDatabase, - sourceEndpoint, - primaryAvailabilityGroupName, - secondaryAvailabilityGroupName, - replicationMode, + distributedAvailabilityGroupName, distributedAvailabilityGroupId, - sourceReplicaId, - targetReplicaId, - linkState, + replicationMode, + partnerLinkRole, + partnerAvailabilityGroupName, + partnerEndpoint, + instanceLinkRole, + instanceAvailabilityGroupName, + failoverMode, + seedingMode, + databases?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The name of the database in link. + /// Managed instance replica id. + /// SQL server replica id. + /// Current link state. + /// Seeding progress. + /// Link health state. + /// Link connected state. + /// Last received LSN. + /// Last received LSN time. + /// Last sent LSN. + /// Last sent LSN time. + /// Last commit LSN. + /// Last commit LSN time. + /// Last hardened LSN. + /// Last hardened LSN time. + /// Last backup LSN. + /// Last backup LSN time. + /// The most recent link connection error description. + /// SQL server certificate validity. + /// Replication lag when Managed Instance link side is primary. + /// Redo lag when Managed Instance link side is primary. + /// A new instance for mocking. + public static DistributedAvailabilityGroupDatabase DistributedAvailabilityGroupDatabase(string databaseName = null, Guid? instanceReplicaId = null, Guid? partnerReplicaId = null, string replicaState = null, string seedingProgress = null, ReplicaSynchronizationHealth? synchronizationHealth = null, ReplicaConnectedState? connectedState = null, string lastReceivedLsn = null, DateTimeOffset? lastReceivedOn = null, string lastSentLsn = null, DateTimeOffset? lastSentOn = null, string lastCommitLsn = null, DateTimeOffset? lastCommitOn = null, string lastHardenedLsn = null, DateTimeOffset? lastHardenedOn = null, string lastBackupLsn = null, DateTimeOffset? lastBackupOn = null, string mostRecentLinkError = null, CertificateInfo partnerAuthCertValidity = null, int? instanceSendReplicationLagSeconds = null, int? instanceRedoReplicationLagSeconds = null) + { + return new DistributedAvailabilityGroupDatabase( + databaseName, + instanceReplicaId, + partnerReplicaId, + replicaState, + seedingProgress, + synchronizationHealth, + connectedState, + lastReceivedLsn, + lastReceivedOn, + lastSentLsn, + lastSentOn, + lastCommitLsn, + lastCommitOn, lastHardenedLsn, + lastHardenedOn, + lastBackupLsn, + lastBackupOn, + mostRecentLinkError, + partnerAuthCertValidity, + instanceSendReplicationLagSeconds, + instanceRedoReplicationLagSeconds, serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The certificate name. + /// The certificate expiry date. + /// A new instance for mocking. + public static CertificateInfo CertificateInfo(string certificateName = null, DateTimeOffset? expiryOn = null) + { + return new CertificateInfo(certificateName, expiryOn, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The id. /// The name. @@ -4087,44 +4086,6 @@ public static ManagedInstanceAdvancedThreatProtectionData ManagedInstanceAdvance serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Resource partner server. - /// Resource partner database. - /// Resource partner location. - /// Local replication role. - /// Partner replication role. - /// Replication mode. - /// Time at which the link was created. - /// Seeding completion percentage for the link. - /// Replication state (PENDING, SEEDING, CATCHUP, SUSPENDED). - /// Whether the user is currently allowed to terminate the link. - /// Link type (GEO, NAMED, STANDBY). - /// A new instance for mocking. - public static SqlServerDatabaseReplicationLinkData SqlServerDatabaseReplicationLinkData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string partnerServer = null, string partnerDatabase = null, AzureLocation? partnerLocation = null, SqlServerDatabaseReplicationRole? role = null, SqlServerDatabaseReplicationRole? partnerRole = null, string replicationMode = null, DateTimeOffset? startOn = null, int? percentComplete = null, ReplicationLinkState? replicationState = null, bool? isTerminationAllowed = null, ReplicationLinkType? linkType = null) - { - return new SqlServerDatabaseReplicationLinkData( - id, - name, - resourceType, - systemData, - partnerServer, - partnerDatabase, - partnerLocation, - role, - partnerRole, - replicationMode, - startOn, - percentComplete, - replicationState, - isTerminationAllowed, - linkType, - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The id. /// The name. @@ -5015,350 +4976,90 @@ public static ManagedDatabaseStartMoveDefinition ManagedDatabaseStartMoveDefinit return new ManagedDatabaseStartMoveDefinition(destinationManagedDatabaseId, operationMode, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The digest storage endpoint, which must be either an Azure blob storage endpoint or an URI for Azure Confidential Ledger. + /// Specifies the state of ledger digest upload. + /// A new instance for mocking. + public static ManagedLedgerDigestUploadData ManagedLedgerDigestUploadData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string digestStorageEndpoint = null, ManagedLedgerDigestUploadsState? state = null) + { + return new ManagedLedgerDigestUploadData( + id, + name, + resourceType, + systemData, + digestStorageEndpoint, + state, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The edition of the database. + /// The service level objective name of the database. + /// The elastic pool name of the database. + /// The last available backup date. + /// The resource ids of the user assigned identities to use. + /// A new instance for mocking. + public static RecoverableDatabaseData RecoverableDatabaseData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string edition = null, string serviceLevelObjective = null, string elasticPoolName = null, DateTimeOffset? lastAvailableBackupOn = null, IDictionary keys = null) + { + keys ??= new Dictionary(); + + return new RecoverableDatabaseData( + id, + name, + resourceType, + systemData, + edition, + serviceLevelObjective, + elasticPoolName, + lastAvailableBackupOn, + keys, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. /// The tags. /// The location. - /// The Azure Active Directory identity of the managed instance. - /// Managed instance SKU. Allowed values for sku.name: GP_Gen5, GP_G8IM, GP_G8IH, BC_Gen5, BC_G8IM, BC_G8IH. - /// - /// - /// Specifies the mode of database creation. - /// - /// Default: Regular instance creation. - /// - /// Restore: Creates an instance by restoring a set of backups to specific point in time. RestorePointInTime and SourceManagedInstanceId must be specified. - /// - /// The fully qualified domain name of the managed instance. - /// Administrator username for the managed instance. Can only be specified when the managed instance is being created (and is required for creation). - /// The administrator login password (required for managed instance creation). - /// Subnet resource ID for the managed instance. - /// The state of the managed instance. - /// The license type. Possible values are 'LicenseIncluded' (regular price inclusive of a new SQL license) and 'BasePrice' (discounted AHB price for bringing your own SQL licenses). - /// The number of vCores. Allowed values: 8, 16, 24, 32, 40, 64, 80. - /// Storage size in GB. Minimum value: 32. Maximum value: 16384. Increments of 32 GB allowed only. Maximum value depends on the selected hardware family and number of vCores. - /// Collation of the managed instance. - /// The Dns Zone that the managed instance is in. - /// The resource id of another managed instance whose DNS zone this managed instance will share after creation. - /// Whether or not the public data endpoint is enabled. - /// The resource identifier of the source managed instance associated with create operation of this instance. - /// Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. - /// Connection type used for connecting to the instance. - /// - /// Id of the timezone. Allowed values are timezones supported by Windows. - /// Windows keeps details on supported timezones, including the id, in registry under - /// KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones. - /// You can get those registry values via SQL Server by querying SELECT name AS timezone_id FROM sys.time_zone_info. - /// List of Ids can also be obtained by executing [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. - /// An example of valid timezone id is "Pacific Standard Time" or "W. Europe Standard Time". - /// - /// The Id of the instance pool this managed server belongs to. - /// Specifies maintenance configuration id to apply to this managed instance. - /// List of private endpoint connections on a managed instance. - /// Minimal TLS version. Allowed values: 'None', '1.0', '1.1', '1.2'. - /// The storage account type used to store backups for this instance. The options are Local (LocallyRedundantStorage), Zone (ZoneRedundantStorage), Geo (GeoRedundantStorage) and GeoZone(GeoZoneRedundantStorage). - /// The storage account type to be used to store backups for this instance. The options are Local (LocallyRedundantStorage), Zone (ZoneRedundantStorage), Geo (GeoRedundantStorage) and GeoZone(GeoZoneRedundantStorage). - /// Whether or not the multi-az is enabled. - /// The resource id of a user assigned identity to be used by default. - /// A CMK URI of the key to use for encryption. - /// The Azure Active Directory administrator of the instance. This can only be used at instance create time. If used for instance update, it will be ignored or it will result in an error. For updates individual APIs will need to be used. - /// The managed instance's service principal. - /// A new instance for mocking. - public static ManagedInstanceData ManagedInstanceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, SqlSku sku = null, ManagedInstancePropertiesProvisioningState? provisioningState = null, ManagedServerCreateMode? managedInstanceCreateMode = null, string fullyQualifiedDomainName = null, string administratorLogin = null, string administratorLoginPassword = null, ResourceIdentifier subnetId = null, string state = null, ManagedInstanceLicenseType? licenseType = null, int? vCores = null, int? storageSizeInGB = null, string collation = null, string dnsZone = null, ResourceIdentifier managedDnsZonePartner = null, bool? isPublicDataEndpointEnabled = null, ResourceIdentifier sourceManagedInstanceId = null, DateTimeOffset? restorePointInTime = null, ManagedInstanceProxyOverride? proxyOverride = null, string timezoneId = null, ResourceIdentifier instancePoolId = null, ResourceIdentifier maintenanceConfigurationId = null, IEnumerable privateEndpointConnections = null, string minimalTlsVersion = null, SqlBackupStorageRedundancy? currentBackupStorageRedundancy = null, SqlBackupStorageRedundancy? requestedBackupStorageRedundancy = null, bool? isZoneRedundant = null, ResourceIdentifier primaryUserAssignedIdentityId = null, Uri keyId = null, ManagedInstanceExternalAdministrator administrators = null, SqlServicePrincipal servicePrincipal = null) + /// The name and tier of the SKU. + /// The name of the database. + /// The max size of the database expressed in bytes. + /// The creation date of the database (ISO8601 format). + /// The deletion date of the database (ISO8601 format). + /// The earliest restore date of the database (ISO8601 format). + /// The storage account type used to store backups for this database. + /// The resource ids of the user assigned identities to use. + /// A new instance for mocking. + public static RestorableDroppedDatabaseData RestorableDroppedDatabaseData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, SqlSku sku = null, string databaseName = null, long? maxSizeBytes = null, DateTimeOffset? createdOn = null, DateTimeOffset? deletedOn = null, DateTimeOffset? earliestRestoreOn = null, SqlBackupStorageRedundancy? backupStorageRedundancy = null, IDictionary keys = null) { tags ??= new Dictionary(); - privateEndpointConnections ??= new List(); + keys ??= new Dictionary(); - return new ManagedInstanceData( + return new RestorableDroppedDatabaseData( id, name, resourceType, systemData, tags, location, - identity, sku, - provisioningState, - managedInstanceCreateMode, - fullyQualifiedDomainName, - administratorLogin, - administratorLoginPassword, - subnetId, - state, - licenseType, - vCores, - storageSizeInGB, - collation, - dnsZone, - managedDnsZonePartner, - isPublicDataEndpointEnabled, - sourceManagedInstanceId, - restorePointInTime, - proxyOverride, - timezoneId, - instancePoolId, - maintenanceConfigurationId, - privateEndpointConnections?.ToList(), - minimalTlsVersion, - currentBackupStorageRedundancy, - requestedBackupStorageRedundancy, - isZoneRedundant, - primaryUserAssignedIdentityId, - keyId, - administrators, - servicePrincipal, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Resource ID. - /// Private endpoint connection properties. - /// A new instance for mocking. - public static ManagedInstancePecProperty ManagedInstancePecProperty(ResourceIdentifier id = null, ManagedInstancePrivateEndpointConnectionProperties properties = null) - { - return new ManagedInstancePecProperty(id, properties, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The Azure Active Directory application object id. - /// The Azure Active Directory application client id. - /// The Azure Active Directory tenant id. - /// Service principal type. - /// A new instance for mocking. - public static SqlServicePrincipal SqlServicePrincipal(Guid? principalId = null, Guid? clientId = null, Guid? tenantId = null, SqlServicePrincipalType? principalType = null) - { - return new SqlServicePrincipal(principalId, clientId, tenantId, principalType, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Managed instance sku. - /// Managed instance identity. - /// Resource tags. - /// - /// - /// Specifies the mode of database creation. - /// - /// Default: Regular instance creation. - /// - /// Restore: Creates an instance by restoring a set of backups to specific point in time. RestorePointInTime and SourceManagedInstanceId must be specified. - /// - /// The fully qualified domain name of the managed instance. - /// Administrator username for the managed instance. Can only be specified when the managed instance is being created (and is required for creation). - /// The administrator login password (required for managed instance creation). - /// Subnet resource ID for the managed instance. - /// The state of the managed instance. - /// The license type. Possible values are 'LicenseIncluded' (regular price inclusive of a new SQL license) and 'BasePrice' (discounted AHB price for bringing your own SQL licenses). - /// The number of vCores. Allowed values: 8, 16, 24, 32, 40, 64, 80. - /// Storage size in GB. Minimum value: 32. Maximum value: 16384. Increments of 32 GB allowed only. Maximum value depends on the selected hardware family and number of vCores. - /// Collation of the managed instance. - /// The Dns Zone that the managed instance is in. - /// The resource id of another managed instance whose DNS zone this managed instance will share after creation. - /// Whether or not the public data endpoint is enabled. - /// The resource identifier of the source managed instance associated with create operation of this instance. - /// Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. - /// Connection type used for connecting to the instance. - /// - /// Id of the timezone. Allowed values are timezones supported by Windows. - /// Windows keeps details on supported timezones, including the id, in registry under - /// KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones. - /// You can get those registry values via SQL Server by querying SELECT name AS timezone_id FROM sys.time_zone_info. - /// List of Ids can also be obtained by executing [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. - /// An example of valid timezone id is "Pacific Standard Time" or "W. Europe Standard Time". - /// - /// The Id of the instance pool this managed server belongs to. - /// Specifies maintenance configuration id to apply to this managed instance. - /// List of private endpoint connections on a managed instance. - /// Minimal TLS version. Allowed values: 'None', '1.0', '1.1', '1.2'. - /// The storage account type used to store backups for this instance. The options are Local (LocallyRedundantStorage), Zone (ZoneRedundantStorage), Geo (GeoRedundantStorage) and GeoZone(GeoZoneRedundantStorage). - /// The storage account type to be used to store backups for this instance. The options are Local (LocallyRedundantStorage), Zone (ZoneRedundantStorage), Geo (GeoRedundantStorage) and GeoZone(GeoZoneRedundantStorage). - /// Whether or not the multi-az is enabled. - /// The resource id of a user assigned identity to be used by default. - /// A CMK URI of the key to use for encryption. - /// The Azure Active Directory administrator of the instance. This can only be used at instance create time. If used for instance update, it will be ignored or it will result in an error. For updates individual APIs will need to be used. - /// The managed instance's service principal. - /// A new instance for mocking. - public static ManagedInstancePatch ManagedInstancePatch(SqlSku sku = null, ManagedServiceIdentity identity = null, IDictionary tags = null, ManagedInstancePropertiesProvisioningState? provisioningState = null, ManagedServerCreateMode? managedInstanceCreateMode = null, string fullyQualifiedDomainName = null, string administratorLogin = null, string administratorLoginPassword = null, ResourceIdentifier subnetId = null, string state = null, ManagedInstanceLicenseType? licenseType = null, int? vCores = null, int? storageSizeInGB = null, string collation = null, string dnsZone = null, ResourceIdentifier managedDnsZonePartner = null, bool? isPublicDataEndpointEnabled = null, ResourceIdentifier sourceManagedInstanceId = null, DateTimeOffset? restorePointInTime = null, ManagedInstanceProxyOverride? proxyOverride = null, string timezoneId = null, ResourceIdentifier instancePoolId = null, ResourceIdentifier maintenanceConfigurationId = null, IEnumerable privateEndpointConnections = null, string minimalTlsVersion = null, SqlBackupStorageRedundancy? currentBackupStorageRedundancy = null, SqlBackupStorageRedundancy? requestedBackupStorageRedundancy = null, bool? isZoneRedundant = null, ResourceIdentifier primaryUserAssignedIdentityId = null, Uri keyId = null, ManagedInstanceExternalAdministrator administrators = null, SqlServicePrincipal servicePrincipal = null) - { - tags ??= new Dictionary(); - privateEndpointConnections ??= new List(); - - return new ManagedInstancePatch( - sku, - identity, - tags, - provisioningState, - managedInstanceCreateMode, - fullyQualifiedDomainName, - administratorLogin, - administratorLoginPassword, - subnetId, - state, - licenseType, - vCores, - storageSizeInGB, - collation, - dnsZone, - managedDnsZonePartner, - isPublicDataEndpointEnabled, - sourceManagedInstanceId, - restorePointInTime, - proxyOverride, - timezoneId, - instancePoolId, - maintenanceConfigurationId, - privateEndpointConnections?.ToList(), - minimalTlsVersion, - currentBackupStorageRedundancy, - requestedBackupStorageRedundancy, - isZoneRedundant, - primaryUserAssignedIdentityId, - keyId, - administrators, - servicePrincipal, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The type of service accessed by the managed instance service, e.g., Azure Storage, Azure Active Directory, etc. - /// The endpoints that the managed instance service communicates with in order to function correctly. - /// A new instance for mocking. - public static SqlOutboundEnvironmentEndpoint SqlOutboundEnvironmentEndpoint(string category = null, IEnumerable endpoints = null) - { - endpoints ??= new List(); - - return new SqlOutboundEnvironmentEndpoint(category, endpoints?.ToList(), serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The domain name of the dependency. - /// The IP Addresses and Ports used when connecting to DomainName. - /// A new instance for mocking. - public static ManagedInstanceEndpointDependency ManagedInstanceEndpointDependency(string domainName = null, IEnumerable endpointDetails = null) - { - endpointDetails ??= new List(); - - return new ManagedInstanceEndpointDependency(domainName, endpointDetails?.ToList(), serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The port an endpoint is connected to. - /// A new instance for mocking. - public static ManagedInstanceEndpointDetail ManagedInstanceEndpointDetail(int? port = null) - { - return new ManagedInstanceEndpointDetail(port, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Requested number of top queries. - /// Aggregation function used to calculate query metrics. - /// Metric used to rank queries. - /// Interval type (length). - /// The start time for the metric (ISO-8601 format). - /// The end time for the metric (ISO-8601 format). - /// List of top resource consuming queries with appropriate metric data. - /// A new instance for mocking. - public static TopQueries TopQueries(int? numberOfQueries = null, string aggregationFunction = null, string observationMetric = null, QueryTimeGrainType? intervalType = null, string startTime = null, string endTime = null, IEnumerable queries = null) - { - queries ??= new List(); - - return new TopQueries( - numberOfQueries, - aggregationFunction, - observationMetric, - intervalType, - startTime, - endTime, - queries?.ToList(), - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The digest storage endpoint, which must be either an Azure blob storage endpoint or an URI for Azure Confidential Ledger. - /// Specifies the state of ledger digest upload. - /// A new instance for mocking. - public static ManagedLedgerDigestUploadData ManagedLedgerDigestUploadData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string digestStorageEndpoint = null, ManagedLedgerDigestUploadsState? state = null) - { - return new ManagedLedgerDigestUploadData( - id, - name, - resourceType, - systemData, - digestStorageEndpoint, - state, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The edition of the database. - /// The service level objective name of the database. - /// The elastic pool name of the database. - /// The last available backup date. - /// The resource ids of the user assigned identities to use. - /// A new instance for mocking. - public static RecoverableDatabaseData RecoverableDatabaseData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string edition = null, string serviceLevelObjective = null, string elasticPoolName = null, DateTimeOffset? lastAvailableBackupOn = null, IDictionary keys = null) - { - keys ??= new Dictionary(); - - return new RecoverableDatabaseData( - id, - name, - resourceType, - systemData, - edition, - serviceLevelObjective, - elasticPoolName, - lastAvailableBackupOn, - keys, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The name and tier of the SKU. - /// The name of the database. - /// The max size of the database expressed in bytes. - /// The creation date of the database (ISO8601 format). - /// The deletion date of the database (ISO8601 format). - /// The earliest restore date of the database (ISO8601 format). - /// The storage account type used to store backups for this database. - /// The resource ids of the user assigned identities to use. - /// A new instance for mocking. - public static RestorableDroppedDatabaseData RestorableDroppedDatabaseData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, SqlSku sku = null, string databaseName = null, long? maxSizeBytes = null, DateTimeOffset? createdOn = null, DateTimeOffset? deletedOn = null, DateTimeOffset? earliestRestoreOn = null, SqlBackupStorageRedundancy? backupStorageRedundancy = null, IDictionary keys = null) - { - tags ??= new Dictionary(); - keys ??= new Dictionary(); - - return new RestorableDroppedDatabaseData( - id, - name, - resourceType, - systemData, - tags, - location, - sku, - databaseName, - maxSizeBytes, - createdOn, - deletedOn, - earliestRestoreOn, - backupStorageRedundancy, - keys, + databaseName, + maxSizeBytes, + createdOn, + deletedOn, + earliestRestoreOn, + backupStorageRedundancy, + keys, serializedAdditionalRawData: null); } @@ -5428,20 +5129,77 @@ public static LogicalDatabaseTransparentDataEncryptionData LogicalDatabaseTransp serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Resource ID. - /// Resource name. - /// Resource type. - /// The start IP address of the firewall rule. Must be IPv6 format. - /// The end IP address of the firewall rule. Must be IPv6 format. Must be greater than or equal to startIpv6Address. - /// A new instance for mocking. - public static IPv6FirewallRuleData IPv6FirewallRuleData(ResourceIdentifier id = null, string name = null, ResourceType? resourceType = null, string startIPv6Address = null, string endIPv6Address = null) - { - return new IPv6FirewallRuleData( - id, - name, - resourceType, - serializedAdditionalRawData: null, + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The name of the database the operation is being performed on. + /// The name of operation. + /// The friendly name of operation. + /// The percentage of the operation completed. + /// The name of the server. + /// The operation start time. + /// The operation state. + /// The operation error code. + /// The operation error description. + /// The operation error severity. + /// Whether or not the error is a user error. + /// The estimated completion time of the operation. + /// The operation description. + /// Whether the operation can be cancelled. + /// The operation phase details. + /// A new instance for mocking. + public static DatabaseOperationData DatabaseOperationData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string databaseName = null, string operation = null, string operationFriendlyName = null, int? percentComplete = null, string serverName = null, DateTimeOffset? startOn = null, ManagementOperationState? state = null, int? errorCode = null, string errorDescription = null, int? errorSeverity = null, bool? isUserError = null, DateTimeOffset? estimatedCompleteOn = null, string description = null, bool? isCancellable = null, PhaseDetails operationPhaseDetails = null) + { + return new DatabaseOperationData( + id, + name, + resourceType, + systemData, + databaseName, + operation, + operationFriendlyName, + percentComplete, + serverName, + startOn, + state, + errorCode, + errorDescription, + errorSeverity, + isUserError, + estimatedCompleteOn, + description, + isCancellable, + operationPhaseDetails, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The operation phase. + /// The operation phase information. + /// A new instance for mocking. + public static PhaseDetails PhaseDetails(Phase? phase = null, IReadOnlyDictionary phaseInformation = null) + { + phaseInformation ??= new Dictionary(); + + return new PhaseDetails(phase, phaseInformation, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Resource ID. + /// Resource name. + /// Resource type. + /// The start IP address of the firewall rule. Must be IPv6 format. + /// The end IP address of the firewall rule. Must be IPv6 format. Must be greater than or equal to startIpv6Address. + /// A new instance for mocking. + public static IPv6FirewallRuleData IPv6FirewallRuleData(ResourceIdentifier id = null, string name = null, ResourceType? resourceType = null, string startIPv6Address = null, string endIPv6Address = null) + { + return new IPv6FirewallRuleData( + id, + name, + resourceType, + serializedAdditionalRawData: null, startIPv6Address, endIPv6Address); } @@ -5744,8 +5502,9 @@ public static SqlVulnerabilityAssessmentData SqlVulnerabilityAssessmentData(Reso /// Replication state of the failover group instance. /// List of partner server information for the failover group. /// List of databases in the failover group. + /// Databases secondary type on partner server. /// A new instance for mocking. - public static FailoverGroupData FailoverGroupData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AzureLocation? location = null, IDictionary tags = null, FailoverGroupReadWriteEndpoint readWriteEndpoint = null, FailoverGroupReadOnlyEndpoint readOnlyEndpoint = null, FailoverGroupReplicationRole? replicationRole = null, string replicationState = null, IEnumerable partnerServers = null, IEnumerable failoverDatabases = null) + public static FailoverGroupData FailoverGroupData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AzureLocation? location = null, IDictionary tags = null, FailoverGroupReadWriteEndpoint readWriteEndpoint = null, FailoverGroupReadOnlyEndpoint readOnlyEndpoint = null, FailoverGroupReplicationRole? replicationRole = null, string replicationState = null, IEnumerable partnerServers = null, IEnumerable failoverDatabases = null, FailoverGroupDatabasesSecondaryType? secondaryType = null) { tags ??= new Dictionary(); partnerServers ??= new List(); @@ -5764,6 +5523,7 @@ public static FailoverGroupData FailoverGroupData(ResourceIdentifier id = null, replicationState, partnerServers?.ToList(), failoverDatabases?.ToList(), + secondaryType, serializedAdditionalRawData: null); } @@ -5795,140 +5555,505 @@ public static InstancePoolData InstancePoolData(ResourceIdentifier id = null, st { tags ??= new Dictionary(); - return new InstancePoolData( - id, - name, - resourceType, - systemData, - tags, - location, + return new InstancePoolData( + id, + name, + resourceType, + systemData, + tags, + location, + sku, + subnetId, + vCores, + licenseType, + dnsZone, + maintenanceConfigurationId, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The name and tier of the SKU. + /// Resource tags. + /// Resource ID of the subnet to place this instance pool in. + /// Count of vCores belonging to this instance pool. + /// The license type. Possible values are 'LicenseIncluded' (price for SQL license is included) and 'BasePrice' (without SQL license price). + /// The Dns Zone that the managed instance pool is in. + /// Specifies maintenance configuration id to apply to this managed instance. + /// A new instance for mocking. + public static InstancePoolPatch InstancePoolPatch(SqlSku sku = null, IDictionary tags = null, ResourceIdentifier subnetId = null, int? vCores = null, InstancePoolLicenseType? licenseType = null, string dnsZone = null, ResourceIdentifier maintenanceConfigurationId = null) + { + tags ??= new Dictionary(); + + return new InstancePoolPatch( + sku, + tags, + subnetId, + vCores, + licenseType, + dnsZone, + maintenanceConfigurationId, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The server name that the backup database belong to. + /// The create time of the server. + /// The name of the database the backup belong to. + /// The delete time of the database. + /// The time the backup was taken. + /// The time the long term retention backup will expire. + /// The storage redundancy type of the backup. + /// The storage redundancy type of the backup. + /// The setting whether the LTR backup is immutable. + /// The BackupStorageAccessTier for the LTR backup. + /// A new instance for mocking. + public static LongTermRetentionBackupData LongTermRetentionBackupData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string serverName = null, DateTimeOffset? serverCreateOn = null, string databaseName = null, DateTimeOffset? databaseDeletedOn = null, DateTimeOffset? backupOn = null, DateTimeOffset? backupExpireOn = null, SqlBackupStorageRedundancy? backupStorageRedundancy = null, SqlBackupStorageRedundancy? requestedBackupStorageRedundancy = null, bool? isBackupImmutable = null, SqlBackupStorageAccessTier? backupStorageAccessTier = null) + { + return new LongTermRetentionBackupData( + id, + name, + resourceType, + systemData, + serverName, + serverCreateOn, + databaseName, + databaseDeletedOn, + backupOn, + backupExpireOn, + backupStorageRedundancy, + requestedBackupStorageRedundancy, + isBackupImmutable, + backupStorageAccessTier, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Request Id. + /// Operation type. + /// Source backup resource id. + /// Target backup resource id. + /// The storage redundancy type of the copied backup. + /// Operation status. + /// Progress message. + /// A new instance for mocking. + public static LongTermRetentionBackupOperationResult LongTermRetentionBackupOperationResult(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, Guid? requestId = null, string operationType = null, ResourceIdentifier fromBackupResourceId = null, ResourceIdentifier toBackupResourceId = null, SqlBackupStorageRedundancy? targetBackupStorageRedundancy = null, string status = null, string message = null) + { + return new LongTermRetentionBackupOperationResult( + id, + name, + resourceType, + systemData, + requestId, + operationType, + fromBackupResourceId, + toBackupResourceId, + targetBackupStorageRedundancy, + status, + message, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The setting whether to make LTR backups immutable. + /// The BackupStorageAccessTier for the LTR backups. + /// The weekly retention policy for an LTR backup in an ISO 8601 format. + /// The monthly retention policy for an LTR backup in an ISO 8601 format. + /// The yearly retention policy for an LTR backup in an ISO 8601 format. + /// The week of year to take the yearly backup in an ISO 8601 format. + /// A new instance for mocking. + public static LongTermRetentionPolicyData LongTermRetentionPolicyData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, bool? makeBackupsImmutable = null, SqlBackupStorageAccessTier? backupStorageAccessTier = null, string weeklyRetention = null, string monthlyRetention = null, string yearlyRetention = null, int? weekOfYear = null) + { + return new LongTermRetentionPolicyData( + id, + name, + resourceType, + systemData, + makeBackupsImmutable, + backupStorageAccessTier, + weeklyRetention, + monthlyRetention, + yearlyRetention, + weekOfYear, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The Azure Active Directory identity of the managed instance. + /// Managed instance SKU. Allowed values for sku.name: GP_Gen5, GP_G8IM, GP_G8IH, BC_Gen5, BC_G8IM, BC_G8IH. + /// Provisioning state of managed instance. + /// + /// Specifies the mode of database creation. + /// + /// Default: Regular instance creation. + /// + /// Restore: Creates an instance by restoring a set of backups to specific point in time. RestorePointInTime and SourceManagedInstanceId must be specified. + /// + /// The fully qualified domain name of the managed instance. + /// Whether or not this is a GPv2 variant of General Purpose edition. + /// Administrator username for the managed instance. Can only be specified when the managed instance is being created (and is required for creation). + /// The administrator login password (required for managed instance creation). + /// Subnet resource ID for the managed instance. + /// The state of the managed instance. + /// The license type. Possible values are 'LicenseIncluded' (regular price inclusive of a new SQL license) and 'BasePrice' (discounted AHB price for bringing your own SQL licenses). + /// Hybrid secondary usage. Possible values are 'Active' (default value) and 'Passive' (customer uses the secondary as Passive DR). + /// Hybrid secondary usage detected. Possible values are 'Active' (customer does not meet the requirements to use the secondary as Passive DR) and 'Passive' (customer meets the requirements to use the secondary as Passive DR). + /// The number of vCores. Allowed values: 8, 16, 24, 32, 40, 64, 80. + /// Storage size in GB. Minimum value: 32. Maximum value: 16384. Increments of 32 GB allowed only. Maximum value depends on the selected hardware family and number of vCores. + /// Storage IOps. Minimum value: 300. Maximum value: 80000. Increments of 1 IOps allowed only. Maximum value depends on the selected hardware family and number of vCores. + /// Storage throughput MBps parameter is not supported in the instance create/update operation. + /// Collation of the managed instance. + /// The Dns Zone that the managed instance is in. + /// The resource id of another managed instance whose DNS zone this managed instance will share after creation. + /// Whether or not the public data endpoint is enabled. + /// The resource identifier of the source managed instance associated with create operation of this instance. + /// Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. + /// Connection type used for connecting to the instance. + /// + /// Id of the timezone. Allowed values are timezones supported by Windows. + /// Windows keeps details on supported timezones, including the id, in registry under + /// KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones. + /// You can get those registry values via SQL Server by querying SELECT name AS timezone_id FROM sys.time_zone_info. + /// List of Ids can also be obtained by executing [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. + /// An example of valid timezone id is "Pacific Standard Time" or "W. Europe Standard Time". + /// + /// The Id of the instance pool this managed server belongs to. + /// Specifies maintenance configuration id to apply to this managed instance. + /// List of private endpoint connections on a managed instance. + /// Minimal TLS version. Allowed values: 'None', '1.0', '1.1', '1.2'. + /// The storage account type used to store backups for this instance. The options are Local (LocallyRedundantStorage), Zone (ZoneRedundantStorage), Geo (GeoRedundantStorage) and GeoZone(GeoZoneRedundantStorage). + /// The storage account type to be used to store backups for this instance. The options are Local (LocallyRedundantStorage), Zone (ZoneRedundantStorage), Geo (GeoRedundantStorage) and GeoZone(GeoZoneRedundantStorage). + /// Whether or not the multi-az is enabled. + /// The resource id of a user assigned identity to be used by default. + /// A CMK URI of the key to use for encryption. + /// The Azure Active Directory administrator of the instance. This can only be used at instance create time. If used for instance update, it will be ignored or it will result in an error. For updates individual APIs will need to be used. + /// The managed instance's service principal. + /// Virtual cluster resource id for the Managed Instance. + /// Status of external governance. + /// Weather or not Managed Instance is freemium. + /// Specifies the point in time (ISO8601 format) of the Managed Instance creation. + /// The managed instance's authentication metadata lookup mode. + /// Specifies the internal format of instance databases specific to the SQL engine version. + /// A new instance for mocking. + public static ManagedInstanceData ManagedInstanceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, SqlSku sku = null, JobExecutionProvisioningState? provisioningState = null, ManagedServerCreateMode? managedInstanceCreateMode = null, string fullyQualifiedDomainName = null, bool? isGeneralPurposeV2 = null, string administratorLogin = null, string administratorLoginPassword = null, ResourceIdentifier subnetId = null, string state = null, ManagedInstanceLicenseType? licenseType = null, HybridSecondaryUsage? hybridSecondaryUsage = null, HybridSecondaryUsageDetected? hybridSecondaryUsageDetected = null, int? vCores = null, int? storageSizeInGB = null, int? storageIOps = null, int? storageThroughputMBps = null, string collation = null, string dnsZone = null, ResourceIdentifier managedDnsZonePartner = null, bool? isPublicDataEndpointEnabled = null, ResourceIdentifier sourceManagedInstanceId = null, DateTimeOffset? restorePointInTime = null, ManagedInstanceProxyOverride? proxyOverride = null, string timezoneId = null, ResourceIdentifier instancePoolId = null, ResourceIdentifier maintenanceConfigurationId = null, IEnumerable privateEndpointConnections = null, string minimalTlsVersion = null, SqlBackupStorageRedundancy? currentBackupStorageRedundancy = null, SqlBackupStorageRedundancy? requestedBackupStorageRedundancy = null, bool? isZoneRedundant = null, ResourceIdentifier primaryUserAssignedIdentityId = null, Uri keyId = null, ManagedInstanceExternalAdministrator administrators = null, SqlServicePrincipal servicePrincipal = null, string virtualClusterId = null, ExternalGovernanceStatus? externalGovernanceStatus = null, FreemiumType? pricingModel = null, DateTimeOffset? createOn = null, AuthMetadataLookupMode? authenticationMetadata = null, ManagedInstanceDatabaseFormat? databaseFormat = null) + { + tags ??= new Dictionary(); + privateEndpointConnections ??= new List(); + + return new ManagedInstanceData( + id, + name, + resourceType, + systemData, + tags, + location, + identity, + sku, + provisioningState, + managedInstanceCreateMode, + fullyQualifiedDomainName, + isGeneralPurposeV2, + administratorLogin, + administratorLoginPassword, + subnetId, + state, + licenseType, + hybridSecondaryUsage, + hybridSecondaryUsageDetected, + vCores, + storageSizeInGB, + storageIOps, + storageThroughputMBps, + collation, + dnsZone, + managedDnsZonePartner, + isPublicDataEndpointEnabled, + sourceManagedInstanceId, + restorePointInTime, + proxyOverride, + timezoneId, + instancePoolId, + maintenanceConfigurationId, + privateEndpointConnections?.ToList(), + minimalTlsVersion, + currentBackupStorageRedundancy, + requestedBackupStorageRedundancy, + isZoneRedundant, + primaryUserAssignedIdentityId, + keyId, + administrators, + servicePrincipal, + virtualClusterId, + externalGovernanceStatus, + pricingModel, + createOn, + authenticationMetadata, + databaseFormat, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Resource ID. + /// Private endpoint connection properties. + /// A new instance for mocking. + public static ManagedInstancePecProperty ManagedInstancePecProperty(ResourceIdentifier id = null, ManagedInstancePrivateEndpointConnectionProperties properties = null) + { + return new ManagedInstancePecProperty(id, properties, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The Azure Active Directory application object id. + /// The Azure Active Directory application client id. + /// The Azure Active Directory tenant id. + /// Service principal type. + /// A new instance for mocking. + public static SqlServicePrincipal SqlServicePrincipal(Guid? principalId = null, Guid? clientId = null, Guid? tenantId = null, SqlServicePrincipalType? principalType = null) + { + return new SqlServicePrincipal(principalId, clientId, tenantId, principalType, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Managed instance sku. + /// Managed instance identity. + /// Resource tags. + /// Provisioning state of managed instance. + /// + /// Specifies the mode of database creation. + /// + /// Default: Regular instance creation. + /// + /// Restore: Creates an instance by restoring a set of backups to specific point in time. RestorePointInTime and SourceManagedInstanceId must be specified. + /// + /// The fully qualified domain name of the managed instance. + /// Whether or not this is a GPv2 variant of General Purpose edition. + /// Administrator username for the managed instance. Can only be specified when the managed instance is being created (and is required for creation). + /// The administrator login password (required for managed instance creation). + /// Subnet resource ID for the managed instance. + /// The state of the managed instance. + /// The license type. Possible values are 'LicenseIncluded' (regular price inclusive of a new SQL license) and 'BasePrice' (discounted AHB price for bringing your own SQL licenses). + /// Hybrid secondary usage. Possible values are 'Active' (default value) and 'Passive' (customer uses the secondary as Passive DR). + /// Hybrid secondary usage detected. Possible values are 'Active' (customer does not meet the requirements to use the secondary as Passive DR) and 'Passive' (customer meets the requirements to use the secondary as Passive DR). + /// The number of vCores. Allowed values: 8, 16, 24, 32, 40, 64, 80. + /// Storage size in GB. Minimum value: 32. Maximum value: 16384. Increments of 32 GB allowed only. Maximum value depends on the selected hardware family and number of vCores. + /// Storage IOps. Minimum value: 300. Maximum value: 80000. Increments of 1 IOps allowed only. Maximum value depends on the selected hardware family and number of vCores. + /// Storage throughput MBps parameter is not supported in the instance create/update operation. + /// Collation of the managed instance. + /// The Dns Zone that the managed instance is in. + /// The resource id of another managed instance whose DNS zone this managed instance will share after creation. + /// Whether or not the public data endpoint is enabled. + /// The resource identifier of the source managed instance associated with create operation of this instance. + /// Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. + /// Connection type used for connecting to the instance. + /// + /// Id of the timezone. Allowed values are timezones supported by Windows. + /// Windows keeps details on supported timezones, including the id, in registry under + /// KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones. + /// You can get those registry values via SQL Server by querying SELECT name AS timezone_id FROM sys.time_zone_info. + /// List of Ids can also be obtained by executing [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. + /// An example of valid timezone id is "Pacific Standard Time" or "W. Europe Standard Time". + /// + /// The Id of the instance pool this managed server belongs to. + /// Specifies maintenance configuration id to apply to this managed instance. + /// List of private endpoint connections on a managed instance. + /// Minimal TLS version. Allowed values: 'None', '1.0', '1.1', '1.2'. + /// The storage account type used to store backups for this instance. The options are Local (LocallyRedundantStorage), Zone (ZoneRedundantStorage), Geo (GeoRedundantStorage) and GeoZone(GeoZoneRedundantStorage). + /// The storage account type to be used to store backups for this instance. The options are Local (LocallyRedundantStorage), Zone (ZoneRedundantStorage), Geo (GeoRedundantStorage) and GeoZone(GeoZoneRedundantStorage). + /// Whether or not the multi-az is enabled. + /// The resource id of a user assigned identity to be used by default. + /// A CMK URI of the key to use for encryption. + /// The Azure Active Directory administrator of the instance. This can only be used at instance create time. If used for instance update, it will be ignored or it will result in an error. For updates individual APIs will need to be used. + /// The managed instance's service principal. + /// Virtual cluster resource id for the Managed Instance. + /// Status of external governance. + /// Weather or not Managed Instance is freemium. + /// Specifies the point in time (ISO8601 format) of the Managed Instance creation. + /// The managed instance's authentication metadata lookup mode. + /// Specifies the internal format of instance databases specific to the SQL engine version. + /// A new instance for mocking. + public static ManagedInstancePatch ManagedInstancePatch(SqlSku sku = null, ManagedServiceIdentity identity = null, IDictionary tags = null, JobExecutionProvisioningState? provisioningState = null, ManagedServerCreateMode? managedInstanceCreateMode = null, string fullyQualifiedDomainName = null, bool? isGeneralPurposeV2 = null, string administratorLogin = null, string administratorLoginPassword = null, ResourceIdentifier subnetId = null, string state = null, ManagedInstanceLicenseType? licenseType = null, HybridSecondaryUsage? hybridSecondaryUsage = null, HybridSecondaryUsageDetected? hybridSecondaryUsageDetected = null, int? vCores = null, int? storageSizeInGB = null, int? storageIOps = null, int? storageThroughputMBps = null, string collation = null, string dnsZone = null, ResourceIdentifier managedDnsZonePartner = null, bool? isPublicDataEndpointEnabled = null, ResourceIdentifier sourceManagedInstanceId = null, DateTimeOffset? restorePointInTime = null, ManagedInstanceProxyOverride? proxyOverride = null, string timezoneId = null, ResourceIdentifier instancePoolId = null, ResourceIdentifier maintenanceConfigurationId = null, IEnumerable privateEndpointConnections = null, string minimalTlsVersion = null, SqlBackupStorageRedundancy? currentBackupStorageRedundancy = null, SqlBackupStorageRedundancy? requestedBackupStorageRedundancy = null, bool? isZoneRedundant = null, ResourceIdentifier primaryUserAssignedIdentityId = null, Uri keyId = null, ManagedInstanceExternalAdministrator administrators = null, SqlServicePrincipal servicePrincipal = null, string virtualClusterId = null, ExternalGovernanceStatus? externalGovernanceStatus = null, FreemiumType? pricingModel = null, DateTimeOffset? createOn = null, AuthMetadataLookupMode? authenticationMetadata = null, ManagedInstanceDatabaseFormat? databaseFormat = null) + { + tags ??= new Dictionary(); + privateEndpointConnections ??= new List(); + + return new ManagedInstancePatch( sku, + identity, + tags, + provisioningState, + managedInstanceCreateMode, + fullyQualifiedDomainName, + isGeneralPurposeV2, + administratorLogin, + administratorLoginPassword, subnetId, - vCores, + state, licenseType, + hybridSecondaryUsage, + hybridSecondaryUsageDetected, + vCores, + storageSizeInGB, + storageIOps, + storageThroughputMBps, + collation, dnsZone, + managedDnsZonePartner, + isPublicDataEndpointEnabled, + sourceManagedInstanceId, + restorePointInTime, + proxyOverride, + timezoneId, + instancePoolId, maintenanceConfigurationId, + privateEndpointConnections?.ToList(), + minimalTlsVersion, + currentBackupStorageRedundancy, + requestedBackupStorageRedundancy, + isZoneRedundant, + primaryUserAssignedIdentityId, + keyId, + administrators, + servicePrincipal, + virtualClusterId, + externalGovernanceStatus, + pricingModel, + createOn, + authenticationMetadata, + databaseFormat, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The name and tier of the SKU. - /// Resource tags. - /// Resource ID of the subnet to place this instance pool in. - /// Count of vCores belonging to this instance pool. - /// The license type. Possible values are 'LicenseIncluded' (price for SQL license is included) and 'BasePrice' (without SQL license price). - /// The Dns Zone that the managed instance pool is in. - /// Specifies maintenance configuration id to apply to this managed instance. - /// A new instance for mocking. - public static InstancePoolPatch InstancePoolPatch(SqlSku sku = null, IDictionary tags = null, ResourceIdentifier subnetId = null, int? vCores = null, InstancePoolLicenseType? licenseType = null, string dnsZone = null, ResourceIdentifier maintenanceConfigurationId = null) + /// Initializes a new instance of . + /// The type of service accessed by the managed instance service, e.g., Azure Storage, Azure Active Directory, etc. + /// The endpoints that the managed instance service communicates with in order to function correctly. + /// A new instance for mocking. + public static SqlOutboundEnvironmentEndpoint SqlOutboundEnvironmentEndpoint(string category = null, IEnumerable endpoints = null) { - tags ??= new Dictionary(); + endpoints ??= new List(); - return new InstancePoolPatch( - sku, - tags, - subnetId, - vCores, - licenseType, - dnsZone, - maintenanceConfigurationId, - serializedAdditionalRawData: null); + return new SqlOutboundEnvironmentEndpoint(category, endpoints?.ToList(), serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The server name that the backup database belong to. - /// The create time of the server. - /// The name of the database the backup belong to. - /// The delete time of the database. - /// The time the backup was taken. - /// The time the long term retention backup will expire. - /// The storage redundancy type of the backup. - /// The storage redundancy type of the backup. - /// The setting whether the LTR backup is immutable. - /// The BackupStorageAccessTier for the LTR backup. - /// A new instance for mocking. - public static LongTermRetentionBackupData LongTermRetentionBackupData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string serverName = null, DateTimeOffset? serverCreateOn = null, string databaseName = null, DateTimeOffset? databaseDeletedOn = null, DateTimeOffset? backupOn = null, DateTimeOffset? backupExpireOn = null, SqlBackupStorageRedundancy? backupStorageRedundancy = null, SqlBackupStorageRedundancy? requestedBackupStorageRedundancy = null, bool? isBackupImmutable = null, SqlBackupStorageAccessTier? backupStorageAccessTier = null) + /// Initializes a new instance of . + /// The domain name of the dependency. + /// The IP Addresses and Ports used when connecting to DomainName. + /// A new instance for mocking. + public static ManagedInstanceEndpointDependency ManagedInstanceEndpointDependency(string domainName = null, IEnumerable endpointDetails = null) { - return new LongTermRetentionBackupData( - id, - name, - resourceType, - systemData, - serverName, - serverCreateOn, - databaseName, - databaseDeletedOn, - backupOn, - backupExpireOn, - backupStorageRedundancy, - requestedBackupStorageRedundancy, - isBackupImmutable, - backupStorageAccessTier, - serializedAdditionalRawData: null); + endpointDetails ??= new List(); + + return new ManagedInstanceEndpointDependency(domainName, endpointDetails?.ToList(), serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . + /// The port an endpoint is connected to. + /// A new instance for mocking. + public static ManagedInstanceEndpointDetail ManagedInstanceEndpointDetail(int? port = null) + { + return new ManagedInstanceEndpointDetail(port, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. /// Request Id. - /// Operation type. - /// Source backup resource id. - /// Target backup resource id. - /// The storage redundancy type of the copied backup. + /// Request type. + /// Queued time. + /// Managed instance name. /// Operation status. - /// Progress message. - /// A new instance for mocking. - public static LongTermRetentionBackupOperationResult LongTermRetentionBackupOperationResult(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, Guid? requestId = null, string operationType = null, ResourceIdentifier fromBackupResourceId = null, ResourceIdentifier toBackupResourceId = null, SqlBackupStorageRedundancy? targetBackupStorageRedundancy = null, string status = null, string message = null) + /// Error message. + /// A new instance for mocking. + public static RefreshExternalGovernanceStatusOperationResultMI RefreshExternalGovernanceStatusOperationResultMI(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, Guid? requestId = null, string requestType = null, string queuedTime = null, string managedInstanceName = null, string status = null, string errorMessage = null) { - return new LongTermRetentionBackupOperationResult( + return new RefreshExternalGovernanceStatusOperationResultMI( id, name, resourceType, systemData, requestId, - operationType, - fromBackupResourceId, - toBackupResourceId, - targetBackupStorageRedundancy, + requestType, + queuedTime, + managedInstanceName, status, - message, + errorMessage, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The setting whether to make LTR backups immutable. - /// The BackupStorageAccessTier for the LTR backups. - /// The weekly retention policy for an LTR backup in an ISO 8601 format. - /// The monthly retention policy for an LTR backup in an ISO 8601 format. - /// The yearly retention policy for an LTR backup in an ISO 8601 format. - /// The week of year to take the yearly backup in an ISO 8601 format. - /// A new instance for mocking. - public static LongTermRetentionPolicyData LongTermRetentionPolicyData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, bool? makeBackupsImmutable = null, SqlBackupStorageAccessTier? backupStorageAccessTier = null, string weeklyRetention = null, string monthlyRetention = null, string yearlyRetention = null, int? weekOfYear = null) + /// Initializes a new instance of . + /// Requested number of top queries. + /// Aggregation function used to calculate query metrics. + /// Metric used to rank queries. + /// Interval type (length). + /// The start time for the metric (ISO-8601 format). + /// The end time for the metric (ISO-8601 format). + /// List of top resource consuming queries with appropriate metric data. + /// A new instance for mocking. + public static TopQueries TopQueries(int? numberOfQueries = null, string aggregationFunction = null, string observationMetric = null, QueryTimeGrainType? intervalType = null, string startTime = null, string endTime = null, IEnumerable queries = null) { - return new LongTermRetentionPolicyData( - id, - name, - resourceType, - systemData, - makeBackupsImmutable, - backupStorageAccessTier, - weeklyRetention, - monthlyRetention, - yearlyRetention, - weekOfYear, + queries ??= new List(); + + return new TopQueries( + numberOfQueries, + aggregationFunction, + observationMetric, + intervalType, + startTime, + endTime, + queries?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Database name of the database in which this query was executed. + /// Unique query id (unique within one database). + /// The start time for the metric (ISO-8601 format). + /// The end time for the metric (ISO-8601 format). + /// List of intervals with appropriate metric data. + /// A new instance for mocking. + public static QueryStatisticsProperties QueryStatisticsProperties(string databaseName = null, string queryId = null, string startTime = null, string endTime = null, IEnumerable intervals = null) + { + intervals ??= new List(); + + return new QueryStatisticsProperties( + databaseName, + queryId, + startTime, + endTime, + intervals?.ToList(), serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The start time for the metric interval (ISO-8601 format). + /// Interval type (length). + /// Execution count of a query in this interval. + /// List of metric objects for this interval. + /// A new instance for mocking. + public static QueryMetricIntervalAutoGenerated QueryMetricIntervalAutoGenerated(string intervalStartTime = null, QueryTimeGrainType? intervalType = null, long? executionCount = null, IEnumerable metrics = null) + { + metrics ??= new List(); + + return new QueryMetricIntervalAutoGenerated(intervalStartTime, intervalType, executionCount, metrics?.ToList(), serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// /// @@ -6121,5 +6246,63 @@ public static RefreshExternalGovernanceStatusOperationResult RefreshExternalGove errorMessage, serializedAdditionalRawData: null); } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Resource partner server. + /// Resource partner database. + /// Resource partner database Id. + /// Resource partner location. + /// Local replication role. + /// Partner replication role. + /// Replication mode. + /// Time at which the link was created. + /// Seeding completion percentage for the link. + /// Replication state (PENDING, SEEDING, CATCHUP, SUSPENDED). + /// Whether the user is currently allowed to terminate the link. + /// Link type (GEO, NAMED, STANDBY). Update operation does not support NAMED. + /// A new instance for mocking. + public static SqlServerDatabaseReplicationLinkData SqlServerDatabaseReplicationLinkData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string partnerServer = null, string partnerDatabase = null, string partnerDatabaseId = null, AzureLocation? partnerLocation = null, SqlServerDatabaseReplicationRole? role = null, SqlServerDatabaseReplicationRole? partnerRole = null, string replicationMode = null, DateTimeOffset? startOn = null, int? percentComplete = null, ReplicationLinkState? replicationState = null, bool? isTerminationAllowed = null, ReplicationLinkType? linkType = null) + { + return new SqlServerDatabaseReplicationLinkData( + id, + name, + resourceType, + systemData, + partnerServer, + partnerDatabase, + partnerDatabaseId, + partnerLocation, + role, + partnerRole, + replicationMode, + startOn, + percentComplete, + replicationState, + isTerminationAllowed, + linkType, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Link type (GEO, NAMED, STANDBY). Update operation does not support NAMED. + /// A new instance for mocking. + public static SqlServerDatabaseReplicationLinkPatch SqlServerDatabaseReplicationLinkPatch(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ReplicationLinkType? linkType = null) + { + return new SqlServerDatabaseReplicationLinkPatch( + id, + name, + resourceType, + systemData, + linkType, + serializedAdditionalRawData: null); + } } } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/DistributedAvailabilityGroupCollection.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/DistributedAvailabilityGroupCollection.cs index aa5cc50bc01c..3f22631d00ff 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/DistributedAvailabilityGroupCollection.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/DistributedAvailabilityGroupCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2021-11-01-preview + /// 2023-08-01-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> Cr /// /// /// Default Api Version - /// 2021-11-01-preview + /// 2023-08-01-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate /// /// /// Default Api Version - /// 2021-11-01-preview + /// 2023-08-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2021-11-01-preview + /// 2023-08-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string distrib /// /// /// Default Api Version - /// 2021-11-01-preview + /// 2023-08-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(C /// /// /// Default Api Version - /// 2021-11-01-preview + /// 2023-08-01-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(Cancellatio /// /// /// Default Api Version - /// 2021-11-01-preview + /// 2023-08-01-preview /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string distributedAvailabi /// /// /// Default Api Version - /// 2021-11-01-preview + /// 2023-08-01-preview /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string distributedAvailabilityGroupName, Ca /// /// /// Default Api Version - /// 2021-11-01-preview + /// 2023-08-01-preview /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2021-11-01-preview + /// 2023-08-01-preview /// /// /// Resource diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/DistributedAvailabilityGroupData.Serialization.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/DistributedAvailabilityGroupData.Serialization.cs index 905862ac760a..e8df4085f823 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/DistributedAvailabilityGroupData.Serialization.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/DistributedAvailabilityGroupData.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; using System.Text; using System.Text.Json; using Azure.Core; @@ -51,55 +52,65 @@ void IJsonModel.Write(Utf8JsonWriter writer, M } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); - if (Optional.IsDefined(TargetDatabase)) + if (options.Format != "W" && Optional.IsDefined(DistributedAvailabilityGroupName)) { - writer.WritePropertyName("targetDatabase"u8); - writer.WriteStringValue(TargetDatabase); + writer.WritePropertyName("distributedAvailabilityGroupName"u8); + writer.WriteStringValue(DistributedAvailabilityGroupName); } - if (Optional.IsDefined(SourceEndpoint)) + if (options.Format != "W" && Optional.IsDefined(DistributedAvailabilityGroupId)) { - writer.WritePropertyName("sourceEndpoint"u8); - writer.WriteStringValue(SourceEndpoint); + writer.WritePropertyName("distributedAvailabilityGroupId"u8); + writer.WriteStringValue(DistributedAvailabilityGroupId.Value); } - if (Optional.IsDefined(PrimaryAvailabilityGroupName)) + if (Optional.IsDefined(ReplicationMode)) { - writer.WritePropertyName("primaryAvailabilityGroupName"u8); - writer.WriteStringValue(PrimaryAvailabilityGroupName); + writer.WritePropertyName("replicationMode"u8); + writer.WriteStringValue(ReplicationMode.Value.ToString()); } - if (Optional.IsDefined(SecondaryAvailabilityGroupName)) + if (options.Format != "W" && Optional.IsDefined(PartnerLinkRole)) { - writer.WritePropertyName("secondaryAvailabilityGroupName"u8); - writer.WriteStringValue(SecondaryAvailabilityGroupName); + writer.WritePropertyName("partnerLinkRole"u8); + writer.WriteStringValue(PartnerLinkRole.Value.ToString()); } - if (Optional.IsDefined(ReplicationMode)) + if (Optional.IsDefined(PartnerAvailabilityGroupName)) { - writer.WritePropertyName("replicationMode"u8); - writer.WriteStringValue(ReplicationMode.Value.ToString()); + writer.WritePropertyName("partnerAvailabilityGroupName"u8); + writer.WriteStringValue(PartnerAvailabilityGroupName); } - if (options.Format != "W" && Optional.IsDefined(DistributedAvailabilityGroupId)) + if (Optional.IsDefined(PartnerEndpoint)) { - writer.WritePropertyName("distributedAvailabilityGroupId"u8); - writer.WriteStringValue(DistributedAvailabilityGroupId.Value); + writer.WritePropertyName("partnerEndpoint"u8); + writer.WriteStringValue(PartnerEndpoint); } - if (options.Format != "W" && Optional.IsDefined(SourceReplicaId)) + if (Optional.IsDefined(InstanceLinkRole)) { - writer.WritePropertyName("sourceReplicaId"u8); - writer.WriteStringValue(SourceReplicaId.Value); + writer.WritePropertyName("instanceLinkRole"u8); + writer.WriteStringValue(InstanceLinkRole.Value.ToString()); } - if (options.Format != "W" && Optional.IsDefined(TargetReplicaId)) + if (Optional.IsDefined(InstanceAvailabilityGroupName)) { - writer.WritePropertyName("targetReplicaId"u8); - writer.WriteStringValue(TargetReplicaId.Value); + writer.WritePropertyName("instanceAvailabilityGroupName"u8); + writer.WriteStringValue(InstanceAvailabilityGroupName); } - if (options.Format != "W" && Optional.IsDefined(LinkState)) + if (Optional.IsDefined(FailoverMode)) { - writer.WritePropertyName("linkState"u8); - writer.WriteStringValue(LinkState); + writer.WritePropertyName("failoverMode"u8); + writer.WriteStringValue(FailoverMode.Value.ToString()); } - if (options.Format != "W" && Optional.IsDefined(LastHardenedLsn)) + if (Optional.IsDefined(SeedingMode)) { - writer.WritePropertyName("lastHardenedLsn"u8); - writer.WriteStringValue(LastHardenedLsn); + writer.WritePropertyName("seedingMode"u8); + writer.WriteStringValue(SeedingMode.Value.ToString()); + } + if (Optional.IsCollectionDefined(Databases)) + { + writer.WritePropertyName("databases"u8); + writer.WriteStartArray(); + foreach (var item in Databases) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); } writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -144,16 +155,17 @@ internal static DistributedAvailabilityGroupData DeserializeDistributedAvailabil string name = default; ResourceType type = default; SystemData systemData = default; - string targetDatabase = default; - string sourceEndpoint = default; - string primaryAvailabilityGroupName = default; - string secondaryAvailabilityGroupName = default; - DistributedAvailabilityGroupReplicationMode? replicationMode = default; + string distributedAvailabilityGroupName = default; Guid? distributedAvailabilityGroupId = default; - Guid? sourceReplicaId = default; - Guid? targetReplicaId = default; - string linkState = default; - string lastHardenedLsn = default; + ReplicationModeType? replicationMode = default; + LinkRole? partnerLinkRole = default; + string partnerAvailabilityGroupName = default; + string partnerEndpoint = default; + LinkRole? instanceLinkRole = default; + string instanceAvailabilityGroupName = default; + FailoverModeType? failoverMode = default; + SeedingModeType? seedingMode = default; + IList databases = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -191,24 +203,18 @@ internal static DistributedAvailabilityGroupData DeserializeDistributedAvailabil } foreach (var property0 in property.Value.EnumerateObject()) { - if (property0.NameEquals("targetDatabase"u8)) - { - targetDatabase = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("sourceEndpoint"u8)) + if (property0.NameEquals("distributedAvailabilityGroupName"u8)) { - sourceEndpoint = property0.Value.GetString(); + distributedAvailabilityGroupName = property0.Value.GetString(); continue; } - if (property0.NameEquals("primaryAvailabilityGroupName"u8)) - { - primaryAvailabilityGroupName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("secondaryAvailabilityGroupName"u8)) + if (property0.NameEquals("distributedAvailabilityGroupId"u8)) { - secondaryAvailabilityGroupName = property0.Value.GetString(); + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + distributedAvailabilityGroupId = property0.Value.GetGuid(); continue; } if (property0.NameEquals("replicationMode"u8)) @@ -217,44 +223,72 @@ internal static DistributedAvailabilityGroupData DeserializeDistributedAvailabil { continue; } - replicationMode = new DistributedAvailabilityGroupReplicationMode(property0.Value.GetString()); + replicationMode = new ReplicationModeType(property0.Value.GetString()); continue; } - if (property0.NameEquals("distributedAvailabilityGroupId"u8)) + if (property0.NameEquals("partnerLinkRole"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - distributedAvailabilityGroupId = property0.Value.GetGuid(); + partnerLinkRole = new LinkRole(property0.Value.GetString()); continue; } - if (property0.NameEquals("sourceReplicaId"u8)) + if (property0.NameEquals("partnerAvailabilityGroupName"u8)) + { + partnerAvailabilityGroupName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("partnerEndpoint"u8)) + { + partnerEndpoint = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("instanceLinkRole"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - sourceReplicaId = property0.Value.GetGuid(); + instanceLinkRole = new LinkRole(property0.Value.GetString()); continue; } - if (property0.NameEquals("targetReplicaId"u8)) + if (property0.NameEquals("instanceAvailabilityGroupName"u8)) + { + instanceAvailabilityGroupName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("failoverMode"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - targetReplicaId = property0.Value.GetGuid(); + failoverMode = new FailoverModeType(property0.Value.GetString()); continue; } - if (property0.NameEquals("linkState"u8)) + if (property0.NameEquals("seedingMode"u8)) { - linkState = property0.Value.GetString(); + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + seedingMode = new SeedingModeType(property0.Value.GetString()); continue; } - if (property0.NameEquals("lastHardenedLsn"u8)) + if (property0.NameEquals("databases"u8)) { - lastHardenedLsn = property0.Value.GetString(); + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(DistributedAvailabilityGroupDatabase.DeserializeDistributedAvailabilityGroupDatabase(item, options)); + } + databases = array; continue; } } @@ -271,16 +305,17 @@ internal static DistributedAvailabilityGroupData DeserializeDistributedAvailabil name, type, systemData, - targetDatabase, - sourceEndpoint, - primaryAvailabilityGroupName, - secondaryAvailabilityGroupName, - replicationMode, + distributedAvailabilityGroupName, distributedAvailabilityGroupId, - sourceReplicaId, - targetReplicaId, - linkState, - lastHardenedLsn, + replicationMode, + partnerLinkRole, + partnerAvailabilityGroupName, + partnerEndpoint, + instanceLinkRole, + instanceAvailabilityGroupName, + failoverMode, + seedingMode, + databases ?? new ChangeTrackingList(), serializedAdditionalRawData); } @@ -350,200 +385,207 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) builder.Append(" properties:"); builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TargetDatabase), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DistributedAvailabilityGroupName), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" targetDatabase: "); + builder.Append(" distributedAvailabilityGroupName: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(TargetDatabase)) + if (Optional.IsDefined(DistributedAvailabilityGroupName)) { - builder.Append(" targetDatabase: "); - if (TargetDatabase.Contains(Environment.NewLine)) + builder.Append(" distributedAvailabilityGroupName: "); + if (DistributedAvailabilityGroupName.Contains(Environment.NewLine)) { builder.AppendLine("'''"); - builder.AppendLine($"{TargetDatabase}'''"); + builder.AppendLine($"{DistributedAvailabilityGroupName}'''"); } else { - builder.AppendLine($"'{TargetDatabase}'"); + builder.AppendLine($"'{DistributedAvailabilityGroupName}'"); } } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SourceEndpoint), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DistributedAvailabilityGroupId), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" sourceEndpoint: "); + builder.Append(" distributedAvailabilityGroupId: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(SourceEndpoint)) + if (Optional.IsDefined(DistributedAvailabilityGroupId)) { - builder.Append(" sourceEndpoint: "); - if (SourceEndpoint.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{SourceEndpoint}'''"); - } - else - { - builder.AppendLine($"'{SourceEndpoint}'"); - } + builder.Append(" distributedAvailabilityGroupId: "); + builder.AppendLine($"'{DistributedAvailabilityGroupId.Value.ToString()}'"); } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PrimaryAvailabilityGroupName), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ReplicationMode), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" primaryAvailabilityGroupName: "); + builder.Append(" replicationMode: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(PrimaryAvailabilityGroupName)) + if (Optional.IsDefined(ReplicationMode)) { - builder.Append(" primaryAvailabilityGroupName: "); - if (PrimaryAvailabilityGroupName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{PrimaryAvailabilityGroupName}'''"); - } - else - { - builder.AppendLine($"'{PrimaryAvailabilityGroupName}'"); - } + builder.Append(" replicationMode: "); + builder.AppendLine($"'{ReplicationMode.Value.ToString()}'"); } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SecondaryAvailabilityGroupName), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PartnerLinkRole), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" secondaryAvailabilityGroupName: "); + builder.Append(" partnerLinkRole: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(SecondaryAvailabilityGroupName)) + if (Optional.IsDefined(PartnerLinkRole)) { - builder.Append(" secondaryAvailabilityGroupName: "); - if (SecondaryAvailabilityGroupName.Contains(Environment.NewLine)) + builder.Append(" partnerLinkRole: "); + builder.AppendLine($"'{PartnerLinkRole.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PartnerAvailabilityGroupName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" partnerAvailabilityGroupName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PartnerAvailabilityGroupName)) + { + builder.Append(" partnerAvailabilityGroupName: "); + if (PartnerAvailabilityGroupName.Contains(Environment.NewLine)) { builder.AppendLine("'''"); - builder.AppendLine($"{SecondaryAvailabilityGroupName}'''"); + builder.AppendLine($"{PartnerAvailabilityGroupName}'''"); } else { - builder.AppendLine($"'{SecondaryAvailabilityGroupName}'"); + builder.AppendLine($"'{PartnerAvailabilityGroupName}'"); } } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ReplicationMode), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PartnerEndpoint), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" replicationMode: "); + builder.Append(" partnerEndpoint: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(ReplicationMode)) + if (Optional.IsDefined(PartnerEndpoint)) { - builder.Append(" replicationMode: "); - builder.AppendLine($"'{ReplicationMode.Value.ToString()}'"); + builder.Append(" partnerEndpoint: "); + if (PartnerEndpoint.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{PartnerEndpoint}'''"); + } + else + { + builder.AppendLine($"'{PartnerEndpoint}'"); + } } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DistributedAvailabilityGroupId), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(InstanceLinkRole), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" distributedAvailabilityGroupId: "); + builder.Append(" instanceLinkRole: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(DistributedAvailabilityGroupId)) + if (Optional.IsDefined(InstanceLinkRole)) { - builder.Append(" distributedAvailabilityGroupId: "); - builder.AppendLine($"'{DistributedAvailabilityGroupId.Value.ToString()}'"); + builder.Append(" instanceLinkRole: "); + builder.AppendLine($"'{InstanceLinkRole.Value.ToString()}'"); } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SourceReplicaId), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(InstanceAvailabilityGroupName), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" sourceReplicaId: "); + builder.Append(" instanceAvailabilityGroupName: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(SourceReplicaId)) + if (Optional.IsDefined(InstanceAvailabilityGroupName)) { - builder.Append(" sourceReplicaId: "); - builder.AppendLine($"'{SourceReplicaId.Value.ToString()}'"); + builder.Append(" instanceAvailabilityGroupName: "); + if (InstanceAvailabilityGroupName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{InstanceAvailabilityGroupName}'''"); + } + else + { + builder.AppendLine($"'{InstanceAvailabilityGroupName}'"); + } } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TargetReplicaId), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(FailoverMode), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" targetReplicaId: "); + builder.Append(" failoverMode: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(TargetReplicaId)) + if (Optional.IsDefined(FailoverMode)) { - builder.Append(" targetReplicaId: "); - builder.AppendLine($"'{TargetReplicaId.Value.ToString()}'"); + builder.Append(" failoverMode: "); + builder.AppendLine($"'{FailoverMode.Value.ToString()}'"); } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LinkState), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SeedingMode), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" linkState: "); + builder.Append(" seedingMode: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(LinkState)) + if (Optional.IsDefined(SeedingMode)) { - builder.Append(" linkState: "); - if (LinkState.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{LinkState}'''"); - } - else - { - builder.AppendLine($"'{LinkState}'"); - } + builder.Append(" seedingMode: "); + builder.AppendLine($"'{SeedingMode.Value.ToString()}'"); } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LastHardenedLsn), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Databases), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" lastHardenedLsn: "); + builder.Append(" databases: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(LastHardenedLsn)) + if (Optional.IsCollectionDefined(Databases)) { - builder.Append(" lastHardenedLsn: "); - if (LastHardenedLsn.Contains(Environment.NewLine)) + if (Databases.Any()) { - builder.AppendLine("'''"); - builder.AppendLine($"{LastHardenedLsn}'''"); - } - else - { - builder.AppendLine($"'{LastHardenedLsn}'"); + builder.Append(" databases: "); + builder.AppendLine("["); + foreach (var item in Databases) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 6, true, " databases: "); + } + builder.AppendLine(" ]"); } } } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/DistributedAvailabilityGroupData.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/DistributedAvailabilityGroupData.cs index a47b5c99fdb0..d6d9aac83086 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/DistributedAvailabilityGroupData.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/DistributedAvailabilityGroupData.cs @@ -54,6 +54,7 @@ public partial class DistributedAvailabilityGroupData : ResourceData /// Initializes a new instance of . public DistributedAvailabilityGroupData() { + Databases = new ChangeTrackingList(); } /// Initializes a new instance of . @@ -61,61 +62,66 @@ public DistributedAvailabilityGroupData() /// The name. /// The resourceType. /// The systemData. - /// The name of the target database. - /// The source endpoint. - /// The primary availability group name. - /// The secondary availability group name. - /// The replication mode of a distributed availability group. Parameter will be ignored during link creation. - /// The distributed availability group id. - /// The source replica id. - /// The target replica id. - /// The link state. - /// The last hardened lsn. + /// Name of the distributed availability group. + /// ID of the distributed availability group. + /// Replication mode of the link. + /// SQL server side link role. + /// SQL server side availability group name. + /// SQL server side endpoint - IP or DNS resolvable name. + /// Managed instance side link role. + /// Managed instance side availability group name. + /// The link failover mode - can be Manual if intended to be used for two-way failover with a supported SQL Server, or None for one-way failover to Azure. + /// Database seeding mode – can be Automatic (default), or Manual for supported scenarios. + /// Databases in the distributed availability group. /// Keeps track of any properties unknown to the library. - internal DistributedAvailabilityGroupData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string targetDatabase, string sourceEndpoint, string primaryAvailabilityGroupName, string secondaryAvailabilityGroupName, DistributedAvailabilityGroupReplicationMode? replicationMode, Guid? distributedAvailabilityGroupId, Guid? sourceReplicaId, Guid? targetReplicaId, string linkState, string lastHardenedLsn, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal DistributedAvailabilityGroupData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string distributedAvailabilityGroupName, Guid? distributedAvailabilityGroupId, ReplicationModeType? replicationMode, LinkRole? partnerLinkRole, string partnerAvailabilityGroupName, string partnerEndpoint, LinkRole? instanceLinkRole, string instanceAvailabilityGroupName, FailoverModeType? failoverMode, SeedingModeType? seedingMode, IList databases, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { - TargetDatabase = targetDatabase; - SourceEndpoint = sourceEndpoint; - PrimaryAvailabilityGroupName = primaryAvailabilityGroupName; - SecondaryAvailabilityGroupName = secondaryAvailabilityGroupName; - ReplicationMode = replicationMode; + DistributedAvailabilityGroupName = distributedAvailabilityGroupName; DistributedAvailabilityGroupId = distributedAvailabilityGroupId; - SourceReplicaId = sourceReplicaId; - TargetReplicaId = targetReplicaId; - LinkState = linkState; - LastHardenedLsn = lastHardenedLsn; + ReplicationMode = replicationMode; + PartnerLinkRole = partnerLinkRole; + PartnerAvailabilityGroupName = partnerAvailabilityGroupName; + PartnerEndpoint = partnerEndpoint; + InstanceLinkRole = instanceLinkRole; + InstanceAvailabilityGroupName = instanceAvailabilityGroupName; + FailoverMode = failoverMode; + SeedingMode = seedingMode; + Databases = databases; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The name of the target database. - [WirePath("properties.targetDatabase")] - public string TargetDatabase { get; set; } - /// The source endpoint. - [WirePath("properties.sourceEndpoint")] - public string SourceEndpoint { get; set; } - /// The primary availability group name. - [WirePath("properties.primaryAvailabilityGroupName")] - public string PrimaryAvailabilityGroupName { get; set; } - /// The secondary availability group name. - [WirePath("properties.secondaryAvailabilityGroupName")] - public string SecondaryAvailabilityGroupName { get; set; } - /// The replication mode of a distributed availability group. Parameter will be ignored during link creation. - [WirePath("properties.replicationMode")] - public DistributedAvailabilityGroupReplicationMode? ReplicationMode { get; set; } - /// The distributed availability group id. + /// Name of the distributed availability group. + [WirePath("properties.distributedAvailabilityGroupName")] + public string DistributedAvailabilityGroupName { get; } + /// ID of the distributed availability group. [WirePath("properties.distributedAvailabilityGroupId")] public Guid? DistributedAvailabilityGroupId { get; } - /// The source replica id. - [WirePath("properties.sourceReplicaId")] - public Guid? SourceReplicaId { get; } - /// The target replica id. - [WirePath("properties.targetReplicaId")] - public Guid? TargetReplicaId { get; } - /// The link state. - [WirePath("properties.linkState")] - public string LinkState { get; } - /// The last hardened lsn. - [WirePath("properties.lastHardenedLsn")] - public string LastHardenedLsn { get; } + /// Replication mode of the link. + [WirePath("properties.replicationMode")] + public ReplicationModeType? ReplicationMode { get; set; } + /// SQL server side link role. + [WirePath("properties.partnerLinkRole")] + public LinkRole? PartnerLinkRole { get; } + /// SQL server side availability group name. + [WirePath("properties.partnerAvailabilityGroupName")] + public string PartnerAvailabilityGroupName { get; set; } + /// SQL server side endpoint - IP or DNS resolvable name. + [WirePath("properties.partnerEndpoint")] + public string PartnerEndpoint { get; set; } + /// Managed instance side link role. + [WirePath("properties.instanceLinkRole")] + public LinkRole? InstanceLinkRole { get; set; } + /// Managed instance side availability group name. + [WirePath("properties.instanceAvailabilityGroupName")] + public string InstanceAvailabilityGroupName { get; set; } + /// The link failover mode - can be Manual if intended to be used for two-way failover with a supported SQL Server, or None for one-way failover to Azure. + [WirePath("properties.failoverMode")] + public FailoverModeType? FailoverMode { get; set; } + /// Database seeding mode – can be Automatic (default), or Manual for supported scenarios. + [WirePath("properties.seedingMode")] + public SeedingModeType? SeedingMode { get; set; } + /// Databases in the distributed availability group. + [WirePath("properties.databases")] + public IList Databases { get; } } } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/DistributedAvailabilityGroupResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/DistributedAvailabilityGroupResource.cs index a78cb3205da7..6a6bedd309ce 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/DistributedAvailabilityGroupResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/DistributedAvailabilityGroupResource.cs @@ -11,6 +11,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager.Sql.Models; namespace Azure.ResourceManager.Sql { @@ -101,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2021-11-01-preview + /// 2023-08-01-preview /// /// /// Resource @@ -141,7 +142,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2021-11-01-preview + /// 2023-08-01-preview /// /// /// Resource @@ -181,7 +182,7 @@ public virtual Response Get(CancellationTo /// /// /// Default Api Version - /// 2021-11-01-preview + /// 2023-08-01-preview /// /// /// Resource @@ -223,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2021-11-01-preview + /// 2023-08-01-preview /// /// /// Resource @@ -265,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2021-11-01-preview + /// 2023-08-01-preview /// /// /// Resource @@ -311,7 +312,7 @@ public virtual async Task> Up /// /// /// Default Api Version - /// 2021-11-01-preview + /// 2023-08-01-preview /// /// /// Resource @@ -343,5 +344,189 @@ public virtual ArmOperation Update(WaitUnt throw; } } + + /// + /// Performs requested failover type in this distributed availability group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}/failover + /// + /// + /// Operation Id + /// DistributedAvailabilityGroups_Failover + /// + /// + /// Default Api Version + /// 2023-08-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 distributed availability group failover request parameters. + /// The cancellation token to use. + /// is null. + public virtual async Task> FailoverAsync(WaitUntil waitUntil, DistributedAvailabilityGroupsFailoverContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _distributedAvailabilityGroupClientDiagnostics.CreateScope("DistributedAvailabilityGroupResource.Failover"); + scope.Start(); + try + { + var response = await _distributedAvailabilityGroupRestClient.FailoverAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new SqlArmOperation(new DistributedAvailabilityGroupOperationSource(Client), _distributedAvailabilityGroupClientDiagnostics, Pipeline, _distributedAvailabilityGroupRestClient.CreateFailoverRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Performs requested failover type in this distributed availability group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}/failover + /// + /// + /// Operation Id + /// DistributedAvailabilityGroups_Failover + /// + /// + /// Default Api Version + /// 2023-08-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 distributed availability group failover request parameters. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Failover(WaitUntil waitUntil, DistributedAvailabilityGroupsFailoverContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _distributedAvailabilityGroupClientDiagnostics.CreateScope("DistributedAvailabilityGroupResource.Failover"); + scope.Start(); + try + { + var response = _distributedAvailabilityGroupRestClient.Failover(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new SqlArmOperation(new DistributedAvailabilityGroupOperationSource(Client), _distributedAvailabilityGroupClientDiagnostics, Pipeline, _distributedAvailabilityGroupRestClient.CreateFailoverRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Sets the role for managed instance in a distributed availability group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}/setRole + /// + /// + /// Operation Id + /// DistributedAvailabilityGroups_SetRole + /// + /// + /// Default Api Version + /// 2023-08-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 distributed availability group set role request parameters. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetRoleAsync(WaitUntil waitUntil, DistributedAvailabilityGroupSetRole distributedAvailabilityGroupSetRole, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(distributedAvailabilityGroupSetRole, nameof(distributedAvailabilityGroupSetRole)); + + using var scope = _distributedAvailabilityGroupClientDiagnostics.CreateScope("DistributedAvailabilityGroupResource.SetRole"); + scope.Start(); + try + { + var response = await _distributedAvailabilityGroupRestClient.SetRoleAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, distributedAvailabilityGroupSetRole, cancellationToken).ConfigureAwait(false); + var operation = new SqlArmOperation(new DistributedAvailabilityGroupOperationSource(Client), _distributedAvailabilityGroupClientDiagnostics, Pipeline, _distributedAvailabilityGroupRestClient.CreateSetRoleRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, distributedAvailabilityGroupSetRole).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Sets the role for managed instance in a distributed availability group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}/setRole + /// + /// + /// Operation Id + /// DistributedAvailabilityGroups_SetRole + /// + /// + /// Default Api Version + /// 2023-08-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 distributed availability group set role request parameters. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation SetRole(WaitUntil waitUntil, DistributedAvailabilityGroupSetRole distributedAvailabilityGroupSetRole, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(distributedAvailabilityGroupSetRole, nameof(distributedAvailabilityGroupSetRole)); + + using var scope = _distributedAvailabilityGroupClientDiagnostics.CreateScope("DistributedAvailabilityGroupResource.SetRole"); + scope.Start(); + try + { + var response = _distributedAvailabilityGroupRestClient.SetRole(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, distributedAvailabilityGroupSetRole, cancellationToken); + var operation = new SqlArmOperation(new DistributedAvailabilityGroupOperationSource(Client), _distributedAvailabilityGroupClientDiagnostics, Pipeline, _distributedAvailabilityGroupRestClient.CreateSetRoleRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, distributedAvailabilityGroupSetRole).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } } } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/MockableSqlArmClient.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/MockableSqlArmClient.cs index 1931c1de9443..8bb265937d3e 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/MockableSqlArmClient.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/MockableSqlArmClient.cs @@ -1162,18 +1162,6 @@ public virtual ManagedInstanceAdvancedThreatProtectionResource GetManagedInstanc return new ManagedInstanceAdvancedThreatProtectionResource(Client, id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual SqlServerDatabaseReplicationLinkResource GetSqlServerDatabaseReplicationLinkResource(ResourceIdentifier id) - { - SqlServerDatabaseReplicationLinkResource.ValidateResourceId(id); - return new SqlServerDatabaseReplicationLinkResource(Client, id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -1258,18 +1246,6 @@ public virtual ManagedDatabaseResource GetManagedDatabaseResource(ResourceIdenti return new ManagedDatabaseResource(Client, id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual ManagedInstanceResource GetManagedInstanceResource(ResourceIdentifier id) - { - ManagedInstanceResource.ValidateResourceId(id); - return new ManagedInstanceResource(Client, id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -1534,6 +1510,18 @@ public virtual LongTermRetentionPolicyResource GetLongTermRetentionPolicyResourc return new LongTermRetentionPolicyResource(Client, id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ManagedInstanceResource GetManagedInstanceResource(ResourceIdentifier id) + { + ManagedInstanceResource.ValidateResourceId(id); + return new ManagedInstanceResource(Client, id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -1545,5 +1533,17 @@ public virtual SqlServerResource GetSqlServerResource(ResourceIdentifier id) SqlServerResource.ValidateResourceId(id); return new SqlServerResource(Client, id); } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual SqlServerDatabaseReplicationLinkResource GetSqlServerDatabaseReplicationLinkResource(ResourceIdentifier id) + { + SqlServerDatabaseReplicationLinkResource.ValidateResourceId(id); + return new SqlServerDatabaseReplicationLinkResource(Client, id); + } } } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/MockableSqlResourceGroupResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/MockableSqlResourceGroupResource.cs index 6e9a0e821e52..e02362bd2516 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/MockableSqlResourceGroupResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/MockableSqlResourceGroupResource.cs @@ -339,77 +339,6 @@ public virtual Response GetInstanceFailoverGroup( return GetInstanceFailoverGroups(locationName).Get(failoverGroupName, cancellationToken); } - /// Gets a collection of ManagedInstanceResources in the ResourceGroupResource. - /// An object representing collection of ManagedInstanceResources and their operations over a ManagedInstanceResource. - public virtual ManagedInstanceCollection GetManagedInstances() - { - return GetCachedClient(client => new ManagedInstanceCollection(client, Id)); - } - - /// - /// Gets a managed instance. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName} - /// - /// - /// Operation Id - /// ManagedInstances_Get - /// - /// - /// Default Api Version - /// 2022-08-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the managed instance. - /// The child resources to include in the response. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetManagedInstanceAsync(string managedInstanceName, string expand = null, CancellationToken cancellationToken = default) - { - return await GetManagedInstances().GetAsync(managedInstanceName, expand, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets a managed instance. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName} - /// - /// - /// Operation Id - /// ManagedInstances_Get - /// - /// - /// Default Api Version - /// 2022-08-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the managed instance. - /// The child resources to include in the response. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetManagedInstance(string managedInstanceName, string expand = null, CancellationToken cancellationToken = default) - { - return GetManagedInstances().Get(managedInstanceName, expand, cancellationToken); - } - /// Gets a collection of InstancePoolResources in the ResourceGroupResource. /// An object representing collection of InstancePoolResources and their operations over a InstancePoolResource. public virtual InstancePoolCollection GetInstancePools() @@ -559,6 +488,77 @@ public virtual Response GetResourc return GetResourceGroupLongTermRetentionBackups(locationName, longTermRetentionServerName, longTermRetentionDatabaseName).Get(backupName, cancellationToken); } + /// Gets a collection of ManagedInstanceResources in the ResourceGroupResource. + /// An object representing collection of ManagedInstanceResources and their operations over a ManagedInstanceResource. + public virtual ManagedInstanceCollection GetManagedInstances() + { + return GetCachedClient(client => new ManagedInstanceCollection(client, Id)); + } + + /// + /// Gets a managed instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName} + /// + /// + /// Operation Id + /// ManagedInstances_Get + /// + /// + /// Default Api Version + /// 2023-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the managed instance. + /// The child resources to include in the response. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetManagedInstanceAsync(string managedInstanceName, string expand = null, CancellationToken cancellationToken = default) + { + return await GetManagedInstances().GetAsync(managedInstanceName, expand, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a managed instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName} + /// + /// + /// Operation Id + /// ManagedInstances_Get + /// + /// + /// Default Api Version + /// 2023-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the managed instance. + /// The child resources to include in the response. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetManagedInstance(string managedInstanceName, string expand = null, CancellationToken cancellationToken = default) + { + return GetManagedInstances().Get(managedInstanceName, expand, cancellationToken); + } + /// Gets a collection of SqlServerResources in the ResourceGroupResource. /// An object representing collection of SqlServerResources and their operations over a SqlServerResource. public virtual SqlServerCollection GetSqlServers() diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/MockableSqlSubscriptionResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/MockableSqlSubscriptionResource.cs index b7021143a99e..2ddb2d978f02 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/MockableSqlSubscriptionResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/MockableSqlSubscriptionResource.cs @@ -30,12 +30,12 @@ public partial class MockableSqlSubscriptionResource : ArmResource private LongTermRetentionManagedInstanceBackupsRestOperations _longTermRetentionManagedInstanceBackupsRestClient; private ClientDiagnostics _virtualClusterClientDiagnostics; private VirtualClustersRestOperations _virtualClusterRestClient; - private ClientDiagnostics _managedInstanceClientDiagnostics; - private ManagedInstancesRestOperations _managedInstanceRestClient; private ClientDiagnostics _instancePoolClientDiagnostics; private InstancePoolsRestOperations _instancePoolRestClient; private ClientDiagnostics _longTermRetentionBackupsClientDiagnostics; private LongTermRetentionBackupsRestOperations _longTermRetentionBackupsRestClient; + private ClientDiagnostics _managedInstanceClientDiagnostics; + private ManagedInstancesRestOperations _managedInstanceRestClient; private ClientDiagnostics _sqlServerServersClientDiagnostics; private ServersRestOperations _sqlServerServersRestClient; @@ -61,12 +61,12 @@ internal MockableSqlSubscriptionResource(ArmClient client, ResourceIdentifier id private LongTermRetentionManagedInstanceBackupsRestOperations LongTermRetentionManagedInstanceBackupsRestClient => _longTermRetentionManagedInstanceBackupsRestClient ??= new LongTermRetentionManagedInstanceBackupsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); private ClientDiagnostics VirtualClusterClientDiagnostics => _virtualClusterClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Sql", VirtualClusterResource.ResourceType.Namespace, Diagnostics); private VirtualClustersRestOperations VirtualClusterRestClient => _virtualClusterRestClient ??= new VirtualClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(VirtualClusterResource.ResourceType)); - private ClientDiagnostics ManagedInstanceClientDiagnostics => _managedInstanceClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Sql", ManagedInstanceResource.ResourceType.Namespace, Diagnostics); - private ManagedInstancesRestOperations ManagedInstanceRestClient => _managedInstanceRestClient ??= new ManagedInstancesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(ManagedInstanceResource.ResourceType)); private ClientDiagnostics InstancePoolClientDiagnostics => _instancePoolClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Sql", InstancePoolResource.ResourceType.Namespace, Diagnostics); private InstancePoolsRestOperations InstancePoolRestClient => _instancePoolRestClient ??= new InstancePoolsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(InstancePoolResource.ResourceType)); private ClientDiagnostics LongTermRetentionBackupsClientDiagnostics => _longTermRetentionBackupsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Sql", ProviderConstants.DefaultProviderNamespace, Diagnostics); private LongTermRetentionBackupsRestOperations LongTermRetentionBackupsRestClient => _longTermRetentionBackupsRestClient ??= new LongTermRetentionBackupsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics ManagedInstanceClientDiagnostics => _managedInstanceClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Sql", ManagedInstanceResource.ResourceType.Namespace, Diagnostics); + private ManagedInstancesRestOperations ManagedInstanceRestClient => _managedInstanceRestClient ??= new ManagedInstancesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(ManagedInstanceResource.ResourceType)); private ClientDiagnostics SqlServerServersClientDiagnostics => _sqlServerServersClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Sql", SqlServerResource.ResourceType.Namespace, Diagnostics); private ServersRestOperations SqlServerServersRestClient => _sqlServerServersRestClient ??= new ServersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(SqlServerResource.ResourceType)); @@ -832,68 +832,6 @@ public virtual Pageable GetVirtualClusters(CancellationT return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VirtualClusterResource(Client, VirtualClusterData.DeserializeVirtualClusterData(e)), VirtualClusterClientDiagnostics, Pipeline, "MockableSqlSubscriptionResource.GetVirtualClusters", "value", "nextLink", cancellationToken); } - /// - /// Gets a list of all managed instances in the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Sql/managedInstances - /// - /// - /// Operation Id - /// ManagedInstances_List - /// - /// - /// Default Api Version - /// 2022-08-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The child resources to include in the response. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetManagedInstancesAsync(string expand = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedInstanceRestClient.CreateListRequest(Id.SubscriptionId, expand); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ManagedInstanceRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, expand); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ManagedInstanceResource(Client, ManagedInstanceData.DeserializeManagedInstanceData(e)), ManagedInstanceClientDiagnostics, Pipeline, "MockableSqlSubscriptionResource.GetManagedInstances", "value", "nextLink", cancellationToken); - } - - /// - /// Gets a list of all managed instances in the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Sql/managedInstances - /// - /// - /// Operation Id - /// ManagedInstances_List - /// - /// - /// Default Api Version - /// 2022-08-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The child resources to include in the response. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetManagedInstances(string expand = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedInstanceRestClient.CreateListRequest(Id.SubscriptionId, expand); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ManagedInstanceRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, expand); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ManagedInstanceResource(Client, ManagedInstanceData.DeserializeManagedInstanceData(e)), ManagedInstanceClientDiagnostics, Pipeline, "MockableSqlSubscriptionResource.GetManagedInstances", "value", "nextLink", cancellationToken); - } - /// /// Gets a list of all instance pools in the subscription. /// @@ -1080,6 +1018,68 @@ public virtual Pageable GetLongTermRetentionBackups return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => LongTermRetentionBackupData.DeserializeLongTermRetentionBackupData(e), LongTermRetentionBackupsClientDiagnostics, Pipeline, "MockableSqlSubscriptionResource.GetLongTermRetentionBackupsWithServer", "value", "nextLink", cancellationToken); } + /// + /// Gets a list of all managed instances in the subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Sql/managedInstances + /// + /// + /// Operation Id + /// ManagedInstances_List + /// + /// + /// Default Api Version + /// 2023-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The child resources to include in the response. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetManagedInstancesAsync(string expand = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedInstanceRestClient.CreateListRequest(Id.SubscriptionId, expand); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ManagedInstanceRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, expand); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ManagedInstanceResource(Client, ManagedInstanceData.DeserializeManagedInstanceData(e)), ManagedInstanceClientDiagnostics, Pipeline, "MockableSqlSubscriptionResource.GetManagedInstances", "value", "nextLink", cancellationToken); + } + + /// + /// Gets a list of all managed instances in the subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Sql/managedInstances + /// + /// + /// Operation Id + /// ManagedInstances_List + /// + /// + /// Default Api Version + /// 2023-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The child resources to include in the response. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetManagedInstances(string expand = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedInstanceRestClient.CreateListRequest(Id.SubscriptionId, expand); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ManagedInstanceRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, expand); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ManagedInstanceResource(Client, ManagedInstanceData.DeserializeManagedInstanceData(e)), ManagedInstanceClientDiagnostics, Pipeline, "MockableSqlSubscriptionResource.GetManagedInstances", "value", "nextLink", cancellationToken); + } + /// /// Determines whether a resource can be created with the specified name. /// diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/SqlExtensions.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/SqlExtensions.cs index 78750ca35df7..9394026cdd18 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/SqlExtensions.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/SqlExtensions.cs @@ -1820,25 +1820,6 @@ public static ManagedInstanceAdvancedThreatProtectionResource GetManagedInstance return GetMockableSqlArmClient(client).GetManagedInstanceAdvancedThreatProtectionResource(id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a 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 SqlServerDatabaseReplicationLinkResource GetSqlServerDatabaseReplicationLinkResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableSqlArmClient(client).GetSqlServerDatabaseReplicationLinkResource(id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -1972,25 +1953,6 @@ public static ManagedDatabaseResource GetManagedDatabaseResource(this ArmClient return GetMockableSqlArmClient(client).GetManagedDatabaseResource(id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a 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 ManagedInstanceResource GetManagedInstanceResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableSqlArmClient(client).GetManagedInstanceResource(id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -2409,6 +2371,25 @@ public static LongTermRetentionPolicyResource GetLongTermRetentionPolicyResource return GetMockableSqlArmClient(client).GetLongTermRetentionPolicyResource(id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a 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 ManagedInstanceResource GetManagedInstanceResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableSqlArmClient(client).GetManagedInstanceResource(id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -2428,6 +2409,25 @@ public static SqlServerResource GetSqlServerResource(this ArmClient client, Reso return GetMockableSqlArmClient(client).GetSqlServerResource(id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a 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 SqlServerDatabaseReplicationLinkResource GetSqlServerDatabaseReplicationLinkResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableSqlArmClient(client).GetSqlServerDatabaseReplicationLinkResource(id); + } + /// /// Gets a collection of SqlServerTrustGroupResources in the ResourceGroupResource. /// @@ -2817,127 +2817,129 @@ public static Response GetInstanceFailoverGroup(t } /// - /// Gets a collection of ManagedInstanceResources in the ResourceGroupResource. + /// Gets a collection of InstancePoolResources in the ResourceGroupResource. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// is null. - /// An object representing collection of ManagedInstanceResources and their operations over a ManagedInstanceResource. - public static ManagedInstanceCollection GetManagedInstances(this ResourceGroupResource resourceGroupResource) + /// An object representing collection of InstancePoolResources and their operations over a InstancePoolResource. + public static InstancePoolCollection GetInstancePools(this ResourceGroupResource resourceGroupResource) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockableSqlResourceGroupResource(resourceGroupResource).GetManagedInstances(); + return GetMockableSqlResourceGroupResource(resourceGroupResource).GetInstancePools(); } /// - /// Gets a managed instance. + /// Gets an instance pool. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName} /// /// /// Operation Id - /// ManagedInstances_Get + /// InstancePools_Get /// /// /// Default Api Version - /// 2022-08-01-preview + /// 2023-05-01-preview /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// The name of the managed instance. - /// The child resources to include in the response. + /// The name of the instance pool to be retrieved. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. + /// or is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static async Task> GetManagedInstanceAsync(this ResourceGroupResource resourceGroupResource, string managedInstanceName, string expand = null, CancellationToken cancellationToken = default) + public static async Task> GetInstancePoolAsync(this ResourceGroupResource resourceGroupResource, string instancePoolName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return await GetMockableSqlResourceGroupResource(resourceGroupResource).GetManagedInstanceAsync(managedInstanceName, expand, cancellationToken).ConfigureAwait(false); + return await GetMockableSqlResourceGroupResource(resourceGroupResource).GetInstancePoolAsync(instancePoolName, cancellationToken).ConfigureAwait(false); } /// - /// Gets a managed instance. + /// Gets an instance pool. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName} /// /// /// Operation Id - /// ManagedInstances_Get + /// InstancePools_Get /// /// /// Default Api Version - /// 2022-08-01-preview + /// 2023-05-01-preview /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// The name of the managed instance. - /// The child resources to include in the response. + /// The name of the instance pool to be retrieved. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. + /// or is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static Response GetManagedInstance(this ResourceGroupResource resourceGroupResource, string managedInstanceName, string expand = null, CancellationToken cancellationToken = default) + public static Response GetInstancePool(this ResourceGroupResource resourceGroupResource, string instancePoolName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockableSqlResourceGroupResource(resourceGroupResource).GetManagedInstance(managedInstanceName, expand, cancellationToken); + return GetMockableSqlResourceGroupResource(resourceGroupResource).GetInstancePool(instancePoolName, cancellationToken); } /// - /// Gets a collection of InstancePoolResources in the ResourceGroupResource. + /// Gets a collection of ResourceGroupLongTermRetentionBackupResources in the ResourceGroupResource. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// is null. - /// An object representing collection of InstancePoolResources and their operations over a InstancePoolResource. - public static InstancePoolCollection GetInstancePools(this ResourceGroupResource resourceGroupResource) + /// The location of the database. + /// The name of the server. + /// The name of the database. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// An object representing collection of ResourceGroupLongTermRetentionBackupResources and their operations over a ResourceGroupLongTermRetentionBackupResource. + public static ResourceGroupLongTermRetentionBackupCollection GetResourceGroupLongTermRetentionBackups(this ResourceGroupResource resourceGroupResource, AzureLocation locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockableSqlResourceGroupResource(resourceGroupResource).GetInstancePools(); + return GetMockableSqlResourceGroupResource(resourceGroupResource).GetResourceGroupLongTermRetentionBackups(locationName, longTermRetentionServerName, longTermRetentionDatabaseName); } /// - /// Gets an instance pool. + /// Gets a long term retention backup. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName} /// /// /// Operation Id - /// InstancePools_Get + /// LongTermRetentionBackups_GetByResourceGroup /// /// /// Default Api Version @@ -2945,37 +2947,40 @@ public static InstancePoolCollection GetInstancePools(this ResourceGroupResource /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// The name of the instance pool to be retrieved. + /// The location of the database. + /// The name of the server. + /// The name of the database. + /// The backup name. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static async Task> GetInstancePoolAsync(this ResourceGroupResource resourceGroupResource, string instancePoolName, CancellationToken cancellationToken = default) + public static async Task> GetResourceGroupLongTermRetentionBackupAsync(this ResourceGroupResource resourceGroupResource, AzureLocation locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return await GetMockableSqlResourceGroupResource(resourceGroupResource).GetInstancePoolAsync(instancePoolName, cancellationToken).ConfigureAwait(false); + return await GetMockableSqlResourceGroupResource(resourceGroupResource).GetResourceGroupLongTermRetentionBackupAsync(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, cancellationToken).ConfigureAwait(false); } /// - /// Gets an instance pool. + /// Gets a long term retention backup. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName} /// /// /// Operation Id - /// InstancePools_Get + /// LongTermRetentionBackups_GetByResourceGroup /// /// /// Default Api Version @@ -2983,58 +2988,57 @@ public static async Task> GetInstancePoolAsync(th /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// The name of the instance pool to be retrieved. + /// The location of the database. + /// The name of the server. + /// The name of the database. + /// The backup name. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static Response GetInstancePool(this ResourceGroupResource resourceGroupResource, string instancePoolName, CancellationToken cancellationToken = default) + public static Response GetResourceGroupLongTermRetentionBackup(this ResourceGroupResource resourceGroupResource, AzureLocation locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockableSqlResourceGroupResource(resourceGroupResource).GetInstancePool(instancePoolName, cancellationToken); + return GetMockableSqlResourceGroupResource(resourceGroupResource).GetResourceGroupLongTermRetentionBackup(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, cancellationToken); } /// - /// Gets a collection of ResourceGroupLongTermRetentionBackupResources in the ResourceGroupResource. + /// Gets a collection of ManagedInstanceResources in the ResourceGroupResource. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// The location of the database. - /// The name of the server. - /// The name of the database. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - /// An object representing collection of ResourceGroupLongTermRetentionBackupResources and their operations over a ResourceGroupLongTermRetentionBackupResource. - public static ResourceGroupLongTermRetentionBackupCollection GetResourceGroupLongTermRetentionBackups(this ResourceGroupResource resourceGroupResource, AzureLocation locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName) + /// is null. + /// An object representing collection of ManagedInstanceResources and their operations over a ManagedInstanceResource. + public static ManagedInstanceCollection GetManagedInstances(this ResourceGroupResource resourceGroupResource) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockableSqlResourceGroupResource(resourceGroupResource).GetResourceGroupLongTermRetentionBackups(locationName, longTermRetentionServerName, longTermRetentionDatabaseName); + return GetMockableSqlResourceGroupResource(resourceGroupResource).GetManagedInstances(); } /// - /// Gets a long term retention backup. + /// Gets a managed instance. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName} /// /// /// Operation Id - /// LongTermRetentionBackups_GetByResourceGroup + /// ManagedInstances_Get /// /// /// Default Api Version @@ -3042,40 +3046,38 @@ public static ResourceGroupLongTermRetentionBackupCollection GetResourceGroupLon /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// The location of the database. - /// The name of the server. - /// The name of the database. - /// The backup name. + /// The name of the managed instance. + /// The child resources to include in the response. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. + /// or is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static async Task> GetResourceGroupLongTermRetentionBackupAsync(this ResourceGroupResource resourceGroupResource, AzureLocation locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, CancellationToken cancellationToken = default) + public static async Task> GetManagedInstanceAsync(this ResourceGroupResource resourceGroupResource, string managedInstanceName, string expand = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return await GetMockableSqlResourceGroupResource(resourceGroupResource).GetResourceGroupLongTermRetentionBackupAsync(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, cancellationToken).ConfigureAwait(false); + return await GetMockableSqlResourceGroupResource(resourceGroupResource).GetManagedInstanceAsync(managedInstanceName, expand, cancellationToken).ConfigureAwait(false); } /// - /// Gets a long term retention backup. + /// Gets a managed instance. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName} /// /// /// Operation Id - /// LongTermRetentionBackups_GetByResourceGroup + /// ManagedInstances_Get /// /// /// Default Api Version @@ -3083,28 +3085,26 @@ public static async Task> /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// The location of the database. - /// The name of the server. - /// The name of the database. - /// The backup name. + /// The name of the managed instance. + /// The child resources to include in the response. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. + /// or is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static Response GetResourceGroupLongTermRetentionBackup(this ResourceGroupResource resourceGroupResource, AzureLocation locationName, string longTermRetentionServerName, string longTermRetentionDatabaseName, string backupName, CancellationToken cancellationToken = default) + public static Response GetManagedInstance(this ResourceGroupResource resourceGroupResource, string managedInstanceName, string expand = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockableSqlResourceGroupResource(resourceGroupResource).GetResourceGroupLongTermRetentionBackup(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, cancellationToken); + return GetMockableSqlResourceGroupResource(resourceGroupResource).GetManagedInstance(managedInstanceName, expand, cancellationToken); } /// @@ -4412,80 +4412,6 @@ public static Pageable GetVirtualClusters(this Subscript return GetMockableSqlSubscriptionResource(subscriptionResource).GetVirtualClusters(cancellationToken); } - /// - /// Gets a list of all managed instances in the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Sql/managedInstances - /// - /// - /// Operation Id - /// ManagedInstances_List - /// - /// - /// Default Api Version - /// 2022-08-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The child resources to include in the response. - /// The cancellation token to use. - /// is null. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetManagedInstancesAsync(this SubscriptionResource subscriptionResource, string expand = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - - return GetMockableSqlSubscriptionResource(subscriptionResource).GetManagedInstancesAsync(expand, cancellationToken); - } - - /// - /// Gets a list of all managed instances in the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Sql/managedInstances - /// - /// - /// Operation Id - /// ManagedInstances_List - /// - /// - /// Default Api Version - /// 2022-08-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The child resources to include in the response. - /// The cancellation token to use. - /// is null. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetManagedInstances(this SubscriptionResource subscriptionResource, string expand = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - - return GetMockableSqlSubscriptionResource(subscriptionResource).GetManagedInstances(expand, cancellationToken); - } - /// /// Gets a list of all instance pools in the subscription. /// @@ -4702,6 +4628,80 @@ public static Pageable GetLongTermRetentionBackupsW return GetMockableSqlSubscriptionResource(subscriptionResource).GetLongTermRetentionBackupsWithServer(locationName, longTermRetentionServerName, onlyLatestPerDatabase, databaseState, cancellationToken); } + /// + /// Gets a list of all managed instances in the subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Sql/managedInstances + /// + /// + /// Operation Id + /// ManagedInstances_List + /// + /// + /// Default Api Version + /// 2023-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The child resources to include in the response. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetManagedInstancesAsync(this SubscriptionResource subscriptionResource, string expand = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableSqlSubscriptionResource(subscriptionResource).GetManagedInstancesAsync(expand, cancellationToken); + } + + /// + /// Gets a list of all managed instances in the subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Sql/managedInstances + /// + /// + /// Operation Id + /// ManagedInstances_List + /// + /// + /// Default Api Version + /// 2023-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The child resources to include in the response. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetManagedInstances(this SubscriptionResource subscriptionResource, string expand = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableSqlSubscriptionResource(subscriptionResource).GetManagedInstances(expand, cancellationToken); + } + /// /// Determines whether a resource can be created with the specified name. /// diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/FailoverGroupCollection.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/FailoverGroupCollection.cs index 9d9b92ad49a7..6d4a92a89be8 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/FailoverGroupCollection.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/FailoverGroupCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> CreateOrUpdateAsy /// /// /// Default Api Version - /// 2023-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wait /// /// /// Default Api Version - /// 2023-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsync(string failo /// /// /// Default Api Version - /// 2023-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string failoverGroupName, Can /// /// /// Default Api Version - /// 2023-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToke /// /// /// Default Api Version - /// 2023-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(CancellationToken cancella /// /// /// Default Api Version - /// 2023-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string failoverGroupName, /// /// /// Default Api Version - /// 2023-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string failoverGroupName, CancellationToken /// /// /// Default Api Version - /// 2023-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task> GetIfExistsAs /// /// /// Default Api Version - /// 2023-02-01-preview + /// 2023-05-01-preview /// /// /// Resource diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/FailoverGroupData.Serialization.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/FailoverGroupData.Serialization.cs index 55a036a527fd..6c7556ba05c8 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/FailoverGroupData.Serialization.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/FailoverGroupData.Serialization.cs @@ -113,6 +113,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite } writer.WriteEndArray(); } + if (Optional.IsDefined(SecondaryType)) + { + writer.WritePropertyName("secondaryType"u8); + writer.WriteStringValue(SecondaryType.Value.ToString()); + } writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -164,6 +169,7 @@ internal static FailoverGroupData DeserializeFailoverGroupData(JsonElement eleme string replicationState = default; IList partnerServers = default; IList databases = default; + FailoverGroupDatabasesSecondaryType? secondaryType = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -291,6 +297,15 @@ internal static FailoverGroupData DeserializeFailoverGroupData(JsonElement eleme databases = array; continue; } + if (property0.NameEquals("secondaryType"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + secondaryType = new FailoverGroupDatabasesSecondaryType(property0.Value.GetString()); + continue; + } } continue; } @@ -313,6 +328,7 @@ internal static FailoverGroupData DeserializeFailoverGroupData(JsonElement eleme replicationState, partnerServers ?? new ChangeTrackingList(), databases ?? new ChangeTrackingList(), + secondaryType, serializedAdditionalRawData); } @@ -553,6 +569,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SecondaryType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" secondaryType: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SecondaryType)) + { + builder.Append(" secondaryType: "); + builder.AppendLine($"'{SecondaryType.Value.ToString()}'"); + } + } + builder.AppendLine(" }"); builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/FailoverGroupData.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/FailoverGroupData.cs index 1320e51e0261..9b79b94791ff 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/FailoverGroupData.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/FailoverGroupData.cs @@ -72,8 +72,9 @@ public FailoverGroupData() /// Replication state of the failover group instance. /// List of partner server information for the failover group. /// List of databases in the failover group. + /// Databases secondary type on partner server. /// Keeps track of any properties unknown to the library. - internal FailoverGroupData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AzureLocation? location, IDictionary tags, FailoverGroupReadWriteEndpoint readWriteEndpoint, FailoverGroupReadOnlyEndpoint readOnlyEndpoint, FailoverGroupReplicationRole? replicationRole, string replicationState, IList partnerServers, IList failoverDatabases, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal FailoverGroupData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AzureLocation? location, IDictionary tags, FailoverGroupReadWriteEndpoint readWriteEndpoint, FailoverGroupReadOnlyEndpoint readOnlyEndpoint, FailoverGroupReplicationRole? replicationRole, string replicationState, IList partnerServers, IList failoverDatabases, FailoverGroupDatabasesSecondaryType? secondaryType, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { Location = location; Tags = tags; @@ -83,6 +84,7 @@ internal FailoverGroupData(ResourceIdentifier id, string name, ResourceType reso ReplicationState = replicationState; PartnerServers = partnerServers; FailoverDatabases = failoverDatabases; + SecondaryType = secondaryType; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -110,5 +112,8 @@ internal FailoverGroupData(ResourceIdentifier id, string name, ResourceType reso /// List of databases in the failover group. [WirePath("properties.databases")] public IList FailoverDatabases { get; } + /// Databases secondary type on partner server. + [WirePath("properties.secondaryType")] + public FailoverGroupDatabasesSecondaryType? SecondaryType { get; set; } } } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/FailoverGroupResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/FailoverGroupResource.cs index 17af2d21e8f6..8e7ef1f9ba18 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/FailoverGroupResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/FailoverGroupResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync(Cancellation /// /// /// Default Api Version - /// 2023-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken cancellatio /// /// /// Default Api Version - /// 2023-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task> UpdateAsync(WaitU /// /// /// Default Api Version - /// 2023-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, F /// /// /// Default Api Version - /// 2023-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -401,7 +401,7 @@ public virtual async Task> FailoverAsync(Wai /// /// /// Default Api Version - /// 2023-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -443,7 +443,7 @@ public virtual ArmOperation Failover(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2023-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -485,7 +485,7 @@ public virtual async Task> ForceFailoverAllo /// /// /// Default Api Version - /// 2023-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -527,7 +527,7 @@ public virtual ArmOperation ForceFailoverAllowDataLoss(Wa /// /// /// Default Api Version - /// 2023-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -569,7 +569,7 @@ public virtual async Task> TryPlannedBeforeF /// /// /// Default Api Version - /// 2023-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -611,7 +611,7 @@ public virtual ArmOperation TryPlannedBeforeForcedFailove /// /// /// Default Api Version - /// 2023-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -673,7 +673,7 @@ public virtual async Task> AddTagAsync(string ke /// /// /// Default Api Version - /// 2023-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -735,7 +735,7 @@ public virtual Response AddTag(string key, string value, /// /// /// Default Api Version - /// 2023-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -792,7 +792,7 @@ public virtual async Task> SetTagsAsync(IDiction /// /// /// Default Api Version - /// 2023-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -849,7 +849,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2023-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -909,7 +909,7 @@ public virtual async Task> RemoveTagAsync(string /// /// /// Default Api Version - /// 2023-02-01-preview + /// 2023-05-01-preview /// /// /// Resource diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/InstancePoolResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/InstancePoolResource.cs index 531a2500f6e3..45e517fb6c55 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/InstancePoolResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/InstancePoolResource.cs @@ -423,7 +423,7 @@ public virtual Pageable GetUsages(bool? expandChildren = null /// /// /// Default Api Version - /// 2022-08-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -454,7 +454,7 @@ public virtual AsyncPageable GetManagedInstancesAsync(s /// /// /// Default Api Version - /// 2022-08-01-preview + /// 2023-05-01-preview /// /// /// Resource diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/LongRunningOperation/RefreshExternalGovernanceStatusOperationResultMIOperationSource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/LongRunningOperation/RefreshExternalGovernanceStatusOperationResultMIOperationSource.cs new file mode 100644 index 000000000000..d8c3c6bea7c5 --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/LongRunningOperation/RefreshExternalGovernanceStatusOperationResultMIOperationSource.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.ResourceManager.Sql.Models; + +namespace Azure.ResourceManager.Sql +{ + internal class RefreshExternalGovernanceStatusOperationResultMIOperationSource : IOperationSource + { + RefreshExternalGovernanceStatusOperationResultMI IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + return RefreshExternalGovernanceStatusOperationResultMI.DeserializeRefreshExternalGovernanceStatusOperationResultMI(document.RootElement); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + return RefreshExternalGovernanceStatusOperationResultMI.DeserializeRefreshExternalGovernanceStatusOperationResultMI(document.RootElement); + } + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedInstanceCollection.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedInstanceCollection.cs index da7e4b72be37..05740e916f2e 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedInstanceCollection.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedInstanceCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-08-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateA /// /// /// Default Api Version - /// 2022-08-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wa /// /// /// Default Api Version - /// 2022-08-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -209,7 +209,7 @@ public virtual async Task> GetAsync(string man /// /// /// Default Api Version - /// 2022-08-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -255,7 +255,7 @@ public virtual Response Get(string managedInstanceName, /// /// /// Default Api Version - /// 2022-08-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -286,7 +286,7 @@ public virtual AsyncPageable GetAllAsync(string expand /// /// /// Default Api Version - /// 2022-08-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -317,7 +317,7 @@ public virtual Pageable GetAll(string expand = null, Ca /// /// /// Default Api Version - /// 2022-08-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -361,7 +361,7 @@ public virtual async Task> ExistsAsync(string managedInstanceName /// /// /// Default Api Version - /// 2022-08-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -405,7 +405,7 @@ public virtual Response Exists(string managedInstanceName, string expand = /// /// /// Default Api Version - /// 2022-08-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -451,7 +451,7 @@ public virtual async Task> GetIfExists /// /// /// Default Api Version - /// 2022-08-01-preview + /// 2023-05-01-preview /// /// /// Resource diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedInstanceData.Serialization.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedInstanceData.Serialization.cs index 3d80851eaf34..b3193a40aeb6 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedInstanceData.Serialization.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedInstanceData.Serialization.cs @@ -91,6 +91,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("fullyQualifiedDomainName"u8); writer.WriteStringValue(FullyQualifiedDomainName); } + if (Optional.IsDefined(IsGeneralPurposeV2)) + { + writer.WritePropertyName("isGeneralPurposeV2"u8); + writer.WriteBooleanValue(IsGeneralPurposeV2.Value); + } if (Optional.IsDefined(AdministratorLogin)) { writer.WritePropertyName("administratorLogin"u8); @@ -116,6 +121,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("licenseType"u8); writer.WriteStringValue(LicenseType.Value.ToString()); } + if (Optional.IsDefined(HybridSecondaryUsage)) + { + writer.WritePropertyName("hybridSecondaryUsage"u8); + writer.WriteStringValue(HybridSecondaryUsage.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(HybridSecondaryUsageDetected)) + { + writer.WritePropertyName("hybridSecondaryUsageDetected"u8); + writer.WriteStringValue(HybridSecondaryUsageDetected.Value.ToString()); + } if (Optional.IsDefined(VCores)) { writer.WritePropertyName("vCores"u8); @@ -126,6 +141,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("storageSizeInGB"u8); writer.WriteNumberValue(StorageSizeInGB.Value); } + if (Optional.IsDefined(StorageIOps)) + { + writer.WritePropertyName("storageIOps"u8); + writer.WriteNumberValue(StorageIOps.Value); + } + if (Optional.IsDefined(StorageThroughputMBps)) + { + writer.WritePropertyName("storageThroughputMBps"u8); + writer.WriteNumberValue(StorageThroughputMBps.Value); + } if (Optional.IsDefined(Collation)) { writer.WritePropertyName("collation"u8); @@ -226,6 +251,36 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("servicePrincipal"u8); writer.WriteObjectValue(ServicePrincipal, options); } + if (options.Format != "W" && Optional.IsDefined(VirtualClusterId)) + { + writer.WritePropertyName("virtualClusterId"u8); + writer.WriteStringValue(VirtualClusterId); + } + if (options.Format != "W" && Optional.IsDefined(ExternalGovernanceStatus)) + { + writer.WritePropertyName("externalGovernanceStatus"u8); + writer.WriteStringValue(ExternalGovernanceStatus.Value.ToString()); + } + if (Optional.IsDefined(PricingModel)) + { + writer.WritePropertyName("pricingModel"u8); + writer.WriteStringValue(PricingModel.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(CreateOn)) + { + writer.WritePropertyName("createTime"u8); + writer.WriteStringValue(CreateOn.Value, "O"); + } + if (Optional.IsDefined(AuthenticationMetadata)) + { + writer.WritePropertyName("authenticationMetadata"u8); + writer.WriteStringValue(AuthenticationMetadata.Value.ToString()); + } + if (Optional.IsDefined(DatabaseFormat)) + { + writer.WritePropertyName("databaseFormat"u8); + writer.WriteStringValue(DatabaseFormat.Value.ToString()); + } writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -273,16 +328,21 @@ internal static ManagedInstanceData DeserializeManagedInstanceData(JsonElement e string name = default; ResourceType type = default; SystemData systemData = default; - ManagedInstancePropertiesProvisioningState? provisioningState = default; + JobExecutionProvisioningState? provisioningState = default; ManagedServerCreateMode? managedInstanceCreateMode = default; string fullyQualifiedDomainName = default; + bool? isGeneralPurposeV2 = default; string administratorLogin = default; string administratorLoginPassword = default; ResourceIdentifier subnetId = default; string state = default; ManagedInstanceLicenseType? licenseType = default; + HybridSecondaryUsage? hybridSecondaryUsage = default; + HybridSecondaryUsageDetected? hybridSecondaryUsageDetected = default; int? vCores = default; int? storageSizeInGB = default; + int? storageIOps = default; + int? storageThroughputMBps = default; string collation = default; string dnsZone = default; ResourceIdentifier dnsZonePartner = default; @@ -302,6 +362,12 @@ internal static ManagedInstanceData DeserializeManagedInstanceData(JsonElement e Uri keyId = default; ManagedInstanceExternalAdministrator administrators = default; SqlServicePrincipal servicePrincipal = default; + string virtualClusterId = default; + ExternalGovernanceStatus? externalGovernanceStatus = default; + FreemiumType? pricingModel = default; + DateTimeOffset? createTime = default; + AuthMetadataLookupMode? authenticationMetadata = default; + ManagedInstanceDatabaseFormat? databaseFormat = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -383,7 +449,7 @@ internal static ManagedInstanceData DeserializeManagedInstanceData(JsonElement e { continue; } - provisioningState = new ManagedInstancePropertiesProvisioningState(property0.Value.GetString()); + provisioningState = new JobExecutionProvisioningState(property0.Value.GetString()); continue; } if (property0.NameEquals("managedInstanceCreateMode"u8)) @@ -400,6 +466,15 @@ internal static ManagedInstanceData DeserializeManagedInstanceData(JsonElement e fullyQualifiedDomainName = property0.Value.GetString(); continue; } + if (property0.NameEquals("isGeneralPurposeV2"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isGeneralPurposeV2 = property0.Value.GetBoolean(); + continue; + } if (property0.NameEquals("administratorLogin"u8)) { administratorLogin = property0.Value.GetString(); @@ -433,6 +508,24 @@ internal static ManagedInstanceData DeserializeManagedInstanceData(JsonElement e licenseType = new ManagedInstanceLicenseType(property0.Value.GetString()); continue; } + if (property0.NameEquals("hybridSecondaryUsage"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + hybridSecondaryUsage = new HybridSecondaryUsage(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("hybridSecondaryUsageDetected"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + hybridSecondaryUsageDetected = new HybridSecondaryUsageDetected(property0.Value.GetString()); + continue; + } if (property0.NameEquals("vCores"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -451,6 +544,24 @@ internal static ManagedInstanceData DeserializeManagedInstanceData(JsonElement e storageSizeInGB = property0.Value.GetInt32(); continue; } + if (property0.NameEquals("storageIOps"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageIOps = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("storageThroughputMBps"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageThroughputMBps = property0.Value.GetInt32(); + continue; + } if (property0.NameEquals("collation"u8)) { collation = property0.Value.GetString(); @@ -611,6 +722,56 @@ internal static ManagedInstanceData DeserializeManagedInstanceData(JsonElement e servicePrincipal = SqlServicePrincipal.DeserializeSqlServicePrincipal(property0.Value, options); continue; } + if (property0.NameEquals("virtualClusterId"u8)) + { + virtualClusterId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("externalGovernanceStatus"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + externalGovernanceStatus = new ExternalGovernanceStatus(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("pricingModel"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + pricingModel = new FreemiumType(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("createTime"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("authenticationMetadata"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authenticationMetadata = new AuthMetadataLookupMode(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("databaseFormat"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + databaseFormat = new ManagedInstanceDatabaseFormat(property0.Value.GetString()); + continue; + } } continue; } @@ -632,13 +793,18 @@ internal static ManagedInstanceData DeserializeManagedInstanceData(JsonElement e provisioningState, managedInstanceCreateMode, fullyQualifiedDomainName, + isGeneralPurposeV2, administratorLogin, administratorLoginPassword, subnetId, state, licenseType, + hybridSecondaryUsage, + hybridSecondaryUsageDetected, vCores, storageSizeInGB, + storageIOps, + storageThroughputMBps, collation, dnsZone, dnsZonePartner, @@ -658,6 +824,12 @@ internal static ManagedInstanceData DeserializeManagedInstanceData(JsonElement e keyId, administrators, servicePrincipal, + virtualClusterId, + externalGovernanceStatus, + pricingModel, + createTime, + authenticationMetadata, + databaseFormat, serializedAdditionalRawData); } @@ -859,6 +1031,22 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IsGeneralPurposeV2), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" isGeneralPurposeV2: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IsGeneralPurposeV2)) + { + builder.Append(" isGeneralPurposeV2: "); + var boolValue = IsGeneralPurposeV2.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AdministratorLogin), out propertyOverride); if (hasPropertyOverride) { @@ -958,6 +1146,36 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(HybridSecondaryUsage), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" hybridSecondaryUsage: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(HybridSecondaryUsage)) + { + builder.Append(" hybridSecondaryUsage: "); + builder.AppendLine($"'{HybridSecondaryUsage.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(HybridSecondaryUsageDetected), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" hybridSecondaryUsageDetected: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(HybridSecondaryUsageDetected)) + { + builder.Append(" hybridSecondaryUsageDetected: "); + builder.AppendLine($"'{HybridSecondaryUsageDetected.Value.ToString()}'"); + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(VCores), out propertyOverride); if (hasPropertyOverride) { @@ -988,6 +1206,36 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(StorageIOps), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" storageIOps: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(StorageIOps)) + { + builder.Append(" storageIOps: "); + builder.AppendLine($"{StorageIOps.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(StorageThroughputMBps), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" storageThroughputMBps: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(StorageThroughputMBps)) + { + builder.Append(" storageThroughputMBps: "); + builder.AppendLine($"{StorageThroughputMBps.Value}"); + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Collation), out propertyOverride); if (hasPropertyOverride) { @@ -1316,6 +1564,105 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(VirtualClusterId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" virtualClusterId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(VirtualClusterId)) + { + builder.Append(" virtualClusterId: "); + if (VirtualClusterId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{VirtualClusterId}'''"); + } + else + { + builder.AppendLine($"'{VirtualClusterId}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ExternalGovernanceStatus), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" externalGovernanceStatus: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ExternalGovernanceStatus)) + { + builder.Append(" externalGovernanceStatus: "); + builder.AppendLine($"'{ExternalGovernanceStatus.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PricingModel), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" pricingModel: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PricingModel)) + { + builder.Append(" pricingModel: "); + builder.AppendLine($"'{PricingModel.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CreateOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" createTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CreateOn)) + { + builder.Append(" createTime: "); + var formattedDateTimeString = TypeFormatters.ToString(CreateOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AuthenticationMetadata), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" authenticationMetadata: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AuthenticationMetadata)) + { + builder.Append(" authenticationMetadata: "); + builder.AppendLine($"'{AuthenticationMetadata.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DatabaseFormat), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" databaseFormat: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DatabaseFormat)) + { + builder.Append(" databaseFormat: "); + builder.AppendLine($"'{DatabaseFormat.Value.ToString()}'"); + } + } + builder.AppendLine(" }"); builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedInstanceData.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedInstanceData.cs index 05cf67810f7d..b02a00aad14e 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedInstanceData.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedInstanceData.cs @@ -67,7 +67,7 @@ public ManagedInstanceData(AzureLocation location) : base(location) /// The location. /// The Azure Active Directory identity of the managed instance. /// Managed instance SKU. Allowed values for sku.name: GP_Gen5, GP_G8IM, GP_G8IH, BC_Gen5, BC_G8IM, BC_G8IH. - /// + /// Provisioning state of managed instance. /// /// Specifies the mode of database creation. /// @@ -76,13 +76,18 @@ public ManagedInstanceData(AzureLocation location) : base(location) /// Restore: Creates an instance by restoring a set of backups to specific point in time. RestorePointInTime and SourceManagedInstanceId must be specified. /// /// The fully qualified domain name of the managed instance. + /// Whether or not this is a GPv2 variant of General Purpose edition. /// Administrator username for the managed instance. Can only be specified when the managed instance is being created (and is required for creation). /// The administrator login password (required for managed instance creation). /// Subnet resource ID for the managed instance. /// The state of the managed instance. /// The license type. Possible values are 'LicenseIncluded' (regular price inclusive of a new SQL license) and 'BasePrice' (discounted AHB price for bringing your own SQL licenses). + /// Hybrid secondary usage. Possible values are 'Active' (default value) and 'Passive' (customer uses the secondary as Passive DR). + /// Hybrid secondary usage detected. Possible values are 'Active' (customer does not meet the requirements to use the secondary as Passive DR) and 'Passive' (customer meets the requirements to use the secondary as Passive DR). /// The number of vCores. Allowed values: 8, 16, 24, 32, 40, 64, 80. /// Storage size in GB. Minimum value: 32. Maximum value: 16384. Increments of 32 GB allowed only. Maximum value depends on the selected hardware family and number of vCores. + /// Storage IOps. Minimum value: 300. Maximum value: 80000. Increments of 1 IOps allowed only. Maximum value depends on the selected hardware family and number of vCores. + /// Storage throughput MBps parameter is not supported in the instance create/update operation. /// Collation of the managed instance. /// The Dns Zone that the managed instance is in. /// The resource id of another managed instance whose DNS zone this managed instance will share after creation. @@ -109,21 +114,32 @@ public ManagedInstanceData(AzureLocation location) : base(location) /// A CMK URI of the key to use for encryption. /// The Azure Active Directory administrator of the instance. This can only be used at instance create time. If used for instance update, it will be ignored or it will result in an error. For updates individual APIs will need to be used. /// The managed instance's service principal. + /// Virtual cluster resource id for the Managed Instance. + /// Status of external governance. + /// Weather or not Managed Instance is freemium. + /// Specifies the point in time (ISO8601 format) of the Managed Instance creation. + /// The managed instance's authentication metadata lookup mode. + /// Specifies the internal format of instance databases specific to the SQL engine version. /// Keeps track of any properties unknown to the library. - internal ManagedInstanceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, SqlSku sku, ManagedInstancePropertiesProvisioningState? provisioningState, ManagedServerCreateMode? managedInstanceCreateMode, string fullyQualifiedDomainName, string administratorLogin, string administratorLoginPassword, ResourceIdentifier subnetId, string state, ManagedInstanceLicenseType? licenseType, int? vCores, int? storageSizeInGB, string collation, string dnsZone, ResourceIdentifier managedDnsZonePartner, bool? isPublicDataEndpointEnabled, ResourceIdentifier sourceManagedInstanceId, DateTimeOffset? restorePointInTime, ManagedInstanceProxyOverride? proxyOverride, string timezoneId, ResourceIdentifier instancePoolId, ResourceIdentifier maintenanceConfigurationId, IReadOnlyList privateEndpointConnections, string minimalTlsVersion, SqlBackupStorageRedundancy? currentBackupStorageRedundancy, SqlBackupStorageRedundancy? requestedBackupStorageRedundancy, bool? isZoneRedundant, ResourceIdentifier primaryUserAssignedIdentityId, Uri keyId, ManagedInstanceExternalAdministrator administrators, SqlServicePrincipal servicePrincipal, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal ManagedInstanceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, SqlSku sku, JobExecutionProvisioningState? provisioningState, ManagedServerCreateMode? managedInstanceCreateMode, string fullyQualifiedDomainName, bool? isGeneralPurposeV2, string administratorLogin, string administratorLoginPassword, ResourceIdentifier subnetId, string state, ManagedInstanceLicenseType? licenseType, HybridSecondaryUsage? hybridSecondaryUsage, HybridSecondaryUsageDetected? hybridSecondaryUsageDetected, int? vCores, int? storageSizeInGB, int? storageIOps, int? storageThroughputMBps, string collation, string dnsZone, ResourceIdentifier managedDnsZonePartner, bool? isPublicDataEndpointEnabled, ResourceIdentifier sourceManagedInstanceId, DateTimeOffset? restorePointInTime, ManagedInstanceProxyOverride? proxyOverride, string timezoneId, ResourceIdentifier instancePoolId, ResourceIdentifier maintenanceConfigurationId, IReadOnlyList privateEndpointConnections, string minimalTlsVersion, SqlBackupStorageRedundancy? currentBackupStorageRedundancy, SqlBackupStorageRedundancy? requestedBackupStorageRedundancy, bool? isZoneRedundant, ResourceIdentifier primaryUserAssignedIdentityId, Uri keyId, ManagedInstanceExternalAdministrator administrators, SqlServicePrincipal servicePrincipal, string virtualClusterId, ExternalGovernanceStatus? externalGovernanceStatus, FreemiumType? pricingModel, DateTimeOffset? createOn, AuthMetadataLookupMode? authenticationMetadata, ManagedInstanceDatabaseFormat? databaseFormat, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Identity = identity; Sku = sku; ProvisioningState = provisioningState; ManagedInstanceCreateMode = managedInstanceCreateMode; FullyQualifiedDomainName = fullyQualifiedDomainName; + IsGeneralPurposeV2 = isGeneralPurposeV2; AdministratorLogin = administratorLogin; AdministratorLoginPassword = administratorLoginPassword; SubnetId = subnetId; State = state; LicenseType = licenseType; + HybridSecondaryUsage = hybridSecondaryUsage; + HybridSecondaryUsageDetected = hybridSecondaryUsageDetected; VCores = vCores; StorageSizeInGB = storageSizeInGB; + StorageIOps = storageIOps; + StorageThroughputMBps = storageThroughputMBps; Collation = collation; DnsZone = dnsZone; ManagedDnsZonePartner = managedDnsZonePartner; @@ -143,6 +159,12 @@ internal ManagedInstanceData(ResourceIdentifier id, string name, ResourceType re KeyId = keyId; Administrators = administrators; ServicePrincipal = servicePrincipal; + VirtualClusterId = virtualClusterId; + ExternalGovernanceStatus = externalGovernanceStatus; + PricingModel = pricingModel; + CreateOn = createOn; + AuthenticationMetadata = authenticationMetadata; + DatabaseFormat = databaseFormat; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -157,9 +179,9 @@ internal ManagedInstanceData() /// Managed instance SKU. Allowed values for sku.name: GP_Gen5, GP_G8IM, GP_G8IH, BC_Gen5, BC_G8IM, BC_G8IH. [WirePath("sku")] public SqlSku Sku { get; set; } - /// Gets the provisioning state. + /// Provisioning state of managed instance. [WirePath("properties.provisioningState")] - public ManagedInstancePropertiesProvisioningState? ProvisioningState { get; } + public JobExecutionProvisioningState? ProvisioningState { get; } /// /// Specifies the mode of database creation. /// @@ -172,6 +194,9 @@ internal ManagedInstanceData() /// The fully qualified domain name of the managed instance. [WirePath("properties.fullyQualifiedDomainName")] public string FullyQualifiedDomainName { get; } + /// Whether or not this is a GPv2 variant of General Purpose edition. + [WirePath("properties.isGeneralPurposeV2")] + public bool? IsGeneralPurposeV2 { get; set; } /// Administrator username for the managed instance. Can only be specified when the managed instance is being created (and is required for creation). [WirePath("properties.administratorLogin")] public string AdministratorLogin { get; set; } @@ -187,12 +212,24 @@ internal ManagedInstanceData() /// The license type. Possible values are 'LicenseIncluded' (regular price inclusive of a new SQL license) and 'BasePrice' (discounted AHB price for bringing your own SQL licenses). [WirePath("properties.licenseType")] public ManagedInstanceLicenseType? LicenseType { get; set; } + /// Hybrid secondary usage. Possible values are 'Active' (default value) and 'Passive' (customer uses the secondary as Passive DR). + [WirePath("properties.hybridSecondaryUsage")] + public HybridSecondaryUsage? HybridSecondaryUsage { get; set; } + /// Hybrid secondary usage detected. Possible values are 'Active' (customer does not meet the requirements to use the secondary as Passive DR) and 'Passive' (customer meets the requirements to use the secondary as Passive DR). + [WirePath("properties.hybridSecondaryUsageDetected")] + public HybridSecondaryUsageDetected? HybridSecondaryUsageDetected { get; } /// The number of vCores. Allowed values: 8, 16, 24, 32, 40, 64, 80. [WirePath("properties.vCores")] public int? VCores { get; set; } /// Storage size in GB. Minimum value: 32. Maximum value: 16384. Increments of 32 GB allowed only. Maximum value depends on the selected hardware family and number of vCores. [WirePath("properties.storageSizeInGB")] public int? StorageSizeInGB { get; set; } + /// Storage IOps. Minimum value: 300. Maximum value: 80000. Increments of 1 IOps allowed only. Maximum value depends on the selected hardware family and number of vCores. + [WirePath("properties.storageIOps")] + public int? StorageIOps { get; set; } + /// Storage throughput MBps parameter is not supported in the instance create/update operation. + [WirePath("properties.storageThroughputMBps")] + public int? StorageThroughputMBps { get; set; } /// Collation of the managed instance. [WirePath("properties.collation")] public string Collation { get; set; } @@ -257,5 +294,23 @@ internal ManagedInstanceData() /// The managed instance's service principal. [WirePath("properties.servicePrincipal")] public SqlServicePrincipal ServicePrincipal { get; set; } + /// Virtual cluster resource id for the Managed Instance. + [WirePath("properties.virtualClusterId")] + public string VirtualClusterId { get; } + /// Status of external governance. + [WirePath("properties.externalGovernanceStatus")] + public ExternalGovernanceStatus? ExternalGovernanceStatus { get; } + /// Weather or not Managed Instance is freemium. + [WirePath("properties.pricingModel")] + public FreemiumType? PricingModel { get; set; } + /// Specifies the point in time (ISO8601 format) of the Managed Instance creation. + [WirePath("properties.createTime")] + public DateTimeOffset? CreateOn { get; } + /// The managed instance's authentication metadata lookup mode. + [WirePath("properties.authenticationMetadata")] + public AuthMetadataLookupMode? AuthenticationMetadata { get; set; } + /// Specifies the internal format of instance databases specific to the SQL engine version. + [WirePath("properties.databaseFormat")] + public ManagedInstanceDatabaseFormat? DatabaseFormat { get; set; } } } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedInstanceResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedInstanceResource.cs index cf3a8f029f09..0e3b7aaf9564 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedInstanceResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedInstanceResource.cs @@ -867,7 +867,7 @@ public virtual DistributedAvailabilityGroupCollection GetDistributedAvailability /// /// /// Default Api Version - /// 2021-11-01-preview + /// 2023-08-01-preview /// /// /// Resource @@ -898,7 +898,7 @@ public virtual async Task> GetDis /// /// /// Default Api Version - /// 2021-11-01-preview + /// 2023-08-01-preview /// /// /// Resource @@ -1465,7 +1465,7 @@ public virtual Response GetManagedInst /// /// /// Default Api Version - /// 2022-08-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -1506,7 +1506,7 @@ public virtual async Task> GetAsync(string exp /// /// /// Default Api Version - /// 2022-08-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -1547,7 +1547,7 @@ public virtual Response Get(string expand = null, Cance /// /// /// Default Api Version - /// 2022-08-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -1589,7 +1589,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2022-08-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -1631,7 +1631,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2022-08-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -1677,7 +1677,7 @@ public virtual async Task> UpdateAsync(Wai /// /// /// Default Api Version - /// 2022-08-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -1927,7 +1927,7 @@ public virtual Pageable GetInaccessibleManagedDatabases /// /// /// Default Api Version - /// 2022-08-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -1970,7 +1970,7 @@ public virtual async Task FailoverAsync(WaitUntil waitUntil, Repli /// /// /// Default Api Version - /// 2022-08-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -2013,7 +2013,7 @@ public virtual ArmOperation Failover(WaitUntil waitUntil, ReplicaType? replicaTy /// /// /// Default Api Version - /// 2022-08-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -2043,7 +2043,7 @@ public virtual AsyncPageable GetOutboundNetworkD /// /// /// Default Api Version - /// 2022-08-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -2060,6 +2060,90 @@ public virtual Pageable GetOutboundNetworkDepend return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => SqlOutboundEnvironmentEndpoint.DeserializeSqlOutboundEnvironmentEndpoint(e), _managedInstanceClientDiagnostics, Pipeline, "ManagedInstanceResource.GetOutboundNetworkDependencies", "value", "nextLink", cancellationToken); } + /// + /// Refresh external governance enablement status. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/refreshExternalGovernanceStatus + /// + /// + /// Operation Id + /// ManagedInstances_RefreshStatus + /// + /// + /// Default Api Version + /// 2023-05-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> RefreshStatusAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _managedInstanceClientDiagnostics.CreateScope("ManagedInstanceResource.RefreshStatus"); + scope.Start(); + try + { + var response = await _managedInstanceRestClient.RefreshStatusAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new SqlArmOperation(new RefreshExternalGovernanceStatusOperationResultMIOperationSource(), _managedInstanceClientDiagnostics, Pipeline, _managedInstanceRestClient.CreateRefreshStatusRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Refresh external governance enablement status. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/refreshExternalGovernanceStatus + /// + /// + /// Operation Id + /// ManagedInstances_RefreshStatus + /// + /// + /// Default Api Version + /// 2023-05-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 RefreshStatus(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _managedInstanceClientDiagnostics.CreateScope("ManagedInstanceResource.RefreshStatus"); + scope.Start(); + try + { + var response = _managedInstanceRestClient.RefreshStatus(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new SqlArmOperation(new RefreshExternalGovernanceStatusOperationResultMIOperationSource(), _managedInstanceClientDiagnostics, Pipeline, _managedInstanceRestClient.CreateRefreshStatusRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// Starts the managed instance. /// @@ -2073,7 +2157,7 @@ public virtual Pageable GetOutboundNetworkDepend /// /// /// Default Api Version - /// 2022-08-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -2083,16 +2167,16 @@ public virtual Pageable GetOutboundNetworkDepend /// /// 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 StartAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + public virtual async Task> StartAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { using var scope = _managedInstanceClientDiagnostics.CreateScope("ManagedInstanceResource.Start"); scope.Start(); try { var response = await _managedInstanceRestClient.StartAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new SqlArmOperation(_managedInstanceClientDiagnostics, Pipeline, _managedInstanceRestClient.CreateStartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var operation = new SqlArmOperation(new ManagedInstanceOperationSource(Client), _managedInstanceClientDiagnostics, Pipeline, _managedInstanceRestClient.CreateStartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; } catch (Exception e) @@ -2115,7 +2199,7 @@ public virtual async Task StartAsync(WaitUntil waitUntil, Cancella /// /// /// Default Api Version - /// 2022-08-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -2125,16 +2209,16 @@ public virtual async Task StartAsync(WaitUntil waitUntil, Cancella /// /// 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 Start(WaitUntil waitUntil, CancellationToken cancellationToken = default) + public virtual ArmOperation Start(WaitUntil waitUntil, CancellationToken cancellationToken = default) { using var scope = _managedInstanceClientDiagnostics.CreateScope("ManagedInstanceResource.Start"); scope.Start(); try { var response = _managedInstanceRestClient.Start(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new SqlArmOperation(_managedInstanceClientDiagnostics, Pipeline, _managedInstanceRestClient.CreateStartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var operation = new SqlArmOperation(new ManagedInstanceOperationSource(Client), _managedInstanceClientDiagnostics, Pipeline, _managedInstanceRestClient.CreateStartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); + operation.WaitForCompletion(cancellationToken); return operation; } catch (Exception e) @@ -2157,7 +2241,7 @@ public virtual ArmOperation Start(WaitUntil waitUntil, CancellationToken cancell /// /// /// Default Api Version - /// 2022-08-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -2167,16 +2251,16 @@ public virtual ArmOperation Start(WaitUntil waitUntil, CancellationToken cancell /// /// 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 StopAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + public virtual async Task> StopAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { using var scope = _managedInstanceClientDiagnostics.CreateScope("ManagedInstanceResource.Stop"); scope.Start(); try { var response = await _managedInstanceRestClient.StopAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new SqlArmOperation(_managedInstanceClientDiagnostics, Pipeline, _managedInstanceRestClient.CreateStopRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var operation = new SqlArmOperation(new ManagedInstanceOperationSource(Client), _managedInstanceClientDiagnostics, Pipeline, _managedInstanceRestClient.CreateStopRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; } catch (Exception e) @@ -2199,7 +2283,7 @@ public virtual async Task StopAsync(WaitUntil waitUntil, Cancellat /// /// /// Default Api Version - /// 2022-08-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -2209,16 +2293,16 @@ public virtual async Task StopAsync(WaitUntil waitUntil, Cancellat /// /// 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 Stop(WaitUntil waitUntil, CancellationToken cancellationToken = default) + public virtual ArmOperation Stop(WaitUntil waitUntil, CancellationToken cancellationToken = default) { using var scope = _managedInstanceClientDiagnostics.CreateScope("ManagedInstanceResource.Stop"); scope.Start(); try { var response = _managedInstanceRestClient.Stop(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new SqlArmOperation(_managedInstanceClientDiagnostics, Pipeline, _managedInstanceRestClient.CreateStopRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var operation = new SqlArmOperation(new ManagedInstanceOperationSource(Client), _managedInstanceClientDiagnostics, Pipeline, _managedInstanceRestClient.CreateStopRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); + operation.WaitForCompletion(cancellationToken); return operation; } catch (Exception e) @@ -2241,7 +2325,7 @@ public virtual ArmOperation Stop(WaitUntil waitUntil, CancellationToken cancella /// /// /// Default Api Version - /// 2022-08-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -2274,7 +2358,7 @@ public virtual AsyncPageable GetTopQueriesAsync(ManagedInstanceResou /// /// /// Default Api Version - /// 2022-08-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -2307,7 +2391,7 @@ public virtual Pageable GetTopQueries(ManagedInstanceResourceGetTopQ /// /// /// Default Api Version - /// 2022-08-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -2369,7 +2453,7 @@ public virtual async Task> AddTagAsync(string /// /// /// Default Api Version - /// 2022-08-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -2431,7 +2515,7 @@ public virtual Response AddTag(string key, string value /// /// /// Default Api Version - /// 2022-08-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -2488,7 +2572,7 @@ public virtual async Task> SetTagsAsync(IDicti /// /// /// Default Api Version - /// 2022-08-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -2545,7 +2629,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2022-08-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -2605,7 +2689,7 @@ public virtual async Task> RemoveTagAsync(stri /// /// /// Default Api Version - /// 2022-08-01-preview + /// 2023-05-01-preview /// /// /// Resource diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/AuthMetadataLookupMode.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/AuthMetadataLookupMode.cs new file mode 100644 index 000000000000..236c253bac6b --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/AuthMetadataLookupMode.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Sql.Models +{ + /// The managed instance's authentication metadata lookup mode. + public readonly partial struct AuthMetadataLookupMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AuthMetadataLookupMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AzureADValue = "AzureAD"; + private const string PairedValue = "Paired"; + private const string WindowsValue = "Windows"; + + /// AzureAD. + public static AuthMetadataLookupMode AzureAD { get; } = new AuthMetadataLookupMode(AzureADValue); + /// Paired. + public static AuthMetadataLookupMode Paired { get; } = new AuthMetadataLookupMode(PairedValue); + /// Windows. + public static AuthMetadataLookupMode Windows { get; } = new AuthMetadataLookupMode(WindowsValue); + /// Determines if two values are the same. + public static bool operator ==(AuthMetadataLookupMode left, AuthMetadataLookupMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AuthMetadataLookupMode left, AuthMetadataLookupMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator AuthMetadataLookupMode(string value) => new AuthMetadataLookupMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AuthMetadataLookupMode other && Equals(other); + /// + public bool Equals(AuthMetadataLookupMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/CertificateInfo.Serialization.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/CertificateInfo.Serialization.cs new file mode 100644 index 000000000000..8919d878bc19 --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/CertificateInfo.Serialization.cs @@ -0,0 +1,194 @@ +// 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; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Sql.Models +{ + public partial class CertificateInfo : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CertificateInfo)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(CertificateName)) + { + writer.WritePropertyName("certificateName"u8); + writer.WriteStringValue(CertificateName); + } + if (options.Format != "W" && Optional.IsDefined(ExpiryOn)) + { + writer.WritePropertyName("expiryDate"u8); + writer.WriteStringValue(ExpiryOn.Value, "O"); + } + 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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + CertificateInfo 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(CertificateInfo)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCertificateInfo(document.RootElement, options); + } + + internal static CertificateInfo DeserializeCertificateInfo(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string certificateName = default; + DateTimeOffset? expiryDate = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("certificateName"u8)) + { + certificateName = property.Value.GetString(); + continue; + } + if (property.NameEquals("expiryDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expiryDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CertificateInfo(certificateName, expiryDate, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CertificateName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" certificateName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CertificateName)) + { + builder.Append(" certificateName: "); + if (CertificateName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{CertificateName}'''"); + } + else + { + builder.AppendLine($"'{CertificateName}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ExpiryOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" expiryDate: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ExpiryOn)) + { + builder.Append(" expiryDate: "); + var formattedDateTimeString = TypeFormatters.ToString(ExpiryOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + 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); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(CertificateInfo)} does not support writing '{options.Format}' format."); + } + } + + CertificateInfo 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); + return DeserializeCertificateInfo(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CertificateInfo)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/CertificateInfo.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/CertificateInfo.cs new file mode 100644 index 000000000000..af5c43c38aaf --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/CertificateInfo.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Sql.Models +{ + /// Certificate information. + public partial class CertificateInfo + { + /// + /// 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 . + internal CertificateInfo() + { + } + + /// Initializes a new instance of . + /// The certificate name. + /// The certificate expiry date. + /// Keeps track of any properties unknown to the library. + internal CertificateInfo(string certificateName, DateTimeOffset? expiryOn, IDictionary serializedAdditionalRawData) + { + CertificateName = certificateName; + ExpiryOn = expiryOn; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The certificate name. + [WirePath("certificateName")] + public string CertificateName { get; } + /// The certificate expiry date. + [WirePath("expiryDate")] + public DateTimeOffset? ExpiryOn { get; } + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DatabaseOperationData.Serialization.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DatabaseOperationData.Serialization.cs index 78a9d14fca4f..bf61968999ea 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DatabaseOperationData.Serialization.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DatabaseOperationData.Serialization.cs @@ -120,6 +120,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW writer.WritePropertyName("isCancellable"u8); writer.WriteBooleanValue(IsCancellable.Value); } + if (options.Format != "W" && Optional.IsDefined(OperationPhaseDetails)) + { + writer.WritePropertyName("operationPhaseDetails"u8); + writer.WriteObjectValue(OperationPhaseDetails, options); + } writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -177,6 +182,7 @@ internal static DatabaseOperationData DeserializeDatabaseOperationData(JsonEleme DateTimeOffset? estimatedCompletionTime = default; string description = default; bool? isCancellable = default; + PhaseDetails operationPhaseDetails = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -316,6 +322,15 @@ internal static DatabaseOperationData DeserializeDatabaseOperationData(JsonEleme isCancellable = property0.Value.GetBoolean(); continue; } + if (property0.NameEquals("operationPhaseDetails"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + operationPhaseDetails = PhaseDetails.DeserializePhaseDetails(property0.Value, options); + continue; + } } continue; } @@ -344,6 +359,7 @@ internal static DatabaseOperationData DeserializeDatabaseOperationData(JsonEleme estimatedCompletionTime, description, isCancellable, + operationPhaseDetails, serializedAdditionalRawData); } @@ -675,6 +691,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OperationPhaseDetails), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" operationPhaseDetails: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(OperationPhaseDetails)) + { + builder.Append(" operationPhaseDetails: "); + BicepSerializationHelpers.AppendChildObject(builder, OperationPhaseDetails, options, 4, false, " operationPhaseDetails: "); + } + } + builder.AppendLine(" }"); builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DatabaseOperationData.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DatabaseOperationData.cs index 5544118ed23a..da828854bf6c 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DatabaseOperationData.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DatabaseOperationData.cs @@ -71,8 +71,9 @@ public DatabaseOperationData() /// The estimated completion time of the operation. /// The operation description. /// Whether the operation can be cancelled. + /// The operation phase details. /// Keeps track of any properties unknown to the library. - internal DatabaseOperationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string databaseName, string operation, string operationFriendlyName, int? percentComplete, string serverName, DateTimeOffset? startOn, ManagementOperationState? state, int? errorCode, string errorDescription, int? errorSeverity, bool? isUserError, DateTimeOffset? estimatedCompleteOn, string description, bool? isCancellable, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal DatabaseOperationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string databaseName, string operation, string operationFriendlyName, int? percentComplete, string serverName, DateTimeOffset? startOn, ManagementOperationState? state, int? errorCode, string errorDescription, int? errorSeverity, bool? isUserError, DateTimeOffset? estimatedCompleteOn, string description, bool? isCancellable, PhaseDetails operationPhaseDetails, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { DatabaseName = databaseName; Operation = operation; @@ -88,6 +89,7 @@ internal DatabaseOperationData(ResourceIdentifier id, string name, ResourceType EstimatedCompleteOn = estimatedCompleteOn; Description = description; IsCancellable = isCancellable; + OperationPhaseDetails = operationPhaseDetails; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -133,5 +135,8 @@ internal DatabaseOperationData(ResourceIdentifier id, string name, ResourceType /// Whether the operation can be cancelled. [WirePath("properties.isCancellable")] public bool? IsCancellable { get; } + /// The operation phase details. + [WirePath("properties.operationPhaseDetails")] + public PhaseDetails OperationPhaseDetails { get; } } } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DistributedAvailabilityGroupDatabase.Serialization.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DistributedAvailabilityGroupDatabase.Serialization.cs new file mode 100644 index 000000000000..360fc1fdd650 --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DistributedAvailabilityGroupDatabase.Serialization.cs @@ -0,0 +1,822 @@ +// 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; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Sql.Models +{ + public partial class DistributedAvailabilityGroupDatabase : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DistributedAvailabilityGroupDatabase)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(DatabaseName)) + { + writer.WritePropertyName("databaseName"u8); + writer.WriteStringValue(DatabaseName); + } + if (options.Format != "W" && Optional.IsDefined(InstanceReplicaId)) + { + writer.WritePropertyName("instanceReplicaId"u8); + writer.WriteStringValue(InstanceReplicaId.Value); + } + if (options.Format != "W" && Optional.IsDefined(PartnerReplicaId)) + { + writer.WritePropertyName("partnerReplicaId"u8); + writer.WriteStringValue(PartnerReplicaId.Value); + } + if (options.Format != "W" && Optional.IsDefined(ReplicaState)) + { + writer.WritePropertyName("replicaState"u8); + writer.WriteStringValue(ReplicaState); + } + if (options.Format != "W" && Optional.IsDefined(SeedingProgress)) + { + writer.WritePropertyName("seedingProgress"u8); + writer.WriteStringValue(SeedingProgress); + } + if (options.Format != "W" && Optional.IsDefined(SynchronizationHealth)) + { + writer.WritePropertyName("synchronizationHealth"u8); + writer.WriteStringValue(SynchronizationHealth.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ConnectedState)) + { + writer.WritePropertyName("connectedState"u8); + writer.WriteStringValue(ConnectedState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(LastReceivedLsn)) + { + writer.WritePropertyName("lastReceivedLsn"u8); + writer.WriteStringValue(LastReceivedLsn); + } + if (options.Format != "W" && Optional.IsDefined(LastReceivedOn)) + { + writer.WritePropertyName("lastReceivedTime"u8); + writer.WriteStringValue(LastReceivedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(LastSentLsn)) + { + writer.WritePropertyName("lastSentLsn"u8); + writer.WriteStringValue(LastSentLsn); + } + if (options.Format != "W" && Optional.IsDefined(LastSentOn)) + { + writer.WritePropertyName("lastSentTime"u8); + writer.WriteStringValue(LastSentOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(LastCommitLsn)) + { + writer.WritePropertyName("lastCommitLsn"u8); + writer.WriteStringValue(LastCommitLsn); + } + if (options.Format != "W" && Optional.IsDefined(LastCommitOn)) + { + writer.WritePropertyName("lastCommitTime"u8); + writer.WriteStringValue(LastCommitOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(LastHardenedLsn)) + { + writer.WritePropertyName("lastHardenedLsn"u8); + writer.WriteStringValue(LastHardenedLsn); + } + if (options.Format != "W" && Optional.IsDefined(LastHardenedOn)) + { + writer.WritePropertyName("lastHardenedTime"u8); + writer.WriteStringValue(LastHardenedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(LastBackupLsn)) + { + writer.WritePropertyName("lastBackupLsn"u8); + writer.WriteStringValue(LastBackupLsn); + } + if (options.Format != "W" && Optional.IsDefined(LastBackupOn)) + { + writer.WritePropertyName("lastBackupTime"u8); + writer.WriteStringValue(LastBackupOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(MostRecentLinkError)) + { + writer.WritePropertyName("mostRecentLinkError"u8); + writer.WriteStringValue(MostRecentLinkError); + } + if (options.Format != "W" && Optional.IsDefined(PartnerAuthCertValidity)) + { + writer.WritePropertyName("partnerAuthCertValidity"u8); + writer.WriteObjectValue(PartnerAuthCertValidity, options); + } + if (options.Format != "W" && Optional.IsDefined(InstanceSendReplicationLagSeconds)) + { + writer.WritePropertyName("instanceSendReplicationLagSeconds"u8); + writer.WriteNumberValue(InstanceSendReplicationLagSeconds.Value); + } + if (options.Format != "W" && Optional.IsDefined(InstanceRedoReplicationLagSeconds)) + { + writer.WritePropertyName("instanceRedoReplicationLagSeconds"u8); + writer.WriteNumberValue(InstanceRedoReplicationLagSeconds.Value); + } + 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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + DistributedAvailabilityGroupDatabase 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(DistributedAvailabilityGroupDatabase)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDistributedAvailabilityGroupDatabase(document.RootElement, options); + } + + internal static DistributedAvailabilityGroupDatabase DeserializeDistributedAvailabilityGroupDatabase(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string databaseName = default; + Guid? instanceReplicaId = default; + Guid? partnerReplicaId = default; + string replicaState = default; + string seedingProgress = default; + ReplicaSynchronizationHealth? synchronizationHealth = default; + ReplicaConnectedState? connectedState = default; + string lastReceivedLsn = default; + DateTimeOffset? lastReceivedTime = default; + string lastSentLsn = default; + DateTimeOffset? lastSentTime = default; + string lastCommitLsn = default; + DateTimeOffset? lastCommitTime = default; + string lastHardenedLsn = default; + DateTimeOffset? lastHardenedTime = default; + string lastBackupLsn = default; + DateTimeOffset? lastBackupTime = default; + string mostRecentLinkError = default; + CertificateInfo partnerAuthCertValidity = default; + int? instanceSendReplicationLagSeconds = default; + int? instanceRedoReplicationLagSeconds = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("databaseName"u8)) + { + databaseName = property.Value.GetString(); + continue; + } + if (property.NameEquals("instanceReplicaId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + instanceReplicaId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("partnerReplicaId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + partnerReplicaId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("replicaState"u8)) + { + replicaState = property.Value.GetString(); + continue; + } + if (property.NameEquals("seedingProgress"u8)) + { + seedingProgress = property.Value.GetString(); + continue; + } + if (property.NameEquals("synchronizationHealth"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + synchronizationHealth = new ReplicaSynchronizationHealth(property.Value.GetString()); + continue; + } + if (property.NameEquals("connectedState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + connectedState = new ReplicaConnectedState(property.Value.GetString()); + continue; + } + if (property.NameEquals("lastReceivedLsn"u8)) + { + lastReceivedLsn = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastReceivedTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastReceivedTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastSentLsn"u8)) + { + lastSentLsn = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastSentTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSentTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastCommitLsn"u8)) + { + lastCommitLsn = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastCommitTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastCommitTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastHardenedLsn"u8)) + { + lastHardenedLsn = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastHardenedTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastHardenedTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastBackupLsn"u8)) + { + lastBackupLsn = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastBackupTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastBackupTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("mostRecentLinkError"u8)) + { + mostRecentLinkError = property.Value.GetString(); + continue; + } + if (property.NameEquals("partnerAuthCertValidity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + partnerAuthCertValidity = CertificateInfo.DeserializeCertificateInfo(property.Value, options); + continue; + } + if (property.NameEquals("instanceSendReplicationLagSeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + instanceSendReplicationLagSeconds = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("instanceRedoReplicationLagSeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + instanceRedoReplicationLagSeconds = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DistributedAvailabilityGroupDatabase( + databaseName, + instanceReplicaId, + partnerReplicaId, + replicaState, + seedingProgress, + synchronizationHealth, + connectedState, + lastReceivedLsn, + lastReceivedTime, + lastSentLsn, + lastSentTime, + lastCommitLsn, + lastCommitTime, + lastHardenedLsn, + lastHardenedTime, + lastBackupLsn, + lastBackupTime, + mostRecentLinkError, + partnerAuthCertValidity, + instanceSendReplicationLagSeconds, + instanceRedoReplicationLagSeconds, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DatabaseName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" databaseName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DatabaseName)) + { + builder.Append(" databaseName: "); + if (DatabaseName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{DatabaseName}'''"); + } + else + { + builder.AppendLine($"'{DatabaseName}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(InstanceReplicaId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" instanceReplicaId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(InstanceReplicaId)) + { + builder.Append(" instanceReplicaId: "); + builder.AppendLine($"'{InstanceReplicaId.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PartnerReplicaId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" partnerReplicaId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PartnerReplicaId)) + { + builder.Append(" partnerReplicaId: "); + builder.AppendLine($"'{PartnerReplicaId.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ReplicaState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" replicaState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ReplicaState)) + { + builder.Append(" replicaState: "); + if (ReplicaState.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ReplicaState}'''"); + } + else + { + builder.AppendLine($"'{ReplicaState}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SeedingProgress), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" seedingProgress: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SeedingProgress)) + { + builder.Append(" seedingProgress: "); + if (SeedingProgress.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{SeedingProgress}'''"); + } + else + { + builder.AppendLine($"'{SeedingProgress}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SynchronizationHealth), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" synchronizationHealth: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SynchronizationHealth)) + { + builder.Append(" synchronizationHealth: "); + builder.AppendLine($"'{SynchronizationHealth.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ConnectedState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" connectedState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ConnectedState)) + { + builder.Append(" connectedState: "); + builder.AppendLine($"'{ConnectedState.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LastReceivedLsn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" lastReceivedLsn: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LastReceivedLsn)) + { + builder.Append(" lastReceivedLsn: "); + if (LastReceivedLsn.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{LastReceivedLsn}'''"); + } + else + { + builder.AppendLine($"'{LastReceivedLsn}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LastReceivedOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" lastReceivedTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LastReceivedOn)) + { + builder.Append(" lastReceivedTime: "); + var formattedDateTimeString = TypeFormatters.ToString(LastReceivedOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LastSentLsn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" lastSentLsn: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LastSentLsn)) + { + builder.Append(" lastSentLsn: "); + if (LastSentLsn.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{LastSentLsn}'''"); + } + else + { + builder.AppendLine($"'{LastSentLsn}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LastSentOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" lastSentTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LastSentOn)) + { + builder.Append(" lastSentTime: "); + var formattedDateTimeString = TypeFormatters.ToString(LastSentOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LastCommitLsn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" lastCommitLsn: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LastCommitLsn)) + { + builder.Append(" lastCommitLsn: "); + if (LastCommitLsn.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{LastCommitLsn}'''"); + } + else + { + builder.AppendLine($"'{LastCommitLsn}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LastCommitOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" lastCommitTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LastCommitOn)) + { + builder.Append(" lastCommitTime: "); + var formattedDateTimeString = TypeFormatters.ToString(LastCommitOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LastHardenedLsn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" lastHardenedLsn: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LastHardenedLsn)) + { + builder.Append(" lastHardenedLsn: "); + if (LastHardenedLsn.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{LastHardenedLsn}'''"); + } + else + { + builder.AppendLine($"'{LastHardenedLsn}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LastHardenedOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" lastHardenedTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LastHardenedOn)) + { + builder.Append(" lastHardenedTime: "); + var formattedDateTimeString = TypeFormatters.ToString(LastHardenedOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LastBackupLsn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" lastBackupLsn: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LastBackupLsn)) + { + builder.Append(" lastBackupLsn: "); + if (LastBackupLsn.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{LastBackupLsn}'''"); + } + else + { + builder.AppendLine($"'{LastBackupLsn}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LastBackupOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" lastBackupTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LastBackupOn)) + { + builder.Append(" lastBackupTime: "); + var formattedDateTimeString = TypeFormatters.ToString(LastBackupOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MostRecentLinkError), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" mostRecentLinkError: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(MostRecentLinkError)) + { + builder.Append(" mostRecentLinkError: "); + if (MostRecentLinkError.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{MostRecentLinkError}'''"); + } + else + { + builder.AppendLine($"'{MostRecentLinkError}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PartnerAuthCertValidity), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" partnerAuthCertValidity: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PartnerAuthCertValidity)) + { + builder.Append(" partnerAuthCertValidity: "); + BicepSerializationHelpers.AppendChildObject(builder, PartnerAuthCertValidity, options, 2, false, " partnerAuthCertValidity: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(InstanceSendReplicationLagSeconds), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" instanceSendReplicationLagSeconds: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(InstanceSendReplicationLagSeconds)) + { + builder.Append(" instanceSendReplicationLagSeconds: "); + builder.AppendLine($"{InstanceSendReplicationLagSeconds.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(InstanceRedoReplicationLagSeconds), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" instanceRedoReplicationLagSeconds: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(InstanceRedoReplicationLagSeconds)) + { + builder.Append(" instanceRedoReplicationLagSeconds: "); + builder.AppendLine($"{InstanceRedoReplicationLagSeconds.Value}"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + 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); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(DistributedAvailabilityGroupDatabase)} does not support writing '{options.Format}' format."); + } + } + + DistributedAvailabilityGroupDatabase 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); + return DeserializeDistributedAvailabilityGroupDatabase(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DistributedAvailabilityGroupDatabase)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DistributedAvailabilityGroupDatabase.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DistributedAvailabilityGroupDatabase.cs new file mode 100644 index 000000000000..c64216736fc6 --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DistributedAvailabilityGroupDatabase.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Sql.Models +{ + /// Database specific information. + public partial class DistributedAvailabilityGroupDatabase + { + /// + /// 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 DistributedAvailabilityGroupDatabase() + { + } + + /// Initializes a new instance of . + /// The name of the database in link. + /// Managed instance replica id. + /// SQL server replica id. + /// Current link state. + /// Seeding progress. + /// Link health state. + /// Link connected state. + /// Last received LSN. + /// Last received LSN time. + /// Last sent LSN. + /// Last sent LSN time. + /// Last commit LSN. + /// Last commit LSN time. + /// Last hardened LSN. + /// Last hardened LSN time. + /// Last backup LSN. + /// Last backup LSN time. + /// The most recent link connection error description. + /// SQL server certificate validity. + /// Replication lag when Managed Instance link side is primary. + /// Redo lag when Managed Instance link side is primary. + /// Keeps track of any properties unknown to the library. + internal DistributedAvailabilityGroupDatabase(string databaseName, Guid? instanceReplicaId, Guid? partnerReplicaId, string replicaState, string seedingProgress, ReplicaSynchronizationHealth? synchronizationHealth, ReplicaConnectedState? connectedState, string lastReceivedLsn, DateTimeOffset? lastReceivedOn, string lastSentLsn, DateTimeOffset? lastSentOn, string lastCommitLsn, DateTimeOffset? lastCommitOn, string lastHardenedLsn, DateTimeOffset? lastHardenedOn, string lastBackupLsn, DateTimeOffset? lastBackupOn, string mostRecentLinkError, CertificateInfo partnerAuthCertValidity, int? instanceSendReplicationLagSeconds, int? instanceRedoReplicationLagSeconds, IDictionary serializedAdditionalRawData) + { + DatabaseName = databaseName; + InstanceReplicaId = instanceReplicaId; + PartnerReplicaId = partnerReplicaId; + ReplicaState = replicaState; + SeedingProgress = seedingProgress; + SynchronizationHealth = synchronizationHealth; + ConnectedState = connectedState; + LastReceivedLsn = lastReceivedLsn; + LastReceivedOn = lastReceivedOn; + LastSentLsn = lastSentLsn; + LastSentOn = lastSentOn; + LastCommitLsn = lastCommitLsn; + LastCommitOn = lastCommitOn; + LastHardenedLsn = lastHardenedLsn; + LastHardenedOn = lastHardenedOn; + LastBackupLsn = lastBackupLsn; + LastBackupOn = lastBackupOn; + MostRecentLinkError = mostRecentLinkError; + PartnerAuthCertValidity = partnerAuthCertValidity; + InstanceSendReplicationLagSeconds = instanceSendReplicationLagSeconds; + InstanceRedoReplicationLagSeconds = instanceRedoReplicationLagSeconds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The name of the database in link. + [WirePath("databaseName")] + public string DatabaseName { get; set; } + /// Managed instance replica id. + [WirePath("instanceReplicaId")] + public Guid? InstanceReplicaId { get; } + /// SQL server replica id. + [WirePath("partnerReplicaId")] + public Guid? PartnerReplicaId { get; } + /// Current link state. + [WirePath("replicaState")] + public string ReplicaState { get; } + /// Seeding progress. + [WirePath("seedingProgress")] + public string SeedingProgress { get; } + /// Link health state. + [WirePath("synchronizationHealth")] + public ReplicaSynchronizationHealth? SynchronizationHealth { get; } + /// Link connected state. + [WirePath("connectedState")] + public ReplicaConnectedState? ConnectedState { get; } + /// Last received LSN. + [WirePath("lastReceivedLsn")] + public string LastReceivedLsn { get; } + /// Last received LSN time. + [WirePath("lastReceivedTime")] + public DateTimeOffset? LastReceivedOn { get; } + /// Last sent LSN. + [WirePath("lastSentLsn")] + public string LastSentLsn { get; } + /// Last sent LSN time. + [WirePath("lastSentTime")] + public DateTimeOffset? LastSentOn { get; } + /// Last commit LSN. + [WirePath("lastCommitLsn")] + public string LastCommitLsn { get; } + /// Last commit LSN time. + [WirePath("lastCommitTime")] + public DateTimeOffset? LastCommitOn { get; } + /// Last hardened LSN. + [WirePath("lastHardenedLsn")] + public string LastHardenedLsn { get; } + /// Last hardened LSN time. + [WirePath("lastHardenedTime")] + public DateTimeOffset? LastHardenedOn { get; } + /// Last backup LSN. + [WirePath("lastBackupLsn")] + public string LastBackupLsn { get; } + /// Last backup LSN time. + [WirePath("lastBackupTime")] + public DateTimeOffset? LastBackupOn { get; } + /// The most recent link connection error description. + [WirePath("mostRecentLinkError")] + public string MostRecentLinkError { get; } + /// SQL server certificate validity. + [WirePath("partnerAuthCertValidity")] + public CertificateInfo PartnerAuthCertValidity { get; } + /// Replication lag when Managed Instance link side is primary. + [WirePath("instanceSendReplicationLagSeconds")] + public int? InstanceSendReplicationLagSeconds { get; } + /// Redo lag when Managed Instance link side is primary. + [WirePath("instanceRedoReplicationLagSeconds")] + public int? InstanceRedoReplicationLagSeconds { get; } + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DistributedAvailabilityGroupReplicationMode.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DistributedAvailabilityGroupReplicationMode.cs deleted file mode 100644 index d3c9f67c5cde..000000000000 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DistributedAvailabilityGroupReplicationMode.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.Sql.Models -{ - /// The replication mode of a distributed availability group. Parameter will be ignored during link creation. - public readonly partial struct DistributedAvailabilityGroupReplicationMode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public DistributedAvailabilityGroupReplicationMode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AsyncValue = "Async"; - private const string SyncValue = "Sync"; - - /// Async. - public static DistributedAvailabilityGroupReplicationMode Async { get; } = new DistributedAvailabilityGroupReplicationMode(AsyncValue); - /// Sync. - public static DistributedAvailabilityGroupReplicationMode Sync { get; } = new DistributedAvailabilityGroupReplicationMode(SyncValue); - /// Determines if two values are the same. - public static bool operator ==(DistributedAvailabilityGroupReplicationMode left, DistributedAvailabilityGroupReplicationMode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(DistributedAvailabilityGroupReplicationMode left, DistributedAvailabilityGroupReplicationMode right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator DistributedAvailabilityGroupReplicationMode(string value) => new DistributedAvailabilityGroupReplicationMode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is DistributedAvailabilityGroupReplicationMode other && Equals(other); - /// - public bool Equals(DistributedAvailabilityGroupReplicationMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DistributedAvailabilityGroupSetRole.Serialization.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DistributedAvailabilityGroupSetRole.Serialization.cs new file mode 100644 index 000000000000..2198c08ee389 --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DistributedAvailabilityGroupSetRole.Serialization.cs @@ -0,0 +1,127 @@ +// 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.Sql.Models +{ + public partial class DistributedAvailabilityGroupSetRole : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DistributedAvailabilityGroupSetRole)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("instanceRole"u8); + writer.WriteStringValue(InstanceRole.ToString()); + writer.WritePropertyName("roleChangeType"u8); + writer.WriteStringValue(RoleChangeType.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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + DistributedAvailabilityGroupSetRole 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(DistributedAvailabilityGroupSetRole)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDistributedAvailabilityGroupSetRole(document.RootElement, options); + } + + internal static DistributedAvailabilityGroupSetRole DeserializeDistributedAvailabilityGroupSetRole(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + InstanceRole instanceRole = default; + RoleChangeType roleChangeType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceRole"u8)) + { + instanceRole = new InstanceRole(property.Value.GetString()); + continue; + } + if (property.NameEquals("roleChangeType"u8)) + { + roleChangeType = new RoleChangeType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DistributedAvailabilityGroupSetRole(instanceRole, roleChangeType, 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); + default: + throw new FormatException($"The model {nameof(DistributedAvailabilityGroupSetRole)} does not support writing '{options.Format}' format."); + } + } + + DistributedAvailabilityGroupSetRole 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); + return DeserializeDistributedAvailabilityGroupSetRole(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DistributedAvailabilityGroupSetRole)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DistributedAvailabilityGroupSetRole.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DistributedAvailabilityGroupSetRole.cs new file mode 100644 index 000000000000..88f071912cc1 --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DistributedAvailabilityGroupSetRole.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; + +namespace Azure.ResourceManager.Sql.Models +{ + /// Distributed availability group failover request. + public partial class DistributedAvailabilityGroupSetRole + { + /// + /// 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 . + /// New role of managed instance in a distributed availability group, can be Primary or Secondary. + /// The type of the role change, can be Planned or Forced. + public DistributedAvailabilityGroupSetRole(InstanceRole instanceRole, RoleChangeType roleChangeType) + { + InstanceRole = instanceRole; + RoleChangeType = roleChangeType; + } + + /// Initializes a new instance of . + /// New role of managed instance in a distributed availability group, can be Primary or Secondary. + /// The type of the role change, can be Planned or Forced. + /// Keeps track of any properties unknown to the library. + internal DistributedAvailabilityGroupSetRole(InstanceRole instanceRole, RoleChangeType roleChangeType, IDictionary serializedAdditionalRawData) + { + InstanceRole = instanceRole; + RoleChangeType = roleChangeType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DistributedAvailabilityGroupSetRole() + { + } + + /// New role of managed instance in a distributed availability group, can be Primary or Secondary. + [WirePath("instanceRole")] + public InstanceRole InstanceRole { get; } + /// The type of the role change, can be Planned or Forced. + [WirePath("roleChangeType")] + public RoleChangeType RoleChangeType { get; } + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DistributedAvailabilityGroupsFailoverContent.Serialization.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DistributedAvailabilityGroupsFailoverContent.Serialization.cs new file mode 100644 index 000000000000..d038c702a3f3 --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DistributedAvailabilityGroupsFailoverContent.Serialization.cs @@ -0,0 +1,119 @@ +// 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.Sql.Models +{ + public partial class DistributedAvailabilityGroupsFailoverContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DistributedAvailabilityGroupsFailoverContent)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("failoverType"u8); + writer.WriteStringValue(FailoverType.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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + DistributedAvailabilityGroupsFailoverContent 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(DistributedAvailabilityGroupsFailoverContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDistributedAvailabilityGroupsFailoverContent(document.RootElement, options); + } + + internal static DistributedAvailabilityGroupsFailoverContent DeserializeDistributedAvailabilityGroupsFailoverContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FailoverType failoverType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("failoverType"u8)) + { + failoverType = new FailoverType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DistributedAvailabilityGroupsFailoverContent(failoverType, 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); + default: + throw new FormatException($"The model {nameof(DistributedAvailabilityGroupsFailoverContent)} does not support writing '{options.Format}' format."); + } + } + + DistributedAvailabilityGroupsFailoverContent 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); + return DeserializeDistributedAvailabilityGroupsFailoverContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DistributedAvailabilityGroupsFailoverContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DistributedAvailabilityGroupsFailoverContent.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DistributedAvailabilityGroupsFailoverContent.cs new file mode 100644 index 000000000000..b1305eb1e21e --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DistributedAvailabilityGroupsFailoverContent.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Sql.Models +{ + /// Distributed availability group failover. + public partial class DistributedAvailabilityGroupsFailoverContent + { + /// + /// 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 failover type, can be ForcedAllowDataLoss or Planned. + public DistributedAvailabilityGroupsFailoverContent(FailoverType failoverType) + { + FailoverType = failoverType; + } + + /// Initializes a new instance of . + /// The failover type, can be ForcedAllowDataLoss or Planned. + /// Keeps track of any properties unknown to the library. + internal DistributedAvailabilityGroupsFailoverContent(FailoverType failoverType, IDictionary serializedAdditionalRawData) + { + FailoverType = failoverType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DistributedAvailabilityGroupsFailoverContent() + { + } + + /// The failover type, can be ForcedAllowDataLoss or Planned. + [WirePath("failoverType")] + public FailoverType FailoverType { get; } + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/FailoverGroupDatabasesSecondaryType.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/FailoverGroupDatabasesSecondaryType.cs new file mode 100644 index 000000000000..3da46138c87e --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/FailoverGroupDatabasesSecondaryType.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.Sql.Models +{ + /// Databases secondary type on partner server. + public readonly partial struct FailoverGroupDatabasesSecondaryType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public FailoverGroupDatabasesSecondaryType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string GeoValue = "Geo"; + private const string StandbyValue = "Standby"; + + /// Geo. + public static FailoverGroupDatabasesSecondaryType Geo { get; } = new FailoverGroupDatabasesSecondaryType(GeoValue); + /// Standby. + public static FailoverGroupDatabasesSecondaryType Standby { get; } = new FailoverGroupDatabasesSecondaryType(StandbyValue); + /// Determines if two values are the same. + public static bool operator ==(FailoverGroupDatabasesSecondaryType left, FailoverGroupDatabasesSecondaryType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(FailoverGroupDatabasesSecondaryType left, FailoverGroupDatabasesSecondaryType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator FailoverGroupDatabasesSecondaryType(string value) => new FailoverGroupDatabasesSecondaryType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is FailoverGroupDatabasesSecondaryType other && Equals(other); + /// + public bool Equals(FailoverGroupDatabasesSecondaryType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/FailoverGroupPatch.Serialization.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/FailoverGroupPatch.Serialization.cs index bac308bb6bd2..ad192432a8db 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/FailoverGroupPatch.Serialization.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/FailoverGroupPatch.Serialization.cs @@ -74,6 +74,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit } writer.WriteEndArray(); } + if (Optional.IsDefined(SecondaryType)) + { + writer.WritePropertyName("secondaryType"u8); + writer.WriteStringValue(SecondaryType.Value.ToString()); + } writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -118,6 +123,7 @@ internal static FailoverGroupPatch DeserializeFailoverGroupPatch(JsonElement ele FailoverGroupReadOnlyEndpoint readOnlyEndpoint = default; IList databases = default; IList partnerServers = default; + FailoverGroupDatabasesSecondaryType? secondaryType = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -198,6 +204,15 @@ internal static FailoverGroupPatch DeserializeFailoverGroupPatch(JsonElement ele partnerServers = array; continue; } + if (property0.NameEquals("secondaryType"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + secondaryType = new FailoverGroupDatabasesSecondaryType(property0.Value.GetString()); + continue; + } } continue; } @@ -213,6 +228,7 @@ internal static FailoverGroupPatch DeserializeFailoverGroupPatch(JsonElement ele readOnlyEndpoint, databases ?? new ChangeTrackingList(), partnerServers ?? new ChangeTrackingList(), + secondaryType, serializedAdditionalRawData); } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/FailoverGroupPatch.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/FailoverGroupPatch.cs index fda14caa01ae..fdb0d21b3ae6 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/FailoverGroupPatch.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/FailoverGroupPatch.cs @@ -60,14 +60,16 @@ public FailoverGroupPatch() /// Read-only endpoint of the failover group instance. /// List of databases in the failover group. /// List of partner server information for the failover group. + /// Databases secondary type on partner server. /// Keeps track of any properties unknown to the library. - internal FailoverGroupPatch(IDictionary tags, FailoverGroupReadWriteEndpoint readWriteEndpoint, FailoverGroupReadOnlyEndpoint readOnlyEndpoint, IList failoverDatabases, IList partnerServers, IDictionary serializedAdditionalRawData) + internal FailoverGroupPatch(IDictionary tags, FailoverGroupReadWriteEndpoint readWriteEndpoint, FailoverGroupReadOnlyEndpoint readOnlyEndpoint, IList failoverDatabases, IList partnerServers, FailoverGroupDatabasesSecondaryType? secondaryType, IDictionary serializedAdditionalRawData) { Tags = tags; ReadWriteEndpoint = readWriteEndpoint; ReadOnlyEndpoint = readOnlyEndpoint; FailoverDatabases = failoverDatabases; PartnerServers = partnerServers; + SecondaryType = secondaryType; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -86,5 +88,8 @@ internal FailoverGroupPatch(IDictionary tags, FailoverGroupReadW /// List of partner server information for the failover group. [WirePath("properties.partnerServers")] public IList PartnerServers { get; } + /// Databases secondary type on partner server. + [WirePath("properties.secondaryType")] + public FailoverGroupDatabasesSecondaryType? SecondaryType { get; set; } } } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/FailoverModeType.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/FailoverModeType.cs new file mode 100644 index 000000000000..3d959f5d8395 --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/FailoverModeType.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.Sql.Models +{ + /// The link failover mode - can be Manual if intended to be used for two-way failover with a supported SQL Server, or None for one-way failover to Azure. + public readonly partial struct FailoverModeType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public FailoverModeType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string ManualValue = "Manual"; + + /// None. + public static FailoverModeType None { get; } = new FailoverModeType(NoneValue); + /// Manual. + public static FailoverModeType Manual { get; } = new FailoverModeType(ManualValue); + /// Determines if two values are the same. + public static bool operator ==(FailoverModeType left, FailoverModeType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(FailoverModeType left, FailoverModeType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator FailoverModeType(string value) => new FailoverModeType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is FailoverModeType other && Equals(other); + /// + public bool Equals(FailoverModeType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/FailoverType.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/FailoverType.cs new file mode 100644 index 000000000000..1f9079b3812f --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/FailoverType.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.Sql.Models +{ + /// The failover type, can be ForcedAllowDataLoss or Planned. + public readonly partial struct FailoverType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public FailoverType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ForcedAllowDataLossValue = "ForcedAllowDataLoss"; + private const string PlannedValue = "Planned"; + + /// ForcedAllowDataLoss. + public static FailoverType ForcedAllowDataLoss { get; } = new FailoverType(ForcedAllowDataLossValue); + /// Planned. + public static FailoverType Planned { get; } = new FailoverType(PlannedValue); + /// Determines if two values are the same. + public static bool operator ==(FailoverType left, FailoverType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(FailoverType left, FailoverType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator FailoverType(string value) => new FailoverType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is FailoverType other && Equals(other); + /// + public bool Equals(FailoverType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/FreemiumType.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/FreemiumType.cs new file mode 100644 index 000000000000..0ecea878ecff --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/FreemiumType.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.Sql.Models +{ + /// Weather or not Managed Instance is freemium. + public readonly partial struct FreemiumType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public FreemiumType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string RegularValue = "Regular"; + private const string FreemiumValue = "Freemium"; + + /// Regular. + public static FreemiumType Regular { get; } = new FreemiumType(RegularValue); + /// Freemium. + public static FreemiumType Freemium { get; } = new FreemiumType(FreemiumValue); + /// Determines if two values are the same. + public static bool operator ==(FreemiumType left, FreemiumType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(FreemiumType left, FreemiumType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator FreemiumType(string value) => new FreemiumType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is FreemiumType other && Equals(other); + /// + public bool Equals(FreemiumType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/HybridSecondaryUsage.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/HybridSecondaryUsage.cs new file mode 100644 index 000000000000..352f8afcf37e --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/HybridSecondaryUsage.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.Sql.Models +{ + /// Hybrid secondary usage. Possible values are 'Active' (default value) and 'Passive' (customer uses the secondary as Passive DR). + public readonly partial struct HybridSecondaryUsage : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public HybridSecondaryUsage(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ActiveValue = "Active"; + private const string PassiveValue = "Passive"; + + /// Active. + public static HybridSecondaryUsage Active { get; } = new HybridSecondaryUsage(ActiveValue); + /// Passive. + public static HybridSecondaryUsage Passive { get; } = new HybridSecondaryUsage(PassiveValue); + /// Determines if two values are the same. + public static bool operator ==(HybridSecondaryUsage left, HybridSecondaryUsage right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(HybridSecondaryUsage left, HybridSecondaryUsage right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator HybridSecondaryUsage(string value) => new HybridSecondaryUsage(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is HybridSecondaryUsage other && Equals(other); + /// + public bool Equals(HybridSecondaryUsage other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/HybridSecondaryUsageDetected.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/HybridSecondaryUsageDetected.cs new file mode 100644 index 000000000000..47b0b1c56434 --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/HybridSecondaryUsageDetected.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.Sql.Models +{ + /// Hybrid secondary usage detected. Possible values are 'Active' (customer does not meet the requirements to use the secondary as Passive DR) and 'Passive' (customer meets the requirements to use the secondary as Passive DR). + public readonly partial struct HybridSecondaryUsageDetected : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public HybridSecondaryUsageDetected(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ActiveValue = "Active"; + private const string PassiveValue = "Passive"; + + /// Active. + public static HybridSecondaryUsageDetected Active { get; } = new HybridSecondaryUsageDetected(ActiveValue); + /// Passive. + public static HybridSecondaryUsageDetected Passive { get; } = new HybridSecondaryUsageDetected(PassiveValue); + /// Determines if two values are the same. + public static bool operator ==(HybridSecondaryUsageDetected left, HybridSecondaryUsageDetected right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(HybridSecondaryUsageDetected left, HybridSecondaryUsageDetected right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator HybridSecondaryUsageDetected(string value) => new HybridSecondaryUsageDetected(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is HybridSecondaryUsageDetected other && Equals(other); + /// + public bool Equals(HybridSecondaryUsageDetected other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/InstanceRole.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/InstanceRole.cs new file mode 100644 index 000000000000..948117b5c9bc --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/InstanceRole.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.Sql.Models +{ + /// New role of managed instance in a distributed availability group, can be Primary or Secondary. + public readonly partial struct InstanceRole : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public InstanceRole(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PrimaryValue = "Primary"; + private const string SecondaryValue = "Secondary"; + + /// Primary. + public static InstanceRole Primary { get; } = new InstanceRole(PrimaryValue); + /// Secondary. + public static InstanceRole Secondary { get; } = new InstanceRole(SecondaryValue); + /// Determines if two values are the same. + public static bool operator ==(InstanceRole left, InstanceRole right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(InstanceRole left, InstanceRole right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator InstanceRole(string value) => new InstanceRole(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is InstanceRole other && Equals(other); + /// + public bool Equals(InstanceRole other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/LinkRole.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/LinkRole.cs new file mode 100644 index 000000000000..7c8ec044f2e3 --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/LinkRole.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.Sql.Models +{ + /// SQL server side link role. + public readonly partial struct LinkRole : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public LinkRole(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PrimaryValue = "Primary"; + private const string SecondaryValue = "Secondary"; + + /// Primary. + public static LinkRole Primary { get; } = new LinkRole(PrimaryValue); + /// Secondary. + public static LinkRole Secondary { get; } = new LinkRole(SecondaryValue); + /// Determines if two values are the same. + public static bool operator ==(LinkRole left, LinkRole right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(LinkRole left, LinkRole right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator LinkRole(string value) => new LinkRole(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is LinkRole other && Equals(other); + /// + public bool Equals(LinkRole other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ManagedInstanceDatabaseFormat.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ManagedInstanceDatabaseFormat.cs new file mode 100644 index 000000000000..37cf7b0d49ee --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ManagedInstanceDatabaseFormat.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.Sql.Models +{ + /// Specifies the internal format of instance databases specific to the SQL engine version. + public readonly partial struct ManagedInstanceDatabaseFormat : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ManagedInstanceDatabaseFormat(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AlwaysUpToDateValue = "AlwaysUpToDate"; + private const string SqlServer2022Value = "SQLServer2022"; + + /// AlwaysUpToDate. + public static ManagedInstanceDatabaseFormat AlwaysUpToDate { get; } = new ManagedInstanceDatabaseFormat(AlwaysUpToDateValue); + /// SQLServer2022. + public static ManagedInstanceDatabaseFormat SqlServer2022 { get; } = new ManagedInstanceDatabaseFormat(SqlServer2022Value); + /// Determines if two values are the same. + public static bool operator ==(ManagedInstanceDatabaseFormat left, ManagedInstanceDatabaseFormat right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ManagedInstanceDatabaseFormat left, ManagedInstanceDatabaseFormat right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ManagedInstanceDatabaseFormat(string value) => new ManagedInstanceDatabaseFormat(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ManagedInstanceDatabaseFormat other && Equals(other); + /// + public bool Equals(ManagedInstanceDatabaseFormat other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ManagedInstancePatch.Serialization.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ManagedInstancePatch.Serialization.cs index 72312d513e1e..f06c96bc7809 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ManagedInstancePatch.Serialization.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ManagedInstancePatch.Serialization.cs @@ -66,6 +66,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr writer.WritePropertyName("fullyQualifiedDomainName"u8); writer.WriteStringValue(FullyQualifiedDomainName); } + if (Optional.IsDefined(IsGeneralPurposeV2)) + { + writer.WritePropertyName("isGeneralPurposeV2"u8); + writer.WriteBooleanValue(IsGeneralPurposeV2.Value); + } if (Optional.IsDefined(AdministratorLogin)) { writer.WritePropertyName("administratorLogin"u8); @@ -91,6 +96,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr writer.WritePropertyName("licenseType"u8); writer.WriteStringValue(LicenseType.Value.ToString()); } + if (Optional.IsDefined(HybridSecondaryUsage)) + { + writer.WritePropertyName("hybridSecondaryUsage"u8); + writer.WriteStringValue(HybridSecondaryUsage.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(HybridSecondaryUsageDetected)) + { + writer.WritePropertyName("hybridSecondaryUsageDetected"u8); + writer.WriteStringValue(HybridSecondaryUsageDetected.Value.ToString()); + } if (Optional.IsDefined(VCores)) { writer.WritePropertyName("vCores"u8); @@ -101,6 +116,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr writer.WritePropertyName("storageSizeInGB"u8); writer.WriteNumberValue(StorageSizeInGB.Value); } + if (Optional.IsDefined(StorageIOps)) + { + writer.WritePropertyName("storageIOps"u8); + writer.WriteNumberValue(StorageIOps.Value); + } + if (Optional.IsDefined(StorageThroughputMBps)) + { + writer.WritePropertyName("storageThroughputMBps"u8); + writer.WriteNumberValue(StorageThroughputMBps.Value); + } if (Optional.IsDefined(Collation)) { writer.WritePropertyName("collation"u8); @@ -201,6 +226,36 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr writer.WritePropertyName("servicePrincipal"u8); writer.WriteObjectValue(ServicePrincipal, options); } + if (options.Format != "W" && Optional.IsDefined(VirtualClusterId)) + { + writer.WritePropertyName("virtualClusterId"u8); + writer.WriteStringValue(VirtualClusterId); + } + if (options.Format != "W" && Optional.IsDefined(ExternalGovernanceStatus)) + { + writer.WritePropertyName("externalGovernanceStatus"u8); + writer.WriteStringValue(ExternalGovernanceStatus.Value.ToString()); + } + if (Optional.IsDefined(PricingModel)) + { + writer.WritePropertyName("pricingModel"u8); + writer.WriteStringValue(PricingModel.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(CreateOn)) + { + writer.WritePropertyName("createTime"u8); + writer.WriteStringValue(CreateOn.Value, "O"); + } + if (Optional.IsDefined(AuthenticationMetadata)) + { + writer.WritePropertyName("authenticationMetadata"u8); + writer.WriteStringValue(AuthenticationMetadata.Value.ToString()); + } + if (Optional.IsDefined(DatabaseFormat)) + { + writer.WritePropertyName("databaseFormat"u8); + writer.WriteStringValue(DatabaseFormat.Value.ToString()); + } writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -243,16 +298,21 @@ internal static ManagedInstancePatch DeserializeManagedInstancePatch(JsonElement SqlSku sku = default; ManagedServiceIdentity identity = default; IDictionary tags = default; - ManagedInstancePropertiesProvisioningState? provisioningState = default; + JobExecutionProvisioningState? provisioningState = default; ManagedServerCreateMode? managedInstanceCreateMode = default; string fullyQualifiedDomainName = default; + bool? isGeneralPurposeV2 = default; string administratorLogin = default; string administratorLoginPassword = default; ResourceIdentifier subnetId = default; string state = default; ManagedInstanceLicenseType? licenseType = default; + HybridSecondaryUsage? hybridSecondaryUsage = default; + HybridSecondaryUsageDetected? hybridSecondaryUsageDetected = default; int? vCores = default; int? storageSizeInGB = default; + int? storageIOps = default; + int? storageThroughputMBps = default; string collation = default; string dnsZone = default; ResourceIdentifier dnsZonePartner = default; @@ -272,6 +332,12 @@ internal static ManagedInstancePatch DeserializeManagedInstancePatch(JsonElement Uri keyId = default; ManagedInstanceExternalAdministrator administrators = default; SqlServicePrincipal servicePrincipal = default; + string virtualClusterId = default; + ExternalGovernanceStatus? externalGovernanceStatus = default; + FreemiumType? pricingModel = default; + DateTimeOffset? createTime = default; + AuthMetadataLookupMode? authenticationMetadata = default; + ManagedInstanceDatabaseFormat? databaseFormat = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -324,7 +390,7 @@ internal static ManagedInstancePatch DeserializeManagedInstancePatch(JsonElement { continue; } - provisioningState = new ManagedInstancePropertiesProvisioningState(property0.Value.GetString()); + provisioningState = new JobExecutionProvisioningState(property0.Value.GetString()); continue; } if (property0.NameEquals("managedInstanceCreateMode"u8)) @@ -341,6 +407,15 @@ internal static ManagedInstancePatch DeserializeManagedInstancePatch(JsonElement fullyQualifiedDomainName = property0.Value.GetString(); continue; } + if (property0.NameEquals("isGeneralPurposeV2"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isGeneralPurposeV2 = property0.Value.GetBoolean(); + continue; + } if (property0.NameEquals("administratorLogin"u8)) { administratorLogin = property0.Value.GetString(); @@ -374,6 +449,24 @@ internal static ManagedInstancePatch DeserializeManagedInstancePatch(JsonElement licenseType = new ManagedInstanceLicenseType(property0.Value.GetString()); continue; } + if (property0.NameEquals("hybridSecondaryUsage"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + hybridSecondaryUsage = new HybridSecondaryUsage(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("hybridSecondaryUsageDetected"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + hybridSecondaryUsageDetected = new HybridSecondaryUsageDetected(property0.Value.GetString()); + continue; + } if (property0.NameEquals("vCores"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -392,6 +485,24 @@ internal static ManagedInstancePatch DeserializeManagedInstancePatch(JsonElement storageSizeInGB = property0.Value.GetInt32(); continue; } + if (property0.NameEquals("storageIOps"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageIOps = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("storageThroughputMBps"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageThroughputMBps = property0.Value.GetInt32(); + continue; + } if (property0.NameEquals("collation"u8)) { collation = property0.Value.GetString(); @@ -552,6 +663,56 @@ internal static ManagedInstancePatch DeserializeManagedInstancePatch(JsonElement servicePrincipal = SqlServicePrincipal.DeserializeSqlServicePrincipal(property0.Value, options); continue; } + if (property0.NameEquals("virtualClusterId"u8)) + { + virtualClusterId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("externalGovernanceStatus"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + externalGovernanceStatus = new ExternalGovernanceStatus(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("pricingModel"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + pricingModel = new FreemiumType(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("createTime"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("authenticationMetadata"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authenticationMetadata = new AuthMetadataLookupMode(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("databaseFormat"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + databaseFormat = new ManagedInstanceDatabaseFormat(property0.Value.GetString()); + continue; + } } continue; } @@ -568,13 +729,18 @@ internal static ManagedInstancePatch DeserializeManagedInstancePatch(JsonElement provisioningState, managedInstanceCreateMode, fullyQualifiedDomainName, + isGeneralPurposeV2, administratorLogin, administratorLoginPassword, subnetId, state, licenseType, + hybridSecondaryUsage, + hybridSecondaryUsageDetected, vCores, storageSizeInGB, + storageIOps, + storageThroughputMBps, collation, dnsZone, dnsZonePartner, @@ -594,6 +760,12 @@ internal static ManagedInstancePatch DeserializeManagedInstancePatch(JsonElement keyId, administrators, servicePrincipal, + virtualClusterId, + externalGovernanceStatus, + pricingModel, + createTime, + authenticationMetadata, + databaseFormat, serializedAdditionalRawData); } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ManagedInstancePatch.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ManagedInstancePatch.cs index 4564590e9977..91fb9b3a22a4 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ManagedInstancePatch.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ManagedInstancePatch.cs @@ -58,7 +58,7 @@ public ManagedInstancePatch() /// Managed instance sku. /// Managed instance identity. /// Resource tags. - /// + /// Provisioning state of managed instance. /// /// Specifies the mode of database creation. /// @@ -67,13 +67,18 @@ public ManagedInstancePatch() /// Restore: Creates an instance by restoring a set of backups to specific point in time. RestorePointInTime and SourceManagedInstanceId must be specified. /// /// The fully qualified domain name of the managed instance. + /// Whether or not this is a GPv2 variant of General Purpose edition. /// Administrator username for the managed instance. Can only be specified when the managed instance is being created (and is required for creation). /// The administrator login password (required for managed instance creation). /// Subnet resource ID for the managed instance. /// The state of the managed instance. /// The license type. Possible values are 'LicenseIncluded' (regular price inclusive of a new SQL license) and 'BasePrice' (discounted AHB price for bringing your own SQL licenses). + /// Hybrid secondary usage. Possible values are 'Active' (default value) and 'Passive' (customer uses the secondary as Passive DR). + /// Hybrid secondary usage detected. Possible values are 'Active' (customer does not meet the requirements to use the secondary as Passive DR) and 'Passive' (customer meets the requirements to use the secondary as Passive DR). /// The number of vCores. Allowed values: 8, 16, 24, 32, 40, 64, 80. /// Storage size in GB. Minimum value: 32. Maximum value: 16384. Increments of 32 GB allowed only. Maximum value depends on the selected hardware family and number of vCores. + /// Storage IOps. Minimum value: 300. Maximum value: 80000. Increments of 1 IOps allowed only. Maximum value depends on the selected hardware family and number of vCores. + /// Storage throughput MBps parameter is not supported in the instance create/update operation. /// Collation of the managed instance. /// The Dns Zone that the managed instance is in. /// The resource id of another managed instance whose DNS zone this managed instance will share after creation. @@ -100,8 +105,14 @@ public ManagedInstancePatch() /// A CMK URI of the key to use for encryption. /// The Azure Active Directory administrator of the instance. This can only be used at instance create time. If used for instance update, it will be ignored or it will result in an error. For updates individual APIs will need to be used. /// The managed instance's service principal. + /// Virtual cluster resource id for the Managed Instance. + /// Status of external governance. + /// Weather or not Managed Instance is freemium. + /// Specifies the point in time (ISO8601 format) of the Managed Instance creation. + /// The managed instance's authentication metadata lookup mode. + /// Specifies the internal format of instance databases specific to the SQL engine version. /// Keeps track of any properties unknown to the library. - internal ManagedInstancePatch(SqlSku sku, ManagedServiceIdentity identity, IDictionary tags, ManagedInstancePropertiesProvisioningState? provisioningState, ManagedServerCreateMode? managedInstanceCreateMode, string fullyQualifiedDomainName, string administratorLogin, string administratorLoginPassword, ResourceIdentifier subnetId, string state, ManagedInstanceLicenseType? licenseType, int? vCores, int? storageSizeInGB, string collation, string dnsZone, ResourceIdentifier managedDnsZonePartner, bool? isPublicDataEndpointEnabled, ResourceIdentifier sourceManagedInstanceId, DateTimeOffset? restorePointInTime, ManagedInstanceProxyOverride? proxyOverride, string timezoneId, ResourceIdentifier instancePoolId, ResourceIdentifier maintenanceConfigurationId, IReadOnlyList privateEndpointConnections, string minimalTlsVersion, SqlBackupStorageRedundancy? currentBackupStorageRedundancy, SqlBackupStorageRedundancy? requestedBackupStorageRedundancy, bool? isZoneRedundant, ResourceIdentifier primaryUserAssignedIdentityId, Uri keyId, ManagedInstanceExternalAdministrator administrators, SqlServicePrincipal servicePrincipal, IDictionary serializedAdditionalRawData) + internal ManagedInstancePatch(SqlSku sku, ManagedServiceIdentity identity, IDictionary tags, JobExecutionProvisioningState? provisioningState, ManagedServerCreateMode? managedInstanceCreateMode, string fullyQualifiedDomainName, bool? isGeneralPurposeV2, string administratorLogin, string administratorLoginPassword, ResourceIdentifier subnetId, string state, ManagedInstanceLicenseType? licenseType, HybridSecondaryUsage? hybridSecondaryUsage, HybridSecondaryUsageDetected? hybridSecondaryUsageDetected, int? vCores, int? storageSizeInGB, int? storageIOps, int? storageThroughputMBps, string collation, string dnsZone, ResourceIdentifier managedDnsZonePartner, bool? isPublicDataEndpointEnabled, ResourceIdentifier sourceManagedInstanceId, DateTimeOffset? restorePointInTime, ManagedInstanceProxyOverride? proxyOverride, string timezoneId, ResourceIdentifier instancePoolId, ResourceIdentifier maintenanceConfigurationId, IReadOnlyList privateEndpointConnections, string minimalTlsVersion, SqlBackupStorageRedundancy? currentBackupStorageRedundancy, SqlBackupStorageRedundancy? requestedBackupStorageRedundancy, bool? isZoneRedundant, ResourceIdentifier primaryUserAssignedIdentityId, Uri keyId, ManagedInstanceExternalAdministrator administrators, SqlServicePrincipal servicePrincipal, string virtualClusterId, ExternalGovernanceStatus? externalGovernanceStatus, FreemiumType? pricingModel, DateTimeOffset? createOn, AuthMetadataLookupMode? authenticationMetadata, ManagedInstanceDatabaseFormat? databaseFormat, IDictionary serializedAdditionalRawData) { Sku = sku; Identity = identity; @@ -109,13 +120,18 @@ internal ManagedInstancePatch(SqlSku sku, ManagedServiceIdentity identity, IDict ProvisioningState = provisioningState; ManagedInstanceCreateMode = managedInstanceCreateMode; FullyQualifiedDomainName = fullyQualifiedDomainName; + IsGeneralPurposeV2 = isGeneralPurposeV2; AdministratorLogin = administratorLogin; AdministratorLoginPassword = administratorLoginPassword; SubnetId = subnetId; State = state; LicenseType = licenseType; + HybridSecondaryUsage = hybridSecondaryUsage; + HybridSecondaryUsageDetected = hybridSecondaryUsageDetected; VCores = vCores; StorageSizeInGB = storageSizeInGB; + StorageIOps = storageIOps; + StorageThroughputMBps = storageThroughputMBps; Collation = collation; DnsZone = dnsZone; ManagedDnsZonePartner = managedDnsZonePartner; @@ -135,6 +151,12 @@ internal ManagedInstancePatch(SqlSku sku, ManagedServiceIdentity identity, IDict KeyId = keyId; Administrators = administrators; ServicePrincipal = servicePrincipal; + VirtualClusterId = virtualClusterId; + ExternalGovernanceStatus = externalGovernanceStatus; + PricingModel = pricingModel; + CreateOn = createOn; + AuthenticationMetadata = authenticationMetadata; + DatabaseFormat = databaseFormat; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -147,9 +169,9 @@ internal ManagedInstancePatch(SqlSku sku, ManagedServiceIdentity identity, IDict /// Resource tags. [WirePath("tags")] public IDictionary Tags { get; } - /// Gets the provisioning state. + /// Provisioning state of managed instance. [WirePath("properties.provisioningState")] - public ManagedInstancePropertiesProvisioningState? ProvisioningState { get; } + public JobExecutionProvisioningState? ProvisioningState { get; } /// /// Specifies the mode of database creation. /// @@ -162,6 +184,9 @@ internal ManagedInstancePatch(SqlSku sku, ManagedServiceIdentity identity, IDict /// The fully qualified domain name of the managed instance. [WirePath("properties.fullyQualifiedDomainName")] public string FullyQualifiedDomainName { get; } + /// Whether or not this is a GPv2 variant of General Purpose edition. + [WirePath("properties.isGeneralPurposeV2")] + public bool? IsGeneralPurposeV2 { get; set; } /// Administrator username for the managed instance. Can only be specified when the managed instance is being created (and is required for creation). [WirePath("properties.administratorLogin")] public string AdministratorLogin { get; set; } @@ -177,12 +202,24 @@ internal ManagedInstancePatch(SqlSku sku, ManagedServiceIdentity identity, IDict /// The license type. Possible values are 'LicenseIncluded' (regular price inclusive of a new SQL license) and 'BasePrice' (discounted AHB price for bringing your own SQL licenses). [WirePath("properties.licenseType")] public ManagedInstanceLicenseType? LicenseType { get; set; } + /// Hybrid secondary usage. Possible values are 'Active' (default value) and 'Passive' (customer uses the secondary as Passive DR). + [WirePath("properties.hybridSecondaryUsage")] + public HybridSecondaryUsage? HybridSecondaryUsage { get; set; } + /// Hybrid secondary usage detected. Possible values are 'Active' (customer does not meet the requirements to use the secondary as Passive DR) and 'Passive' (customer meets the requirements to use the secondary as Passive DR). + [WirePath("properties.hybridSecondaryUsageDetected")] + public HybridSecondaryUsageDetected? HybridSecondaryUsageDetected { get; } /// The number of vCores. Allowed values: 8, 16, 24, 32, 40, 64, 80. [WirePath("properties.vCores")] public int? VCores { get; set; } /// Storage size in GB. Minimum value: 32. Maximum value: 16384. Increments of 32 GB allowed only. Maximum value depends on the selected hardware family and number of vCores. [WirePath("properties.storageSizeInGB")] public int? StorageSizeInGB { get; set; } + /// Storage IOps. Minimum value: 300. Maximum value: 80000. Increments of 1 IOps allowed only. Maximum value depends on the selected hardware family and number of vCores. + [WirePath("properties.storageIOps")] + public int? StorageIOps { get; set; } + /// Storage throughput MBps parameter is not supported in the instance create/update operation. + [WirePath("properties.storageThroughputMBps")] + public int? StorageThroughputMBps { get; set; } /// Collation of the managed instance. [WirePath("properties.collation")] public string Collation { get; set; } @@ -247,5 +284,23 @@ internal ManagedInstancePatch(SqlSku sku, ManagedServiceIdentity identity, IDict /// The managed instance's service principal. [WirePath("properties.servicePrincipal")] public SqlServicePrincipal ServicePrincipal { get; set; } + /// Virtual cluster resource id for the Managed Instance. + [WirePath("properties.virtualClusterId")] + public string VirtualClusterId { get; } + /// Status of external governance. + [WirePath("properties.externalGovernanceStatus")] + public ExternalGovernanceStatus? ExternalGovernanceStatus { get; } + /// Weather or not Managed Instance is freemium. + [WirePath("properties.pricingModel")] + public FreemiumType? PricingModel { get; set; } + /// Specifies the point in time (ISO8601 format) of the Managed Instance creation. + [WirePath("properties.createTime")] + public DateTimeOffset? CreateOn { get; } + /// The managed instance's authentication metadata lookup mode. + [WirePath("properties.authenticationMetadata")] + public AuthMetadataLookupMode? AuthenticationMetadata { get; set; } + /// Specifies the internal format of instance databases specific to the SQL engine version. + [WirePath("properties.databaseFormat")] + public ManagedInstanceDatabaseFormat? DatabaseFormat { get; set; } } } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ManagedInstancePropertiesProvisioningState.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ManagedInstancePropertiesProvisioningState.cs deleted file mode 100644 index 4e611e194278..000000000000 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ManagedInstancePropertiesProvisioningState.cs +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.Sql.Models -{ - /// The ManagedInstancePropertiesProvisioningState. - public readonly partial struct ManagedInstancePropertiesProvisioningState : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ManagedInstancePropertiesProvisioningState(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string CreatingValue = "Creating"; - private const string DeletingValue = "Deleting"; - private const string UpdatingValue = "Updating"; - private const string UnknownValue = "Unknown"; - private const string SucceededValue = "Succeeded"; - private const string FailedValue = "Failed"; - private const string AcceptedValue = "Accepted"; - private const string CreatedValue = "Created"; - private const string DeletedValue = "Deleted"; - private const string UnrecognizedValue = "Unrecognized"; - private const string RunningValue = "Running"; - private const string CanceledValue = "Canceled"; - private const string NotSpecifiedValue = "NotSpecified"; - private const string RegisteringValue = "Registering"; - private const string TimedOutValue = "TimedOut"; - - /// Creating. - public static ManagedInstancePropertiesProvisioningState Creating { get; } = new ManagedInstancePropertiesProvisioningState(CreatingValue); - /// Deleting. - public static ManagedInstancePropertiesProvisioningState Deleting { get; } = new ManagedInstancePropertiesProvisioningState(DeletingValue); - /// Updating. - public static ManagedInstancePropertiesProvisioningState Updating { get; } = new ManagedInstancePropertiesProvisioningState(UpdatingValue); - /// Unknown. - public static ManagedInstancePropertiesProvisioningState Unknown { get; } = new ManagedInstancePropertiesProvisioningState(UnknownValue); - /// Succeeded. - public static ManagedInstancePropertiesProvisioningState Succeeded { get; } = new ManagedInstancePropertiesProvisioningState(SucceededValue); - /// Failed. - public static ManagedInstancePropertiesProvisioningState Failed { get; } = new ManagedInstancePropertiesProvisioningState(FailedValue); - /// Accepted. - public static ManagedInstancePropertiesProvisioningState Accepted { get; } = new ManagedInstancePropertiesProvisioningState(AcceptedValue); - /// Created. - public static ManagedInstancePropertiesProvisioningState Created { get; } = new ManagedInstancePropertiesProvisioningState(CreatedValue); - /// Deleted. - public static ManagedInstancePropertiesProvisioningState Deleted { get; } = new ManagedInstancePropertiesProvisioningState(DeletedValue); - /// Unrecognized. - public static ManagedInstancePropertiesProvisioningState Unrecognized { get; } = new ManagedInstancePropertiesProvisioningState(UnrecognizedValue); - /// Running. - public static ManagedInstancePropertiesProvisioningState Running { get; } = new ManagedInstancePropertiesProvisioningState(RunningValue); - /// Canceled. - public static ManagedInstancePropertiesProvisioningState Canceled { get; } = new ManagedInstancePropertiesProvisioningState(CanceledValue); - /// NotSpecified. - public static ManagedInstancePropertiesProvisioningState NotSpecified { get; } = new ManagedInstancePropertiesProvisioningState(NotSpecifiedValue); - /// Registering. - public static ManagedInstancePropertiesProvisioningState Registering { get; } = new ManagedInstancePropertiesProvisioningState(RegisteringValue); - /// TimedOut. - public static ManagedInstancePropertiesProvisioningState TimedOut { get; } = new ManagedInstancePropertiesProvisioningState(TimedOutValue); - /// Determines if two values are the same. - public static bool operator ==(ManagedInstancePropertiesProvisioningState left, ManagedInstancePropertiesProvisioningState right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ManagedInstancePropertiesProvisioningState left, ManagedInstancePropertiesProvisioningState right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ManagedInstancePropertiesProvisioningState(string value) => new ManagedInstancePropertiesProvisioningState(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ManagedInstancePropertiesProvisioningState other && Equals(other); - /// - public bool Equals(ManagedInstancePropertiesProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/Phase.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/Phase.cs new file mode 100644 index 000000000000..0eff4e631a3f --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/Phase.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Sql.Models +{ + /// The operation phase. + public readonly partial struct Phase : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public Phase(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CopyingValue = "Copying"; + private const string CatchupValue = "Catchup"; + private const string WaitingForCutoverValue = "WaitingForCutover"; + private const string CutoverInProgressValue = "CutoverInProgress"; + + /// Copying. + public static Phase Copying { get; } = new Phase(CopyingValue); + /// Catchup. + public static Phase Catchup { get; } = new Phase(CatchupValue); + /// WaitingForCutover. + public static Phase WaitingForCutover { get; } = new Phase(WaitingForCutoverValue); + /// CutoverInProgress. + public static Phase CutoverInProgress { get; } = new Phase(CutoverInProgressValue); + /// Determines if two values are the same. + public static bool operator ==(Phase left, Phase right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(Phase left, Phase right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator Phase(string value) => new Phase(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is Phase other && Equals(other); + /// + public bool Equals(Phase other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/PhaseDetails.Serialization.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/PhaseDetails.Serialization.cs new file mode 100644 index 000000000000..75adbde44ca3 --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/PhaseDetails.Serialization.cs @@ -0,0 +1,223 @@ +// 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.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Sql.Models +{ + public partial class PhaseDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PhaseDetails)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(Phase)) + { + writer.WritePropertyName("phase"u8); + writer.WriteStringValue(Phase.Value.ToString()); + } + if (options.Format != "W" && Optional.IsCollectionDefined(PhaseInformation)) + { + writer.WritePropertyName("phaseInformation"u8); + writer.WriteStartObject(); + foreach (var item in PhaseInformation) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + 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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + PhaseDetails 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(PhaseDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePhaseDetails(document.RootElement, options); + } + + internal static PhaseDetails DeserializePhaseDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Phase? phase = default; + IReadOnlyDictionary phaseInformation = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("phase"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + phase = new Phase(property.Value.GetString()); + continue; + } + if (property.NameEquals("phaseInformation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + phaseInformation = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PhaseDetails(phase, phaseInformation ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Phase), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" phase: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Phase)) + { + builder.Append(" phase: "); + builder.AppendLine($"'{Phase.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PhaseInformation), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" phaseInformation: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(PhaseInformation)) + { + if (PhaseInformation.Any()) + { + builder.Append(" phaseInformation: "); + builder.AppendLine("{"); + foreach (var item in PhaseInformation) + { + builder.Append($" '{item.Key}': "); + if (item.Value == null) + { + builder.Append("null"); + continue; + } + if (item.Value.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{item.Value}'''"); + } + else + { + builder.AppendLine($"'{item.Value}'"); + } + } + builder.AppendLine(" }"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + 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); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(PhaseDetails)} does not support writing '{options.Format}' format."); + } + } + + PhaseDetails 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); + return DeserializePhaseDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PhaseDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/PhaseDetails.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/PhaseDetails.cs new file mode 100644 index 000000000000..fff23013fece --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/PhaseDetails.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.Sql.Models +{ + /// The phase details properties of a database operation. + public partial class PhaseDetails + { + /// + /// 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 . + internal PhaseDetails() + { + PhaseInformation = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The operation phase. + /// The operation phase information. + /// Keeps track of any properties unknown to the library. + internal PhaseDetails(Phase? phase, IReadOnlyDictionary phaseInformation, IDictionary serializedAdditionalRawData) + { + Phase = phase; + PhaseInformation = phaseInformation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The operation phase. + [WirePath("phase")] + public Phase? Phase { get; } + /// The operation phase information. + [WirePath("phaseInformation")] + public IReadOnlyDictionary PhaseInformation { get; } + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/QueryMetricIntervalAutoGenerated.Serialization.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/QueryMetricIntervalAutoGenerated.Serialization.cs new file mode 100644 index 000000000000..1baad1f8cffb --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/QueryMetricIntervalAutoGenerated.Serialization.cs @@ -0,0 +1,272 @@ +// 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.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Sql.Models +{ + public partial class QueryMetricIntervalAutoGenerated : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(QueryMetricIntervalAutoGenerated)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(IntervalStartTime)) + { + writer.WritePropertyName("intervalStartTime"u8); + writer.WriteStringValue(IntervalStartTime); + } + if (options.Format != "W" && Optional.IsDefined(IntervalType)) + { + writer.WritePropertyName("intervalType"u8); + writer.WriteStringValue(IntervalType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ExecutionCount)) + { + writer.WritePropertyName("executionCount"u8); + writer.WriteNumberValue(ExecutionCount.Value); + } + if (Optional.IsCollectionDefined(Metrics)) + { + writer.WritePropertyName("metrics"u8); + writer.WriteStartArray(); + foreach (var item in Metrics) + { + 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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + QueryMetricIntervalAutoGenerated 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(QueryMetricIntervalAutoGenerated)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeQueryMetricIntervalAutoGenerated(document.RootElement, options); + } + + internal static QueryMetricIntervalAutoGenerated DeserializeQueryMetricIntervalAutoGenerated(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string intervalStartTime = default; + QueryTimeGrainType? intervalType = default; + long? executionCount = default; + IReadOnlyList metrics = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("intervalStartTime"u8)) + { + intervalStartTime = property.Value.GetString(); + continue; + } + if (property.NameEquals("intervalType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + intervalType = new QueryTimeGrainType(property.Value.GetString()); + continue; + } + if (property.NameEquals("executionCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + executionCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("metrics"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(QueryMetricProperties.DeserializeQueryMetricProperties(item, options)); + } + metrics = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new QueryMetricIntervalAutoGenerated(intervalStartTime, intervalType, executionCount, metrics ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IntervalStartTime), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" intervalStartTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IntervalStartTime)) + { + builder.Append(" intervalStartTime: "); + if (IntervalStartTime.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{IntervalStartTime}'''"); + } + else + { + builder.AppendLine($"'{IntervalStartTime}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IntervalType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" intervalType: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IntervalType)) + { + builder.Append(" intervalType: "); + builder.AppendLine($"'{IntervalType.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ExecutionCount), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" executionCount: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ExecutionCount)) + { + builder.Append(" executionCount: "); + builder.AppendLine($"'{ExecutionCount.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Metrics), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" metrics: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Metrics)) + { + if (Metrics.Any()) + { + builder.Append(" metrics: "); + builder.AppendLine("["); + foreach (var item in Metrics) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " metrics: "); + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + 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); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(QueryMetricIntervalAutoGenerated)} does not support writing '{options.Format}' format."); + } + } + + QueryMetricIntervalAutoGenerated 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); + return DeserializeQueryMetricIntervalAutoGenerated(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(QueryMetricIntervalAutoGenerated)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/QueryMetricIntervalAutoGenerated.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/QueryMetricIntervalAutoGenerated.cs new file mode 100644 index 000000000000..8bb7b0c61145 --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/QueryMetricIntervalAutoGenerated.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.Sql.Models +{ + /// Properties of a query metrics interval. + public partial class QueryMetricIntervalAutoGenerated + { + /// + /// 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 . + internal QueryMetricIntervalAutoGenerated() + { + Metrics = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The start time for the metric interval (ISO-8601 format). + /// Interval type (length). + /// Execution count of a query in this interval. + /// List of metric objects for this interval. + /// Keeps track of any properties unknown to the library. + internal QueryMetricIntervalAutoGenerated(string intervalStartTime, QueryTimeGrainType? intervalType, long? executionCount, IReadOnlyList metrics, IDictionary serializedAdditionalRawData) + { + IntervalStartTime = intervalStartTime; + IntervalType = intervalType; + ExecutionCount = executionCount; + Metrics = metrics; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The start time for the metric interval (ISO-8601 format). + [WirePath("intervalStartTime")] + public string IntervalStartTime { get; } + /// Interval type (length). + [WirePath("intervalType")] + public QueryTimeGrainType? IntervalType { get; } + /// Execution count of a query in this interval. + [WirePath("executionCount")] + public long? ExecutionCount { get; } + /// List of metric objects for this interval. + [WirePath("metrics")] + public IReadOnlyList Metrics { get; } + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/QueryStatisticsProperties.Serialization.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/QueryStatisticsProperties.Serialization.cs index 0c874d0f206b..52964aef5ace 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/QueryStatisticsProperties.Serialization.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/QueryStatisticsProperties.Serialization.cs @@ -100,7 +100,7 @@ internal static QueryStatisticsProperties DeserializeQueryStatisticsProperties(J string queryId = default; string startTime = default; string endTime = default; - IReadOnlyList intervals = default; + IReadOnlyList intervals = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -131,10 +131,10 @@ internal static QueryStatisticsProperties DeserializeQueryStatisticsProperties(J { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(QueryMetricInterval.DeserializeQueryMetricInterval(item, options)); + array.Add(QueryMetricIntervalAutoGenerated.DeserializeQueryMetricIntervalAutoGenerated(item, options)); } intervals = array; continue; @@ -150,7 +150,7 @@ internal static QueryStatisticsProperties DeserializeQueryStatisticsProperties(J queryId, startTime, endTime, - intervals ?? new ChangeTrackingList(), + intervals ?? new ChangeTrackingList(), serializedAdditionalRawData); } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/QueryStatisticsProperties.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/QueryStatisticsProperties.cs index a1aa5a92e4ac..47d8cb2d46a2 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/QueryStatisticsProperties.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/QueryStatisticsProperties.cs @@ -48,7 +48,7 @@ public partial class QueryStatisticsProperties /// Initializes a new instance of . internal QueryStatisticsProperties() { - Intervals = new ChangeTrackingList(); + Intervals = new ChangeTrackingList(); } /// Initializes a new instance of . @@ -58,7 +58,7 @@ internal QueryStatisticsProperties() /// The end time for the metric (ISO-8601 format). /// List of intervals with appropriate metric data. /// Keeps track of any properties unknown to the library. - internal QueryStatisticsProperties(string databaseName, string queryId, string startTime, string endTime, IReadOnlyList intervals, IDictionary serializedAdditionalRawData) + internal QueryStatisticsProperties(string databaseName, string queryId, string startTime, string endTime, IReadOnlyList intervals, IDictionary serializedAdditionalRawData) { DatabaseName = databaseName; QueryId = queryId; @@ -82,6 +82,6 @@ internal QueryStatisticsProperties(string databaseName, string queryId, string s public string EndTime { get; } /// List of intervals with appropriate metric data. [WirePath("intervals")] - public IReadOnlyList Intervals { get; } + public IReadOnlyList Intervals { get; } } } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/RefreshExternalGovernanceStatusOperationResultMI.Serialization.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/RefreshExternalGovernanceStatusOperationResultMI.Serialization.cs new file mode 100644 index 000000000000..f40abc5fe4fa --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/RefreshExternalGovernanceStatusOperationResultMI.Serialization.cs @@ -0,0 +1,460 @@ +// 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; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Sql.Models +{ + public partial class RefreshExternalGovernanceStatusOperationResultMI : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RefreshExternalGovernanceStatusOperationResultMI)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W") + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W") + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ResourceType); + } + if (options.Format != "W" && Optional.IsDefined(SystemData)) + { + writer.WritePropertyName("systemData"u8); + JsonSerializer.Serialize(writer, SystemData); + } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(RequestId)) + { + writer.WritePropertyName("requestId"u8); + writer.WriteStringValue(RequestId.Value); + } + if (options.Format != "W" && Optional.IsDefined(RequestType)) + { + writer.WritePropertyName("requestType"u8); + writer.WriteStringValue(RequestType); + } + if (options.Format != "W" && Optional.IsDefined(QueuedTime)) + { + writer.WritePropertyName("queuedTime"u8); + writer.WriteStringValue(QueuedTime); + } + if (options.Format != "W" && Optional.IsDefined(ManagedInstanceName)) + { + writer.WritePropertyName("managedInstanceName"u8); + writer.WriteStringValue(ManagedInstanceName); + } + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status); + } + if (options.Format != "W" && Optional.IsDefined(ErrorMessage)) + { + writer.WritePropertyName("errorMessage"u8); + writer.WriteStringValue(ErrorMessage); + } + writer.WriteEndObject(); + 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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RefreshExternalGovernanceStatusOperationResultMI 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(RefreshExternalGovernanceStatusOperationResultMI)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRefreshExternalGovernanceStatusOperationResultMI(document.RootElement, options); + } + + internal static RefreshExternalGovernanceStatusOperationResultMI DeserializeRefreshExternalGovernanceStatusOperationResultMI(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + Guid? requestId = default; + string requestType = default; + string queuedTime = default; + string managedInstanceName = default; + string status = default; + string errorMessage = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + 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 (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("requestId"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + requestId = property0.Value.GetGuid(); + continue; + } + if (property0.NameEquals("requestType"u8)) + { + requestType = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("queuedTime"u8)) + { + queuedTime = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("managedInstanceName"u8)) + { + managedInstanceName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("status"u8)) + { + status = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("errorMessage"u8)) + { + errorMessage = property0.Value.GetString(); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RefreshExternalGovernanceStatusOperationResultMI( + id, + name, + type, + systemData, + requestId, + requestType, + queuedTime, + managedInstanceName, + status, + errorMessage, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RequestId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" requestId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(RequestId)) + { + builder.Append(" requestId: "); + builder.AppendLine($"'{RequestId.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RequestType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" requestType: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(RequestType)) + { + builder.Append(" requestType: "); + if (RequestType.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{RequestType}'''"); + } + else + { + builder.AppendLine($"'{RequestType}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(QueuedTime), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" queuedTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(QueuedTime)) + { + builder.Append(" queuedTime: "); + if (QueuedTime.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{QueuedTime}'''"); + } + else + { + builder.AppendLine($"'{QueuedTime}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ManagedInstanceName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" managedInstanceName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ManagedInstanceName)) + { + builder.Append(" managedInstanceName: "); + if (ManagedInstanceName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ManagedInstanceName}'''"); + } + else + { + builder.AppendLine($"'{ManagedInstanceName}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Status), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" status: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Status)) + { + builder.Append(" status: "); + if (Status.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Status}'''"); + } + else + { + builder.AppendLine($"'{Status}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ErrorMessage), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" errorMessage: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ErrorMessage)) + { + builder.Append(" errorMessage: "); + if (ErrorMessage.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ErrorMessage}'''"); + } + else + { + builder.AppendLine($"'{ErrorMessage}'"); + } + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + 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); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(RefreshExternalGovernanceStatusOperationResultMI)} does not support writing '{options.Format}' format."); + } + } + + RefreshExternalGovernanceStatusOperationResultMI 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); + return DeserializeRefreshExternalGovernanceStatusOperationResultMI(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RefreshExternalGovernanceStatusOperationResultMI)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/RefreshExternalGovernanceStatusOperationResultMI.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/RefreshExternalGovernanceStatusOperationResultMI.cs new file mode 100644 index 000000000000..79a5ba84b6bc --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/RefreshExternalGovernanceStatusOperationResultMI.cs @@ -0,0 +1,97 @@ +// 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; + +namespace Azure.ResourceManager.Sql.Models +{ + /// An RefreshExternalGovernanceStatus operation result resource. + public partial class RefreshExternalGovernanceStatusOperationResultMI : 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 RefreshExternalGovernanceStatusOperationResultMI() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Request Id. + /// Request type. + /// Queued time. + /// Managed instance name. + /// Operation status. + /// Error message. + /// Keeps track of any properties unknown to the library. + internal RefreshExternalGovernanceStatusOperationResultMI(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, Guid? requestId, string requestType, string queuedTime, string managedInstanceName, string status, string errorMessage, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + RequestId = requestId; + RequestType = requestType; + QueuedTime = queuedTime; + ManagedInstanceName = managedInstanceName; + Status = status; + ErrorMessage = errorMessage; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Request Id. + [WirePath("properties.requestId")] + public Guid? RequestId { get; } + /// Request type. + [WirePath("properties.requestType")] + public string RequestType { get; } + /// Queued time. + [WirePath("properties.queuedTime")] + public string QueuedTime { get; } + /// Managed instance name. + [WirePath("properties.managedInstanceName")] + public string ManagedInstanceName { get; } + /// Operation status. + [WirePath("properties.status")] + public string Status { get; } + /// Error message. + [WirePath("properties.errorMessage")] + public string ErrorMessage { get; } + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ReplicaConnectedState.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ReplicaConnectedState.cs new file mode 100644 index 000000000000..1881e60c7a05 --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ReplicaConnectedState.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.Sql.Models +{ + /// Link connected state. + public readonly partial struct ReplicaConnectedState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ReplicaConnectedState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DisconnectedValue = "DISCONNECTED"; + private const string ConnectedValue = "CONNECTED"; + + /// DISCONNECTED. + public static ReplicaConnectedState Disconnected { get; } = new ReplicaConnectedState(DisconnectedValue); + /// CONNECTED. + public static ReplicaConnectedState Connected { get; } = new ReplicaConnectedState(ConnectedValue); + /// Determines if two values are the same. + public static bool operator ==(ReplicaConnectedState left, ReplicaConnectedState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ReplicaConnectedState left, ReplicaConnectedState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ReplicaConnectedState(string value) => new ReplicaConnectedState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ReplicaConnectedState other && Equals(other); + /// + public bool Equals(ReplicaConnectedState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ReplicaSynchronizationHealth.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ReplicaSynchronizationHealth.cs new file mode 100644 index 000000000000..6a5b84619bc0 --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ReplicaSynchronizationHealth.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Sql.Models +{ + /// Link health state. + public readonly partial struct ReplicaSynchronizationHealth : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ReplicaSynchronizationHealth(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NOTHealthyValue = "NOT_HEALTHY"; + private const string PartiallyHealthyValue = "PARTIALLY_HEALTHY"; + private const string HealthyValue = "HEALTHY"; + + /// NOT_HEALTHY. + public static ReplicaSynchronizationHealth NOTHealthy { get; } = new ReplicaSynchronizationHealth(NOTHealthyValue); + /// PARTIALLY_HEALTHY. + public static ReplicaSynchronizationHealth PartiallyHealthy { get; } = new ReplicaSynchronizationHealth(PartiallyHealthyValue); + /// HEALTHY. + public static ReplicaSynchronizationHealth Healthy { get; } = new ReplicaSynchronizationHealth(HealthyValue); + /// Determines if two values are the same. + public static bool operator ==(ReplicaSynchronizationHealth left, ReplicaSynchronizationHealth right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ReplicaSynchronizationHealth left, ReplicaSynchronizationHealth right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ReplicaSynchronizationHealth(string value) => new ReplicaSynchronizationHealth(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ReplicaSynchronizationHealth other && Equals(other); + /// + public bool Equals(ReplicaSynchronizationHealth other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ReplicationLinkType.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ReplicationLinkType.cs index 7d00892ac180..669023e6166a 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ReplicationLinkType.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ReplicationLinkType.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Sql.Models { - /// Link type (GEO, NAMED, STANDBY). + /// Link type (GEO, NAMED, STANDBY). Update operation does not support NAMED. public readonly partial struct ReplicationLinkType : IEquatable { private readonly string _value; diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ReplicationModeType.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ReplicationModeType.cs new file mode 100644 index 000000000000..f1c86a360212 --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ReplicationModeType.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.Sql.Models +{ + /// Replication mode of the link. + public readonly partial struct ReplicationModeType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ReplicationModeType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AsyncValue = "Async"; + private const string SyncValue = "Sync"; + + /// Async. + public static ReplicationModeType Async { get; } = new ReplicationModeType(AsyncValue); + /// Sync. + public static ReplicationModeType Sync { get; } = new ReplicationModeType(SyncValue); + /// Determines if two values are the same. + public static bool operator ==(ReplicationModeType left, ReplicationModeType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ReplicationModeType left, ReplicationModeType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ReplicationModeType(string value) => new ReplicationModeType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ReplicationModeType other && Equals(other); + /// + public bool Equals(ReplicationModeType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/RoleChangeType.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/RoleChangeType.cs new file mode 100644 index 000000000000..d90dcaea02b8 --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/RoleChangeType.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.Sql.Models +{ + /// The type of the role change, can be Planned or Forced. + public readonly partial struct RoleChangeType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public RoleChangeType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ForcedValue = "Forced"; + private const string PlannedValue = "Planned"; + + /// Forced. + public static RoleChangeType Forced { get; } = new RoleChangeType(ForcedValue); + /// Planned. + public static RoleChangeType Planned { get; } = new RoleChangeType(PlannedValue); + /// Determines if two values are the same. + public static bool operator ==(RoleChangeType left, RoleChangeType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(RoleChangeType left, RoleChangeType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator RoleChangeType(string value) => new RoleChangeType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is RoleChangeType other && Equals(other); + /// + public bool Equals(RoleChangeType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SeedingModeType.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SeedingModeType.cs new file mode 100644 index 000000000000..9224118da907 --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SeedingModeType.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.Sql.Models +{ + /// Database seeding mode – can be Automatic (default), or Manual for supported scenarios. + public readonly partial struct SeedingModeType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SeedingModeType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AutomaticValue = "Automatic"; + private const string ManualValue = "Manual"; + + /// Automatic. + public static SeedingModeType Automatic { get; } = new SeedingModeType(AutomaticValue); + /// Manual. + public static SeedingModeType Manual { get; } = new SeedingModeType(ManualValue); + /// Determines if two values are the same. + public static bool operator ==(SeedingModeType left, SeedingModeType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SeedingModeType left, SeedingModeType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator SeedingModeType(string value) => new SeedingModeType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SeedingModeType other && Equals(other); + /// + public bool Equals(SeedingModeType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlServerDatabaseReplicationLinkPatch.Serialization.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlServerDatabaseReplicationLinkPatch.Serialization.cs new file mode 100644 index 000000000000..1717ae1153d5 --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlServerDatabaseReplicationLinkPatch.Serialization.cs @@ -0,0 +1,285 @@ +// 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; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Sql.Models +{ + public partial class SqlServerDatabaseReplicationLinkPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SqlServerDatabaseReplicationLinkPatch)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W") + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W") + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ResourceType); + } + if (options.Format != "W" && Optional.IsDefined(SystemData)) + { + writer.WritePropertyName("systemData"u8); + JsonSerializer.Serialize(writer, SystemData); + } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(LinkType)) + { + writer.WritePropertyName("linkType"u8); + writer.WriteStringValue(LinkType.Value.ToString()); + } + writer.WriteEndObject(); + 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)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + SqlServerDatabaseReplicationLinkPatch 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(SqlServerDatabaseReplicationLinkPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSqlServerDatabaseReplicationLinkPatch(document.RootElement, options); + } + + internal static SqlServerDatabaseReplicationLinkPatch DeserializeSqlServerDatabaseReplicationLinkPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + ReplicationLinkType? linkType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + 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 (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("linkType"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + linkType = new ReplicationLinkType(property0.Value.GetString()); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SqlServerDatabaseReplicationLinkPatch( + id, + name, + type, + systemData, + linkType, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LinkType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" linkType: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LinkType)) + { + builder.Append(" linkType: "); + builder.AppendLine($"'{LinkType.Value.ToString()}'"); + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + 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); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(SqlServerDatabaseReplicationLinkPatch)} does not support writing '{options.Format}' format."); + } + } + + SqlServerDatabaseReplicationLinkPatch 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); + return DeserializeSqlServerDatabaseReplicationLinkPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SqlServerDatabaseReplicationLinkPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlServerDatabaseReplicationLinkPatch.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlServerDatabaseReplicationLinkPatch.cs new file mode 100644 index 000000000000..120d6f0bb14a --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlServerDatabaseReplicationLinkPatch.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; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Sql.Models +{ + /// A replication link update request. + public partial class SqlServerDatabaseReplicationLinkPatch : 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 SqlServerDatabaseReplicationLinkPatch() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Link type (GEO, NAMED, STANDBY). Update operation does not support NAMED. + /// Keeps track of any properties unknown to the library. + internal SqlServerDatabaseReplicationLinkPatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ReplicationLinkType? linkType, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + LinkType = linkType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Link type (GEO, NAMED, STANDBY). Update operation does not support NAMED. + [WirePath("properties.linkType")] + public ReplicationLinkType? LinkType { get; set; } + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/DatabaseRestOperations.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/DatabaseRestOperations.cs index 8f8fe82dbe45..eaa109200931 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/DatabaseRestOperations.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/DatabaseRestOperations.cs @@ -32,11 +32,11 @@ public DatabaseRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-02-01-preview"; + _apiVersion = apiVersion ?? "2022-11-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateCancelRequestUri(string subscriptionId, string resourceGroupName, string serverName, string databaseName, Guid operationId) + internal RequestUriBuilder CreateListByDatabaseRequestUri(string subscriptionId, string resourceGroupName, string serverName, string databaseName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -48,18 +48,16 @@ internal RequestUriBuilder CreateCancelRequestUri(string subscriptionId, string uri.AppendPath(serverName, true); uri.AppendPath("/databases/", false); uri.AppendPath(databaseName, true); - uri.AppendPath("/operations/", false); - uri.AppendPath(operationId, true); - uri.AppendPath("/cancel", false); + uri.AppendPath("/operations", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateCancelRequest(string subscriptionId, string resourceGroupName, string serverName, string databaseName, Guid operationId) + internal HttpMessage CreateListByDatabaseRequest(string subscriptionId, string resourceGroupName, string serverName, string databaseName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Post; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -70,70 +68,77 @@ internal HttpMessage CreateCancelRequest(string subscriptionId, string resourceG uri.AppendPath(serverName, true); uri.AppendPath("/databases/", false); uri.AppendPath(databaseName, true); - uri.AppendPath("/operations/", false); - uri.AppendPath(operationId, true); - uri.AppendPath("/cancel", false); + uri.AppendPath("/operations", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; + request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; } - /// Cancels the asynchronous operation on the database. + /// Gets a list of operations performed on the database. /// The subscription ID that identifies an Azure subscription. /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. /// The name of the server. /// The name of the database. - /// The operation identifier. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task CancelAsync(string subscriptionId, string resourceGroupName, string serverName, string databaseName, Guid operationId, CancellationToken cancellationToken = default) + public async Task> ListByDatabaseAsync(string subscriptionId, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(serverName, nameof(serverName)); Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - using var message = CreateCancelRequest(subscriptionId, resourceGroupName, serverName, databaseName, operationId); + using var message = CreateListByDatabaseRequest(subscriptionId, resourceGroupName, serverName, databaseName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - return message.Response; + { + DatabaseOperationListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DatabaseOperationListResult.DeserializeDatabaseOperationListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Cancels the asynchronous operation on the database. + /// Gets a list of operations performed on the database. /// The subscription ID that identifies an Azure subscription. /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. /// The name of the server. /// The name of the database. - /// The operation identifier. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Cancel(string subscriptionId, string resourceGroupName, string serverName, string databaseName, Guid operationId, CancellationToken cancellationToken = default) + public Response ListByDatabase(string subscriptionId, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(serverName, nameof(serverName)); Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - using var message = CreateCancelRequest(subscriptionId, resourceGroupName, serverName, databaseName, operationId); + using var message = CreateListByDatabaseRequest(subscriptionId, resourceGroupName, serverName, databaseName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - return message.Response; + { + DatabaseOperationListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DatabaseOperationListResult.DeserializeDatabaseOperationListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListByDatabaseRequestUri(string subscriptionId, string resourceGroupName, string serverName, string databaseName) + internal RequestUriBuilder CreateCancelRequestUri(string subscriptionId, string resourceGroupName, string serverName, string databaseName, Guid operationId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -145,16 +150,18 @@ internal RequestUriBuilder CreateListByDatabaseRequestUri(string subscriptionId, uri.AppendPath(serverName, true); uri.AppendPath("/databases/", false); uri.AppendPath(databaseName, true); - uri.AppendPath("/operations", false); + uri.AppendPath("/operations/", false); + uri.AppendPath(operationId, true); + uri.AppendPath("/cancel", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListByDatabaseRequest(string subscriptionId, string resourceGroupName, string serverName, string databaseName) + internal HttpMessage CreateCancelRequest(string subscriptionId, string resourceGroupName, string serverName, string databaseName, Guid operationId) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -165,71 +172,64 @@ internal HttpMessage CreateListByDatabaseRequest(string subscriptionId, string r uri.AppendPath(serverName, true); uri.AppendPath("/databases/", false); uri.AppendPath(databaseName, true); - uri.AppendPath("/operations", false); + uri.AppendPath("/operations/", false); + uri.AppendPath(operationId, true); + uri.AppendPath("/cancel", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; - request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; } - /// Gets a list of operations performed on the database. + /// Cancels the asynchronous operation on the database. /// The subscription ID that identifies an Azure subscription. /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. /// The name of the server. /// The name of the database. + /// The operation identifier. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListByDatabaseAsync(string subscriptionId, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default) + public async Task CancelAsync(string subscriptionId, string resourceGroupName, string serverName, string databaseName, Guid operationId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(serverName, nameof(serverName)); Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - using var message = CreateListByDatabaseRequest(subscriptionId, resourceGroupName, serverName, databaseName); + using var message = CreateCancelRequest(subscriptionId, resourceGroupName, serverName, databaseName, operationId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - DatabaseOperationListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DatabaseOperationListResult.DeserializeDatabaseOperationListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Gets a list of operations performed on the database. + /// Cancels the asynchronous operation on the database. /// The subscription ID that identifies an Azure subscription. /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. /// The name of the server. /// The name of the database. + /// The operation identifier. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response ListByDatabase(string subscriptionId, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default) + public Response Cancel(string subscriptionId, string resourceGroupName, string serverName, string databaseName, Guid operationId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(serverName, nameof(serverName)); Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - using var message = CreateListByDatabaseRequest(subscriptionId, resourceGroupName, serverName, databaseName); + using var message = CreateCancelRequest(subscriptionId, resourceGroupName, serverName, databaseName, operationId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - DatabaseOperationListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DatabaseOperationListResult.DeserializeDatabaseOperationListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + return message.Response; default: throw new RequestFailedException(message.Response); } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/DistributedAvailabilityGroupsRestOperations.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/DistributedAvailabilityGroupsRestOperations.cs index 3c5aa7ee1e24..226557a3efb2 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/DistributedAvailabilityGroupsRestOperations.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/DistributedAvailabilityGroupsRestOperations.cs @@ -32,7 +32,7 @@ public DistributedAvailabilityGroupsRestOperations(HttpPipeline pipeline, string { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-11-01-preview"; + _apiVersion = apiVersion ?? "2023-08-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -369,6 +369,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendPath(distributedAvailabilityGroupName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; + request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; } @@ -529,6 +530,210 @@ public Response Update(string subscriptionId, string resourceGroupName, string m } } + internal RequestUriBuilder CreateFailoverRequestUri(string subscriptionId, string resourceGroupName, string managedInstanceName, string distributedAvailabilityGroupName, DistributedAvailabilityGroupsFailoverContent content) + { + 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.Sql/managedInstances/", false); + uri.AppendPath(managedInstanceName, true); + uri.AppendPath("/distributedAvailabilityGroups/", false); + uri.AppendPath(distributedAvailabilityGroupName, true); + uri.AppendPath("/failover", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateFailoverRequest(string subscriptionId, string resourceGroupName, string managedInstanceName, string distributedAvailabilityGroupName, DistributedAvailabilityGroupsFailoverContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + 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.Sql/managedInstances/", false); + uri.AppendPath(managedInstanceName, true); + uri.AppendPath("/distributedAvailabilityGroups/", false); + uri.AppendPath(distributedAvailabilityGroupName, true); + uri.AppendPath("/failover", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// Performs requested failover type in this distributed availability group. + /// The subscription ID that identifies an Azure subscription. + /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The name of the managed instance. + /// The distributed availability group name. + /// The distributed availability group failover request parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task FailoverAsync(string subscriptionId, string resourceGroupName, string managedInstanceName, string distributedAvailabilityGroupName, DistributedAvailabilityGroupsFailoverContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(managedInstanceName, nameof(managedInstanceName)); + Argument.AssertNotNullOrEmpty(distributedAvailabilityGroupName, nameof(distributedAvailabilityGroupName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateFailoverRequest(subscriptionId, resourceGroupName, managedInstanceName, distributedAvailabilityGroupName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Performs requested failover type in this distributed availability group. + /// The subscription ID that identifies an Azure subscription. + /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The name of the managed instance. + /// The distributed availability group name. + /// The distributed availability group failover request parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Failover(string subscriptionId, string resourceGroupName, string managedInstanceName, string distributedAvailabilityGroupName, DistributedAvailabilityGroupsFailoverContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(managedInstanceName, nameof(managedInstanceName)); + Argument.AssertNotNullOrEmpty(distributedAvailabilityGroupName, nameof(distributedAvailabilityGroupName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateFailoverRequest(subscriptionId, resourceGroupName, managedInstanceName, distributedAvailabilityGroupName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateSetRoleRequestUri(string subscriptionId, string resourceGroupName, string managedInstanceName, string distributedAvailabilityGroupName, DistributedAvailabilityGroupSetRole distributedAvailabilityGroupSetRole) + { + 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.Sql/managedInstances/", false); + uri.AppendPath(managedInstanceName, true); + uri.AppendPath("/distributedAvailabilityGroups/", false); + uri.AppendPath(distributedAvailabilityGroupName, true); + uri.AppendPath("/setRole", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateSetRoleRequest(string subscriptionId, string resourceGroupName, string managedInstanceName, string distributedAvailabilityGroupName, DistributedAvailabilityGroupSetRole distributedAvailabilityGroupSetRole) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + 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.Sql/managedInstances/", false); + uri.AppendPath(managedInstanceName, true); + uri.AppendPath("/distributedAvailabilityGroups/", false); + uri.AppendPath(distributedAvailabilityGroupName, true); + uri.AppendPath("/setRole", false); + 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(distributedAvailabilityGroupSetRole, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Sets the role for managed instance in a distributed availability group. + /// The subscription ID that identifies an Azure subscription. + /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The name of the managed instance. + /// The distributed availability group name. + /// The distributed availability group set role request parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task SetRoleAsync(string subscriptionId, string resourceGroupName, string managedInstanceName, string distributedAvailabilityGroupName, DistributedAvailabilityGroupSetRole distributedAvailabilityGroupSetRole, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(managedInstanceName, nameof(managedInstanceName)); + Argument.AssertNotNullOrEmpty(distributedAvailabilityGroupName, nameof(distributedAvailabilityGroupName)); + Argument.AssertNotNull(distributedAvailabilityGroupSetRole, nameof(distributedAvailabilityGroupSetRole)); + + using var message = CreateSetRoleRequest(subscriptionId, resourceGroupName, managedInstanceName, distributedAvailabilityGroupName, distributedAvailabilityGroupSetRole); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Sets the role for managed instance in a distributed availability group. + /// The subscription ID that identifies an Azure subscription. + /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The name of the managed instance. + /// The distributed availability group name. + /// The distributed availability group set role request parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response SetRole(string subscriptionId, string resourceGroupName, string managedInstanceName, string distributedAvailabilityGroupName, DistributedAvailabilityGroupSetRole distributedAvailabilityGroupSetRole, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(managedInstanceName, nameof(managedInstanceName)); + Argument.AssertNotNullOrEmpty(distributedAvailabilityGroupName, nameof(distributedAvailabilityGroupName)); + Argument.AssertNotNull(distributedAvailabilityGroupSetRole, nameof(distributedAvailabilityGroupSetRole)); + + using var message = CreateSetRoleRequest(subscriptionId, resourceGroupName, managedInstanceName, distributedAvailabilityGroupName, distributedAvailabilityGroupSetRole); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + internal RequestUriBuilder CreateListByInstanceNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string managedInstanceName) { var uri = new RawRequestUriBuilder(); diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/FailoverGroupsRestOperations.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/FailoverGroupsRestOperations.cs index 059590482ef9..c684bd9f598f 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/FailoverGroupsRestOperations.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/FailoverGroupsRestOperations.cs @@ -32,7 +32,7 @@ public FailoverGroupsRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-02-01-preview"; + _apiVersion = apiVersion ?? "2023-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/ManagedInstancesRestOperations.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/ManagedInstancesRestOperations.cs index 4c314dadb778..eb2034046f4f 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/ManagedInstancesRestOperations.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/ManagedInstancesRestOperations.cs @@ -32,7 +32,7 @@ public ManagedInstancesRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-08-01-preview"; + _apiVersion = apiVersion ?? "2023-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -890,6 +890,92 @@ public Response ListOutboundNetworkDep } } + internal RequestUriBuilder CreateRefreshStatusRequestUri(string subscriptionId, string resourceGroupName, string managedInstanceName) + { + 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.Sql/managedInstances/", false); + uri.AppendPath(managedInstanceName, true); + uri.AppendPath("/refreshExternalGovernanceStatus", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateRefreshStatusRequest(string subscriptionId, string resourceGroupName, string managedInstanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + 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.Sql/managedInstances/", false); + uri.AppendPath(managedInstanceName, true); + uri.AppendPath("/refreshExternalGovernanceStatus", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Refresh external governance enablement status. + /// The subscription ID that identifies an Azure subscription. + /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The name of the managed instance. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task RefreshStatusAsync(string subscriptionId, string resourceGroupName, string managedInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(managedInstanceName, nameof(managedInstanceName)); + + using var message = CreateRefreshStatusRequest(subscriptionId, resourceGroupName, managedInstanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Refresh external governance enablement status. + /// The subscription ID that identifies an Azure subscription. + /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The name of the managed instance. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response RefreshStatus(string subscriptionId, string resourceGroupName, string managedInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(managedInstanceName, nameof(managedInstanceName)); + + using var message = CreateRefreshStatusRequest(subscriptionId, resourceGroupName, managedInstanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + internal RequestUriBuilder CreateStartRequestUri(string subscriptionId, string resourceGroupName, string managedInstanceName) { var uri = new RawRequestUriBuilder(); @@ -921,6 +1007,7 @@ internal HttpMessage CreateStartRequest(string subscriptionId, string resourceGr uri.AppendPath("/start", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; + request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; } @@ -942,6 +1029,7 @@ public async Task StartAsync(string subscriptionId, string resourceGro await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { + case 200: case 202: return message.Response; default: @@ -966,6 +1054,7 @@ public Response Start(string subscriptionId, string resourceGroupName, string ma _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { + case 200: case 202: return message.Response; default: @@ -1004,6 +1093,7 @@ internal HttpMessage CreateStopRequest(string subscriptionId, string resourceGro uri.AppendPath("/stop", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; + request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; } @@ -1025,6 +1115,7 @@ public async Task StopAsync(string subscriptionId, string resourceGrou await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { + case 200: case 202: return message.Response; default: @@ -1049,6 +1140,7 @@ public Response Stop(string subscriptionId, string resourceGroupName, string man _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { + case 200: case 202: return message.Response; default: diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/ReplicationLinksRestOperations.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/ReplicationLinksRestOperations.cs index 19980bb12588..3437081fe907 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/ReplicationLinksRestOperations.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/ReplicationLinksRestOperations.cs @@ -32,7 +32,7 @@ public ReplicationLinksRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-02-01-preview"; + _apiVersion = apiVersion ?? "2023-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -250,6 +250,114 @@ public Response Get(string subscriptionId, } } + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string serverName, string databaseName, string linkId, SqlServerDatabaseReplicationLinkData 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.Sql/servers/", false); + uri.AppendPath(serverName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendPath("/replicationLinks/", false); + uri.AppendPath(linkId, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string serverName, string databaseName, string linkId, SqlServerDatabaseReplicationLinkData 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.Sql/servers/", false); + uri.AppendPath(serverName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendPath("/replicationLinks/", false); + uri.AppendPath(linkId, 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; + } + + /// Updates the replication link type. + /// The subscription ID that identifies an Azure subscription. + /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The name of the server. + /// The name of the database. + /// The to use. + /// The to use. + /// 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 serverName, string databaseName, string linkId, SqlServerDatabaseReplicationLinkData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(serverName, nameof(serverName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNullOrEmpty(linkId, nameof(linkId)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, serverName, databaseName, linkId, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Updates the replication link type. + /// The subscription ID that identifies an Azure subscription. + /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The name of the server. + /// The name of the database. + /// The to use. + /// The to use. + /// 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 serverName, string databaseName, string linkId, SqlServerDatabaseReplicationLinkData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(serverName, nameof(serverName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNullOrEmpty(linkId, nameof(linkId)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, serverName, databaseName, linkId, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string serverName, string databaseName, string linkId) { var uri = new RawRequestUriBuilder(); @@ -349,6 +457,114 @@ public Response Delete(string subscriptionId, string resourceGroupName, string s } } + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string serverName, string databaseName, string linkId, SqlServerDatabaseReplicationLinkPatch patch) + { + 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.Sql/servers/", false); + uri.AppendPath(serverName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendPath("/replicationLinks/", false); + uri.AppendPath(linkId, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string serverName, string databaseName, string linkId, SqlServerDatabaseReplicationLinkPatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + 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.Sql/servers/", false); + uri.AppendPath(serverName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendPath("/replicationLinks/", false); + uri.AppendPath(linkId, 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(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Updates the replication link type. + /// The subscription ID that identifies an Azure subscription. + /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The name of the server. + /// The name of the database. + /// The to use. + /// The to use. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string serverName, string databaseName, string linkId, SqlServerDatabaseReplicationLinkPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(serverName, nameof(serverName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNullOrEmpty(linkId, nameof(linkId)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, serverName, databaseName, linkId, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Updates the replication link type. + /// The subscription ID that identifies an Azure subscription. + /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The name of the server. + /// The name of the database. + /// The to use. + /// The to use. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string serverName, string databaseName, string linkId, SqlServerDatabaseReplicationLinkPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(serverName, nameof(serverName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNullOrEmpty(linkId, nameof(linkId)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, serverName, databaseName, linkId, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + internal RequestUriBuilder CreateFailoverRequestUri(string subscriptionId, string resourceGroupName, string serverName, string databaseName, string linkId) { var uri = new RawRequestUriBuilder(); diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseResource.cs index 0c82451d2890..62bd9e9c0876 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseResource.cs @@ -48,8 +48,6 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, private readonly RestorePointsRestOperations _sqlServerDatabaseRestorePointRestorePointsRestClient; private readonly ClientDiagnostics _databaseExtensionsClientDiagnostics; private readonly DatabaseExtensionsRestOperations _databaseExtensionsRestClient; - private readonly ClientDiagnostics _databaseOperationsClientDiagnostics; - private readonly DatabaseRestOperations _databaseOperationsRestClient; private readonly ClientDiagnostics _databaseUsagesClientDiagnostics; private readonly DatabaseUsagesRestOperations _databaseUsagesRestClient; private readonly ClientDiagnostics _sqlDatabaseSensitivityLabelSensitivityLabelsClientDiagnostics; @@ -58,6 +56,8 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, private readonly SynapseLinkWorkspacesRestOperations _synapseLinkWorkspacesRestClient; private readonly ClientDiagnostics _databaseEncryptionProtectorsClientDiagnostics; private readonly DatabaseEncryptionProtectorsRestOperations _databaseEncryptionProtectorsRestClient; + private readonly ClientDiagnostics _databaseOperationsClientDiagnostics; + private readonly DatabaseRestOperations _databaseOperationsRestClient; private readonly SqlDatabaseData _data; /// Gets the resource type for the operations. @@ -97,8 +97,6 @@ internal SqlDatabaseResource(ArmClient client, ResourceIdentifier id) : base(cli _sqlServerDatabaseRestorePointRestorePointsRestClient = new RestorePointsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, sqlServerDatabaseRestorePointRestorePointsApiVersion); _databaseExtensionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Sql", ProviderConstants.DefaultProviderNamespace, Diagnostics); _databaseExtensionsRestClient = new DatabaseExtensionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - _databaseOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Sql", ProviderConstants.DefaultProviderNamespace, Diagnostics); - _databaseOperationsRestClient = new DatabaseRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); _databaseUsagesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Sql", ProviderConstants.DefaultProviderNamespace, Diagnostics); _databaseUsagesRestClient = new DatabaseUsagesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); _sqlDatabaseSensitivityLabelSensitivityLabelsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Sql", SqlDatabaseSensitivityLabelResource.ResourceType.Namespace, Diagnostics); @@ -108,6 +106,8 @@ internal SqlDatabaseResource(ArmClient client, ResourceIdentifier id) : base(cli _synapseLinkWorkspacesRestClient = new SynapseLinkWorkspacesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); _databaseEncryptionProtectorsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Sql", ProviderConstants.DefaultProviderNamespace, Diagnostics); _databaseEncryptionProtectorsRestClient = new DatabaseEncryptionProtectorsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + _databaseOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Sql", ProviderConstants.DefaultProviderNamespace, Diagnostics); + _databaseOperationsRestClient = new DatabaseRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); #if DEBUG ValidateResourceId(Id); #endif @@ -1092,75 +1092,6 @@ public virtual Response GetDatabaseAdv return GetDatabaseAdvancedThreatProtections().Get(advancedThreatProtectionName, cancellationToken); } - /// Gets a collection of SqlServerDatabaseReplicationLinkResources in the SqlDatabase. - /// An object representing collection of SqlServerDatabaseReplicationLinkResources and their operations over a SqlServerDatabaseReplicationLinkResource. - public virtual SqlServerDatabaseReplicationLinkCollection GetSqlServerDatabaseReplicationLinks() - { - return GetCachedClient(client => new SqlServerDatabaseReplicationLinkCollection(client, Id)); - } - - /// - /// Gets a replication link. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId} - /// - /// - /// Operation Id - /// ReplicationLinks_Get - /// - /// - /// Default Api Version - /// 2022-02-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the replication link. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetSqlServerDatabaseReplicationLinkAsync(string linkId, CancellationToken cancellationToken = default) - { - return await GetSqlServerDatabaseReplicationLinks().GetAsync(linkId, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets a replication link. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId} - /// - /// - /// Operation Id - /// ReplicationLinks_Get - /// - /// - /// Default Api Version - /// 2022-02-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the replication link. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetSqlServerDatabaseReplicationLink(string linkId, CancellationToken cancellationToken = default) - { - return GetSqlServerDatabaseReplicationLinks().Get(linkId, cancellationToken); - } - /// Gets a collection of LogicalDatabaseTransparentDataEncryptionResources in the SqlDatabase. /// An object representing collection of LogicalDatabaseTransparentDataEncryptionResources and their operations over a LogicalDatabaseTransparentDataEncryptionResource. public virtual LogicalDatabaseTransparentDataEncryptionCollection GetLogicalDatabaseTransparentDataEncryptions() @@ -1356,6 +1287,75 @@ public virtual Response GetLongTermRetentionPol return GetLongTermRetentionPolicies().Get(policyName, cancellationToken); } + /// Gets a collection of SqlServerDatabaseReplicationLinkResources in the SqlDatabase. + /// An object representing collection of SqlServerDatabaseReplicationLinkResources and their operations over a SqlServerDatabaseReplicationLinkResource. + public virtual SqlServerDatabaseReplicationLinkCollection GetSqlServerDatabaseReplicationLinks() + { + return GetCachedClient(client => new SqlServerDatabaseReplicationLinkCollection(client, Id)); + } + + /// + /// Gets a replication link. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId} + /// + /// + /// Operation Id + /// ReplicationLinks_Get + /// + /// + /// Default Api Version + /// 2023-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the replication link. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSqlServerDatabaseReplicationLinkAsync(string linkId, CancellationToken cancellationToken = default) + { + return await GetSqlServerDatabaseReplicationLinks().GetAsync(linkId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a replication link. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId} + /// + /// + /// Operation Id + /// ReplicationLinks_Get + /// + /// + /// Default Api Version + /// 2023-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the replication link. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSqlServerDatabaseReplicationLink(string linkId, CancellationToken cancellationToken = default) + { + return GetSqlServerDatabaseReplicationLinks().Get(linkId, cancellationToken); + } + /// /// Gets a database. /// @@ -2028,128 +2028,6 @@ public virtual Pageable GetDatabaseExtens return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ImportExportExtensionsOperationResult.DeserializeImportExportExtensionsOperationResult(e), _databaseExtensionsClientDiagnostics, Pipeline, "SqlDatabaseResource.GetDatabaseExtensions", "value", "nextLink", cancellationToken); } - /// - /// Cancels the asynchronous operation on the database. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/operations/{operationId}/cancel - /// - /// - /// Operation Id - /// DatabaseOperations_Cancel - /// - /// - /// Default Api Version - /// 2021-02-01-preview - /// - /// - /// - /// The operation identifier. - /// The cancellation token to use. - public virtual async Task CancelDatabaseOperationAsync(Guid operationId, CancellationToken cancellationToken = default) - { - using var scope = _databaseOperationsClientDiagnostics.CreateScope("SqlDatabaseResource.CancelDatabaseOperation"); - scope.Start(); - try - { - var response = await _databaseOperationsRestClient.CancelAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, operationId, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Cancels the asynchronous operation on the database. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/operations/{operationId}/cancel - /// - /// - /// Operation Id - /// DatabaseOperations_Cancel - /// - /// - /// Default Api Version - /// 2021-02-01-preview - /// - /// - /// - /// The operation identifier. - /// The cancellation token to use. - public virtual Response CancelDatabaseOperation(Guid operationId, CancellationToken cancellationToken = default) - { - using var scope = _databaseOperationsClientDiagnostics.CreateScope("SqlDatabaseResource.CancelDatabaseOperation"); - scope.Start(); - try - { - var response = _databaseOperationsRestClient.Cancel(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, operationId, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a list of operations performed on the database. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/operations - /// - /// - /// Operation Id - /// DatabaseOperations_ListByDatabase - /// - /// - /// Default Api Version - /// 2021-02-01-preview - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetDatabaseOperationsAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _databaseOperationsRestClient.CreateListByDatabaseRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _databaseOperationsRestClient.CreateListByDatabaseNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => DatabaseOperationData.DeserializeDatabaseOperationData(e), _databaseOperationsClientDiagnostics, Pipeline, "SqlDatabaseResource.GetDatabaseOperations", "value", "nextLink", cancellationToken); - } - - /// - /// Gets a list of operations performed on the database. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/operations - /// - /// - /// Operation Id - /// DatabaseOperations_ListByDatabase - /// - /// - /// Default Api Version - /// 2021-02-01-preview - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetDatabaseOperations(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _databaseOperationsRestClient.CreateListByDatabaseRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _databaseOperationsRestClient.CreateListByDatabaseNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => DatabaseOperationData.DeserializeDatabaseOperationData(e), _databaseOperationsClientDiagnostics, Pipeline, "SqlDatabaseResource.GetDatabaseOperations", "value", "nextLink", cancellationToken); - } - /// /// Gets database usages. /// @@ -3316,6 +3194,128 @@ public virtual ArmOperation UpgradeDataWarehouse(WaitUntil waitUntil, Cancellati } } + /// + /// Gets a list of operations performed on the database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/operations + /// + /// + /// Operation Id + /// DatabaseOperations_ListByDatabase + /// + /// + /// Default Api Version + /// 2022-11-01-preview + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetDatabaseOperationsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _databaseOperationsRestClient.CreateListByDatabaseRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _databaseOperationsRestClient.CreateListByDatabaseNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => DatabaseOperationData.DeserializeDatabaseOperationData(e), _databaseOperationsClientDiagnostics, Pipeline, "SqlDatabaseResource.GetDatabaseOperations", "value", "nextLink", cancellationToken); + } + + /// + /// Gets a list of operations performed on the database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/operations + /// + /// + /// Operation Id + /// DatabaseOperations_ListByDatabase + /// + /// + /// Default Api Version + /// 2022-11-01-preview + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetDatabaseOperations(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _databaseOperationsRestClient.CreateListByDatabaseRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _databaseOperationsRestClient.CreateListByDatabaseNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => DatabaseOperationData.DeserializeDatabaseOperationData(e), _databaseOperationsClientDiagnostics, Pipeline, "SqlDatabaseResource.GetDatabaseOperations", "value", "nextLink", cancellationToken); + } + + /// + /// Cancels the asynchronous operation on the database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/operations/{operationId}/cancel + /// + /// + /// Operation Id + /// DatabaseOperations_Cancel + /// + /// + /// Default Api Version + /// 2022-11-01-preview + /// + /// + /// + /// The operation identifier. + /// The cancellation token to use. + public virtual async Task CancelDatabaseOperationAsync(Guid operationId, CancellationToken cancellationToken = default) + { + using var scope = _databaseOperationsClientDiagnostics.CreateScope("SqlDatabaseResource.CancelDatabaseOperation"); + scope.Start(); + try + { + var response = await _databaseOperationsRestClient.CancelAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, operationId, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Cancels the asynchronous operation on the database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/operations/{operationId}/cancel + /// + /// + /// Operation Id + /// DatabaseOperations_Cancel + /// + /// + /// Default Api Version + /// 2022-11-01-preview + /// + /// + /// + /// The operation identifier. + /// The cancellation token to use. + public virtual Response CancelDatabaseOperation(Guid operationId, CancellationToken cancellationToken = default) + { + using var scope = _databaseOperationsClientDiagnostics.CreateScope("SqlDatabaseResource.CancelDatabaseOperation"); + scope.Start(); + try + { + var response = _databaseOperationsRestClient.Cancel(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, operationId, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// Add a tag to the current resource. /// diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerDatabaseReplicationLinkCollection.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerDatabaseReplicationLinkCollection.cs index b277742dd662..129e3b73c0f5 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerDatabaseReplicationLinkCollection.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerDatabaseReplicationLinkCollection.cs @@ -51,6 +51,104 @@ internal static void ValidateResourceId(ResourceIdentifier id) throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SqlDatabaseResource.ResourceType), nameof(id)); } + /// + /// Updates the replication link type. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId} + /// + /// + /// Operation Id + /// ReplicationLinks_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2023-05-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 to use. + /// The to use. + /// 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 linkId, SqlServerDatabaseReplicationLinkData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(linkId, nameof(linkId)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _sqlServerDatabaseReplicationLinkReplicationLinksClientDiagnostics.CreateScope("SqlServerDatabaseReplicationLinkCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _sqlServerDatabaseReplicationLinkReplicationLinksRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, linkId, data, cancellationToken).ConfigureAwait(false); + var operation = new SqlArmOperation(new SqlServerDatabaseReplicationLinkOperationSource(Client), _sqlServerDatabaseReplicationLinkReplicationLinksClientDiagnostics, Pipeline, _sqlServerDatabaseReplicationLinkReplicationLinksRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, linkId, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates the replication link type. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId} + /// + /// + /// Operation Id + /// ReplicationLinks_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2023-05-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 to use. + /// The to use. + /// 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 linkId, SqlServerDatabaseReplicationLinkData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(linkId, nameof(linkId)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _sqlServerDatabaseReplicationLinkReplicationLinksClientDiagnostics.CreateScope("SqlServerDatabaseReplicationLinkCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _sqlServerDatabaseReplicationLinkReplicationLinksRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, linkId, data, cancellationToken); + var operation = new SqlArmOperation(new SqlServerDatabaseReplicationLinkOperationSource(Client), _sqlServerDatabaseReplicationLinkReplicationLinksClientDiagnostics, Pipeline, _sqlServerDatabaseReplicationLinkReplicationLinksRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, linkId, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// Gets a replication link. /// @@ -64,7 +162,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -109,7 +207,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2022-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -154,7 +252,7 @@ public virtual Response Get(string lin /// /// /// Default Api Version - /// 2022-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -184,7 +282,7 @@ public virtual AsyncPageable GetAllAsy /// /// /// Default Api Version - /// 2022-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -214,7 +312,7 @@ public virtual Pageable GetAll(Cancell /// /// /// Default Api Version - /// 2022-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -257,7 +355,7 @@ public virtual async Task> ExistsAsync(string linkId, Cancellatio /// /// /// Default Api Version - /// 2022-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -300,7 +398,7 @@ public virtual Response Exists(string linkId, CancellationToken cancellati /// /// /// Default Api Version - /// 2022-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -345,7 +443,7 @@ public virtual async Task /// /// Default Api Version - /// 2022-02-01-preview + /// 2023-05-01-preview /// /// /// Resource diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerDatabaseReplicationLinkData.Serialization.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerDatabaseReplicationLinkData.Serialization.cs index 78328b10121b..57908f4df95a 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerDatabaseReplicationLinkData.Serialization.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerDatabaseReplicationLinkData.Serialization.cs @@ -61,6 +61,11 @@ void IJsonModel.Write(Utf8JsonWriter write writer.WritePropertyName("partnerDatabase"u8); writer.WriteStringValue(PartnerDatabase); } + if (options.Format != "W" && Optional.IsDefined(PartnerDatabaseId)) + { + writer.WritePropertyName("partnerDatabaseId"u8); + writer.WriteStringValue(PartnerDatabaseId); + } if (options.Format != "W" && Optional.IsDefined(PartnerLocation)) { writer.WritePropertyName("partnerLocation"u8); @@ -101,7 +106,7 @@ void IJsonModel.Write(Utf8JsonWriter write writer.WritePropertyName("isTerminationAllowed"u8); writer.WriteBooleanValue(IsTerminationAllowed.Value); } - if (options.Format != "W" && Optional.IsDefined(LinkType)) + if (Optional.IsDefined(LinkType)) { writer.WritePropertyName("linkType"u8); writer.WriteStringValue(LinkType.Value.ToString()); @@ -151,6 +156,7 @@ internal static SqlServerDatabaseReplicationLinkData DeserializeSqlServerDatabas SystemData systemData = default; string partnerServer = default; string partnerDatabase = default; + string partnerDatabaseId = default; AzureLocation? partnerLocation = default; SqlServerDatabaseReplicationRole? role = default; SqlServerDatabaseReplicationRole? partnerRole = default; @@ -207,6 +213,11 @@ internal static SqlServerDatabaseReplicationLinkData DeserializeSqlServerDatabas partnerDatabase = property0.Value.GetString(); continue; } + if (property0.NameEquals("partnerDatabaseId"u8)) + { + partnerDatabaseId = property0.Value.GetString(); + continue; + } if (property0.NameEquals("partnerLocation"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -300,6 +311,7 @@ internal static SqlServerDatabaseReplicationLinkData DeserializeSqlServerDatabas systemData, partnerServer, partnerDatabase, + partnerDatabaseId, partnerLocation, role, partnerRole, @@ -424,6 +436,29 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PartnerDatabaseId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" partnerDatabaseId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PartnerDatabaseId)) + { + builder.Append(" partnerDatabaseId: "); + if (PartnerDatabaseId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{PartnerDatabaseId}'''"); + } + else + { + builder.AppendLine($"'{PartnerDatabaseId}'"); + } + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PartnerLocation), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerDatabaseReplicationLinkData.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerDatabaseReplicationLinkData.cs index d0551234ec4d..6dcc552a5740 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerDatabaseReplicationLinkData.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerDatabaseReplicationLinkData.cs @@ -63,6 +63,7 @@ public SqlServerDatabaseReplicationLinkData() /// The systemData. /// Resource partner server. /// Resource partner database. + /// Resource partner database Id. /// Resource partner location. /// Local replication role. /// Partner replication role. @@ -71,12 +72,13 @@ public SqlServerDatabaseReplicationLinkData() /// Seeding completion percentage for the link. /// Replication state (PENDING, SEEDING, CATCHUP, SUSPENDED). /// Whether the user is currently allowed to terminate the link. - /// Link type (GEO, NAMED, STANDBY). + /// Link type (GEO, NAMED, STANDBY). Update operation does not support NAMED. /// Keeps track of any properties unknown to the library. - internal SqlServerDatabaseReplicationLinkData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string partnerServer, string partnerDatabase, AzureLocation? partnerLocation, SqlServerDatabaseReplicationRole? role, SqlServerDatabaseReplicationRole? partnerRole, string replicationMode, DateTimeOffset? startOn, int? percentComplete, ReplicationLinkState? replicationState, bool? isTerminationAllowed, ReplicationLinkType? linkType, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal SqlServerDatabaseReplicationLinkData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string partnerServer, string partnerDatabase, string partnerDatabaseId, AzureLocation? partnerLocation, SqlServerDatabaseReplicationRole? role, SqlServerDatabaseReplicationRole? partnerRole, string replicationMode, DateTimeOffset? startOn, int? percentComplete, ReplicationLinkState? replicationState, bool? isTerminationAllowed, ReplicationLinkType? linkType, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { PartnerServer = partnerServer; PartnerDatabase = partnerDatabase; + PartnerDatabaseId = partnerDatabaseId; PartnerLocation = partnerLocation; Role = role; PartnerRole = partnerRole; @@ -95,6 +97,9 @@ internal SqlServerDatabaseReplicationLinkData(ResourceIdentifier id, string name /// Resource partner database. [WirePath("properties.partnerDatabase")] public string PartnerDatabase { get; } + /// Resource partner database Id. + [WirePath("properties.partnerDatabaseId")] + public string PartnerDatabaseId { get; } /// Resource partner location. [WirePath("properties.partnerLocation")] public AzureLocation? PartnerLocation { get; } @@ -119,8 +124,8 @@ internal SqlServerDatabaseReplicationLinkData(ResourceIdentifier id, string name /// Whether the user is currently allowed to terminate the link. [WirePath("properties.isTerminationAllowed")] public bool? IsTerminationAllowed { get; } - /// Link type (GEO, NAMED, STANDBY). + /// Link type (GEO, NAMED, STANDBY). Update operation does not support NAMED. [WirePath("properties.linkType")] - public ReplicationLinkType? LinkType { get; } + public ReplicationLinkType? LinkType { get; set; } } } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerDatabaseReplicationLinkResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerDatabaseReplicationLinkResource.cs index a51cd286b554..1dfe2649e97d 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerDatabaseReplicationLinkResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerDatabaseReplicationLinkResource.cs @@ -11,6 +11,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager.Sql.Models; namespace Azure.ResourceManager.Sql { @@ -102,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -142,7 +143,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2022-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -182,7 +183,7 @@ public virtual Response Get(Cancellati /// /// /// Default Api Version - /// 2022-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -224,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2022-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -253,6 +254,98 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel } } + /// + /// Updates the replication link type. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId} + /// + /// + /// Operation Id + /// ReplicationLinks_Update + /// + /// + /// Default Api Version + /// 2023-05-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 to use. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, SqlServerDatabaseReplicationLinkPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _sqlServerDatabaseReplicationLinkReplicationLinksClientDiagnostics.CreateScope("SqlServerDatabaseReplicationLinkResource.Update"); + scope.Start(); + try + { + var response = await _sqlServerDatabaseReplicationLinkReplicationLinksRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new SqlArmOperation(new SqlServerDatabaseReplicationLinkOperationSource(Client), _sqlServerDatabaseReplicationLinkReplicationLinksClientDiagnostics, Pipeline, _sqlServerDatabaseReplicationLinkReplicationLinksRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates the replication link type. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId} + /// + /// + /// Operation Id + /// ReplicationLinks_Update + /// + /// + /// Default Api Version + /// 2023-05-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 to use. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, SqlServerDatabaseReplicationLinkPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _sqlServerDatabaseReplicationLinkReplicationLinksClientDiagnostics.CreateScope("SqlServerDatabaseReplicationLinkResource.Update"); + scope.Start(); + try + { + var response = _sqlServerDatabaseReplicationLinkReplicationLinksRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch, cancellationToken); + var operation = new SqlArmOperation(new SqlServerDatabaseReplicationLinkOperationSource(Client), _sqlServerDatabaseReplicationLinkReplicationLinksClientDiagnostics, Pipeline, _sqlServerDatabaseReplicationLinkReplicationLinksRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// Fails over from the current primary server to this server. /// @@ -266,7 +359,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2022-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -308,7 +401,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2022-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -350,7 +443,7 @@ public virtual ArmOperation Failover(W /// /// /// Default Api Version - /// 2022-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -392,7 +485,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2022-02-01-preview + /// 2023-05-01-preview /// /// /// Resource diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerResource.cs index 61ba71d334e4..5ba10f569484 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerResource.cs @@ -44,10 +44,10 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, private readonly ServerRestOperations _serverOperationsRestClient; private readonly ClientDiagnostics _tdeCertificatesClientDiagnostics; private readonly TdeCertificatesRestOperations _tdeCertificatesRestClient; - private readonly ClientDiagnostics _sqlServerDatabaseReplicationLinkReplicationLinksClientDiagnostics; - private readonly ReplicationLinksRestOperations _sqlServerDatabaseReplicationLinkReplicationLinksRestClient; private readonly ClientDiagnostics _sqlDatabaseDatabasesClientDiagnostics; private readonly DatabasesRestOperations _sqlDatabaseDatabasesRestClient; + private readonly ClientDiagnostics _sqlServerDatabaseReplicationLinkReplicationLinksClientDiagnostics; + private readonly ReplicationLinksRestOperations _sqlServerDatabaseReplicationLinkReplicationLinksRestClient; private readonly SqlServerData _data; /// Gets the resource type for the operations. @@ -81,12 +81,12 @@ internal SqlServerResource(ArmClient client, ResourceIdentifier id) : base(clien _serverOperationsRestClient = new ServerRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); _tdeCertificatesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Sql", ProviderConstants.DefaultProviderNamespace, Diagnostics); _tdeCertificatesRestClient = new TdeCertificatesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - _sqlServerDatabaseReplicationLinkReplicationLinksClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Sql", SqlServerDatabaseReplicationLinkResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(SqlServerDatabaseReplicationLinkResource.ResourceType, out string sqlServerDatabaseReplicationLinkReplicationLinksApiVersion); - _sqlServerDatabaseReplicationLinkReplicationLinksRestClient = new ReplicationLinksRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, sqlServerDatabaseReplicationLinkReplicationLinksApiVersion); _sqlDatabaseDatabasesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Sql", SqlDatabaseResource.ResourceType.Namespace, Diagnostics); TryGetApiVersion(SqlDatabaseResource.ResourceType, out string sqlDatabaseDatabasesApiVersion); _sqlDatabaseDatabasesRestClient = new DatabasesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, sqlDatabaseDatabasesApiVersion); + _sqlServerDatabaseReplicationLinkReplicationLinksClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Sql", SqlServerDatabaseReplicationLinkResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(SqlServerDatabaseReplicationLinkResource.ResourceType, out string sqlServerDatabaseReplicationLinkReplicationLinksApiVersion); + _sqlServerDatabaseReplicationLinkReplicationLinksRestClient = new ReplicationLinksRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, sqlServerDatabaseReplicationLinkReplicationLinksApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -2044,7 +2044,7 @@ public virtual FailoverGroupCollection GetFailoverGroups() /// /// /// Default Api Version - /// 2023-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -2075,7 +2075,7 @@ public virtual async Task> GetFailoverGroupAsync /// /// /// Default Api Version - /// 2023-02-01-preview + /// 2023-05-01-preview /// /// /// Resource @@ -2537,66 +2537,6 @@ public virtual ArmOperation CreateTdeCertificate(WaitUntil waitUntil, TdeCertifi } } - /// - /// Gets a list of replication links. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/replicationLinks - /// - /// - /// Operation Id - /// ReplicationLinks_ListByServer - /// - /// - /// Default Api Version - /// 2022-02-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetReplicationLinksAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _sqlServerDatabaseReplicationLinkReplicationLinksRestClient.CreateListByServerRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _sqlServerDatabaseReplicationLinkReplicationLinksRestClient.CreateListByServerNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SqlServerDatabaseReplicationLinkResource(Client, SqlServerDatabaseReplicationLinkData.DeserializeSqlServerDatabaseReplicationLinkData(e)), _sqlServerDatabaseReplicationLinkReplicationLinksClientDiagnostics, Pipeline, "SqlServerResource.GetReplicationLinks", "value", "nextLink", cancellationToken); - } - - /// - /// Gets a list of replication links. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/replicationLinks - /// - /// - /// Operation Id - /// ReplicationLinks_ListByServer - /// - /// - /// Default Api Version - /// 2022-02-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetReplicationLinks(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _sqlServerDatabaseReplicationLinkReplicationLinksRestClient.CreateListByServerRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _sqlServerDatabaseReplicationLinkReplicationLinksRestClient.CreateListByServerNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SqlServerDatabaseReplicationLinkResource(Client, SqlServerDatabaseReplicationLinkData.DeserializeSqlServerDatabaseReplicationLinkData(e)), _sqlServerDatabaseReplicationLinkReplicationLinksClientDiagnostics, Pipeline, "SqlServerResource.GetReplicationLinks", "value", "nextLink", cancellationToken); - } - /// /// Gets a list of inaccessible databases in a logical server /// @@ -2833,6 +2773,66 @@ public virtual ArmOperation Refr } } + /// + /// Gets a list of replication links. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/replicationLinks + /// + /// + /// Operation Id + /// ReplicationLinks_ListByServer + /// + /// + /// Default Api Version + /// 2023-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetReplicationLinksAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _sqlServerDatabaseReplicationLinkReplicationLinksRestClient.CreateListByServerRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _sqlServerDatabaseReplicationLinkReplicationLinksRestClient.CreateListByServerNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SqlServerDatabaseReplicationLinkResource(Client, SqlServerDatabaseReplicationLinkData.DeserializeSqlServerDatabaseReplicationLinkData(e)), _sqlServerDatabaseReplicationLinkReplicationLinksClientDiagnostics, Pipeline, "SqlServerResource.GetReplicationLinks", "value", "nextLink", cancellationToken); + } + + /// + /// Gets a list of replication links. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/replicationLinks + /// + /// + /// Operation Id + /// ReplicationLinks_ListByServer + /// + /// + /// Default Api Version + /// 2023-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetReplicationLinks(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _sqlServerDatabaseReplicationLinkReplicationLinksRestClient.CreateListByServerRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _sqlServerDatabaseReplicationLinkReplicationLinksRestClient.CreateListByServerNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SqlServerDatabaseReplicationLinkResource(Client, SqlServerDatabaseReplicationLinkData.DeserializeSqlServerDatabaseReplicationLinkData(e)), _sqlServerDatabaseReplicationLinkReplicationLinksClientDiagnostics, Pipeline, "SqlServerResource.GetReplicationLinks", "value", "nextLink", cancellationToken); + } + /// /// Add a tag to the current resource. /// diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/autorest.md b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/autorest.md index 1f0aeb2a7215..dab7edda8b62 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/autorest.md +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/autorest.md @@ -5,7 +5,7 @@ Run `dotnet build /t:GenerateCode` to generate code. ``` yaml azure-arm: true tag: package-composite-v5 -require: https://github.com/Azure/azure-rest-api-specs/blob/e7e476ba9cd5dcaacb4b344a0ca9677ba731686b/specification/sql/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/sql/resource-manager/readme.md namespace: Azure.ResourceManager.Sql output-folder: $(this-folder)/Generated clear-output-folder: true