From 6a8191f445028e6961b9c2b04a3361a5c69aedcb Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 8 Oct 2024 03:18:21 +0000 Subject: [PATCH] CodeGen from PR 30902 in Azure/azure-rest-api-specs Merge 39629ab2a5580d16f5b4000053f3e3beb416d86a into 838d84411303b55e628b4d737b12f5ebdc114635 --- ...zure.ResourceManager.Sql.netstandard2.0.cs | 198 ++- .../Samples/Sample_InstancePoolResource.cs | 136 +-- .../Sample_ManagedInstanceCollection.cs | 146 ++- .../Samples/Sample_ManagedInstanceResource.cs | 132 +- .../src/Generated/ArmSqlModelFactory.cs | 1083 +++++++++-------- .../Extensions/MockableSqlArmClient.cs | 24 +- .../MockableSqlResourceGroupResource.cs | 142 +-- .../MockableSqlSubscriptionResource.cs | 132 +- .../src/Generated/Extensions/SqlExtensions.cs | 368 +++--- .../src/Generated/InstancePoolResource.cs | 4 +- ...eStatusOperationResultMIOperationSource.cs | 30 + .../Generated/ManagedInstanceCollection.cs | 20 +- .../ManagedInstanceData.Serialization.cs | 351 +++++- .../src/Generated/ManagedInstanceData.cs | 63 +- .../src/Generated/ManagedInstanceResource.cs | 152 ++- .../Models/AuthMetadataLookupMode.cs | 54 + .../src/Generated/Models/FreemiumType.cs | 51 + .../Generated/Models/HybridSecondaryUsage.cs | 51 + .../Models/HybridSecondaryUsageDetected.cs | 51 + .../Models/ManagedInstanceDatabaseFormat.cs | 51 + .../ManagedInstancePatch.Serialization.cs | 176 ++- .../Generated/Models/ManagedInstancePatch.cs | 63 +- ...agedInstancePropertiesProvisioningState.cs | 90 -- ...tricIntervalAutoGenerated.Serialization.cs | 279 +++++ .../QueryMetricIntervalAutoGenerated.cs | 82 ++ ...QueryStatisticsProperties.Serialization.cs | 8 +- .../Models/QueryStatisticsProperties.cs | 6 +- ...ceStatusOperationResultMI.Serialization.cs | 433 +++++++ ...ternalGovernanceStatusOperationResultMI.cs | 97 ++ .../ManagedInstancesRestOperations.cs | 94 +- .../Azure.ResourceManager.Sql/src/autorest.md | 2 +- 31 files changed, 3422 insertions(+), 1147 deletions(-) create mode 100644 sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/LongRunningOperation/RefreshExternalGovernanceStatusOperationResultMIOperationSource.cs create mode 100644 sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/AuthMetadataLookupMode.cs create mode 100644 sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/FreemiumType.cs create mode 100644 sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/HybridSecondaryUsage.cs create mode 100644 sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/HybridSecondaryUsageDetected.cs create mode 100644 sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ManagedInstanceDatabaseFormat.cs delete mode 100644 sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ManagedInstancePropertiesProvisioningState.cs create mode 100644 sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/QueryMetricIntervalAutoGenerated.Serialization.cs create mode 100644 sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/QueryMetricIntervalAutoGenerated.cs create mode 100644 sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/RefreshExternalGovernanceStatusOperationResultMI.Serialization.cs create mode 100644 sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/RefreshExternalGovernanceStatusOperationResultMI.cs 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 108720ecaccc..b1b9fa616374 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 @@ -1871,15 +1871,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 { } } @@ -1888,9 +1895,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 { } } @@ -1898,10 +1906,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; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -2362,14 +2373,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; } @@ -7167,7 +7180,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; } @@ -7181,7 +7194,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; } @@ -7209,9 +7222,10 @@ public static partial class ArmSqlModelFactory 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; } @@ -7223,6 +7237,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; } @@ -7343,6 +7358,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, @@ -8262,6 +8296,24 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer 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; @@ -8301,6 +8353,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, @@ -9015,6 +9103,24 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer 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() { } @@ -9208,13 +9314,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 { } } @@ -9223,9 +9336,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 { } } @@ -9233,11 +9347,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; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } @@ -9296,37 +9413,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer 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; @@ -9742,6 +9828,20 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class 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; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + 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() { } @@ -9801,7 +9901,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; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -10026,6 +10126,22 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write 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; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + 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 ReplicationLinkState : System.IEquatable { 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/src/Generated/ArmSqlModelFactory.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ArmSqlModelFactory.cs index 0064125ba412..37b24808eaf3 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). @@ -4933,565 +4913,305 @@ 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, + databaseName, + maxSizeBytes, + createdOn, + deletedOn, + earliestRestoreOn, + backupStorageRedundancy, + keys, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Value of the server configuration option. + /// Provisioning state of server configuration option. + /// A new instance for mocking. + public static ManagedInstanceServerConfigurationOptionData ManagedInstanceServerConfigurationOptionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, int? serverConfigurationOptionValue = null, JobExecutionProvisioningState? provisioningState = null) + { + return new ManagedInstanceServerConfigurationOptionData( + id, + name, + resourceType, + systemData, + serverConfigurationOptionValue, 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) + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The description of the schedule. + /// The time zone of the schedule. + /// Schedule list. + /// Next action to be executed (Start or Stop). + /// Timestamp when the next action will be executed in the corresponding schedule time zone. + /// A new instance for mocking. + public static ManagedInstanceStartStopScheduleData ManagedInstanceStartStopScheduleData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string description = null, string timeZoneId = null, IEnumerable scheduleList = null, string nextRunAction = null, string nextExecutionTime = null) { - return new ManagedInstancePecProperty(id, properties, serializedAdditionalRawData: null); + scheduleList ??= new List(); + + return new ManagedInstanceStartStopScheduleData( + id, + name, + resourceType, + systemData, + description, + timeZoneId, + scheduleList?.ToList(), + nextRunAction, + nextExecutionTime, + 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) + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Specifies the state of the transparent data encryption. + /// A new instance for mocking. + public static LogicalDatabaseTransparentDataEncryptionData LogicalDatabaseTransparentDataEncryptionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, TransparentDataEncryptionState? state = null) { - return new SqlServicePrincipal(principalId, clientId, tenantId, principalType, serializedAdditionalRawData: null); + return new LogicalDatabaseTransparentDataEncryptionData( + id, + name, + resourceType, + systemData, + state, + 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) + /// 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, DatabaseOperationPhaseDetails operationPhaseDetails = null) { - tags ??= new Dictionary(); - privateEndpointConnections ??= new List(); - - return new ManagedInstancePatch( - sku, - identity, - tags, - provisioningState, - managedInstanceCreateMode, - fullyQualifiedDomainName, - administratorLogin, - administratorLoginPassword, - subnetId, + return new DatabaseOperationData( + id, + name, + resourceType, + systemData, + databaseName, + operation, + operationFriendlyName, + percentComplete, + serverName, + startOn, state, - licenseType, - vCores, - storageSizeInGB, - collation, - dnsZone, - managedDnsZonePartner, - isPublicDataEndpointEnabled, - sourceManagedInstanceId, - restorePointInTime, - proxyOverride, - timezoneId, - instancePoolId, - maintenanceConfigurationId, - privateEndpointConnections?.ToList(), - minimalTlsVersion, - currentBackupStorageRedundancy, - requestedBackupStorageRedundancy, - isZoneRedundant, - primaryUserAssignedIdentityId, - keyId, - administrators, - servicePrincipal, + errorCode, + errorDescription, + errorSeverity, + isUserError, + estimatedCompleteOn, + description, + isCancellable, + operationPhaseDetails, 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) + /// Initializes a new instance of . + /// The operation phase. + /// The operation phase information. + /// A new instance for mocking. + public static DatabaseOperationPhaseDetails DatabaseOperationPhaseDetails(DatabaseOperationPhase? phase = null, IReadOnlyDictionary phaseInformation = null) { - endpointDetails ??= new List(); - - return new ManagedInstanceEndpointDependency(domainName, endpointDetails?.ToList(), serializedAdditionalRawData: null); - } + phaseInformation ??= new Dictionary(); - /// 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); + return new DatabaseOperationPhaseDetails(phase, phaseInformation, 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) + /// 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) { - queries ??= new List(); - - return new TopQueries( - numberOfQueries, - aggregationFunction, - observationMetric, - intervalType, - startTime, - endTime, - queries?.ToList(), - serializedAdditionalRawData: null); + return new IPv6FirewallRuleData( + id, + name, + resourceType, + serializedAdditionalRawData: null, + startIPv6Address, + endIPv6Address); } - /// 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) + /// The baseline set result. + /// A new instance for mocking. + public static SqlVulnerabilityAssessmentBaselineData SqlVulnerabilityAssessmentBaselineData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary>> results = null) { - return new ManagedLedgerDigestUploadData( + results ??= new Dictionary>>(); + + return new SqlVulnerabilityAssessmentBaselineData( id, name, resourceType, systemData, - digestStorageEndpoint, - state, + results, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// 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) + /// The latest scan flag. + /// The rule baseline result list. + /// A new instance for mocking. + public static SqlVulnerabilityAssessmentBaselineCreateOrUpdateContent SqlVulnerabilityAssessmentBaselineCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, bool? isLatestScan = null, IDictionary>> results = null) { - keys ??= new Dictionary(); + results ??= new Dictionary>>(); - return new RecoverableDatabaseData( + return new SqlVulnerabilityAssessmentBaselineCreateOrUpdateContent( id, name, resourceType, systemData, - edition, - serviceLevelObjective, - elasticPoolName, - lastAvailableBackupOn, - keys, + isLatestScan, + results, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// 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) + /// The rule baseline result. + /// A new instance for mocking. + public static SqlVulnerabilityAssessmentBaselineRuleData SqlVulnerabilityAssessmentBaselineRuleData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable> results = null) { - tags ??= new Dictionary(); - keys ??= new Dictionary(); + results ??= new List>(); - return new RestorableDroppedDatabaseData( + return new SqlVulnerabilityAssessmentBaselineRuleData( id, name, resourceType, systemData, - tags, - location, - sku, - databaseName, - maxSizeBytes, - createdOn, - deletedOn, - earliestRestoreOn, - backupStorageRedundancy, - keys, + results?.ToList(), serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. - /// Value of the server configuration option. - /// Provisioning state of server configuration option. - /// A new instance for mocking. - public static ManagedInstanceServerConfigurationOptionData ManagedInstanceServerConfigurationOptionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, int? serverConfigurationOptionValue = null, JobExecutionProvisioningState? provisioningState = null) - { - return new ManagedInstanceServerConfigurationOptionData( - id, - name, - resourceType, - systemData, - serverConfigurationOptionValue, - provisioningState, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The description of the schedule. - /// The time zone of the schedule. - /// Schedule list. - /// Next action to be executed (Start or Stop). - /// Timestamp when the next action will be executed in the corresponding schedule time zone. - /// A new instance for mocking. - public static ManagedInstanceStartStopScheduleData ManagedInstanceStartStopScheduleData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string description = null, string timeZoneId = null, IEnumerable scheduleList = null, string nextRunAction = null, string nextExecutionTime = null) - { - scheduleList ??= new List(); - - return new ManagedInstanceStartStopScheduleData( - id, - name, - resourceType, - systemData, - description, - timeZoneId, - scheduleList?.ToList(), - nextRunAction, - nextExecutionTime, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Specifies the state of the transparent data encryption. - /// A new instance for mocking. - public static LogicalDatabaseTransparentDataEncryptionData LogicalDatabaseTransparentDataEncryptionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, TransparentDataEncryptionState? state = null) - { - return new LogicalDatabaseTransparentDataEncryptionData( - id, - name, - resourceType, - systemData, - state, - 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, DatabaseOperationPhaseDetails 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 DatabaseOperationPhaseDetails DatabaseOperationPhaseDetails(DatabaseOperationPhase? phase = null, IReadOnlyDictionary phaseInformation = null) - { - phaseInformation ??= new Dictionary(); - - return new DatabaseOperationPhaseDetails(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); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The baseline set result. - /// A new instance for mocking. - public static SqlVulnerabilityAssessmentBaselineData SqlVulnerabilityAssessmentBaselineData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary>> results = null) - { - results ??= new Dictionary>>(); - - return new SqlVulnerabilityAssessmentBaselineData( - id, - name, - resourceType, - systemData, - results, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The latest scan flag. - /// The rule baseline result list. - /// A new instance for mocking. - public static SqlVulnerabilityAssessmentBaselineCreateOrUpdateContent SqlVulnerabilityAssessmentBaselineCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, bool? isLatestScan = null, IDictionary>> results = null) - { - results ??= new Dictionary>>(); - - return new SqlVulnerabilityAssessmentBaselineCreateOrUpdateContent( - id, - name, - resourceType, - systemData, - isLatestScan, - results, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The rule baseline result. - /// A new instance for mocking. - public static SqlVulnerabilityAssessmentBaselineRuleData SqlVulnerabilityAssessmentBaselineRuleData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable> results = null) - { - results ??= new List>(); - - return new SqlVulnerabilityAssessmentBaselineRuleData( - id, - name, - resourceType, - systemData, - results?.ToList(), - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The latest scan flag. - /// The rule baseline result. - /// A new instance for mocking. - public static SqlVulnerabilityAssessmentBaselineRuleCreateOrUpdateContent SqlVulnerabilityAssessmentBaselineRuleCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, bool? isLatestScan = null, IEnumerable> results = null) + /// The latest scan flag. + /// The rule baseline result. + /// A new instance for mocking. + public static SqlVulnerabilityAssessmentBaselineRuleCreateOrUpdateContent SqlVulnerabilityAssessmentBaselineRuleCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, bool? isLatestScan = null, IEnumerable> results = null) { results ??= new List>(); @@ -5906,6 +5626,371 @@ public static LongTermRetentionPolicyData LongTermRetentionPolicyData(ResourceId 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, + 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 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 . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Request Id. + /// Request type. + /// Queued time. + /// Managed instance name. + /// Operation status. + /// 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 RefreshExternalGovernanceStatusOperationResultMI( + id, + name, + resourceType, + systemData, + requestId, + requestType, + queuedTime, + managedInstanceName, + status, + errorMessage, + 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 . + /// 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 . /// /// 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 217cbffe79ea..8bb265937d3e 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/MockableSqlArmClient.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/MockableSqlArmClient.cs @@ -1246,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. @@ -1522,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. 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 84185a040f19..9394026cdd18 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/SqlExtensions.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/SqlExtensions.cs @@ -1953,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. @@ -2390,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. @@ -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/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 b201d670d93e..ec9459487a84 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedInstanceData.Serialization.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedInstanceData.Serialization.cs @@ -67,6 +67,11 @@ protected override void JsonModelWriteCore(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); @@ -92,6 +97,16 @@ protected override void JsonModelWriteCore(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); @@ -102,6 +117,16 @@ protected override void JsonModelWriteCore(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); @@ -202,6 +227,36 @@ protected override void JsonModelWriteCore(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(); } @@ -233,16 +288,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; @@ -262,6 +322,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()) @@ -343,7 +409,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)) @@ -360,6 +426,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(); @@ -393,6 +468,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) @@ -411,6 +504,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(); @@ -571,6 +682,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; } @@ -592,13 +753,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, @@ -618,6 +784,12 @@ internal static ManagedInstanceData DeserializeManagedInstanceData(JsonElement e keyId, administrators, servicePrincipal, + virtualClusterId, + externalGovernanceStatus, + pricingModel, + createTime, + authenticationMetadata, + databaseFormat, serializedAdditionalRawData); } @@ -819,6 +991,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) { @@ -918,6 +1106,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) { @@ -948,6 +1166,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) { @@ -1276,6 +1524,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..8cbda8529cf6 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedInstanceResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedInstanceResource.cs @@ -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..3c2bd9dfdffa --- /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 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 != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 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..7c15f87c25b6 --- /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 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 != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 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..787e7a24ebe1 --- /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 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 != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 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..5dba9bfa0e77 --- /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 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 != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 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..ed9c1b652eaa --- /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 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 != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 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 8af061516409..bc423f7c0ed8 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 @@ -74,6 +74,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit 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); @@ -99,6 +104,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit 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); @@ -109,6 +124,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit 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); @@ -209,6 +234,36 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit 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) { @@ -250,16 +305,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; @@ -279,6 +339,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()) @@ -331,7 +397,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)) @@ -348,6 +414,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(); @@ -381,6 +456,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) @@ -399,6 +492,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(); @@ -559,6 +670,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; } @@ -575,13 +736,18 @@ internal static ManagedInstancePatch DeserializeManagedInstancePatch(JsonElement provisioningState, managedInstanceCreateMode, fullyQualifiedDomainName, + isGeneralPurposeV2, administratorLogin, administratorLoginPassword, subnetId, state, licenseType, + hybridSecondaryUsage, + hybridSecondaryUsageDetected, vCores, storageSizeInGB, + storageIOps, + storageThroughputMBps, collation, dnsZone, dnsZonePartner, @@ -601,6 +767,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 69b071a8428b..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 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 != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} 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..b68c6af69888 --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/QueryMetricIntervalAutoGenerated.Serialization.cs @@ -0,0 +1,279 @@ +// 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) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(QueryMetricIntervalAutoGenerated)} does not support writing '{format}' format."); + } + + 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 + } + } + } + + 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 b532c7137090..6f097ad9db21 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 @@ -107,7 +107,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()) @@ -138,10 +138,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; @@ -157,7 +157,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..0cdb793a189a --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/RefreshExternalGovernanceStatusOperationResultMI.Serialization.cs @@ -0,0 +1,433 @@ +// 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) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RefreshExternalGovernanceStatusOperationResultMI)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + 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(); + } + + 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/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/autorest.md b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/autorest.md index fce496a18d8e..e58aa268fbd1 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/f45a76fc39f033947ed12faf4b6416e1e19724cd/specification/sql/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/sql/resource-manager/readme.md #package-composite-v5 namespace: Azure.ResourceManager.Sql output-folder: $(this-folder)/Generated