From f60938658bfcfd2e4077be6082a9f69afd4cbf36 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 20 Sep 2023 21:03:17 +0000 Subject: [PATCH] CodeGen from PR 25852 in Azure/azure-rest-api-specs Merge 7867ec80992f1472bd07688c5890d061cabc3ce7 into e770272bb303e5a9776195112ac23a80344c0b18 --- ...zure.ResourceManager.Sql.netstandard2.0.cs | 77 ++- .../Samples/Sample_ElasticPoolResource.cs | 2 +- .../Sample_JobPrivateEndpointCollection.cs | 167 ++++++ .../Sample_JobPrivateEndpointResource.cs | 120 +++++ .../Samples/Sample_SqlDatabaseCollection.cs | 66 +-- .../Samples/Sample_SqlDatabaseResource.cs | 42 +- ..._SqlPrivateEndpointConnectionCollection.cs | 80 +-- ...le_SqlPrivateEndpointConnectionResource.cs | 6 +- .../Samples/Sample_SqlServerResource.cs | 4 +- .../src/Generated/ArmSqlModelFactory.cs | 59 ++- .../src/Generated/Extensions/SqlExtensions.cs | 19 + .../Generated/JobPrivateEndpointCollection.cs | 341 +++++++++++++ .../src/Generated/JobPrivateEndpointData.cs | 42 ++ .../Generated/JobPrivateEndpointResource.cs | 297 +++++++++++ .../JobPrivateEndpointOperationSource.cs | 40 ++ .../Models/DatabaseImportDefinition.cs | 2 +- .../Models/FreeLimitExhaustionBehavior.cs | 57 +++ .../JobPrivateEndpointData.Serialization.cs | 98 ++++ ...PrivateEndpointListResult.Serialization.cs | 50 ++ .../Models/JobPrivateEndpointListResult.cs | 37 ++ ...tionSettingsAutoGenerated.Serialization.cs | 31 ++ .../NetworkIsolationSettingsAutoGenerated.cs | 25 + .../Models/SqlAlwaysEncryptedEnclaveType.cs | 2 +- .../Models/SqlAvailabilityZoneType.cs | 2 +- .../Models/SqlDatabaseData.Serialization.cs | 47 +- .../Models/SqlDatabasePatch.Serialization.cs | 15 + .../src/Generated/Models/SqlDatabasePatch.cs | 12 + ...ateEndpointConnectionData.Serialization.cs | 18 +- .../RestOperations/DatabasesRestOperations.cs | 2 +- .../JobPrivateEndpointsRestOperations.cs | 474 ++++++++++++++++++ ...rivateEndpointConnectionsRestOperations.cs | 160 +++--- .../src/Generated/SqlDatabaseData.cs | 26 +- .../SqlPrivateEndpointConnectionData.cs | 8 +- .../Generated/SqlServerJobAgentResource.cs | 53 ++ .../Azure.ResourceManager.Sql/src/autorest.md | 2 +- 35 files changed, 2274 insertions(+), 209 deletions(-) create mode 100644 sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_JobPrivateEndpointCollection.cs create mode 100644 sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_JobPrivateEndpointResource.cs create mode 100644 sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/JobPrivateEndpointCollection.cs create mode 100644 sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/JobPrivateEndpointData.cs create mode 100644 sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/JobPrivateEndpointResource.cs create mode 100644 sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/LongRunningOperation/JobPrivateEndpointOperationSource.cs create mode 100644 sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/FreeLimitExhaustionBehavior.cs create mode 100644 sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/JobPrivateEndpointData.Serialization.cs create mode 100644 sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/JobPrivateEndpointListResult.Serialization.cs create mode 100644 sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/JobPrivateEndpointListResult.cs create mode 100644 sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/NetworkIsolationSettingsAutoGenerated.Serialization.cs create mode 100644 sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/NetworkIsolationSettingsAutoGenerated.cs create mode 100644 sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/JobPrivateEndpointsRestOperations.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 a1e1fa3cc57d..78bd7ae41f03 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 @@ -666,6 +666,41 @@ protected IPv6FirewallRuleResource() { } public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Sql.IPv6FirewallRuleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Sql.IPv6FirewallRuleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } + public partial class JobPrivateEndpointCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected JobPrivateEndpointCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string privateEndpointName, Azure.ResourceManager.Sql.JobPrivateEndpointData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string privateEndpointName, Azure.ResourceManager.Sql.JobPrivateEndpointData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string privateEndpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string privateEndpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string privateEndpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string privateEndpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class JobPrivateEndpointData : Azure.ResourceManager.Models.ResourceData + { + public JobPrivateEndpointData() { } + public string PrivateEndpointId { get { throw null; } } + public Azure.Core.ResourceIdentifier TargetServerAzureResourceId { get { throw null; } set { } } + } + public partial class JobPrivateEndpointResource : Azure.ResourceManager.ArmResource + { + public static readonly Azure.Core.ResourceType ResourceType; + protected JobPrivateEndpointResource() { } + public virtual Azure.ResourceManager.Sql.JobPrivateEndpointData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string serverName, string jobAgentName, string privateEndpointName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Sql.JobPrivateEndpointData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Sql.JobPrivateEndpointData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class LedgerDigestUploadCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected LedgerDigestUploadCollection() { } @@ -2715,8 +2750,10 @@ public SqlDatabaseData(Azure.Core.AzureLocation location) : base (default(Azure. public System.DateTimeOffset? EarliestRestoreOn { get { throw null; } } public Azure.Core.ResourceIdentifier ElasticPoolId { get { throw null; } set { } } public string EncryptionProtector { get { throw null; } set { } } + public bool? EncryptionProtectorAutoRotation { get { throw null; } set { } } public Azure.Core.ResourceIdentifier FailoverGroupId { get { throw null; } } public System.Guid? FederatedClientId { get { throw null; } set { } } + public Azure.ResourceManager.Sql.Models.FreeLimitExhaustionBehavior? FreeLimitExhaustionBehavior { get { throw null; } set { } } public int? HighAvailabilityReplicaCount { get { throw null; } set { } } public Azure.ResourceManager.Sql.Models.DatabaseIdentity Identity { get { throw null; } set { } } public bool? IsInfraEncryptionEnabled { get { throw null; } } @@ -2750,6 +2787,7 @@ public SqlDatabaseData(Azure.Core.AzureLocation location) : base (default(Azure. public Azure.Core.ResourceIdentifier SourceDatabaseId { get { throw null; } set { } } public Azure.Core.ResourceIdentifier SourceResourceId { get { throw null; } set { } } public Azure.ResourceManager.Sql.Models.SqlDatabaseStatus? Status { get { throw null; } } + public bool? UseFreeLimit { get { throw null; } set { } } } public partial class SqlDatabaseResource : Azure.ResourceManager.ArmResource { @@ -3254,6 +3292,7 @@ public static partial class SqlExtensions public static Azure.Pageable GetInstancePools(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetInstancePoolsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.Sql.IPv6FirewallRuleResource GetIPv6FirewallRuleResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Sql.JobPrivateEndpointResource GetJobPrivateEndpointResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.Sql.LedgerDigestUploadResource GetLedgerDigestUploadResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.Sql.LogicalDatabaseTransparentDataEncryptionResource GetLogicalDatabaseTransparentDataEncryptionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -3505,6 +3544,7 @@ public partial class SqlPrivateEndpointConnectionData : Azure.ResourceManager.Mo { public SqlPrivateEndpointConnectionData() { } public Azure.ResourceManager.Sql.Models.SqlPrivateLinkServiceConnectionStateProperty ConnectionState { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList GroupIds { get { throw null; } } public Azure.Core.ResourceIdentifier PrivateEndpointId { get { throw null; } set { } } public Azure.ResourceManager.Sql.Models.SqlPrivateEndpointProvisioningState? ProvisioningState { get { throw null; } } } @@ -4005,6 +4045,9 @@ protected SqlServerJobAgentResource() { } public virtual Azure.Pageable GetJobExecutionsByAgent(System.DateTimeOffset? createTimeMin = default(System.DateTimeOffset?), System.DateTimeOffset? createTimeMax = default(System.DateTimeOffset?), System.DateTimeOffset? endTimeMin = default(System.DateTimeOffset?), System.DateTimeOffset? endTimeMax = default(System.DateTimeOffset?), bool? isActive = default(bool?), int? skip = default(int?), int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetJobExecutionsByAgentAsync(Azure.ResourceManager.Sql.Models.SqlServerJobAgentResourceGetJobExecutionsByAgentOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetJobExecutionsByAgentAsync(System.DateTimeOffset? createTimeMin = default(System.DateTimeOffset?), System.DateTimeOffset? createTimeMax = default(System.DateTimeOffset?), System.DateTimeOffset? endTimeMin = default(System.DateTimeOffset?), System.DateTimeOffset? endTimeMax = default(System.DateTimeOffset?), bool? isActive = default(bool?), int? skip = default(int?), int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetJobPrivateEndpoint(string privateEndpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetJobPrivateEndpointAsync(string privateEndpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Sql.JobPrivateEndpointCollection GetJobPrivateEndpoints() { throw null; } public virtual Azure.Response GetSqlServerJob(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetSqlServerJobAsync(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetSqlServerJobCredential(string credentialName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -5359,6 +5402,7 @@ public static partial class ArmSqlModelFactory public static Azure.ResourceManager.Sql.Models.InstancePoolVcoresCapability InstancePoolVcoresCapability(string name = null, int? value = default(int?), Azure.ResourceManager.Sql.Models.MaxSizeCapability storageLimit = null, Azure.ResourceManager.Sql.Models.SqlCapabilityStatus? status = default(Azure.ResourceManager.Sql.Models.SqlCapabilityStatus?), string reason = null) { throw null; } public static Azure.ResourceManager.Sql.IPv6FirewallRuleData IPv6FirewallRuleData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), string startIPv6Address = null, string endIPv6Address = null) { throw null; } public static Azure.ResourceManager.Sql.Models.JobExecutionTarget JobExecutionTarget(Azure.ResourceManager.Sql.Models.JobTargetType? targetType = default(Azure.ResourceManager.Sql.Models.JobTargetType?), string serverName = null, string databaseName = null) { throw null; } + public static Azure.ResourceManager.Sql.JobPrivateEndpointData JobPrivateEndpointData(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 targetServerAzureResourceId = null, string privateEndpointId = null) { throw null; } public static Azure.ResourceManager.Sql.LedgerDigestUploadData LedgerDigestUploadData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string digestStorageEndpoint = null, Azure.ResourceManager.Sql.Models.LedgerDigestUploadsState? state = default(Azure.ResourceManager.Sql.Models.LedgerDigestUploadsState?)) { throw null; } public static Azure.ResourceManager.Sql.Models.LicenseTypeCapability LicenseTypeCapability(string name = null, Azure.ResourceManager.Sql.Models.SqlCapabilityStatus? status = default(Azure.ResourceManager.Sql.Models.SqlCapabilityStatus?), string reason = null) { throw null; } public static Azure.ResourceManager.Sql.LogicalDatabaseTransparentDataEncryptionData LogicalDatabaseTransparentDataEncryptionData(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.TransparentDataEncryptionState? state = default(Azure.ResourceManager.Sql.Models.TransparentDataEncryptionState?)) { throw null; } @@ -5451,7 +5495,7 @@ public static partial class ArmSqlModelFactory public static Azure.ResourceManager.Sql.SqlAgentConfigurationData SqlAgentConfigurationData(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.SqlAgentConfigurationPropertiesState? state = default(Azure.ResourceManager.Sql.Models.SqlAgentConfigurationPropertiesState?)) { throw null; } public static Azure.ResourceManager.Sql.SqlDatabaseAutomaticTuningData SqlDatabaseAutomaticTuningData(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.AutomaticTuningMode? desiredState = default(Azure.ResourceManager.Sql.Models.AutomaticTuningMode?), Azure.ResourceManager.Sql.Models.AutomaticTuningMode? actualState = default(Azure.ResourceManager.Sql.Models.AutomaticTuningMode?), System.Collections.Generic.IDictionary options = null) { throw null; } public static Azure.ResourceManager.Sql.SqlDatabaseBlobAuditingPolicyData SqlDatabaseBlobAuditingPolicyData(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, int? retentionDays = default(int?), System.Collections.Generic.IEnumerable auditActionsAndGroups = null, bool? isStorageSecondaryKeyInUse = default(bool?), bool? isAzureMonitorTargetEnabled = default(bool?), int? queueDelayMs = default(int?), bool? isManagedIdentityInUse = default(bool?), Azure.ResourceManager.Sql.Models.BlobAuditingPolicyState? state = default(Azure.ResourceManager.Sql.Models.BlobAuditingPolicyState?), string storageEndpoint = null, string storageAccountAccessKey = null, System.Guid? storageAccountSubscriptionId = default(System.Guid?)) { throw null; } - public static Azure.ResourceManager.Sql.SqlDatabaseData SqlDatabaseData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Sql.Models.SqlSku sku = null, string kind = null, string managedBy = null, Azure.ResourceManager.Sql.Models.DatabaseIdentity identity = null, Azure.ResourceManager.Sql.Models.SqlDatabaseCreateMode? createMode = default(Azure.ResourceManager.Sql.Models.SqlDatabaseCreateMode?), string collation = null, long? maxSizeBytes = default(long?), Azure.ResourceManager.Sql.Models.SampleSchemaName? sampleName = default(Azure.ResourceManager.Sql.Models.SampleSchemaName?), Azure.Core.ResourceIdentifier elasticPoolId = null, Azure.Core.ResourceIdentifier sourceDatabaseId = null, Azure.ResourceManager.Sql.Models.SqlDatabaseStatus? status = default(Azure.ResourceManager.Sql.Models.SqlDatabaseStatus?), System.Guid? databaseId = default(System.Guid?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), string currentServiceObjectiveName = null, string requestedServiceObjectiveName = null, Azure.Core.AzureLocation? defaultSecondaryLocation = default(Azure.Core.AzureLocation?), Azure.Core.ResourceIdentifier failoverGroupId = null, System.DateTimeOffset? restorePointInTime = default(System.DateTimeOffset?), System.DateTimeOffset? sourceDatabaseDeletedOn = default(System.DateTimeOffset?), Azure.Core.ResourceIdentifier recoveryServicesRecoveryPointId = null, Azure.Core.ResourceIdentifier longTermRetentionBackupResourceId = null, Azure.Core.ResourceIdentifier recoverableDatabaseId = null, Azure.Core.ResourceIdentifier restorableDroppedDatabaseId = null, Azure.ResourceManager.Sql.Models.CatalogCollationType? catalogCollation = default(Azure.ResourceManager.Sql.Models.CatalogCollationType?), bool? isZoneRedundant = default(bool?), Azure.ResourceManager.Sql.Models.DatabaseLicenseType? licenseType = default(Azure.ResourceManager.Sql.Models.DatabaseLicenseType?), long? maxLogSizeBytes = default(long?), System.DateTimeOffset? earliestRestoreOn = default(System.DateTimeOffset?), Azure.ResourceManager.Sql.Models.DatabaseReadScale? readScale = default(Azure.ResourceManager.Sql.Models.DatabaseReadScale?), int? highAvailabilityReplicaCount = default(int?), Azure.ResourceManager.Sql.Models.SecondaryType? secondaryType = default(Azure.ResourceManager.Sql.Models.SecondaryType?), Azure.ResourceManager.Sql.Models.SqlSku currentSku = null, int? autoPauseDelay = default(int?), Azure.ResourceManager.Sql.Models.SqlBackupStorageRedundancy? currentBackupStorageRedundancy = default(Azure.ResourceManager.Sql.Models.SqlBackupStorageRedundancy?), Azure.ResourceManager.Sql.Models.SqlBackupStorageRedundancy? requestedBackupStorageRedundancy = default(Azure.ResourceManager.Sql.Models.SqlBackupStorageRedundancy?), double? minCapacity = default(double?), System.DateTimeOffset? pausedOn = default(System.DateTimeOffset?), System.DateTimeOffset? resumedOn = default(System.DateTimeOffset?), Azure.Core.ResourceIdentifier maintenanceConfigurationId = null, bool? isLedgerOn = default(bool?), bool? isInfraEncryptionEnabled = default(bool?), System.Guid? federatedClientId = default(System.Guid?), System.Collections.Generic.IDictionary keys = null, string encryptionProtector = null, Azure.ResourceManager.Sql.Models.SqlAlwaysEncryptedEnclaveType? preferredEnclaveType = default(Azure.ResourceManager.Sql.Models.SqlAlwaysEncryptedEnclaveType?), Azure.Core.ResourceIdentifier sourceResourceId = null, bool? manualCutover = default(bool?), bool? performCutover = default(bool?), Azure.ResourceManager.Sql.Models.SqlAvailabilityZoneType? availabilityZone = default(Azure.ResourceManager.Sql.Models.SqlAvailabilityZoneType?)) { throw null; } + public static Azure.ResourceManager.Sql.SqlDatabaseData SqlDatabaseData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Sql.Models.SqlSku sku = null, string kind = null, string managedBy = null, Azure.ResourceManager.Sql.Models.DatabaseIdentity identity = null, Azure.ResourceManager.Sql.Models.SqlDatabaseCreateMode? createMode = default(Azure.ResourceManager.Sql.Models.SqlDatabaseCreateMode?), string collation = null, long? maxSizeBytes = default(long?), Azure.ResourceManager.Sql.Models.SampleSchemaName? sampleName = default(Azure.ResourceManager.Sql.Models.SampleSchemaName?), Azure.Core.ResourceIdentifier elasticPoolId = null, Azure.Core.ResourceIdentifier sourceDatabaseId = null, Azure.ResourceManager.Sql.Models.SqlDatabaseStatus? status = default(Azure.ResourceManager.Sql.Models.SqlDatabaseStatus?), System.Guid? databaseId = default(System.Guid?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), string currentServiceObjectiveName = null, string requestedServiceObjectiveName = null, Azure.Core.AzureLocation? defaultSecondaryLocation = default(Azure.Core.AzureLocation?), Azure.Core.ResourceIdentifier failoverGroupId = null, System.DateTimeOffset? restorePointInTime = default(System.DateTimeOffset?), System.DateTimeOffset? sourceDatabaseDeletedOn = default(System.DateTimeOffset?), Azure.Core.ResourceIdentifier recoveryServicesRecoveryPointId = null, Azure.Core.ResourceIdentifier longTermRetentionBackupResourceId = null, Azure.Core.ResourceIdentifier recoverableDatabaseId = null, Azure.Core.ResourceIdentifier restorableDroppedDatabaseId = null, Azure.ResourceManager.Sql.Models.CatalogCollationType? catalogCollation = default(Azure.ResourceManager.Sql.Models.CatalogCollationType?), bool? isZoneRedundant = default(bool?), Azure.ResourceManager.Sql.Models.DatabaseLicenseType? licenseType = default(Azure.ResourceManager.Sql.Models.DatabaseLicenseType?), long? maxLogSizeBytes = default(long?), System.DateTimeOffset? earliestRestoreOn = default(System.DateTimeOffset?), Azure.ResourceManager.Sql.Models.DatabaseReadScale? readScale = default(Azure.ResourceManager.Sql.Models.DatabaseReadScale?), int? highAvailabilityReplicaCount = default(int?), Azure.ResourceManager.Sql.Models.SecondaryType? secondaryType = default(Azure.ResourceManager.Sql.Models.SecondaryType?), Azure.ResourceManager.Sql.Models.SqlSku currentSku = null, int? autoPauseDelay = default(int?), Azure.ResourceManager.Sql.Models.SqlBackupStorageRedundancy? currentBackupStorageRedundancy = default(Azure.ResourceManager.Sql.Models.SqlBackupStorageRedundancy?), Azure.ResourceManager.Sql.Models.SqlBackupStorageRedundancy? requestedBackupStorageRedundancy = default(Azure.ResourceManager.Sql.Models.SqlBackupStorageRedundancy?), double? minCapacity = default(double?), System.DateTimeOffset? pausedOn = default(System.DateTimeOffset?), System.DateTimeOffset? resumedOn = default(System.DateTimeOffset?), Azure.Core.ResourceIdentifier maintenanceConfigurationId = null, bool? isLedgerOn = default(bool?), bool? isInfraEncryptionEnabled = default(bool?), System.Guid? federatedClientId = default(System.Guid?), System.Collections.Generic.IDictionary keys = null, string encryptionProtector = null, Azure.ResourceManager.Sql.Models.SqlAlwaysEncryptedEnclaveType? preferredEnclaveType = default(Azure.ResourceManager.Sql.Models.SqlAlwaysEncryptedEnclaveType?), bool? useFreeLimit = default(bool?), Azure.ResourceManager.Sql.Models.FreeLimitExhaustionBehavior? freeLimitExhaustionBehavior = default(Azure.ResourceManager.Sql.Models.FreeLimitExhaustionBehavior?), Azure.Core.ResourceIdentifier sourceResourceId = null, bool? manualCutover = default(bool?), bool? performCutover = default(bool?), Azure.ResourceManager.Sql.Models.SqlAvailabilityZoneType? availabilityZone = default(Azure.ResourceManager.Sql.Models.SqlAvailabilityZoneType?), bool? encryptionProtectorAutoRotation = default(bool?)) { throw null; } public static Azure.ResourceManager.Sql.Models.SqlDatabaseExtension SqlDatabaseExtension(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.DatabaseExtensionOperationMode? operationMode = default(Azure.ResourceManager.Sql.Models.DatabaseExtensionOperationMode?), Azure.ResourceManager.Sql.Models.StorageKeyType? storageKeyType = default(Azure.ResourceManager.Sql.Models.StorageKeyType?), string storageKey = null, System.Uri storageUri = null) { throw null; } public static Azure.ResourceManager.Sql.Models.SqlDatabaseKey SqlDatabaseKey(Azure.ResourceManager.Sql.Models.SqlDatabaseKeyType? keyType = default(Azure.ResourceManager.Sql.Models.SqlDatabaseKeyType?), string thumbprint = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), string subregion = null) { throw null; } public static Azure.ResourceManager.Sql.SqlDatabaseSecurityAlertPolicyData SqlDatabaseSecurityAlertPolicyData(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.SecurityAlertsPolicyState? state = default(Azure.ResourceManager.Sql.Models.SecurityAlertsPolicyState?), System.Collections.Generic.IEnumerable disabledAlerts = null, System.Collections.Generic.IEnumerable emailAddresses = null, bool? sendToEmailAccountAdmins = default(bool?), string storageEndpoint = null, string storageAccountAccessKey = null, int? retentionDays = default(int?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?)) { throw null; } @@ -5464,7 +5508,7 @@ public static partial class ArmSqlModelFactory public static Azure.ResourceManager.Sql.Models.SqlMetricValue SqlMetricValue(int? count = default(int?), double? average = default(double?), double? maximum = default(double?), double? minimum = default(double?), System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), double? total = default(double?)) { throw null; } public static Azure.ResourceManager.Sql.Models.SqlNameAvailabilityResponse SqlNameAvailabilityResponse(string name = null, bool? isAvailable = default(bool?), Azure.ResourceManager.Sql.Models.SqlNameUnavailableReason? reason = default(Azure.ResourceManager.Sql.Models.SqlNameUnavailableReason?), string message = null) { throw null; } public static Azure.ResourceManager.Sql.Models.SqlOutboundEnvironmentEndpoint SqlOutboundEnvironmentEndpoint(string category = null, System.Collections.Generic.IEnumerable endpoints = null) { throw null; } - public static Azure.ResourceManager.Sql.SqlPrivateEndpointConnectionData SqlPrivateEndpointConnectionData(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.SqlPrivateLinkServiceConnectionStateProperty connectionState = null, Azure.ResourceManager.Sql.Models.SqlPrivateEndpointProvisioningState? provisioningState = default(Azure.ResourceManager.Sql.Models.SqlPrivateEndpointProvisioningState?)) { throw null; } + public static Azure.ResourceManager.Sql.SqlPrivateEndpointConnectionData SqlPrivateEndpointConnectionData(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, System.Collections.Generic.IEnumerable groupIds = null, Azure.ResourceManager.Sql.Models.SqlPrivateLinkServiceConnectionStateProperty connectionState = null, Azure.ResourceManager.Sql.Models.SqlPrivateEndpointProvisioningState? provisioningState = default(Azure.ResourceManager.Sql.Models.SqlPrivateEndpointProvisioningState?)) { throw null; } public static Azure.ResourceManager.Sql.SqlPrivateLinkResourceData SqlPrivateLinkResourceData(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.SqlPrivateLinkResourceProperties properties = null) { throw null; } public static Azure.ResourceManager.Sql.Models.SqlPrivateLinkResourceProperties SqlPrivateLinkResourceProperties(string groupId = null, System.Collections.Generic.IEnumerable requiredMembers = null, System.Collections.Generic.IEnumerable requiredZoneNames = null) { throw null; } public static Azure.ResourceManager.Sql.Models.SqlPrivateLinkServiceConnectionStateProperty SqlPrivateLinkServiceConnectionStateProperty(Azure.ResourceManager.Sql.Models.SqlPrivateLinkServiceConnectionStatus status = default(Azure.ResourceManager.Sql.Models.SqlPrivateLinkServiceConnectionStatus), string description = null, Azure.ResourceManager.Sql.Models.SqlPrivateLinkServiceConnectionActionsRequired? actionsRequired = default(Azure.ResourceManager.Sql.Models.SqlPrivateLinkServiceConnectionActionsRequired?)) { throw null; } @@ -5768,7 +5812,7 @@ public DatabaseImportDefinition(Azure.ResourceManager.Sql.Models.StorageKeyType public string DatabaseName { get { throw null; } set { } } public string Edition { get { throw null; } set { } } public string MaxSizeBytes { get { throw null; } set { } } - public Azure.ResourceManager.Sql.Models.NetworkIsolationSettings NetworkIsolation { get { throw null; } set { } } + public Azure.ResourceManager.Sql.Models.NetworkIsolationSettingsAutoGenerated NetworkIsolation { get { throw null; } set { } } public string ServiceObjectiveName { get { throw null; } set { } } public string StorageKey { get { throw null; } } public Azure.ResourceManager.Sql.Models.StorageKeyType StorageKeyType { get { throw null; } } @@ -6212,6 +6256,24 @@ public FailoverGroupReadWriteEndpoint(Azure.ResourceManager.Sql.Models.ReadWrite public override string ToString() { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct FreeLimitExhaustionBehavior : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public FreeLimitExhaustionBehavior(string value) { throw null; } + public static Azure.ResourceManager.Sql.Models.FreeLimitExhaustionBehavior AutoPause { get { throw null; } } + public static Azure.ResourceManager.Sql.Models.FreeLimitExhaustionBehavior BillOverUsage { get { throw null; } } + public bool Equals(Azure.ResourceManager.Sql.Models.FreeLimitExhaustionBehavior 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.FreeLimitExhaustionBehavior left, Azure.ResourceManager.Sql.Models.FreeLimitExhaustionBehavior right) { throw null; } + public static implicit operator Azure.ResourceManager.Sql.Models.FreeLimitExhaustionBehavior (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Sql.Models.FreeLimitExhaustionBehavior left, Azure.ResourceManager.Sql.Models.FreeLimitExhaustionBehavior 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; @@ -7271,6 +7333,12 @@ public NetworkIsolationSettings() { } public Azure.Core.ResourceIdentifier SqlServerResourceId { get { throw null; } set { } } public Azure.Core.ResourceIdentifier StorageAccountResourceId { get { throw null; } set { } } } + public partial class NetworkIsolationSettingsAutoGenerated + { + public NetworkIsolationSettingsAutoGenerated() { } + public Azure.Core.ResourceIdentifier SqlServerResourceId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier StorageAccountResourceId { get { throw null; } set { } } + } public partial class PartnerRegionInfo { public PartnerRegionInfo() { } @@ -8177,8 +8245,10 @@ public SqlDatabasePatch() { } public System.DateTimeOffset? EarliestRestoreOn { get { throw null; } } public Azure.Core.ResourceIdentifier ElasticPoolId { get { throw null; } set { } } public string EncryptionProtector { get { throw null; } set { } } + public bool? EncryptionProtectorAutoRotation { get { throw null; } set { } } public Azure.Core.ResourceIdentifier FailoverGroupId { get { throw null; } } public System.Guid? FederatedClientId { get { throw null; } set { } } + public Azure.ResourceManager.Sql.Models.FreeLimitExhaustionBehavior? FreeLimitExhaustionBehavior { get { throw null; } set { } } public int? HighAvailabilityReplicaCount { get { throw null; } set { } } public Azure.ResourceManager.Sql.Models.DatabaseIdentity Identity { get { throw null; } set { } } public bool? IsInfraEncryptionEnabled { get { throw null; } } @@ -8210,6 +8280,7 @@ public SqlDatabasePatch() { } public Azure.Core.ResourceIdentifier SourceDatabaseId { get { throw null; } set { } } public Azure.ResourceManager.Sql.Models.SqlDatabaseStatus? Status { get { throw null; } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } + public bool? UseFreeLimit { get { throw null; } set { } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct SqlDatabaseState : System.IEquatable diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_ElasticPoolResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_ElasticPoolResource.cs index 7ca2bf1dc6f2..6e3beeace2c6 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_ElasticPoolResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_ElasticPoolResource.cs @@ -208,7 +208,7 @@ public async Task GetElasticPoolOperations_ListTheElasticPoolManagementOperation [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetDatabases_GetsAListOfDatabasesInAnElasticPool() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ListDatabasesByElasticPool.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/ListDatabasesByElasticPool.json // this example is just showing the usage of "Databases_ListByElasticPool" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_JobPrivateEndpointCollection.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_JobPrivateEndpointCollection.cs new file mode 100644 index 000000000000..ad09903513ba --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_JobPrivateEndpointCollection.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.Sql; + +namespace Azure.ResourceManager.Sql.Samples +{ + public partial class Sample_JobPrivateEndpointCollection + { + // List private endpoints in a job agent + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListPrivateEndpointsInAJobAgent() + { + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ListJobPrivateEndpointsByAgent.json + // this example is just showing the usage of "JobPrivateEndpoints_ListByAgent" 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 SqlServerJobAgentResource created on azure + // for more information of creating SqlServerJobAgentResource, please refer to the document of SqlServerJobAgentResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "group1"; + string serverName = "server1"; + string jobAgentName = "agent1"; + ResourceIdentifier sqlServerJobAgentResourceId = SqlServerJobAgentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName, jobAgentName); + SqlServerJobAgentResource sqlServerJobAgent = client.GetSqlServerJobAgentResource(sqlServerJobAgentResourceId); + + // get the collection of this JobPrivateEndpointResource + JobPrivateEndpointCollection collection = sqlServerJobAgent.GetJobPrivateEndpoints(); + + // invoke the operation and iterate over the result + await foreach (JobPrivateEndpointResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + JobPrivateEndpointData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get a private endpoint. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetAPrivateEndpoint() + { + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/GetJobPrivateEndpoint.json + // this example is just showing the usage of "JobPrivateEndpoints_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 SqlServerJobAgentResource created on azure + // for more information of creating SqlServerJobAgentResource, please refer to the document of SqlServerJobAgentResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "group1"; + string serverName = "server1"; + string jobAgentName = "agent1"; + ResourceIdentifier sqlServerJobAgentResourceId = SqlServerJobAgentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName, jobAgentName); + SqlServerJobAgentResource sqlServerJobAgent = client.GetSqlServerJobAgentResource(sqlServerJobAgentResourceId); + + // get the collection of this JobPrivateEndpointResource + JobPrivateEndpointCollection collection = sqlServerJobAgent.GetJobPrivateEndpoints(); + + // invoke the operation + string privateEndpointName = "endpoint1"; + JobPrivateEndpointResource result = await collection.GetAsync(privateEndpointName); + + // 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 + JobPrivateEndpointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get a private endpoint. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetAPrivateEndpoint() + { + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/GetJobPrivateEndpoint.json + // this example is just showing the usage of "JobPrivateEndpoints_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 SqlServerJobAgentResource created on azure + // for more information of creating SqlServerJobAgentResource, please refer to the document of SqlServerJobAgentResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "group1"; + string serverName = "server1"; + string jobAgentName = "agent1"; + ResourceIdentifier sqlServerJobAgentResourceId = SqlServerJobAgentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName, jobAgentName); + SqlServerJobAgentResource sqlServerJobAgent = client.GetSqlServerJobAgentResource(sqlServerJobAgentResourceId); + + // get the collection of this JobPrivateEndpointResource + JobPrivateEndpointCollection collection = sqlServerJobAgent.GetJobPrivateEndpoints(); + + // invoke the operation + string privateEndpointName = "endpoint1"; + bool result = await collection.ExistsAsync(privateEndpointName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Create a private endpoint. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateAPrivateEndpoint() + { + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/CreateOrUpdateJobPrivateEndpoint.json + // this example is just showing the usage of "JobPrivateEndpoints_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlServerJobAgentResource created on azure + // for more information of creating SqlServerJobAgentResource, please refer to the document of SqlServerJobAgentResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "group1"; + string serverName = "server1"; + string jobAgentName = "agent1"; + ResourceIdentifier sqlServerJobAgentResourceId = SqlServerJobAgentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName, jobAgentName); + SqlServerJobAgentResource sqlServerJobAgent = client.GetSqlServerJobAgentResource(sqlServerJobAgentResourceId); + + // get the collection of this JobPrivateEndpointResource + JobPrivateEndpointCollection collection = sqlServerJobAgent.GetJobPrivateEndpoints(); + + // invoke the operation + string privateEndpointName = "endpoint1"; + JobPrivateEndpointData data = new JobPrivateEndpointData() + { + TargetServerAzureResourceId = new ResourceIdentifier("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/targetserver1"), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, privateEndpointName, data); + JobPrivateEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + JobPrivateEndpointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_JobPrivateEndpointResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_JobPrivateEndpointResource.cs new file mode 100644 index 000000000000..1fa1cc1e642b --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_JobPrivateEndpointResource.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.Sql; + +namespace Azure.ResourceManager.Sql.Samples +{ + public partial class Sample_JobPrivateEndpointResource + { + // Get a private endpoint. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetAPrivateEndpoint() + { + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/GetJobPrivateEndpoint.json + // this example is just showing the usage of "JobPrivateEndpoints_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 JobPrivateEndpointResource created on azure + // for more information of creating JobPrivateEndpointResource, please refer to the document of JobPrivateEndpointResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "group1"; + string serverName = "server1"; + string jobAgentName = "agent1"; + string privateEndpointName = "endpoint1"; + ResourceIdentifier jobPrivateEndpointResourceId = JobPrivateEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName, jobAgentName, privateEndpointName); + JobPrivateEndpointResource jobPrivateEndpoint = client.GetJobPrivateEndpointResource(jobPrivateEndpointResourceId); + + // invoke the operation + JobPrivateEndpointResource result = await jobPrivateEndpoint.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 + JobPrivateEndpointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create a private endpoint. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreateAPrivateEndpoint() + { + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/CreateOrUpdateJobPrivateEndpoint.json + // this example is just showing the usage of "JobPrivateEndpoints_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this JobPrivateEndpointResource created on azure + // for more information of creating JobPrivateEndpointResource, please refer to the document of JobPrivateEndpointResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "group1"; + string serverName = "server1"; + string jobAgentName = "agent1"; + string privateEndpointName = "endpoint1"; + ResourceIdentifier jobPrivateEndpointResourceId = JobPrivateEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName, jobAgentName, privateEndpointName); + JobPrivateEndpointResource jobPrivateEndpoint = client.GetJobPrivateEndpointResource(jobPrivateEndpointResourceId); + + // invoke the operation + JobPrivateEndpointData data = new JobPrivateEndpointData() + { + TargetServerAzureResourceId = new ResourceIdentifier("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/targetserver1"), + }; + ArmOperation lro = await jobPrivateEndpoint.UpdateAsync(WaitUntil.Completed, data); + JobPrivateEndpointResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + JobPrivateEndpointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Delete a private endpoint + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeleteAPrivateEndpoint() + { + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/DeleteJobPrivateEndpoint.json + // this example is just showing the usage of "JobPrivateEndpoints_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this JobPrivateEndpointResource created on azure + // for more information of creating JobPrivateEndpointResource, please refer to the document of JobPrivateEndpointResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "group1"; + string serverName = "server1"; + string jobAgentName = "agent1"; + string privateEndpointName = "endpoint1"; + ResourceIdentifier jobPrivateEndpointResourceId = JobPrivateEndpointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName, jobAgentName, privateEndpointName); + JobPrivateEndpointResource jobPrivateEndpoint = client.GetJobPrivateEndpointResource(jobPrivateEndpointResourceId); + + // invoke the operation + await jobPrivateEndpoint.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_SqlDatabaseCollection.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_SqlDatabaseCollection.cs index 545688616fb1..d3955344fb13 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_SqlDatabaseCollection.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_SqlDatabaseCollection.cs @@ -24,7 +24,7 @@ public partial class Sample_SqlDatabaseCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GetsAListOfDatabasesConfiguredWithEnclaveType() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ListVCoreDatabasesEnclaveTypeByServer.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/ListVCoreDatabasesEnclaveTypeByServer.json // this example is just showing the usage of "Databases_ListByServer" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -61,7 +61,7 @@ public async Task GetAll_GetsAListOfDatabasesConfiguredWithEnclaveType() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GetsAListOfDatabases() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ListVCoreDatabasesByServer.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/ListVCoreDatabasesByServer.json // this example is just showing the usage of "Databases_ListByServer" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -98,7 +98,7 @@ public async Task GetAll_GetsAListOfDatabases() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsADatabaseConfiguredWithDefaultEnclaveType() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/GetVCoreDatabaseDefaultEnclave.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/GetVCoreDatabaseDefaultEnclave.json // this example is just showing the usage of "Databases_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 @@ -133,7 +133,7 @@ public async Task Get_GetsADatabaseConfiguredWithDefaultEnclaveType() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetsADatabaseConfiguredWithDefaultEnclaveType() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/GetVCoreDatabaseDefaultEnclave.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/GetVCoreDatabaseDefaultEnclave.json // this example is just showing the usage of "Databases_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 @@ -164,7 +164,7 @@ public async Task Exists_GetsADatabaseConfiguredWithDefaultEnclaveType() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsADatabaseConfiguredWithVBSEnclaveType() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/GetVCoreDatabaseVBSEnclave.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/GetVCoreDatabaseVBSEnclave.json // this example is just showing the usage of "Databases_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 @@ -199,7 +199,7 @@ public async Task Get_GetsADatabaseConfiguredWithVBSEnclaveType() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetsADatabaseConfiguredWithVBSEnclaveType() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/GetVCoreDatabaseVBSEnclave.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/GetVCoreDatabaseVBSEnclave.json // this example is just showing the usage of "Databases_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 @@ -230,7 +230,7 @@ public async Task Exists_GetsADatabaseConfiguredWithVBSEnclaveType() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsADatabaseWithAvailabilityZoneSpecified() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/GetDatabaseWithAvailabilityZone.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/GetDatabaseWithAvailabilityZone.json // this example is just showing the usage of "Databases_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 @@ -265,7 +265,7 @@ public async Task Get_GetsADatabaseWithAvailabilityZoneSpecified() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetsADatabaseWithAvailabilityZoneSpecified() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/GetDatabaseWithAvailabilityZone.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/GetDatabaseWithAvailabilityZone.json // this example is just showing the usage of "Databases_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 @@ -296,7 +296,7 @@ public async Task Exists_GetsADatabaseWithAvailabilityZoneSpecified() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsADatabaseWithDatabaseLevelKeysExpanded() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/GetVCoreDatabaseWithExpandEqualsKeys.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/GetVCoreDatabaseWithExpandEqualsKeys.json // this example is just showing the usage of "Databases_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 @@ -332,7 +332,7 @@ public async Task Get_GetsADatabaseWithDatabaseLevelKeysExpanded() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetsADatabaseWithDatabaseLevelKeysExpanded() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/GetVCoreDatabaseWithExpandEqualsKeys.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/GetVCoreDatabaseWithExpandEqualsKeys.json // this example is just showing the usage of "Databases_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 @@ -364,7 +364,7 @@ public async Task Exists_GetsADatabaseWithDatabaseLevelKeysExpanded() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsADatabase() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/GetVCoreDatabase.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/GetVCoreDatabase.json // this example is just showing the usage of "Databases_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 @@ -399,7 +399,7 @@ public async Task Get_GetsADatabase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetsADatabase() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/GetVCoreDatabase.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/GetVCoreDatabase.json // this example is just showing the usage of "Databases_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 @@ -430,7 +430,7 @@ public async Task Exists_GetsADatabase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreatesAVCoreDatabaseBySpecifyingServiceObjectiveName() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateVCoreDatabaseByServiceObjective.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/CreateVCoreDatabaseByServiceObjective.json // this example is just showing the usage of "Databases_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 @@ -474,7 +474,7 @@ public async Task CreateOrUpdate_CreatesAVCoreDatabaseBySpecifyingServiceObjecti [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreatesAVCoreDatabaseBySpecifyingSkuNameAndCapacity() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateVCoreDatabaseBySkuNameCapacity.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/CreateVCoreDatabaseBySkuNameCapacity.json // this example is just showing the usage of "Databases_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 @@ -517,7 +517,7 @@ public async Task CreateOrUpdate_CreatesAVCoreDatabaseBySpecifyingSkuNameAndCapa [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreatesADataWarehouseDatabaseAsACrossSubscriptionRestoreFromABackupOfADroppedDatabase() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDwDatabaseCrossSubscriptionRestore.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/CreateDwDatabaseCrossSubscriptionRestore.json // this example is just showing the usage of "Databases_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 @@ -558,7 +558,7 @@ public async Task CreateOrUpdate_CreatesADataWarehouseDatabaseAsACrossSubscripti [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreatesADataWarehouseDatabaseAsACrossSubscriptionRestoreFromAGeoBackup() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDwDatabaseCrossSubscriptionRecovery.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/CreateDwDatabaseCrossSubscriptionRecovery.json // this example is just showing the usage of "Databases_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 @@ -599,7 +599,7 @@ public async Task CreateOrUpdate_CreatesADataWarehouseDatabaseAsACrossSubscripti [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreatesADataWarehouseDatabaseAsACrossSubscriptionRestoreFromARestorePointOfAnExistingDatabase() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDwDatabaseCrossSubscriptionPITR.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/CreateDwDatabaseCrossSubscriptionPITR.json // this example is just showing the usage of "Databases_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 @@ -641,7 +641,7 @@ public async Task CreateOrUpdate_CreatesADataWarehouseDatabaseAsACrossSubscripti [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreatesADatabaseAsACopy() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabaseCopyMode.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/CreateDatabaseCopyMode.json // this example is just showing the usage of "Databases_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 @@ -686,7 +686,7 @@ public async Task CreateOrUpdate_CreatesADatabaseAsACopy() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreatesADatabaseAsAStandbySecondary() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabaseStandbyMode.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/CreateDatabaseStandbyMode.json // this example is just showing the usage of "Databases_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 @@ -732,7 +732,7 @@ public async Task CreateOrUpdate_CreatesADatabaseAsAStandbySecondary() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreatesADatabaseAsAnOnLineSecondary() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabaseSecondaryMode.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/CreateDatabaseSecondaryMode.json // this example is just showing the usage of "Databases_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 @@ -778,7 +778,7 @@ public async Task CreateOrUpdate_CreatesADatabaseAsAnOnLineSecondary() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreatesADatabaseAsNamedReplicaSecondary() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabaseNamedReplica.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/CreateDatabaseNamedReplica.json // this example is just showing the usage of "Databases_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 @@ -825,7 +825,7 @@ public async Task CreateOrUpdate_CreatesADatabaseAsNamedReplicaSecondary() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreatesADatabaseFromPointInTimeRestore() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabasePITRMode.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/CreateDatabasePITRMode.json // this example is just showing the usage of "Databases_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 @@ -867,7 +867,7 @@ public async Task CreateOrUpdate_CreatesADatabaseFromPointInTimeRestore() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreatesADatabaseWithDefaultEnclaveType() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabaseDefaultEnclave.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/CreateDatabaseDefaultEnclave.json // this example is just showing the usage of "Databases_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 @@ -907,7 +907,7 @@ public async Task CreateOrUpdate_CreatesADatabaseWithDefaultEnclaveType() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreatesADatabaseWithVBSEnclaveType() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabaseVBSEnclave.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/CreateDatabaseVBSEnclave.json // this example is just showing the usage of "Databases_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 @@ -947,7 +947,7 @@ public async Task CreateOrUpdate_CreatesADatabaseWithVBSEnclaveType() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreatesADatabaseWithAvailabilityZoneSpecified() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabaseWithAvailabilityZone.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/CreateDatabaseWithAvailabilityZone.json // this example is just showing the usage of "Databases_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 @@ -994,7 +994,7 @@ public async Task CreateOrUpdate_CreatesADatabaseWithAvailabilityZoneSpecified() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreatesADatabaseWithDatabaseLevelCustomerManagedKeys() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabaseDefaultModeWithKeysAndEncryptionProtector.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/CreateDatabaseDefaultModeWithKeysAndEncryptionProtector.json // this example is just showing the usage of "Databases_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 @@ -1054,7 +1054,7 @@ public async Task CreateOrUpdate_CreatesADatabaseWithDatabaseLevelCustomerManage [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreatesADatabaseWithDefaultMode() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabaseDefaultMode.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/CreateDatabaseDefaultMode.json // this example is just showing the usage of "Databases_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 @@ -1100,7 +1100,7 @@ public async Task CreateOrUpdate_CreatesADatabaseWithDefaultMode() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreatesADatabaseWithLedgerOn() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabaseLedger.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/CreateDatabaseLedger.json // this example is just showing the usage of "Databases_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 @@ -1140,7 +1140,7 @@ public async Task CreateOrUpdate_CreatesADatabaseWithLedgerOn() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreatesADatabaseWithMinimumNumberOfParameters() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabaseMin.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/CreateDatabaseMin.json // this example is just showing the usage of "Databases_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 @@ -1177,7 +1177,7 @@ public async Task CreateOrUpdate_CreatesADatabaseWithMinimumNumberOfParameters() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreatesADatabaseWithPreferredMaintenanceWindow() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabaseMaintenanceConfiguration.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/CreateDatabaseMaintenanceConfiguration.json // this example is just showing the usage of "Databases_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 @@ -1224,7 +1224,7 @@ public async Task CreateOrUpdate_CreatesADatabaseWithPreferredMaintenanceWindow( [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreatesADatabaseWithSpecifiedBackupStorageRedundancy() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateDatabaseConfiguredBackupStorageRedundancy.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/CreateDatabaseConfiguredBackupStorageRedundancy.json // this example is just showing the usage of "Databases_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 @@ -1264,7 +1264,7 @@ public async Task CreateOrUpdate_CreatesADatabaseWithSpecifiedBackupStorageRedun [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_UpdatesADatabaseToHyperscaleSLOWithManualCutover() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/UpdateDatabaseHyperscaleMigrationWithManualCutover.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/UpdateDatabaseHyperscaleMigrationWithManualCutover.json // this example is just showing the usage of "Databases_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 @@ -1317,7 +1317,7 @@ public async Task CreateOrUpdate_UpdatesADatabaseToHyperscaleSLOWithManualCutove [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_UpdatesADatabaseToHyperscaleTierByTriggeringManualCutoverDuringMigrationWorkflow() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/UpdateDatabaseHyperscaleMigrationPerformCutover.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/UpdateDatabaseHyperscaleMigrationPerformCutover.json // this example is just showing the usage of "Databases_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_SqlDatabaseResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_SqlDatabaseResource.cs index 80f23b75abc7..a1cd171509a3 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_SqlDatabaseResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_SqlDatabaseResource.cs @@ -648,7 +648,7 @@ public async Task RevertDatabaseEncryptionProtector_RevertsTheEncryptionProtecto [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsADatabaseConfiguredWithDefaultEnclaveType() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/GetVCoreDatabaseDefaultEnclave.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/GetVCoreDatabaseDefaultEnclave.json // this example is just showing the usage of "Databases_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 @@ -680,7 +680,7 @@ public async Task Get_GetsADatabaseConfiguredWithDefaultEnclaveType() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsADatabaseConfiguredWithVBSEnclaveType() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/GetVCoreDatabaseVBSEnclave.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/GetVCoreDatabaseVBSEnclave.json // this example is just showing the usage of "Databases_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 @@ -712,7 +712,7 @@ public async Task Get_GetsADatabaseConfiguredWithVBSEnclaveType() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsADatabaseWithAvailabilityZoneSpecified() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/GetDatabaseWithAvailabilityZone.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/GetDatabaseWithAvailabilityZone.json // this example is just showing the usage of "Databases_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 @@ -744,7 +744,7 @@ public async Task Get_GetsADatabaseWithAvailabilityZoneSpecified() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsADatabaseWithDatabaseLevelKeysExpanded() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/GetVCoreDatabaseWithExpandEqualsKeys.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/GetVCoreDatabaseWithExpandEqualsKeys.json // this example is just showing the usage of "Databases_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 @@ -777,7 +777,7 @@ public async Task Get_GetsADatabaseWithDatabaseLevelKeysExpanded() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsADatabase() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/GetVCoreDatabase.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/GetVCoreDatabase.json // this example is just showing the usage of "Databases_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 @@ -809,7 +809,7 @@ public async Task Get_GetsADatabase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeletesADatabase() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/DeleteDatabase.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/DeleteDatabase.json // this example is just showing the usage of "Databases_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 @@ -837,7 +837,7 @@ public async Task Delete_DeletesADatabase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_AssignsMaintenanceWindowToADatabase() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/PatchVCoreDatabaseAssignMaintenanceConfiguration.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/PatchVCoreDatabaseAssignMaintenanceConfiguration.json // this example is just showing the usage of "Databases_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 @@ -875,7 +875,7 @@ public async Task Update_AssignsMaintenanceWindowToADatabase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreatesADatabaseWithVBSEnclaveType() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/PatchDatabaseVBSEnclave.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/PatchDatabaseVBSEnclave.json // this example is just showing the usage of "Databases_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 @@ -912,7 +912,7 @@ public async Task Update_CreatesADatabaseWithVBSEnclaveType() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_PatchADatabaseWithDatabaseLevelCustomerManagedKeys() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/PatchVCoreDatabaseWithKeysAndEncryptionProtector.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/PatchVCoreDatabaseWithKeysAndEncryptionProtector.json // this example is just showing the usage of "Databases_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 @@ -967,7 +967,7 @@ public async Task Update_PatchADatabaseWithDatabaseLevelCustomerManagedKeys() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_ResetsMaintenanceWindowOfADatabaseToDefault() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/PatchVCoreDatabaseResetMaintenanceConfiguration.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/PatchVCoreDatabaseResetMaintenanceConfiguration.json // this example is just showing the usage of "Databases_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 @@ -1005,7 +1005,7 @@ public async Task Update_ResetsMaintenanceWindowOfADatabaseToDefault() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdatesADatabaseWithDefaultEnclaveType() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/PatchDatabaseDefaultEnclave.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/PatchDatabaseDefaultEnclave.json // this example is just showing the usage of "Databases_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 @@ -1042,7 +1042,7 @@ public async Task Update_UpdatesADatabaseWithDefaultEnclaveType() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdatesADatabase() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/PatchVCoreDatabase.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/PatchVCoreDatabase.json // this example is just showing the usage of "Databases_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 @@ -1081,7 +1081,7 @@ public async Task Update_UpdatesADatabase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Export_ExportsADatabaseUsingPrivateLinkToCommunicateWithSQLServerAndStorageAccount() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ExportDatabaseWithNetworkIsolation.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/ExportDatabaseWithNetworkIsolation.json // this example is just showing the usage of "Databases_Export" 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 @@ -1119,7 +1119,7 @@ public async Task Export_ExportsADatabaseUsingPrivateLinkToCommunicateWithSQLSer [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Export_ExportsADatabase() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ExportDatabase.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/ExportDatabase.json // this example is just showing the usage of "Databases_Export" 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 @@ -1152,7 +1152,7 @@ public async Task Export_ExportsADatabase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Failover_FailoverAnDatabase() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/FailoverDatabase.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/FailoverDatabase.json // this example is just showing the usage of "Databases_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 @@ -1181,7 +1181,7 @@ public async Task Failover_FailoverAnDatabase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Import_ImportsToAnExistingEmptyDatabaseUsingPrivateLinkToCommunicateWithSQLServerAndStorageAccount() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ImportDatabaseWithNetworkIsolation.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/ImportDatabaseWithNetworkIsolation.json // this example is just showing the usage of "Databases_Import" 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 @@ -1219,7 +1219,7 @@ public async Task Import_ImportsToAnExistingEmptyDatabaseUsingPrivateLinkToCommu [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Import_ImportsToAnExistingEmptyDatabase() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ImportDatabase.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/ImportDatabase.json // this example is just showing the usage of "Databases_Import" 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 @@ -1252,7 +1252,7 @@ public async Task Import_ImportsToAnExistingEmptyDatabase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Rename_RenamesADatabase() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/RenameDatabase.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/RenameDatabase.json // this example is just showing the usage of "Databases_Rename" 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 @@ -1281,7 +1281,7 @@ public async Task Rename_RenamesADatabase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Pause_PausesADatabase() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/PauseDatabase.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/PauseDatabase.json // this example is just showing the usage of "Databases_Pause" 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 @@ -1314,7 +1314,7 @@ public async Task Pause_PausesADatabase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Resume_ResumesADatabase() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ResumeDatabase.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/ResumeDatabase.json // this example is just showing the usage of "Databases_Resume" 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 @@ -1347,7 +1347,7 @@ public async Task Resume_ResumesADatabase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task UpgradeDataWarehouse_UpgradesADataWarehouse() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/UpgradeDataWarehouse.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/UpgradeDataWarehouse.json // this example is just showing the usage of "Databases_UpgradeDataWarehouse" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_SqlPrivateEndpointConnectionCollection.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_SqlPrivateEndpointConnectionCollection.cs index 71e1046eb624..cb6781865284 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_SqlPrivateEndpointConnectionCollection.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_SqlPrivateEndpointConnectionCollection.cs @@ -18,12 +18,49 @@ namespace Azure.ResourceManager.Sql.Samples { public partial class Sample_SqlPrivateEndpointConnectionCollection { + // Gets list of private endpoint connections on a server. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_GetsListOfPrivateEndpointConnectionsOnAServer() + { + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/PrivateEndpointConnectionList.json + // this example is just showing the usage of "PrivateEndpointConnections_ListByServer" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlServerResource created on azure + // for more information of creating SqlServerResource, please refer to the document of SqlServerResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "Default"; + string serverName = "test-svr"; + ResourceIdentifier sqlServerResourceId = SqlServerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName); + SqlServerResource sqlServer = client.GetSqlServerResource(sqlServerResourceId); + + // get the collection of this SqlPrivateEndpointConnectionResource + SqlPrivateEndpointConnectionCollection collection = sqlServer.GetSqlPrivateEndpointConnections(); + + // invoke the operation and iterate over the result + await foreach (SqlPrivateEndpointConnectionResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SqlPrivateEndpointConnectionData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + // Gets private endpoint connection. [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PrivateEndpointConnectionGet.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/PrivateEndpointConnectionGet.json // this example is just showing the usage of "PrivateEndpointConnections_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 @@ -58,7 +95,7 @@ public async Task Get_GetsPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PrivateEndpointConnectionGet.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/PrivateEndpointConnectionGet.json // this example is just showing the usage of "PrivateEndpointConnections_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 @@ -89,7 +126,7 @@ public async Task Exists_GetsPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_ApproveOrRejectAPrivateEndpointConnectionWithAGivenName() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PrivateEndpointConnectionUpdate.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/PrivateEndpointConnectionUpdate.json // this example is just showing the usage of "PrivateEndpointConnections_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 @@ -123,42 +160,5 @@ public async Task CreateOrUpdate_ApproveOrRejectAPrivateEndpointConnectionWithAG // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - - // Gets list of private endpoint connections on a server. - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_GetsListOfPrivateEndpointConnectionsOnAServer() - { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PrivateEndpointConnectionList.json - // this example is just showing the usage of "PrivateEndpointConnections_ListByServer" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this SqlServerResource created on azure - // for more information of creating SqlServerResource, please refer to the document of SqlServerResource - string subscriptionId = "00000000-1111-2222-3333-444444444444"; - string resourceGroupName = "Default"; - string serverName = "test-svr"; - ResourceIdentifier sqlServerResourceId = SqlServerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName); - SqlServerResource sqlServer = client.GetSqlServerResource(sqlServerResourceId); - - // get the collection of this SqlPrivateEndpointConnectionResource - SqlPrivateEndpointConnectionCollection collection = sqlServer.GetSqlPrivateEndpointConnections(); - - // invoke the operation and iterate over the result - await foreach (SqlPrivateEndpointConnectionResource item in collection.GetAllAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - SqlPrivateEndpointConnectionData 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_SqlPrivateEndpointConnectionResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_SqlPrivateEndpointConnectionResource.cs index 0e57142ee430..fd79e1c72eba 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_SqlPrivateEndpointConnectionResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_SqlPrivateEndpointConnectionResource.cs @@ -23,7 +23,7 @@ public partial class Sample_SqlPrivateEndpointConnectionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PrivateEndpointConnectionGet.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/PrivateEndpointConnectionGet.json // this example is just showing the usage of "PrivateEndpointConnections_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 @@ -55,7 +55,7 @@ public async Task Get_GetsPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_ApproveOrRejectAPrivateEndpointConnectionWithAGivenName() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PrivateEndpointConnectionUpdate.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/PrivateEndpointConnectionUpdate.json // this example is just showing the usage of "PrivateEndpointConnections_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 @@ -92,7 +92,7 @@ public async Task Update_ApproveOrRejectAPrivateEndpointConnectionWithAGivenName [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeletesAPrivateEndpointConnectionWithAGivenName() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PrivateEndpointConnectionDelete.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/PrivateEndpointConnectionDelete.json // this example is just showing the usage of "PrivateEndpointConnections_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 diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_SqlServerResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_SqlServerResource.cs index 3b035ff3f66f..d6a03cf8ce04 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_SqlServerResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/samples/Generated/Samples/Sample_SqlServerResource.cs @@ -149,7 +149,7 @@ public async Task GetReplicationLinks_ListReplicationLinksOnServer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetInaccessibleDatabases_GetsAListOfInaccessibleDatabasesInALogicalServer() { - // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ListVCoreInaccessibleDatabasesByServer.json + // Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/ListVCoreInaccessibleDatabasesByServer.json // this example is just showing the usage of "Databases_ListInaccessibleByServer" 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 @@ -474,7 +474,7 @@ public async Task ImportDatabase_ImportsToANewDatabaseUsingPrivateLinkForTheSQLS { DatabaseName = "testdb", AuthenticationType = "Sql", - NetworkIsolation = new NetworkIsolationSettings() + NetworkIsolation = new NetworkIsolationSettingsAutoGenerated() { StorageAccountResourceId = new ResourceIdentifier("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Storage/storageAccounts/test-privatelink"), SqlServerResourceId = new ResourceIdentifier("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr"), diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ArmSqlModelFactory.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ArmSqlModelFactory.cs index 7c8b0cdacab6..9cd5e285b525 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ArmSqlModelFactory.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ArmSqlModelFactory.cs @@ -699,6 +699,19 @@ public static JobExecutionTarget JobExecutionTarget(JobTargetType? targetType = return new JobExecutionTarget(targetType, serverName, databaseName); } + /// Initializes a new instance of JobPrivateEndpointData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// ARM resource id of the server the private endpoint will target. + /// Private endpoint id of the private endpoint. + /// A new instance for mocking. + public static JobPrivateEndpointData JobPrivateEndpointData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ResourceIdentifier targetServerAzureResourceId = null, string privateEndpointId = null) + { + return new JobPrivateEndpointData(id, name, resourceType, systemData, targetServerAzureResourceId, privateEndpointId); + } + /// Initializes a new instance of SqlServerJobData. /// The id. /// The name. @@ -1571,12 +1584,28 @@ public static ManagedServerSecurityAlertPolicyData ManagedServerSecurityAlertPol /// The resourceType. /// The systemData. /// Private endpoint which the connection belongs to. + /// Group IDs. /// Connection state of the private endpoint connection. /// State of the private endpoint connection. /// A new instance for mocking. - public static SqlPrivateEndpointConnectionData SqlPrivateEndpointConnectionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ResourceIdentifier privateEndpointId = null, SqlPrivateLinkServiceConnectionStateProperty connectionState = null, SqlPrivateEndpointProvisioningState? provisioningState = null) + public static SqlPrivateEndpointConnectionData SqlPrivateEndpointConnectionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ResourceIdentifier privateEndpointId = null, IEnumerable groupIds = null, SqlPrivateLinkServiceConnectionStateProperty connectionState = null, SqlPrivateEndpointProvisioningState? provisioningState = null) { - return new SqlPrivateEndpointConnectionData(id, name, resourceType, systemData, privateEndpointId != null ? ResourceManagerModelFactory.WritableSubResource(privateEndpointId) : null, connectionState, provisioningState); + groupIds ??= new List(); + + return new SqlPrivateEndpointConnectionData(id, name, resourceType, systemData, privateEndpointId != null ? ResourceManagerModelFactory.WritableSubResource(privateEndpointId) : null, groupIds?.ToList(), connectionState, provisioningState); + } + + /// Initializes a new instance of ServerPrivateEndpointConnectionProperties. + /// Private endpoint which the connection belongs to. + /// Group IDs. + /// Connection state of the private endpoint connection. + /// State of the private endpoint connection. + /// A new instance for mocking. + public static ServerPrivateEndpointConnectionProperties ServerPrivateEndpointConnectionProperties(ResourceIdentifier privateEndpointId = null, IEnumerable groupIds = null, SqlPrivateLinkServiceConnectionStateProperty connectionState = null, SqlPrivateEndpointProvisioningState? provisioningState = null) + { + groupIds ??= new List(); + + return new ServerPrivateEndpointConnectionProperties(privateEndpointId != null ? ResourceManagerModelFactory.WritableSubResource(privateEndpointId) : null, groupIds?.ToList(), connectionState, provisioningState); } /// Initializes a new instance of SqlPrivateLinkServiceConnectionStateProperty. @@ -3174,6 +3203,14 @@ public static ManagedDatabaseRestoreDetailUnrestorableFileProperties ManagedData /// The resource ids of the user assigned identities to use. /// The azure key vault URI of the database if it's configured with per Database Customer Managed Keys. /// Type of enclave requested on the database i.e. Default or VBS enclaves. + /// Whether or not the database uses free monthly limits. Allowed on one database in a subscription. + /// + /// Specifies the behavior when monthly free limits are exhausted for the free database. + /// + /// AutoPause: The database will be auto paused upon exhaustion of free limits for remainder of the month. + /// + /// BillForUsage: The database will continue to be online upon exhaustion of free limits and any overage will be billed. + /// /// /// The resource identifier of the source associated with the create operation of this database. /// @@ -3208,13 +3245,14 @@ public static ManagedDatabaseRestoreDetailUnrestorableFileProperties ManagedData /// When performCutover is specified, the scaling operation will trigger cutover and perform role-change to Hyperscale database. /// /// Specifies the availability zone the database is pinned to. + /// The flag to enable or disable auto rotation of database encryption protector AKV key. /// A new instance for mocking. - public static SqlDatabaseData SqlDatabaseData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, SqlSku sku = null, string kind = null, string managedBy = null, DatabaseIdentity identity = null, SqlDatabaseCreateMode? createMode = null, string collation = null, long? maxSizeBytes = null, SampleSchemaName? sampleName = null, ResourceIdentifier elasticPoolId = null, ResourceIdentifier sourceDatabaseId = null, SqlDatabaseStatus? status = null, Guid? databaseId = null, DateTimeOffset? createdOn = null, string currentServiceObjectiveName = null, string requestedServiceObjectiveName = null, AzureLocation? defaultSecondaryLocation = null, ResourceIdentifier failoverGroupId = null, DateTimeOffset? restorePointInTime = null, DateTimeOffset? sourceDatabaseDeletedOn = null, ResourceIdentifier recoveryServicesRecoveryPointId = null, ResourceIdentifier longTermRetentionBackupResourceId = null, ResourceIdentifier recoverableDatabaseId = null, ResourceIdentifier restorableDroppedDatabaseId = null, CatalogCollationType? catalogCollation = null, bool? isZoneRedundant = null, DatabaseLicenseType? licenseType = null, long? maxLogSizeBytes = null, DateTimeOffset? earliestRestoreOn = null, DatabaseReadScale? readScale = null, int? highAvailabilityReplicaCount = null, SecondaryType? secondaryType = null, SqlSku currentSku = null, int? autoPauseDelay = null, SqlBackupStorageRedundancy? currentBackupStorageRedundancy = null, SqlBackupStorageRedundancy? requestedBackupStorageRedundancy = null, double? minCapacity = null, DateTimeOffset? pausedOn = null, DateTimeOffset? resumedOn = null, ResourceIdentifier maintenanceConfigurationId = null, bool? isLedgerOn = null, bool? isInfraEncryptionEnabled = null, Guid? federatedClientId = null, IDictionary keys = null, string encryptionProtector = null, SqlAlwaysEncryptedEnclaveType? preferredEnclaveType = null, ResourceIdentifier sourceResourceId = null, bool? manualCutover = null, bool? performCutover = null, SqlAvailabilityZoneType? availabilityZone = null) + public static SqlDatabaseData SqlDatabaseData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, SqlSku sku = null, string kind = null, string managedBy = null, DatabaseIdentity identity = null, SqlDatabaseCreateMode? createMode = null, string collation = null, long? maxSizeBytes = null, SampleSchemaName? sampleName = null, ResourceIdentifier elasticPoolId = null, ResourceIdentifier sourceDatabaseId = null, SqlDatabaseStatus? status = null, Guid? databaseId = null, DateTimeOffset? createdOn = null, string currentServiceObjectiveName = null, string requestedServiceObjectiveName = null, AzureLocation? defaultSecondaryLocation = null, ResourceIdentifier failoverGroupId = null, DateTimeOffset? restorePointInTime = null, DateTimeOffset? sourceDatabaseDeletedOn = null, ResourceIdentifier recoveryServicesRecoveryPointId = null, ResourceIdentifier longTermRetentionBackupResourceId = null, ResourceIdentifier recoverableDatabaseId = null, ResourceIdentifier restorableDroppedDatabaseId = null, CatalogCollationType? catalogCollation = null, bool? isZoneRedundant = null, DatabaseLicenseType? licenseType = null, long? maxLogSizeBytes = null, DateTimeOffset? earliestRestoreOn = null, DatabaseReadScale? readScale = null, int? highAvailabilityReplicaCount = null, SecondaryType? secondaryType = null, SqlSku currentSku = null, int? autoPauseDelay = null, SqlBackupStorageRedundancy? currentBackupStorageRedundancy = null, SqlBackupStorageRedundancy? requestedBackupStorageRedundancy = null, double? minCapacity = null, DateTimeOffset? pausedOn = null, DateTimeOffset? resumedOn = null, ResourceIdentifier maintenanceConfigurationId = null, bool? isLedgerOn = null, bool? isInfraEncryptionEnabled = null, Guid? federatedClientId = null, IDictionary keys = null, string encryptionProtector = null, SqlAlwaysEncryptedEnclaveType? preferredEnclaveType = null, bool? useFreeLimit = null, FreeLimitExhaustionBehavior? freeLimitExhaustionBehavior = null, ResourceIdentifier sourceResourceId = null, bool? manualCutover = null, bool? performCutover = null, SqlAvailabilityZoneType? availabilityZone = null, bool? encryptionProtectorAutoRotation = null) { tags ??= new Dictionary(); keys ??= new Dictionary(); - return new SqlDatabaseData(id, name, resourceType, systemData, tags, location, sku, kind, managedBy, identity, createMode, collation, maxSizeBytes, sampleName, elasticPoolId, sourceDatabaseId, status, databaseId, createdOn, currentServiceObjectiveName, requestedServiceObjectiveName, defaultSecondaryLocation, failoverGroupId, restorePointInTime, sourceDatabaseDeletedOn, recoveryServicesRecoveryPointId, longTermRetentionBackupResourceId, recoverableDatabaseId, restorableDroppedDatabaseId, catalogCollation, isZoneRedundant, licenseType, maxLogSizeBytes, earliestRestoreOn, readScale, highAvailabilityReplicaCount, secondaryType, currentSku, autoPauseDelay, currentBackupStorageRedundancy, requestedBackupStorageRedundancy, minCapacity, pausedOn, resumedOn, maintenanceConfigurationId, isLedgerOn, isInfraEncryptionEnabled, federatedClientId, keys, encryptionProtector, preferredEnclaveType, sourceResourceId, manualCutover, performCutover, availabilityZone); + return new SqlDatabaseData(id, name, resourceType, systemData, tags, location, sku, kind, managedBy, identity, createMode, collation, maxSizeBytes, sampleName, elasticPoolId, sourceDatabaseId, status, databaseId, createdOn, currentServiceObjectiveName, requestedServiceObjectiveName, defaultSecondaryLocation, failoverGroupId, restorePointInTime, sourceDatabaseDeletedOn, recoveryServicesRecoveryPointId, longTermRetentionBackupResourceId, recoverableDatabaseId, restorableDroppedDatabaseId, catalogCollation, isZoneRedundant, licenseType, maxLogSizeBytes, earliestRestoreOn, readScale, highAvailabilityReplicaCount, secondaryType, currentSku, autoPauseDelay, currentBackupStorageRedundancy, requestedBackupStorageRedundancy, minCapacity, pausedOn, resumedOn, maintenanceConfigurationId, isLedgerOn, isInfraEncryptionEnabled, federatedClientId, keys, encryptionProtector, preferredEnclaveType, useFreeLimit, freeLimitExhaustionBehavior, sourceResourceId, manualCutover, performCutover, availabilityZone, encryptionProtectorAutoRotation); } /// Initializes a new instance of DatabaseIdentity. @@ -3594,19 +3632,6 @@ public static SqlServerPrivateEndpointConnection SqlServerPrivateEndpointConnect return new SqlServerPrivateEndpointConnection(id, properties); } - /// Initializes a new instance of ServerPrivateEndpointConnectionProperties. - /// Private endpoint which the connection belongs to. - /// Group IDs. - /// Connection state of the private endpoint connection. - /// State of the private endpoint connection. - /// A new instance for mocking. - public static ServerPrivateEndpointConnectionProperties ServerPrivateEndpointConnectionProperties(ResourceIdentifier privateEndpointId = null, IEnumerable groupIds = null, SqlPrivateLinkServiceConnectionStateProperty connectionState = null, SqlPrivateEndpointProvisioningState? provisioningState = null) - { - groupIds ??= new List(); - - return new ServerPrivateEndpointConnectionProperties(privateEndpointId != null ? ResourceManagerModelFactory.WritableSubResource(privateEndpointId) : null, groupIds?.ToList(), connectionState, provisioningState); - } - /// Initializes a new instance of RefreshExternalGovernanceStatusOperationResult. /// The id. /// The 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 e1c84fcbeac1..8102de2884df 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/SqlExtensions.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/SqlExtensions.cs @@ -640,6 +640,25 @@ public static SqlServerJobExecutionStepTargetResource GetSqlServerJobExecutionSt } #endregion + #region JobPrivateEndpointResource + /// + /// 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 instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static JobPrivateEndpointResource GetJobPrivateEndpointResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + JobPrivateEndpointResource.ValidateResourceId(id); + return new JobPrivateEndpointResource(client, id); + } + ); + } + #endregion + #region SqlServerJobResource /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/JobPrivateEndpointCollection.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/JobPrivateEndpointCollection.cs new file mode 100644 index 000000000000..964f3608a46a --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/JobPrivateEndpointCollection.cs @@ -0,0 +1,341 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Sql +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetJobPrivateEndpoints method from an instance of . + /// + public partial class JobPrivateEndpointCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _jobPrivateEndpointClientDiagnostics; + private readonly JobPrivateEndpointsRestOperations _jobPrivateEndpointRestClient; + + /// Initializes a new instance of the class for mocking. + protected JobPrivateEndpointCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal JobPrivateEndpointCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _jobPrivateEndpointClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Sql", JobPrivateEndpointResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(JobPrivateEndpointResource.ResourceType, out string jobPrivateEndpointApiVersion); + _jobPrivateEndpointRestClient = new JobPrivateEndpointsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, jobPrivateEndpointApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != SqlServerJobAgentResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SqlServerJobAgentResource.ResourceType), nameof(id)); + } + + /// + /// Creates or updates a private endpoint. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/privateEndpoints/{privateEndpointName} + /// + /// + /// Operation Id + /// JobPrivateEndpoints_CreateOrUpdate + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the private endpoint. + /// The requested private endpoint state. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string privateEndpointName, JobPrivateEndpointData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointName, nameof(privateEndpointName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _jobPrivateEndpointClientDiagnostics.CreateScope("JobPrivateEndpointCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _jobPrivateEndpointRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, privateEndpointName, data, cancellationToken).ConfigureAwait(false); + var operation = new SqlArmOperation(new JobPrivateEndpointOperationSource(Client), _jobPrivateEndpointClientDiagnostics, Pipeline, _jobPrivateEndpointRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, privateEndpointName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates a private endpoint. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/privateEndpoints/{privateEndpointName} + /// + /// + /// Operation Id + /// JobPrivateEndpoints_CreateOrUpdate + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the private endpoint. + /// The requested private endpoint state. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string privateEndpointName, JobPrivateEndpointData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointName, nameof(privateEndpointName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _jobPrivateEndpointClientDiagnostics.CreateScope("JobPrivateEndpointCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _jobPrivateEndpointRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, privateEndpointName, data, cancellationToken); + var operation = new SqlArmOperation(new JobPrivateEndpointOperationSource(Client), _jobPrivateEndpointClientDiagnostics, Pipeline, _jobPrivateEndpointRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, privateEndpointName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a private endpoint. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/privateEndpoints/{privateEndpointName} + /// + /// + /// Operation Id + /// JobPrivateEndpoints_Get + /// + /// + /// + /// The name of the private endpoint to get. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string privateEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointName, nameof(privateEndpointName)); + + using var scope = _jobPrivateEndpointClientDiagnostics.CreateScope("JobPrivateEndpointCollection.Get"); + scope.Start(); + try + { + var response = await _jobPrivateEndpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, privateEndpointName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new JobPrivateEndpointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a private endpoint. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/privateEndpoints/{privateEndpointName} + /// + /// + /// Operation Id + /// JobPrivateEndpoints_Get + /// + /// + /// + /// The name of the private endpoint to get. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string privateEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointName, nameof(privateEndpointName)); + + using var scope = _jobPrivateEndpointClientDiagnostics.CreateScope("JobPrivateEndpointCollection.Get"); + scope.Start(); + try + { + var response = _jobPrivateEndpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, privateEndpointName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new JobPrivateEndpointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a list of job agent private endpoints. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/privateEndpoints + /// + /// + /// Operation Id + /// JobPrivateEndpoints_ListByAgent + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _jobPrivateEndpointRestClient.CreateListByAgentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _jobPrivateEndpointRestClient.CreateListByAgentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new JobPrivateEndpointResource(Client, JobPrivateEndpointData.DeserializeJobPrivateEndpointData(e)), _jobPrivateEndpointClientDiagnostics, Pipeline, "JobPrivateEndpointCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets a list of job agent private endpoints. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/privateEndpoints + /// + /// + /// Operation Id + /// JobPrivateEndpoints_ListByAgent + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _jobPrivateEndpointRestClient.CreateListByAgentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _jobPrivateEndpointRestClient.CreateListByAgentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new JobPrivateEndpointResource(Client, JobPrivateEndpointData.DeserializeJobPrivateEndpointData(e)), _jobPrivateEndpointClientDiagnostics, Pipeline, "JobPrivateEndpointCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/privateEndpoints/{privateEndpointName} + /// + /// + /// Operation Id + /// JobPrivateEndpoints_Get + /// + /// + /// + /// The name of the private endpoint to get. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string privateEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointName, nameof(privateEndpointName)); + + using var scope = _jobPrivateEndpointClientDiagnostics.CreateScope("JobPrivateEndpointCollection.Exists"); + scope.Start(); + try + { + var response = await _jobPrivateEndpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, privateEndpointName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/privateEndpoints/{privateEndpointName} + /// + /// + /// Operation Id + /// JobPrivateEndpoints_Get + /// + /// + /// + /// The name of the private endpoint to get. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string privateEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointName, nameof(privateEndpointName)); + + using var scope = _jobPrivateEndpointClientDiagnostics.CreateScope("JobPrivateEndpointCollection.Exists"); + scope.Start(); + try + { + var response = _jobPrivateEndpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, privateEndpointName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/JobPrivateEndpointData.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/JobPrivateEndpointData.cs new file mode 100644 index 000000000000..b7e1c19ce582 --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/JobPrivateEndpointData.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Sql +{ + /// + /// A class representing the JobPrivateEndpoint data model. + /// A job agent private endpoint. + /// + public partial class JobPrivateEndpointData : ResourceData + { + /// Initializes a new instance of JobPrivateEndpointData. + public JobPrivateEndpointData() + { + } + + /// Initializes a new instance of JobPrivateEndpointData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// ARM resource id of the server the private endpoint will target. + /// Private endpoint id of the private endpoint. + internal JobPrivateEndpointData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ResourceIdentifier targetServerAzureResourceId, string privateEndpointId) : base(id, name, resourceType, systemData) + { + TargetServerAzureResourceId = targetServerAzureResourceId; + PrivateEndpointId = privateEndpointId; + } + + /// ARM resource id of the server the private endpoint will target. + public ResourceIdentifier TargetServerAzureResourceId { get; set; } + /// Private endpoint id of the private endpoint. + public string PrivateEndpointId { get; } + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/JobPrivateEndpointResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/JobPrivateEndpointResource.cs new file mode 100644 index 000000000000..d42702e46297 --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/JobPrivateEndpointResource.cs @@ -0,0 +1,297 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Sql +{ + /// + /// A Class representing a JobPrivateEndpoint along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetJobPrivateEndpointResource method. + /// Otherwise you can get one from its parent resource using the GetJobPrivateEndpoint method. + /// + public partial class JobPrivateEndpointResource : ArmResource + { + /// Generate the resource identifier of a instance. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string serverName, string jobAgentName, string privateEndpointName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/privateEndpoints/{privateEndpointName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _jobPrivateEndpointClientDiagnostics; + private readonly JobPrivateEndpointsRestOperations _jobPrivateEndpointRestClient; + private readonly JobPrivateEndpointData _data; + + /// Initializes a new instance of the class for mocking. + protected JobPrivateEndpointResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal JobPrivateEndpointResource(ArmClient client, JobPrivateEndpointData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal JobPrivateEndpointResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _jobPrivateEndpointClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Sql", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string jobPrivateEndpointApiVersion); + _jobPrivateEndpointRestClient = new JobPrivateEndpointsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, jobPrivateEndpointApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Sql/servers/jobAgents/privateEndpoints"; + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual JobPrivateEndpointData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets a private endpoint. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/privateEndpoints/{privateEndpointName} + /// + /// + /// Operation Id + /// JobPrivateEndpoints_Get + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _jobPrivateEndpointClientDiagnostics.CreateScope("JobPrivateEndpointResource.Get"); + scope.Start(); + try + { + var response = await _jobPrivateEndpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new JobPrivateEndpointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a private endpoint. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/privateEndpoints/{privateEndpointName} + /// + /// + /// Operation Id + /// JobPrivateEndpoints_Get + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _jobPrivateEndpointClientDiagnostics.CreateScope("JobPrivateEndpointResource.Get"); + scope.Start(); + try + { + var response = _jobPrivateEndpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new JobPrivateEndpointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a private endpoint. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/privateEndpoints/{privateEndpointName} + /// + /// + /// Operation Id + /// JobPrivateEndpoints_Delete + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _jobPrivateEndpointClientDiagnostics.CreateScope("JobPrivateEndpointResource.Delete"); + scope.Start(); + try + { + var response = await _jobPrivateEndpointRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new SqlArmOperation(_jobPrivateEndpointClientDiagnostics, Pipeline, _jobPrivateEndpointRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a private endpoint. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/privateEndpoints/{privateEndpointName} + /// + /// + /// Operation Id + /// JobPrivateEndpoints_Delete + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _jobPrivateEndpointClientDiagnostics.CreateScope("JobPrivateEndpointResource.Delete"); + scope.Start(); + try + { + var response = _jobPrivateEndpointRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new SqlArmOperation(_jobPrivateEndpointClientDiagnostics, Pipeline, _jobPrivateEndpointRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates a private endpoint. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/privateEndpoints/{privateEndpointName} + /// + /// + /// Operation Id + /// JobPrivateEndpoints_CreateOrUpdate + /// + /// + /// + /// 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 requested private endpoint state. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, JobPrivateEndpointData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _jobPrivateEndpointClientDiagnostics.CreateScope("JobPrivateEndpointResource.Update"); + scope.Start(); + try + { + var response = await _jobPrivateEndpointRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new SqlArmOperation(new JobPrivateEndpointOperationSource(Client), _jobPrivateEndpointClientDiagnostics, Pipeline, _jobPrivateEndpointRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates a private endpoint. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/privateEndpoints/{privateEndpointName} + /// + /// + /// Operation Id + /// JobPrivateEndpoints_CreateOrUpdate + /// + /// + /// + /// 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 requested private endpoint state. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, JobPrivateEndpointData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _jobPrivateEndpointClientDiagnostics.CreateScope("JobPrivateEndpointResource.Update"); + scope.Start(); + try + { + var response = _jobPrivateEndpointRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new SqlArmOperation(new JobPrivateEndpointOperationSource(Client), _jobPrivateEndpointClientDiagnostics, Pipeline, _jobPrivateEndpointRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/LongRunningOperation/JobPrivateEndpointOperationSource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/LongRunningOperation/JobPrivateEndpointOperationSource.cs new file mode 100644 index 000000000000..ee88f6ef2b06 --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/LongRunningOperation/JobPrivateEndpointOperationSource.cs @@ -0,0 +1,40 @@ +// 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; +using Azure.Core; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Sql +{ + internal class JobPrivateEndpointOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal JobPrivateEndpointOperationSource(ArmClient client) + { + _client = client; + } + + JobPrivateEndpointResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = JobPrivateEndpointData.DeserializeJobPrivateEndpointData(document.RootElement); + return new JobPrivateEndpointResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = JobPrivateEndpointData.DeserializeJobPrivateEndpointData(document.RootElement); + return new JobPrivateEndpointResource(_client, data); + } + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DatabaseImportDefinition.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DatabaseImportDefinition.cs index 2918573cbd70..f48775d4dddc 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DatabaseImportDefinition.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DatabaseImportDefinition.cs @@ -55,6 +55,6 @@ public DatabaseImportDefinition(StorageKeyType storageKeyType, string storageKey /// Authentication type. public string AuthenticationType { get; set; } /// Optional resource information to enable network isolation for request. - public NetworkIsolationSettings NetworkIsolation { get; set; } + public NetworkIsolationSettingsAutoGenerated NetworkIsolation { get; set; } } } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/FreeLimitExhaustionBehavior.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/FreeLimitExhaustionBehavior.cs new file mode 100644 index 000000000000..41155b8ca9ed --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/FreeLimitExhaustionBehavior.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Sql.Models +{ + /// + /// Specifies the behavior when monthly free limits are exhausted for the free database. + /// + /// AutoPause: The database will be auto paused upon exhaustion of free limits for remainder of the month. + /// + /// BillForUsage: The database will continue to be online upon exhaustion of free limits and any overage will be billed. + /// + public readonly partial struct FreeLimitExhaustionBehavior : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public FreeLimitExhaustionBehavior(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AutoPauseValue = "AutoPause"; + private const string BillOverUsageValue = "BillOverUsage"; + + /// AutoPause. + public static FreeLimitExhaustionBehavior AutoPause { get; } = new FreeLimitExhaustionBehavior(AutoPauseValue); + /// BillOverUsage. + public static FreeLimitExhaustionBehavior BillOverUsage { get; } = new FreeLimitExhaustionBehavior(BillOverUsageValue); + /// Determines if two values are the same. + public static bool operator ==(FreeLimitExhaustionBehavior left, FreeLimitExhaustionBehavior right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(FreeLimitExhaustionBehavior left, FreeLimitExhaustionBehavior right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator FreeLimitExhaustionBehavior(string value) => new FreeLimitExhaustionBehavior(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is FreeLimitExhaustionBehavior other && Equals(other); + /// + public bool Equals(FreeLimitExhaustionBehavior other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/JobPrivateEndpointData.Serialization.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/JobPrivateEndpointData.Serialization.cs new file mode 100644 index 000000000000..853bed6308ff --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/JobPrivateEndpointData.Serialization.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Sql +{ + public partial class JobPrivateEndpointData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(TargetServerAzureResourceId)) + { + writer.WritePropertyName("targetServerAzureResourceId"u8); + writer.WriteStringValue(TargetServerAzureResourceId); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static JobPrivateEndpointData DeserializeJobPrivateEndpointData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + Optional targetServerAzureResourceId = default; + Optional privateEndpointId = default; + 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("targetServerAzureResourceId"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetServerAzureResourceId = new ResourceIdentifier(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("privateEndpointId"u8)) + { + privateEndpointId = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new JobPrivateEndpointData(id, name, type, systemData.Value, targetServerAzureResourceId.Value, privateEndpointId.Value); + } + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/JobPrivateEndpointListResult.Serialization.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/JobPrivateEndpointListResult.Serialization.cs new file mode 100644 index 000000000000..48a9218272be --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/JobPrivateEndpointListResult.Serialization.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Sql; + +namespace Azure.ResourceManager.Sql.Models +{ + internal partial class JobPrivateEndpointListResult + { + internal static JobPrivateEndpointListResult DeserializeJobPrivateEndpointListResult(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JobPrivateEndpointData.DeserializeJobPrivateEndpointData(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new JobPrivateEndpointListResult(Optional.ToList(value), nextLink.Value); + } + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/JobPrivateEndpointListResult.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/JobPrivateEndpointListResult.cs new file mode 100644 index 000000000000..b098686f4148 --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/JobPrivateEndpointListResult.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Sql; + +namespace Azure.ResourceManager.Sql.Models +{ + /// A list of job agent private endpoints. + internal partial class JobPrivateEndpointListResult + { + /// Initializes a new instance of JobPrivateEndpointListResult. + internal JobPrivateEndpointListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of JobPrivateEndpointListResult. + /// Array of results. + /// Link to retrieve next page of results. + internal JobPrivateEndpointListResult(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Array of results. + public IReadOnlyList Value { get; } + /// Link to retrieve next page of results. + public string NextLink { get; } + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/NetworkIsolationSettingsAutoGenerated.Serialization.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/NetworkIsolationSettingsAutoGenerated.Serialization.cs new file mode 100644 index 000000000000..68f2ea8d802c --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/NetworkIsolationSettingsAutoGenerated.Serialization.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Sql.Models +{ + public partial class NetworkIsolationSettingsAutoGenerated : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(StorageAccountResourceId)) + { + writer.WritePropertyName("storageAccountResourceId"u8); + writer.WriteStringValue(StorageAccountResourceId); + } + if (Optional.IsDefined(SqlServerResourceId)) + { + writer.WritePropertyName("sqlServerResourceId"u8); + writer.WriteStringValue(SqlServerResourceId); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/NetworkIsolationSettingsAutoGenerated.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/NetworkIsolationSettingsAutoGenerated.cs new file mode 100644 index 000000000000..3b14c408a6a0 --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/NetworkIsolationSettingsAutoGenerated.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.ResourceManager.Sql.Models +{ + /// Contains the ARM resources for which to create private endpoint connection. + public partial class NetworkIsolationSettingsAutoGenerated + { + /// Initializes a new instance of NetworkIsolationSettingsAutoGenerated. + public NetworkIsolationSettingsAutoGenerated() + { + } + + /// The resource id for the storage account used to store BACPAC file. If set, private endpoint connection will be created for the storage account. Must match storage account used for StorageUri parameter. + public ResourceIdentifier StorageAccountResourceId { get; set; } + /// The resource id for the SQL server which is the target of this request. If set, private endpoint connection will be created for the SQL server. Must match server which is target of the operation. + public ResourceIdentifier SqlServerResourceId { get; set; } + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlAlwaysEncryptedEnclaveType.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlAlwaysEncryptedEnclaveType.cs index 193b04668b42..2ae6a1f97a04 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlAlwaysEncryptedEnclaveType.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlAlwaysEncryptedEnclaveType.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Sql.Models { - /// Type of enclave requested on the database i.e. Default or VBS enclaves. + /// Type of enclave requested on the elastic pool. public readonly partial struct SqlAlwaysEncryptedEnclaveType : IEquatable { private readonly string _value; diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlAvailabilityZoneType.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlAvailabilityZoneType.cs index d8adc3380487..75dfe8a34909 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlAvailabilityZoneType.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlAvailabilityZoneType.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Sql.Models { - /// Specifies the availability zone the database is pinned to. + /// Specifies the availability zone the pool's primary replica is pinned to. public readonly partial struct SqlAvailabilityZoneType : IEquatable { private readonly string _value; diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlDatabaseData.Serialization.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlDatabaseData.Serialization.cs index b6481b91f422..2a2e94c92f62 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlDatabaseData.Serialization.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlDatabaseData.Serialization.cs @@ -185,6 +185,16 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("preferredEnclaveType"u8); writer.WriteStringValue(PreferredEnclaveType.Value.ToString()); } + if (Optional.IsDefined(UseFreeLimit)) + { + writer.WritePropertyName("useFreeLimit"u8); + writer.WriteBooleanValue(UseFreeLimit.Value); + } + if (Optional.IsDefined(FreeLimitExhaustionBehavior)) + { + writer.WritePropertyName("freeLimitExhaustionBehavior"u8); + writer.WriteStringValue(FreeLimitExhaustionBehavior.Value.ToString()); + } if (Optional.IsDefined(SourceResourceId)) { writer.WritePropertyName("sourceResourceId"u8); @@ -205,6 +215,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("availabilityZone"u8); writer.WriteStringValue(AvailabilityZone.Value.ToString()); } + if (Optional.IsDefined(EncryptionProtectorAutoRotation)) + { + writer.WritePropertyName("encryptionProtectorAutoRotation"u8); + writer.WriteBooleanValue(EncryptionProtectorAutoRotation.Value); + } writer.WriteEndObject(); writer.WriteEndObject(); } @@ -266,10 +281,13 @@ internal static SqlDatabaseData DeserializeSqlDatabaseData(JsonElement element) Optional> keys = default; Optional encryptionProtector = default; Optional preferredEnclaveType = default; + Optional useFreeLimit = default; + Optional freeLimitExhaustionBehavior = default; Optional sourceResourceId = default; Optional manualCutover = default; Optional performCutover = default; Optional availabilityZone = default; + Optional encryptionProtectorAutoRotation = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("sku"u8)) @@ -710,6 +728,24 @@ internal static SqlDatabaseData DeserializeSqlDatabaseData(JsonElement element) preferredEnclaveType = new SqlAlwaysEncryptedEnclaveType(property0.Value.GetString()); continue; } + if (property0.NameEquals("useFreeLimit"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useFreeLimit = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("freeLimitExhaustionBehavior"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + freeLimitExhaustionBehavior = new FreeLimitExhaustionBehavior(property0.Value.GetString()); + continue; + } if (property0.NameEquals("sourceResourceId"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -746,11 +782,20 @@ internal static SqlDatabaseData DeserializeSqlDatabaseData(JsonElement element) availabilityZone = new SqlAvailabilityZoneType(property0.Value.GetString()); continue; } + if (property0.NameEquals("encryptionProtectorAutoRotation"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + encryptionProtectorAutoRotation = property0.Value.GetBoolean(); + continue; + } } continue; } } - return new SqlDatabaseData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, sku.Value, kind.Value, managedBy.Value, identity.Value, Optional.ToNullable(createMode), collation.Value, Optional.ToNullable(maxSizeBytes), Optional.ToNullable(sampleName), elasticPoolId.Value, sourceDatabaseId.Value, Optional.ToNullable(status), Optional.ToNullable(databaseId), Optional.ToNullable(creationDate), currentServiceObjectiveName.Value, requestedServiceObjectiveName.Value, Optional.ToNullable(defaultSecondaryLocation), failoverGroupId.Value, Optional.ToNullable(restorePointInTime), Optional.ToNullable(sourceDatabaseDeletionDate), recoveryServicesRecoveryPointId.Value, longTermRetentionBackupResourceId.Value, recoverableDatabaseId.Value, restorableDroppedDatabaseId.Value, Optional.ToNullable(catalogCollation), Optional.ToNullable(zoneRedundant), Optional.ToNullable(licenseType), Optional.ToNullable(maxLogSizeBytes), Optional.ToNullable(earliestRestoreDate), Optional.ToNullable(readScale), Optional.ToNullable(highAvailabilityReplicaCount), Optional.ToNullable(secondaryType), currentSku.Value, Optional.ToNullable(autoPauseDelay), Optional.ToNullable(currentBackupStorageRedundancy), Optional.ToNullable(requestedBackupStorageRedundancy), Optional.ToNullable(minCapacity), Optional.ToNullable(pausedDate), Optional.ToNullable(resumedDate), maintenanceConfigurationId.Value, Optional.ToNullable(isLedgerOn), Optional.ToNullable(isInfraEncryptionEnabled), Optional.ToNullable(federatedClientId), Optional.ToDictionary(keys), encryptionProtector.Value, Optional.ToNullable(preferredEnclaveType), sourceResourceId.Value, Optional.ToNullable(manualCutover), Optional.ToNullable(performCutover), Optional.ToNullable(availabilityZone)); + return new SqlDatabaseData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, sku.Value, kind.Value, managedBy.Value, identity.Value, Optional.ToNullable(createMode), collation.Value, Optional.ToNullable(maxSizeBytes), Optional.ToNullable(sampleName), elasticPoolId.Value, sourceDatabaseId.Value, Optional.ToNullable(status), Optional.ToNullable(databaseId), Optional.ToNullable(creationDate), currentServiceObjectiveName.Value, requestedServiceObjectiveName.Value, Optional.ToNullable(defaultSecondaryLocation), failoverGroupId.Value, Optional.ToNullable(restorePointInTime), Optional.ToNullable(sourceDatabaseDeletionDate), recoveryServicesRecoveryPointId.Value, longTermRetentionBackupResourceId.Value, recoverableDatabaseId.Value, restorableDroppedDatabaseId.Value, Optional.ToNullable(catalogCollation), Optional.ToNullable(zoneRedundant), Optional.ToNullable(licenseType), Optional.ToNullable(maxLogSizeBytes), Optional.ToNullable(earliestRestoreDate), Optional.ToNullable(readScale), Optional.ToNullable(highAvailabilityReplicaCount), Optional.ToNullable(secondaryType), currentSku.Value, Optional.ToNullable(autoPauseDelay), Optional.ToNullable(currentBackupStorageRedundancy), Optional.ToNullable(requestedBackupStorageRedundancy), Optional.ToNullable(minCapacity), Optional.ToNullable(pausedDate), Optional.ToNullable(resumedDate), maintenanceConfigurationId.Value, Optional.ToNullable(isLedgerOn), Optional.ToNullable(isInfraEncryptionEnabled), Optional.ToNullable(federatedClientId), Optional.ToDictionary(keys), encryptionProtector.Value, Optional.ToNullable(preferredEnclaveType), Optional.ToNullable(useFreeLimit), Optional.ToNullable(freeLimitExhaustionBehavior), sourceResourceId.Value, Optional.ToNullable(manualCutover), Optional.ToNullable(performCutover), Optional.ToNullable(availabilityZone), Optional.ToNullable(encryptionProtectorAutoRotation)); } } } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlDatabasePatch.Serialization.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlDatabasePatch.Serialization.cs index a5d8a9026672..36c78c5197d7 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlDatabasePatch.Serialization.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlDatabasePatch.Serialization.cs @@ -179,6 +179,16 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("preferredEnclaveType"u8); writer.WriteStringValue(PreferredEnclaveType.Value.ToString()); } + if (Optional.IsDefined(UseFreeLimit)) + { + writer.WritePropertyName("useFreeLimit"u8); + writer.WriteBooleanValue(UseFreeLimit.Value); + } + if (Optional.IsDefined(FreeLimitExhaustionBehavior)) + { + writer.WritePropertyName("freeLimitExhaustionBehavior"u8); + writer.WriteStringValue(FreeLimitExhaustionBehavior.Value.ToString()); + } if (Optional.IsDefined(ManualCutover)) { writer.WritePropertyName("manualCutover"u8); @@ -189,6 +199,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("performCutover"u8); writer.WriteBooleanValue(PerformCutover.Value); } + if (Optional.IsDefined(EncryptionProtectorAutoRotation)) + { + writer.WritePropertyName("encryptionProtectorAutoRotation"u8); + writer.WriteBooleanValue(EncryptionProtectorAutoRotation.Value); + } writer.WriteEndObject(); writer.WriteEndObject(); } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlDatabasePatch.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlDatabasePatch.cs index 68e06ebd598a..3398f7b4f216 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlDatabasePatch.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlDatabasePatch.cs @@ -127,6 +127,16 @@ public SqlDatabasePatch() public string EncryptionProtector { get; set; } /// Type of enclave requested on the database i.e. Default or VBS enclaves. public SqlAlwaysEncryptedEnclaveType? PreferredEnclaveType { get; set; } + /// Whether or not the database uses free monthly limits. Allowed on one database in a subscription. + public bool? UseFreeLimit { get; set; } + /// + /// Specifies the behavior when monthly free limits are exhausted for the free database. + /// + /// AutoPause: The database will be auto paused upon exhaustion of free limits for remainder of the month. + /// + /// BillForUsage: The database will continue to be online upon exhaustion of free limits and any overage will be billed. + /// + public FreeLimitExhaustionBehavior? FreeLimitExhaustionBehavior { get; set; } /// /// Whether or not customer controlled manual cutover needs to be done during Update Database operation to Hyperscale tier. /// @@ -147,5 +157,7 @@ public SqlDatabasePatch() /// When performCutover is specified, the scaling operation will trigger cutover and perform role-change to Hyperscale database. /// public bool? PerformCutover { get; set; } + /// The flag to enable or disable auto rotation of database encryption protector AKV key. + public bool? EncryptionProtectorAutoRotation { get; set; } } } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlPrivateEndpointConnectionData.Serialization.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlPrivateEndpointConnectionData.Serialization.cs index 5973b318f778..23fe07b7a57b 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlPrivateEndpointConnectionData.Serialization.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlPrivateEndpointConnectionData.Serialization.cs @@ -5,6 +5,7 @@ #nullable disable +using System.Collections.Generic; using System.Text.Json; using Azure.Core; using Azure.ResourceManager.Models; @@ -45,6 +46,7 @@ internal static SqlPrivateEndpointConnectionData DeserializeSqlPrivateEndpointCo ResourceType type = default; Optional systemData = default; Optional privateEndpoint = default; + Optional> groupIds = default; Optional privateLinkServiceConnectionState = default; Optional provisioningState = default; foreach (var property in element.EnumerateObject()) @@ -91,6 +93,20 @@ internal static SqlPrivateEndpointConnectionData DeserializeSqlPrivateEndpointCo privateEndpoint = JsonSerializer.Deserialize(property0.Value.GetRawText()); continue; } + if (property0.NameEquals("groupIds"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + groupIds = array; + continue; + } if (property0.NameEquals("privateLinkServiceConnectionState"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -113,7 +129,7 @@ internal static SqlPrivateEndpointConnectionData DeserializeSqlPrivateEndpointCo continue; } } - return new SqlPrivateEndpointConnectionData(id, name, type, systemData.Value, privateEndpoint, privateLinkServiceConnectionState.Value, Optional.ToNullable(provisioningState)); + return new SqlPrivateEndpointConnectionData(id, name, type, systemData.Value, privateEndpoint, Optional.ToList(groupIds), privateLinkServiceConnectionState.Value, Optional.ToNullable(provisioningState)); } } } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/DatabasesRestOperations.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/DatabasesRestOperations.cs index ca8b64b1d746..4c606afcd7b8 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/DatabasesRestOperations.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/DatabasesRestOperations.cs @@ -33,7 +33,7 @@ public DatabasesRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-08-01-preview"; + _apiVersion = apiVersion ?? "2023-02-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/JobPrivateEndpointsRestOperations.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/JobPrivateEndpointsRestOperations.cs new file mode 100644 index 000000000000..86195928a6f9 --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/JobPrivateEndpointsRestOperations.cs @@ -0,0 +1,474 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Sql.Models; + +namespace Azure.ResourceManager.Sql +{ + internal partial class JobPrivateEndpointsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of JobPrivateEndpointsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public JobPrivateEndpointsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-05-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateListByAgentRequest(string subscriptionId, string resourceGroupName, string serverName, string jobAgentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Sql/servers/", false); + uri.AppendPath(serverName, true); + uri.AppendPath("/jobAgents/", false); + uri.AppendPath(jobAgentName, true); + uri.AppendPath("/privateEndpoints", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets a list of job agent private endpoints. + /// The subscription ID that identifies an Azure subscription. + /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The name of the server. + /// The name of the job agent. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByAgentAsync(string subscriptionId, string resourceGroupName, string serverName, string jobAgentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(serverName, nameof(serverName)); + Argument.AssertNotNullOrEmpty(jobAgentName, nameof(jobAgentName)); + + using var message = CreateListByAgentRequest(subscriptionId, resourceGroupName, serverName, jobAgentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + JobPrivateEndpointListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = JobPrivateEndpointListResult.DeserializeJobPrivateEndpointListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets a list of job agent private endpoints. + /// The subscription ID that identifies an Azure subscription. + /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The name of the server. + /// The name of the job agent. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByAgent(string subscriptionId, string resourceGroupName, string serverName, string jobAgentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(serverName, nameof(serverName)); + Argument.AssertNotNullOrEmpty(jobAgentName, nameof(jobAgentName)); + + using var message = CreateListByAgentRequest(subscriptionId, resourceGroupName, serverName, jobAgentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + JobPrivateEndpointListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = JobPrivateEndpointListResult.DeserializeJobPrivateEndpointListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string serverName, string jobAgentName, string privateEndpointName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Sql/servers/", false); + uri.AppendPath(serverName, true); + uri.AppendPath("/jobAgents/", false); + uri.AppendPath(jobAgentName, true); + uri.AppendPath("/privateEndpoints/", false); + uri.AppendPath(privateEndpointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets a private endpoint. + /// The subscription ID that identifies an Azure subscription. + /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The name of the server. + /// The name of the job agent. + /// The name of the private endpoint to get. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string serverName, string jobAgentName, string privateEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(serverName, nameof(serverName)); + Argument.AssertNotNullOrEmpty(jobAgentName, nameof(jobAgentName)); + Argument.AssertNotNullOrEmpty(privateEndpointName, nameof(privateEndpointName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, serverName, jobAgentName, privateEndpointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + JobPrivateEndpointData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = JobPrivateEndpointData.DeserializeJobPrivateEndpointData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((JobPrivateEndpointData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets a private endpoint. + /// The subscription ID that identifies an Azure subscription. + /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The name of the server. + /// The name of the job agent. + /// The name of the private endpoint to get. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string serverName, string jobAgentName, string privateEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(serverName, nameof(serverName)); + Argument.AssertNotNullOrEmpty(jobAgentName, nameof(jobAgentName)); + Argument.AssertNotNullOrEmpty(privateEndpointName, nameof(privateEndpointName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, serverName, jobAgentName, privateEndpointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + JobPrivateEndpointData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = JobPrivateEndpointData.DeserializeJobPrivateEndpointData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((JobPrivateEndpointData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string serverName, string jobAgentName, string privateEndpointName, JobPrivateEndpointData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Sql/servers/", false); + uri.AppendPath(serverName, true); + uri.AppendPath("/jobAgents/", false); + uri.AppendPath(jobAgentName, true); + uri.AppendPath("/privateEndpoints/", false); + uri.AppendPath(privateEndpointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates or updates a private endpoint. + /// The subscription ID that identifies an Azure subscription. + /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The name of the server. + /// The name of the job agent. + /// The name of the private endpoint. + /// The requested private endpoint state. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string serverName, string jobAgentName, string privateEndpointName, JobPrivateEndpointData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(serverName, nameof(serverName)); + Argument.AssertNotNullOrEmpty(jobAgentName, nameof(jobAgentName)); + Argument.AssertNotNullOrEmpty(privateEndpointName, nameof(privateEndpointName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, serverName, jobAgentName, privateEndpointName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates or updates a private endpoint. + /// The subscription ID that identifies an Azure subscription. + /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The name of the server. + /// The name of the job agent. + /// The name of the private endpoint. + /// The requested private endpoint state. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string serverName, string jobAgentName, string privateEndpointName, JobPrivateEndpointData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(serverName, nameof(serverName)); + Argument.AssertNotNullOrEmpty(jobAgentName, nameof(jobAgentName)); + Argument.AssertNotNullOrEmpty(privateEndpointName, nameof(privateEndpointName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, serverName, jobAgentName, privateEndpointName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string serverName, string jobAgentName, string privateEndpointName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Sql/servers/", false); + uri.AppendPath(serverName, true); + uri.AppendPath("/jobAgents/", false); + uri.AppendPath(jobAgentName, true); + uri.AppendPath("/privateEndpoints/", false); + uri.AppendPath(privateEndpointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + _userAgent.Apply(message); + return message; + } + + /// Deletes a private endpoint. + /// The subscription ID that identifies an Azure subscription. + /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The name of the server. + /// The name of the job agent. + /// The name of the private endpoint to delete. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string serverName, string jobAgentName, string privateEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(serverName, nameof(serverName)); + Argument.AssertNotNullOrEmpty(jobAgentName, nameof(jobAgentName)); + Argument.AssertNotNullOrEmpty(privateEndpointName, nameof(privateEndpointName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, serverName, jobAgentName, privateEndpointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes a private endpoint. + /// The subscription ID that identifies an Azure subscription. + /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The name of the server. + /// The name of the job agent. + /// The name of the private endpoint to delete. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string serverName, string jobAgentName, string privateEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(serverName, nameof(serverName)); + Argument.AssertNotNullOrEmpty(jobAgentName, nameof(jobAgentName)); + Argument.AssertNotNullOrEmpty(privateEndpointName, nameof(privateEndpointName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, serverName, jobAgentName, privateEndpointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByAgentNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string serverName, string jobAgentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets a list of job agent private endpoints. + /// The URL to the next page of results. + /// The subscription ID that identifies an Azure subscription. + /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The name of the server. + /// The name of the job agent. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByAgentNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string serverName, string jobAgentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(serverName, nameof(serverName)); + Argument.AssertNotNullOrEmpty(jobAgentName, nameof(jobAgentName)); + + using var message = CreateListByAgentNextPageRequest(nextLink, subscriptionId, resourceGroupName, serverName, jobAgentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + JobPrivateEndpointListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = JobPrivateEndpointListResult.DeserializeJobPrivateEndpointListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets a list of job agent private endpoints. + /// The URL to the next page of results. + /// The subscription ID that identifies an Azure subscription. + /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The name of the server. + /// The name of the job agent. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByAgentNextPage(string nextLink, string subscriptionId, string resourceGroupName, string serverName, string jobAgentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(serverName, nameof(serverName)); + Argument.AssertNotNullOrEmpty(jobAgentName, nameof(jobAgentName)); + + using var message = CreateListByAgentNextPageRequest(nextLink, subscriptionId, resourceGroupName, serverName, jobAgentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + JobPrivateEndpointListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = JobPrivateEndpointListResult.DeserializeJobPrivateEndpointListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs index 0dee943bf222..121083df1685 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs @@ -33,10 +33,89 @@ public PrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2020-11-01-preview"; + _apiVersion = apiVersion ?? "2022-08-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } + internal HttpMessage CreateListByServerRequest(string subscriptionId, string resourceGroupName, string serverName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Sql/servers/", false); + uri.AppendPath(serverName, true); + uri.AppendPath("/privateEndpointConnections", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets all private endpoint connections on a server. + /// The subscription ID that identifies an Azure subscription. + /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The name of the server. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByServerAsync(string subscriptionId, string resourceGroupName, string serverName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(serverName, nameof(serverName)); + + using var message = CreateListByServerRequest(subscriptionId, resourceGroupName, serverName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SqlPrivateEndpointConnectionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SqlPrivateEndpointConnectionListResult.DeserializeSqlPrivateEndpointConnectionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all private endpoint connections on a server. + /// The subscription ID that identifies an Azure subscription. + /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The name of the server. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByServer(string subscriptionId, string resourceGroupName, string serverName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(serverName, nameof(serverName)); + + using var message = CreateListByServerRequest(subscriptionId, resourceGroupName, serverName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SqlPrivateEndpointConnectionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SqlPrivateEndpointConnectionListResult.DeserializeSqlPrivateEndpointConnectionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string serverName, string privateEndpointConnectionName) { var message = _pipeline.CreateMessage(); @@ -286,85 +365,6 @@ public Response Delete(string subscriptionId, string resourceGroupName, string s } } - internal HttpMessage CreateListByServerRequest(string subscriptionId, string resourceGroupName, string serverName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Sql/servers/", false); - uri.AppendPath(serverName, true); - uri.AppendPath("/privateEndpointConnections", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets all private endpoint connections on a server. - /// The subscription ID that identifies an Azure subscription. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. - /// The name of the server. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByServerAsync(string subscriptionId, string resourceGroupName, string serverName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(serverName, nameof(serverName)); - - using var message = CreateListByServerRequest(subscriptionId, resourceGroupName, serverName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SqlPrivateEndpointConnectionListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SqlPrivateEndpointConnectionListResult.DeserializeSqlPrivateEndpointConnectionListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets all private endpoint connections on a server. - /// The subscription ID that identifies an Azure subscription. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. - /// The name of the server. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByServer(string subscriptionId, string resourceGroupName, string serverName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(serverName, nameof(serverName)); - - using var message = CreateListByServerRequest(subscriptionId, resourceGroupName, serverName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SqlPrivateEndpointConnectionListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SqlPrivateEndpointConnectionListResult.DeserializeSqlPrivateEndpointConnectionListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - internal HttpMessage CreateListByServerNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string serverName) { var message = _pipeline.CreateMessage(); diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseData.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseData.cs index 8084dbdf7f87..f55a8a185f26 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseData.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseData.cs @@ -109,6 +109,14 @@ public SqlDatabaseData(AzureLocation location) : base(location) /// The resource ids of the user assigned identities to use. /// The azure key vault URI of the database if it's configured with per Database Customer Managed Keys. /// Type of enclave requested on the database i.e. Default or VBS enclaves. + /// Whether or not the database uses free monthly limits. Allowed on one database in a subscription. + /// + /// Specifies the behavior when monthly free limits are exhausted for the free database. + /// + /// AutoPause: The database will be auto paused upon exhaustion of free limits for remainder of the month. + /// + /// BillForUsage: The database will continue to be online upon exhaustion of free limits and any overage will be billed. + /// /// /// The resource identifier of the source associated with the create operation of this database. /// @@ -143,7 +151,8 @@ public SqlDatabaseData(AzureLocation location) : base(location) /// When performCutover is specified, the scaling operation will trigger cutover and perform role-change to Hyperscale database. /// /// Specifies the availability zone the database is pinned to. - internal SqlDatabaseData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, SqlSku sku, string kind, string managedBy, DatabaseIdentity identity, SqlDatabaseCreateMode? createMode, string collation, long? maxSizeBytes, SampleSchemaName? sampleName, ResourceIdentifier elasticPoolId, ResourceIdentifier sourceDatabaseId, SqlDatabaseStatus? status, Guid? databaseId, DateTimeOffset? createdOn, string currentServiceObjectiveName, string requestedServiceObjectiveName, AzureLocation? defaultSecondaryLocation, ResourceIdentifier failoverGroupId, DateTimeOffset? restorePointInTime, DateTimeOffset? sourceDatabaseDeletedOn, ResourceIdentifier recoveryServicesRecoveryPointId, ResourceIdentifier longTermRetentionBackupResourceId, ResourceIdentifier recoverableDatabaseId, ResourceIdentifier restorableDroppedDatabaseId, CatalogCollationType? catalogCollation, bool? isZoneRedundant, DatabaseLicenseType? licenseType, long? maxLogSizeBytes, DateTimeOffset? earliestRestoreOn, DatabaseReadScale? readScale, int? highAvailabilityReplicaCount, SecondaryType? secondaryType, SqlSku currentSku, int? autoPauseDelay, SqlBackupStorageRedundancy? currentBackupStorageRedundancy, SqlBackupStorageRedundancy? requestedBackupStorageRedundancy, double? minCapacity, DateTimeOffset? pausedOn, DateTimeOffset? resumedOn, ResourceIdentifier maintenanceConfigurationId, bool? isLedgerOn, bool? isInfraEncryptionEnabled, Guid? federatedClientId, IDictionary keys, string encryptionProtector, SqlAlwaysEncryptedEnclaveType? preferredEnclaveType, ResourceIdentifier sourceResourceId, bool? manualCutover, bool? performCutover, SqlAvailabilityZoneType? availabilityZone) : base(id, name, resourceType, systemData, tags, location) + /// The flag to enable or disable auto rotation of database encryption protector AKV key. + internal SqlDatabaseData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, SqlSku sku, string kind, string managedBy, DatabaseIdentity identity, SqlDatabaseCreateMode? createMode, string collation, long? maxSizeBytes, SampleSchemaName? sampleName, ResourceIdentifier elasticPoolId, ResourceIdentifier sourceDatabaseId, SqlDatabaseStatus? status, Guid? databaseId, DateTimeOffset? createdOn, string currentServiceObjectiveName, string requestedServiceObjectiveName, AzureLocation? defaultSecondaryLocation, ResourceIdentifier failoverGroupId, DateTimeOffset? restorePointInTime, DateTimeOffset? sourceDatabaseDeletedOn, ResourceIdentifier recoveryServicesRecoveryPointId, ResourceIdentifier longTermRetentionBackupResourceId, ResourceIdentifier recoverableDatabaseId, ResourceIdentifier restorableDroppedDatabaseId, CatalogCollationType? catalogCollation, bool? isZoneRedundant, DatabaseLicenseType? licenseType, long? maxLogSizeBytes, DateTimeOffset? earliestRestoreOn, DatabaseReadScale? readScale, int? highAvailabilityReplicaCount, SecondaryType? secondaryType, SqlSku currentSku, int? autoPauseDelay, SqlBackupStorageRedundancy? currentBackupStorageRedundancy, SqlBackupStorageRedundancy? requestedBackupStorageRedundancy, double? minCapacity, DateTimeOffset? pausedOn, DateTimeOffset? resumedOn, ResourceIdentifier maintenanceConfigurationId, bool? isLedgerOn, bool? isInfraEncryptionEnabled, Guid? federatedClientId, IDictionary keys, string encryptionProtector, SqlAlwaysEncryptedEnclaveType? preferredEnclaveType, bool? useFreeLimit, FreeLimitExhaustionBehavior? freeLimitExhaustionBehavior, ResourceIdentifier sourceResourceId, bool? manualCutover, bool? performCutover, SqlAvailabilityZoneType? availabilityZone, bool? encryptionProtectorAutoRotation) : base(id, name, resourceType, systemData, tags, location) { Sku = sku; Kind = kind; @@ -190,10 +199,13 @@ internal SqlDatabaseData(ResourceIdentifier id, string name, ResourceType resour Keys = keys; EncryptionProtector = encryptionProtector; PreferredEnclaveType = preferredEnclaveType; + UseFreeLimit = useFreeLimit; + FreeLimitExhaustionBehavior = freeLimitExhaustionBehavior; SourceResourceId = sourceResourceId; ManualCutover = manualCutover; PerformCutover = performCutover; AvailabilityZone = availabilityZone; + EncryptionProtectorAutoRotation = encryptionProtectorAutoRotation; } /// @@ -317,6 +329,16 @@ internal SqlDatabaseData(ResourceIdentifier id, string name, ResourceType resour public string EncryptionProtector { get; set; } /// Type of enclave requested on the database i.e. Default or VBS enclaves. public SqlAlwaysEncryptedEnclaveType? PreferredEnclaveType { get; set; } + /// Whether or not the database uses free monthly limits. Allowed on one database in a subscription. + public bool? UseFreeLimit { get; set; } + /// + /// Specifies the behavior when monthly free limits are exhausted for the free database. + /// + /// AutoPause: The database will be auto paused upon exhaustion of free limits for remainder of the month. + /// + /// BillForUsage: The database will continue to be online upon exhaustion of free limits and any overage will be billed. + /// + public FreeLimitExhaustionBehavior? FreeLimitExhaustionBehavior { get; set; } /// /// The resource identifier of the source associated with the create operation of this database. /// @@ -355,5 +377,7 @@ internal SqlDatabaseData(ResourceIdentifier id, string name, ResourceType resour public bool? PerformCutover { get; set; } /// Specifies the availability zone the database is pinned to. public SqlAvailabilityZoneType? AvailabilityZone { get; set; } + /// The flag to enable or disable auto rotation of database encryption protector AKV key. + public bool? EncryptionProtectorAutoRotation { get; set; } } } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlPrivateEndpointConnectionData.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlPrivateEndpointConnectionData.cs index 47a03e2b1269..fe6320781413 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlPrivateEndpointConnectionData.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlPrivateEndpointConnectionData.cs @@ -5,6 +5,7 @@ #nullable disable +using System.Collections.Generic; using Azure.Core; using Azure.ResourceManager.Models; using Azure.ResourceManager.Resources.Models; @@ -21,6 +22,7 @@ public partial class SqlPrivateEndpointConnectionData : ResourceData /// Initializes a new instance of SqlPrivateEndpointConnectionData. public SqlPrivateEndpointConnectionData() { + GroupIds = new ChangeTrackingList(); } /// Initializes a new instance of SqlPrivateEndpointConnectionData. @@ -29,11 +31,13 @@ public SqlPrivateEndpointConnectionData() /// The resourceType. /// The systemData. /// Private endpoint which the connection belongs to. + /// Group IDs. /// Connection state of the private endpoint connection. /// State of the private endpoint connection. - internal SqlPrivateEndpointConnectionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, WritableSubResource privateEndpoint, SqlPrivateLinkServiceConnectionStateProperty connectionState, SqlPrivateEndpointProvisioningState? provisioningState) : base(id, name, resourceType, systemData) + internal SqlPrivateEndpointConnectionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, WritableSubResource privateEndpoint, IReadOnlyList groupIds, SqlPrivateLinkServiceConnectionStateProperty connectionState, SqlPrivateEndpointProvisioningState? provisioningState) : base(id, name, resourceType, systemData) { PrivateEndpoint = privateEndpoint; + GroupIds = groupIds; ConnectionState = connectionState; ProvisioningState = provisioningState; } @@ -52,6 +56,8 @@ public ResourceIdentifier PrivateEndpointId } } + /// Group IDs. + public IReadOnlyList GroupIds { get; } /// Connection state of the private endpoint connection. public SqlPrivateLinkServiceConnectionStateProperty ConnectionState { get; set; } /// State of the private endpoint connection. diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerJobAgentResource.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerJobAgentResource.cs index 27dd2c6d7d81..7c4a4f64496d 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerJobAgentResource.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlServerJobAgentResource.cs @@ -147,6 +147,59 @@ public virtual Response GetSqlServerJobCredentia return GetSqlServerJobCredentials().Get(credentialName, cancellationToken); } + /// Gets a collection of JobPrivateEndpointResources in the SqlServerJobAgent. + /// An object representing collection of JobPrivateEndpointResources and their operations over a JobPrivateEndpointResource. + public virtual JobPrivateEndpointCollection GetJobPrivateEndpoints() + { + return GetCachedClient(Client => new JobPrivateEndpointCollection(Client, Id)); + } + + /// + /// Gets a private endpoint. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/privateEndpoints/{privateEndpointName} + /// + /// + /// Operation Id + /// JobPrivateEndpoints_Get + /// + /// + /// + /// The name of the private endpoint to get. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetJobPrivateEndpointAsync(string privateEndpointName, CancellationToken cancellationToken = default) + { + return await GetJobPrivateEndpoints().GetAsync(privateEndpointName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a private endpoint. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/privateEndpoints/{privateEndpointName} + /// + /// + /// Operation Id + /// JobPrivateEndpoints_Get + /// + /// + /// + /// The name of the private endpoint to get. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual Response GetJobPrivateEndpoint(string privateEndpointName, CancellationToken cancellationToken = default) + { + return GetJobPrivateEndpoints().Get(privateEndpointName, cancellationToken); + } + /// Gets a collection of SqlServerJobResources in the SqlServerJobAgent. /// An object representing collection of SqlServerJobResources and their operations over a SqlServerJobResource. public virtual SqlServerJobCollection GetSqlServerJobs() diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/autorest.md b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/autorest.md index 71c10dba865d..66eab94c81ce 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/eba34b9c764e877193788a87a81cebfa915eb858/specification/sql/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/sql/resource-manager/readme.md namespace: Azure.ResourceManager.Sql output-folder: $(this-folder)/Generated clear-output-folder: true