From 984c22ffce40b94aeb3f62eaa1095f4c8d672023 Mon Sep 17 00:00:00 2001 From: Jay Patel Date: Thu, 17 Jul 2025 22:28:34 -0400 Subject: [PATCH 1/3] Update README with new commit SHA and updated servers.json file ref --- src/Sql/Sql.Management.Sdk/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Sql/Sql.Management.Sdk/README.md b/src/Sql/Sql.Management.Sdk/README.md index bb4828ac721d..1b3169e4c8e9 100644 --- a/src/Sql/Sql.Management.Sdk/README.md +++ b/src/Sql/Sql.Management.Sdk/README.md @@ -26,7 +26,7 @@ use-extension: ### ``` yaml -commit: a21edd5a33e0db83bde8d1dfe706a0cf3db6409e +commit: 51eb4a8df996ebb94c835bf93e08a7001e5d5459 input-file: - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/metrics.json - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/sql.core_legacy.json @@ -108,7 +108,7 @@ input-file: - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/RecoverableDatabases.json - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/RestorableDroppedDatabases.json - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/InstanceFailoverGroups.json - - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/Servers.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/Servers.json - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/ServerConfigurationOptions.json - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/ManagedLedgerDigestUploads.json - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/ManagedDatabases.json From e0f2304fcf78a79bd720f98d827add9196c2b0c6 Mon Sep 17 00:00:00 2001 From: Jay Patel Date: Thu, 17 Jul 2025 22:34:07 -0400 Subject: [PATCH 2/3] Reverting change to input file for PS team investigation --- src/Sql/Sql.Management.Sdk/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Sql/Sql.Management.Sdk/README.md b/src/Sql/Sql.Management.Sdk/README.md index 1b3169e4c8e9..482c282098a2 100644 --- a/src/Sql/Sql.Management.Sdk/README.md +++ b/src/Sql/Sql.Management.Sdk/README.md @@ -108,7 +108,7 @@ input-file: - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/RecoverableDatabases.json - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/RestorableDroppedDatabases.json - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/InstanceFailoverGroups.json - - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/Servers.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/Servers.json - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/ServerConfigurationOptions.json - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/ManagedLedgerDigestUploads.json - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/ManagedDatabases.json From e3c757f772989d76314f2d27665e9aad1afb1213 Mon Sep 17 00:00:00 2001 From: Jay Patel Date: Fri, 18 Jul 2025 06:03:35 -0400 Subject: [PATCH 3/3] Adding minimum SDK changes required --- .../Generated/IServersOperations.cs | 20 +- .../Models/ExportDatabaseDefinition.cs | 5 +- .../ImportExistingDatabaseDefinition.cs | 5 +- .../Models/ImportNewDatabaseDefinition.cs | 42 ++-- .../Generated/Models/MinimalTlsVersion.cs | 22 ++ .../NetworkIsolationSettingsAutoGenerated.cs | 66 ++++++ .../Generated/Models/Server.cs | 49 +++- .../Generated/Models/ServerCreateMode.cs | 23 ++ .../Generated/Models/ServerProperties.cs | 48 +++- .../Generated/Models/ServerUpdate.cs | 48 +++- .../Models/ServersCreateOrUpdateHeaders.cs | 45 ++++ .../Generated/Models/ServersDeleteHeaders.cs | 45 ++++ .../Models/ServersImportDatabaseHeaders.cs | 45 ++++ .../Models/ServersRefreshStatusHeaders.cs | 45 ++++ .../Generated/Models/ServersUpdateHeaders.cs | 45 ++++ .../Generated/Models/StorageKeyType.cs | 1 + .../Generated/ServersOperations.cs | 222 +++++++++--------- .../Generated/ServersOperationsExtensions.cs | 22 +- .../Generated/SqlManagementClient.cs | 3 + src/Sql/Sql.Management.Sdk/README.md | 2 +- 20 files changed, 618 insertions(+), 185 deletions(-) create mode 100644 src/Sql/Sql.Management.Sdk/Generated/Models/MinimalTlsVersion.cs create mode 100644 src/Sql/Sql.Management.Sdk/Generated/Models/NetworkIsolationSettingsAutoGenerated.cs create mode 100644 src/Sql/Sql.Management.Sdk/Generated/Models/ServerCreateMode.cs create mode 100644 src/Sql/Sql.Management.Sdk/Generated/Models/ServersCreateOrUpdateHeaders.cs create mode 100644 src/Sql/Sql.Management.Sdk/Generated/Models/ServersDeleteHeaders.cs create mode 100644 src/Sql/Sql.Management.Sdk/Generated/Models/ServersImportDatabaseHeaders.cs create mode 100644 src/Sql/Sql.Management.Sdk/Generated/Models/ServersRefreshStatusHeaders.cs create mode 100644 src/Sql/Sql.Management.Sdk/Generated/Models/ServersUpdateHeaders.cs diff --git a/src/Sql/Sql.Management.Sdk/Generated/IServersOperations.cs b/src/Sql/Sql.Management.Sdk/Generated/IServersOperations.cs index f262e6666e2a..dafef0519f5f 100644 --- a/src/Sql/Sql.Management.Sdk/Generated/IServersOperations.cs +++ b/src/Sql/Sql.Management.Sdk/Generated/IServersOperations.cs @@ -144,7 +144,7 @@ public partial interface IServersOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, Server parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, Server parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Deletes a server. @@ -168,7 +168,7 @@ public partial interface IServersOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Updates a server. @@ -198,7 +198,7 @@ public partial interface IServersOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, ServerUpdate parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, ServerUpdate parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Imports a bacpac into a new database. @@ -228,7 +228,7 @@ public partial interface IServersOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> ImportDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, ImportNewDatabaseDefinition parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> ImportDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, ImportNewDatabaseDefinition parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Refresh external governance enablement status. @@ -255,7 +255,7 @@ public partial interface IServersOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> RefreshStatusWithHttpMessagesAsync(string resourceGroupName, string serverName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> RefreshStatusWithHttpMessagesAsync(string resourceGroupName, string serverName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Creates or updates a server. @@ -285,7 +285,7 @@ public partial interface IServersOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, Server parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, Server parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Deletes a server. @@ -309,7 +309,7 @@ public partial interface IServersOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Updates a server. @@ -339,7 +339,7 @@ public partial interface IServersOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, ServerUpdate parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, ServerUpdate parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Imports a bacpac into a new database. @@ -369,7 +369,7 @@ public partial interface IServersOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginImportDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, ImportNewDatabaseDefinition parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginImportDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, ImportNewDatabaseDefinition parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Refresh external governance enablement status. @@ -396,7 +396,7 @@ public partial interface IServersOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginRefreshStatusWithHttpMessagesAsync(string resourceGroupName, string serverName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginRefreshStatusWithHttpMessagesAsync(string resourceGroupName, string serverName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Gets a list of all servers in the subscription. diff --git a/src/Sql/Sql.Management.Sdk/Generated/Models/ExportDatabaseDefinition.cs b/src/Sql/Sql.Management.Sdk/Generated/Models/ExportDatabaseDefinition.cs index 8c80a9f7567a..d31756356362 100644 --- a/src/Sql/Sql.Management.Sdk/Generated/Models/ExportDatabaseDefinition.cs +++ b/src/Sql/Sql.Management.Sdk/Generated/Models/ExportDatabaseDefinition.cs @@ -25,7 +25,8 @@ public ExportDatabaseDefinition() /// /// Storage key type. - /// Possible values include: 'SharedAccessKey', 'StorageAccessKey' + /// Possible values include: 'SharedAccessKey', 'StorageAccessKey', + /// 'ManagedIdentity' /// Storage key. /// @@ -64,7 +65,7 @@ public ExportDatabaseDefinition() /// - /// Gets or sets storage key type. Possible values include: 'SharedAccessKey', 'StorageAccessKey' + /// Gets or sets storage key type. Possible values include: 'SharedAccessKey', 'StorageAccessKey', 'ManagedIdentity' /// [Newtonsoft.Json.JsonProperty(PropertyName = "storageKeyType")] public string StorageKeyType {get; set; } diff --git a/src/Sql/Sql.Management.Sdk/Generated/Models/ImportExistingDatabaseDefinition.cs b/src/Sql/Sql.Management.Sdk/Generated/Models/ImportExistingDatabaseDefinition.cs index f4b0b13cf18f..56fad6986e19 100644 --- a/src/Sql/Sql.Management.Sdk/Generated/Models/ImportExistingDatabaseDefinition.cs +++ b/src/Sql/Sql.Management.Sdk/Generated/Models/ImportExistingDatabaseDefinition.cs @@ -26,7 +26,8 @@ public ImportExistingDatabaseDefinition() /// /// Storage key type. - /// Possible values include: 'SharedAccessKey', 'StorageAccessKey' + /// Possible values include: 'SharedAccessKey', 'StorageAccessKey', + /// 'ManagedIdentity' /// Storage key. /// @@ -65,7 +66,7 @@ public ImportExistingDatabaseDefinition() /// - /// Gets or sets storage key type. Possible values include: 'SharedAccessKey', 'StorageAccessKey' + /// Gets or sets storage key type. Possible values include: 'SharedAccessKey', 'StorageAccessKey', 'ManagedIdentity' /// [Newtonsoft.Json.JsonProperty(PropertyName = "storageKeyType")] public string StorageKeyType {get; set; } diff --git a/src/Sql/Sql.Management.Sdk/Generated/Models/ImportNewDatabaseDefinition.cs b/src/Sql/Sql.Management.Sdk/Generated/Models/ImportNewDatabaseDefinition.cs index 41105c6e765c..c49449474b8f 100644 --- a/src/Sql/Sql.Management.Sdk/Generated/Models/ImportNewDatabaseDefinition.cs +++ b/src/Sql/Sql.Management.Sdk/Generated/Models/ImportNewDatabaseDefinition.cs @@ -37,27 +37,32 @@ public ImportNewDatabaseDefinition() /// Max size in bytes for the import database. /// - /// Storage key type. - /// Possible values include: 'SharedAccessKey', 'StorageAccessKey' + /// Storage key type: StorageAccessKey, SharedAccessKey, or ManagedIdentity. + /// Possible values include: 'SharedAccessKey', 'StorageAccessKey', + /// 'ManagedIdentity' - /// Storage key. + /// Storage key for the storage account. If StorageKeyType is ManagedIdentity, + /// this field should specify the Managed Identity's resource ID. /// /// Storage Uri. /// - /// Administrator login name. + /// Administrator login name. If AuthenticationType is ManagedIdentity, this + /// field should specify the Managed Identity's resource ID. /// - /// Administrator login password. + /// Administrator login password. If AuthenticationType is ManagedIdentity, + /// this field should not be specified. /// - /// Authentication type. + /// Type of credentials provided for access to the target SQL server: SQL, + /// ADPassword or ManagedIdentity. /// /// Optional resource information to enable network isolation for request. /// - public ImportNewDatabaseDefinition(string storageKeyType, string storageKey, string storageUri, string administratorLogin, string administratorLoginPassword, string databaseName = default(string), string edition = default(string), string serviceObjectiveName = default(string), string maxSizeBytes = default(string), string authenticationType = default(string), NetworkIsolationSettings networkIsolation = default(NetworkIsolationSettings)) + public ImportNewDatabaseDefinition(string storageKeyType, string storageKey, string storageUri, string administratorLogin, string databaseName = default(string), string edition = default(string), string serviceObjectiveName = default(string), string maxSizeBytes = default(string), string administratorLoginPassword = default(string), string authenticationType = default(string), NetworkIsolationSettingsAutoGenerated networkIsolation = default(NetworkIsolationSettingsAutoGenerated)) { this.DatabaseName = databaseName; @@ -105,13 +110,16 @@ public ImportNewDatabaseDefinition() public string MaxSizeBytes {get; set; } /// - /// Gets or sets storage key type. Possible values include: 'SharedAccessKey', 'StorageAccessKey' + /// Gets or sets storage key type: StorageAccessKey, SharedAccessKey, or + /// ManagedIdentity. Possible values include: 'SharedAccessKey', 'StorageAccessKey', 'ManagedIdentity' /// [Newtonsoft.Json.JsonProperty(PropertyName = "storageKeyType")] public string StorageKeyType {get; set; } /// - /// Gets or sets storage key. + /// Gets or sets storage key for the storage account. If StorageKeyType is + /// ManagedIdentity, this field should specify the Managed Identity's resource + /// ID. /// [Newtonsoft.Json.JsonProperty(PropertyName = "storageKey")] public string StorageKey {get; set; } @@ -123,19 +131,23 @@ public ImportNewDatabaseDefinition() public string StorageUri {get; set; } /// - /// Gets or sets administrator login name. + /// Gets or sets administrator login name. If AuthenticationType is + /// ManagedIdentity, this field should specify the Managed Identity's resource + /// ID. /// [Newtonsoft.Json.JsonProperty(PropertyName = "administratorLogin")] public string AdministratorLogin {get; set; } /// - /// Gets or sets administrator login password. + /// Gets or sets administrator login password. If AuthenticationType is + /// ManagedIdentity, this field should not be specified. /// [Newtonsoft.Json.JsonProperty(PropertyName = "administratorLoginPassword")] public string AdministratorLoginPassword {get; set; } /// - /// Gets or sets authentication type. + /// Gets or sets type of credentials provided for access to the target SQL + /// server: SQL, ADPassword or ManagedIdentity. /// [Newtonsoft.Json.JsonProperty(PropertyName = "authenticationType")] public string AuthenticationType {get; set; } @@ -145,7 +157,7 @@ public ImportNewDatabaseDefinition() /// request. /// [Newtonsoft.Json.JsonProperty(PropertyName = "networkIsolation")] - public NetworkIsolationSettings NetworkIsolation {get; set; } + public NetworkIsolationSettingsAutoGenerated NetworkIsolation {get; set; } /// /// Validate the object. /// @@ -170,10 +182,6 @@ public virtual void Validate() { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "AdministratorLogin"); } - if (this.AdministratorLoginPassword == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "AdministratorLoginPassword"); - } diff --git a/src/Sql/Sql.Management.Sdk/Generated/Models/MinimalTlsVersion.cs b/src/Sql/Sql.Management.Sdk/Generated/Models/MinimalTlsVersion.cs new file mode 100644 index 000000000000..9cbc228fb5c4 --- /dev/null +++ b/src/Sql/Sql.Management.Sdk/Generated/Models/MinimalTlsVersion.cs @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Sql.Models +{ + + /// + /// Defines values for MinimalTlsVersion. + /// + + + public static class MinimalTlsVersion + { + public const string None = "None"; + public const string One0 = "1.0"; + public const string One1 = "1.1"; + public const string One2 = "1.2"; + public const string One3 = "1.3"; + } +} \ No newline at end of file diff --git a/src/Sql/Sql.Management.Sdk/Generated/Models/NetworkIsolationSettingsAutoGenerated.cs b/src/Sql/Sql.Management.Sdk/Generated/Models/NetworkIsolationSettingsAutoGenerated.cs new file mode 100644 index 000000000000..682f375b0170 --- /dev/null +++ b/src/Sql/Sql.Management.Sdk/Generated/Models/NetworkIsolationSettingsAutoGenerated.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Sql.Models +{ + using System.Linq; + + /// + /// Contains the ARM resources for which to create private endpoint connection. + /// + public partial class NetworkIsolationSettingsAutoGenerated + { + /// + /// Initializes a new instance of the NetworkIsolationSettingsAutoGenerated class. + /// + public NetworkIsolationSettingsAutoGenerated() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NetworkIsolationSettingsAutoGenerated class. + /// + + /// 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. + /// + + /// 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 NetworkIsolationSettingsAutoGenerated(string storageAccountResourceId = default(string), string sqlServerResourceId = default(string)) + + { + this.StorageAccountResourceId = storageAccountResourceId; + this.SqlServerResourceId = sqlServerResourceId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets 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. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "storageAccountResourceId")] + public string StorageAccountResourceId {get; set; } + + /// + /// Gets or sets 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. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sqlServerResourceId")] + public string SqlServerResourceId {get; set; } + } +} \ No newline at end of file diff --git a/src/Sql/Sql.Management.Sdk/Generated/Models/Server.cs b/src/Sql/Sql.Management.Sdk/Generated/Models/Server.cs index 8332bc113e51..0858bbe88d98 100644 --- a/src/Sql/Sql.Management.Sdk/Generated/Models/Server.cs +++ b/src/Sql/Sql.Management.Sdk/Generated/Models/Server.cs @@ -64,8 +64,8 @@ public Server() /// List of private endpoint connections on a server /// - /// Minimal TLS version. Allowed values: 'None', '1.0', '1.1', '1.2' - /// + /// Minimal TLS version. Allowed values: 'None', 1.0', '1.1', '1.2', '1.3' + /// Possible values include: 'None', '1.0', '1.1', '1.2', '1.3' /// Whether or not public endpoint access is allowed for this server. Value is /// optional but if passed in, must be 'Enabled' or 'Disabled' or @@ -85,10 +85,10 @@ public Server() /// A CMK URI of the key to use for encryption. /// - /// The Azure Active Directory administrator of the server. This can only be - /// used at server create time. If used for server update, it will be ignored - /// or it will result in an error. For updates individual APIs will need to be - /// used. + /// The Azure Active Directory administrator can be utilized during server + /// creation and for server updates, except for the azureADOnlyAuthentication + /// property. To update the azureADOnlyAuthentication property, individual API + /// must be used. /// /// Whether or not to restrict outbound network access for this server. Value @@ -101,7 +101,14 @@ public Server() /// Status of external governance. /// Possible values include: 'Enabled', 'Disabled' - public Server(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ResourceIdentity identity = default(ResourceIdentity), string kind = default(string), string administratorLogin = default(string), string administratorLoginPassword = default(string), string version = default(string), string state = default(string), string fullyQualifiedDomainName = default(string), System.Collections.Generic.IList privateEndpointConnections = default(System.Collections.Generic.IList), string minimalTlsVersion = default(string), string publicNetworkAccess = default(string), string workspaceFeature = default(string), string primaryUserAssignedIdentityId = default(string), System.Guid? federatedClientId = default(System.Guid?), string keyId = default(string), ServerExternalAdministrator administrators = default(ServerExternalAdministrator), string restrictOutboundNetworkAccess = default(string), string isIPv6Enabled = default(string), string externalGovernanceStatus = default(string)) + + /// Number of days this server will stay soft-deleted. + /// + + /// Create mode for server, only valid values for this are Normal and Restore. + /// Possible values include: 'Normal', 'ServerMigrationV1', + /// 'DatabaseMigrationV1', 'ServerMigration', 'Standby', 'Restore' + public Server(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ResourceIdentity identity = default(ResourceIdentity), string kind = default(string), string administratorLogin = default(string), string administratorLoginPassword = default(string), string version = default(string), string state = default(string), string fullyQualifiedDomainName = default(string), System.Collections.Generic.IList privateEndpointConnections = default(System.Collections.Generic.IList), string minimalTlsVersion = default(string), string publicNetworkAccess = default(string), string workspaceFeature = default(string), string primaryUserAssignedIdentityId = default(string), System.Guid? federatedClientId = default(System.Guid?), string keyId = default(string), ServerExternalAdministrator administrators = default(ServerExternalAdministrator), string restrictOutboundNetworkAccess = default(string), string isIPv6Enabled = default(string), string externalGovernanceStatus = default(string), int? retentionDays = default(int?), string createMode = default(string)) : base(location, id, name, type, tags) { @@ -123,6 +130,8 @@ public Server() this.RestrictOutboundNetworkAccess = restrictOutboundNetworkAccess; this.IsIPv6Enabled = isIPv6Enabled; this.ExternalGovernanceStatus = externalGovernanceStatus; + this.RetentionDays = retentionDays; + this.CreateMode = createMode; CustomInit(); } @@ -184,8 +193,8 @@ public Server() public System.Collections.Generic.IList PrivateEndpointConnections {get; private set; } /// - /// Gets or sets minimal TLS version. Allowed values: 'None', '1.0', '1.1', - /// '1.2' + /// Gets or sets minimal TLS version. Allowed values: 'None', 1.0', '1.1', + /// '1.2', '1.3' Possible values include: 'None', '1.0', '1.1', '1.2', '1.3' /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties.minimalTlsVersion")] public string MinimalTlsVersion {get; set; } @@ -225,10 +234,10 @@ public Server() public string KeyId {get; set; } /// - /// Gets or sets the Azure Active Directory administrator of the server. This - /// can only be used at server create time. If used for server update, it will - /// be ignored or it will result in an error. For updates individual APIs will - /// need to be used. + /// Gets or sets the Azure Active Directory administrator can be utilized + /// during server creation and for server updates, except for the + /// azureADOnlyAuthentication property. To update the azureADOnlyAuthentication + /// property, individual API must be used. /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties.administrators")] public ServerExternalAdministrator Administrators {get; set; } @@ -253,6 +262,19 @@ public Server() /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties.externalGovernanceStatus")] public string ExternalGovernanceStatus {get; private set; } + + /// + /// Gets or sets number of days this server will stay soft-deleted. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.retentionDays")] + public int? RetentionDays {get; set; } + + /// + /// Gets or sets create mode for server, only valid values for this are Normal + /// and Restore. Possible values include: 'Normal', 'ServerMigrationV1', 'DatabaseMigrationV1', 'ServerMigration', 'Standby', 'Restore' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.createMode")] + public string CreateMode {get; set; } /// /// Validate the object. /// @@ -288,6 +310,7 @@ public override void Validate() + } } } \ No newline at end of file diff --git a/src/Sql/Sql.Management.Sdk/Generated/Models/ServerCreateMode.cs b/src/Sql/Sql.Management.Sdk/Generated/Models/ServerCreateMode.cs new file mode 100644 index 000000000000..b3ffd20712ea --- /dev/null +++ b/src/Sql/Sql.Management.Sdk/Generated/Models/ServerCreateMode.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Sql.Models +{ + + /// + /// Defines values for ServerCreateMode. + /// + + + public static class ServerCreateMode + { + public const string Normal = "Normal"; + public const string ServerMigrationV1 = "ServerMigrationV1"; + public const string DatabaseMigrationV1 = "DatabaseMigrationV1"; + public const string ServerMigration = "ServerMigration"; + public const string Standby = "Standby"; + public const string Restore = "Restore"; + } +} \ No newline at end of file diff --git a/src/Sql/Sql.Management.Sdk/Generated/Models/ServerProperties.cs b/src/Sql/Sql.Management.Sdk/Generated/Models/ServerProperties.cs index c00024d51082..956c675f961d 100644 --- a/src/Sql/Sql.Management.Sdk/Generated/Models/ServerProperties.cs +++ b/src/Sql/Sql.Management.Sdk/Generated/Models/ServerProperties.cs @@ -42,8 +42,8 @@ public ServerProperties() /// List of private endpoint connections on a server /// - /// Minimal TLS version. Allowed values: 'None', '1.0', '1.1', '1.2' - /// + /// Minimal TLS version. Allowed values: 'None', 1.0', '1.1', '1.2', '1.3' + /// Possible values include: 'None', '1.0', '1.1', '1.2', '1.3' /// Whether or not public endpoint access is allowed for this server. Value is /// optional but if passed in, must be 'Enabled' or 'Disabled' or @@ -63,10 +63,10 @@ public ServerProperties() /// A CMK URI of the key to use for encryption. /// - /// The Azure Active Directory administrator of the server. This can only be - /// used at server create time. If used for server update, it will be ignored - /// or it will result in an error. For updates individual APIs will need to be - /// used. + /// The Azure Active Directory administrator can be utilized during server + /// creation and for server updates, except for the azureADOnlyAuthentication + /// property. To update the azureADOnlyAuthentication property, individual API + /// must be used. /// /// Whether or not to restrict outbound network access for this server. Value @@ -79,7 +79,14 @@ public ServerProperties() /// Status of external governance. /// Possible values include: 'Enabled', 'Disabled' - public ServerProperties(string administratorLogin = default(string), string administratorLoginPassword = default(string), string version = default(string), string state = default(string), string fullyQualifiedDomainName = default(string), System.Collections.Generic.IList privateEndpointConnections = default(System.Collections.Generic.IList), string minimalTlsVersion = default(string), string publicNetworkAccess = default(string), string workspaceFeature = default(string), string primaryUserAssignedIdentityId = default(string), System.Guid? federatedClientId = default(System.Guid?), string keyId = default(string), ServerExternalAdministrator administrators = default(ServerExternalAdministrator), string restrictOutboundNetworkAccess = default(string), string isIPv6Enabled = default(string), string externalGovernanceStatus = default(string)) + + /// Number of days this server will stay soft-deleted. + /// + + /// Create mode for server, only valid values for this are Normal and Restore. + /// Possible values include: 'Normal', 'ServerMigrationV1', + /// 'DatabaseMigrationV1', 'ServerMigration', 'Standby', 'Restore' + public ServerProperties(string administratorLogin = default(string), string administratorLoginPassword = default(string), string version = default(string), string state = default(string), string fullyQualifiedDomainName = default(string), System.Collections.Generic.IList privateEndpointConnections = default(System.Collections.Generic.IList), string minimalTlsVersion = default(string), string publicNetworkAccess = default(string), string workspaceFeature = default(string), string primaryUserAssignedIdentityId = default(string), System.Guid? federatedClientId = default(System.Guid?), string keyId = default(string), ServerExternalAdministrator administrators = default(ServerExternalAdministrator), string restrictOutboundNetworkAccess = default(string), string isIPv6Enabled = default(string), string externalGovernanceStatus = default(string), int? retentionDays = default(int?), string createMode = default(string)) { this.AdministratorLogin = administratorLogin; @@ -98,6 +105,8 @@ public ServerProperties() this.RestrictOutboundNetworkAccess = restrictOutboundNetworkAccess; this.IsIPv6Enabled = isIPv6Enabled; this.ExternalGovernanceStatus = externalGovernanceStatus; + this.RetentionDays = retentionDays; + this.CreateMode = createMode; CustomInit(); } @@ -146,8 +155,8 @@ public ServerProperties() public System.Collections.Generic.IList PrivateEndpointConnections {get; private set; } /// - /// Gets or sets minimal TLS version. Allowed values: 'None', '1.0', '1.1', - /// '1.2' + /// Gets or sets minimal TLS version. Allowed values: 'None', 1.0', '1.1', + /// '1.2', '1.3' Possible values include: 'None', '1.0', '1.1', '1.2', '1.3' /// [Newtonsoft.Json.JsonProperty(PropertyName = "minimalTlsVersion")] public string MinimalTlsVersion {get; set; } @@ -187,10 +196,10 @@ public ServerProperties() public string KeyId {get; set; } /// - /// Gets or sets the Azure Active Directory administrator of the server. This - /// can only be used at server create time. If used for server update, it will - /// be ignored or it will result in an error. For updates individual APIs will - /// need to be used. + /// Gets or sets the Azure Active Directory administrator can be utilized + /// during server creation and for server updates, except for the + /// azureADOnlyAuthentication property. To update the azureADOnlyAuthentication + /// property, individual API must be used. /// [Newtonsoft.Json.JsonProperty(PropertyName = "administrators")] public ServerExternalAdministrator Administrators {get; set; } @@ -215,5 +224,18 @@ public ServerProperties() /// [Newtonsoft.Json.JsonProperty(PropertyName = "externalGovernanceStatus")] public string ExternalGovernanceStatus {get; private set; } + + /// + /// Gets or sets number of days this server will stay soft-deleted. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "retentionDays")] + public int? RetentionDays {get; set; } + + /// + /// Gets or sets create mode for server, only valid values for this are Normal + /// and Restore. Possible values include: 'Normal', 'ServerMigrationV1', 'DatabaseMigrationV1', 'ServerMigration', 'Standby', 'Restore' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "createMode")] + public string CreateMode {get; set; } } } \ No newline at end of file diff --git a/src/Sql/Sql.Management.Sdk/Generated/Models/ServerUpdate.cs b/src/Sql/Sql.Management.Sdk/Generated/Models/ServerUpdate.cs index a75538242b4d..a0a62bf5c430 100644 --- a/src/Sql/Sql.Management.Sdk/Generated/Models/ServerUpdate.cs +++ b/src/Sql/Sql.Management.Sdk/Generated/Models/ServerUpdate.cs @@ -49,8 +49,8 @@ public ServerUpdate() /// List of private endpoint connections on a server /// - /// Minimal TLS version. Allowed values: 'None', '1.0', '1.1', '1.2' - /// + /// Minimal TLS version. Allowed values: 'None', 1.0', '1.1', '1.2', '1.3' + /// Possible values include: 'None', '1.0', '1.1', '1.2', '1.3' /// Whether or not public endpoint access is allowed for this server. Value is /// optional but if passed in, must be 'Enabled' or 'Disabled' or @@ -70,10 +70,10 @@ public ServerUpdate() /// A CMK URI of the key to use for encryption. /// - /// The Azure Active Directory administrator of the server. This can only be - /// used at server create time. If used for server update, it will be ignored - /// or it will result in an error. For updates individual APIs will need to be - /// used. + /// The Azure Active Directory administrator can be utilized during server + /// creation and for server updates, except for the azureADOnlyAuthentication + /// property. To update the azureADOnlyAuthentication property, individual API + /// must be used. /// /// Whether or not to restrict outbound network access for this server. Value @@ -86,7 +86,14 @@ public ServerUpdate() /// Status of external governance. /// Possible values include: 'Enabled', 'Disabled' - public ServerUpdate(ResourceIdentity identity = default(ResourceIdentity), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string administratorLogin = default(string), string administratorLoginPassword = default(string), string version = default(string), string state = default(string), string fullyQualifiedDomainName = default(string), System.Collections.Generic.IList privateEndpointConnections = default(System.Collections.Generic.IList), string minimalTlsVersion = default(string), string publicNetworkAccess = default(string), string workspaceFeature = default(string), string primaryUserAssignedIdentityId = default(string), System.Guid? federatedClientId = default(System.Guid?), string keyId = default(string), ServerExternalAdministrator administrators = default(ServerExternalAdministrator), string restrictOutboundNetworkAccess = default(string), string isIPv6Enabled = default(string), string externalGovernanceStatus = default(string)) + + /// Number of days this server will stay soft-deleted. + /// + + /// Create mode for server, only valid values for this are Normal and Restore. + /// Possible values include: 'Normal', 'ServerMigrationV1', + /// 'DatabaseMigrationV1', 'ServerMigration', 'Standby', 'Restore' + public ServerUpdate(ResourceIdentity identity = default(ResourceIdentity), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string administratorLogin = default(string), string administratorLoginPassword = default(string), string version = default(string), string state = default(string), string fullyQualifiedDomainName = default(string), System.Collections.Generic.IList privateEndpointConnections = default(System.Collections.Generic.IList), string minimalTlsVersion = default(string), string publicNetworkAccess = default(string), string workspaceFeature = default(string), string primaryUserAssignedIdentityId = default(string), System.Guid? federatedClientId = default(System.Guid?), string keyId = default(string), ServerExternalAdministrator administrators = default(ServerExternalAdministrator), string restrictOutboundNetworkAccess = default(string), string isIPv6Enabled = default(string), string externalGovernanceStatus = default(string), int? retentionDays = default(int?), string createMode = default(string)) { this.Identity = identity; @@ -107,6 +114,8 @@ public ServerUpdate() this.RestrictOutboundNetworkAccess = restrictOutboundNetworkAccess; this.IsIPv6Enabled = isIPv6Enabled; this.ExternalGovernanceStatus = externalGovernanceStatus; + this.RetentionDays = retentionDays; + this.CreateMode = createMode; CustomInit(); } @@ -167,8 +176,8 @@ public ServerUpdate() public System.Collections.Generic.IList PrivateEndpointConnections {get; private set; } /// - /// Gets or sets minimal TLS version. Allowed values: 'None', '1.0', '1.1', - /// '1.2' + /// Gets or sets minimal TLS version. Allowed values: 'None', 1.0', '1.1', + /// '1.2', '1.3' Possible values include: 'None', '1.0', '1.1', '1.2', '1.3' /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties.minimalTlsVersion")] public string MinimalTlsVersion {get; set; } @@ -208,10 +217,10 @@ public ServerUpdate() public string KeyId {get; set; } /// - /// Gets or sets the Azure Active Directory administrator of the server. This - /// can only be used at server create time. If used for server update, it will - /// be ignored or it will result in an error. For updates individual APIs will - /// need to be used. + /// Gets or sets the Azure Active Directory administrator can be utilized + /// during server creation and for server updates, except for the + /// azureADOnlyAuthentication property. To update the azureADOnlyAuthentication + /// property, individual API must be used. /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties.administrators")] public ServerExternalAdministrator Administrators {get; set; } @@ -236,5 +245,18 @@ public ServerUpdate() /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties.externalGovernanceStatus")] public string ExternalGovernanceStatus {get; private set; } + + /// + /// Gets or sets number of days this server will stay soft-deleted. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.retentionDays")] + public int? RetentionDays {get; set; } + + /// + /// Gets or sets create mode for server, only valid values for this are Normal + /// and Restore. Possible values include: 'Normal', 'ServerMigrationV1', 'DatabaseMigrationV1', 'ServerMigration', 'Standby', 'Restore' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.createMode")] + public string CreateMode {get; set; } } } \ No newline at end of file diff --git a/src/Sql/Sql.Management.Sdk/Generated/Models/ServersCreateOrUpdateHeaders.cs b/src/Sql/Sql.Management.Sdk/Generated/Models/ServersCreateOrUpdateHeaders.cs new file mode 100644 index 000000000000..514a658290c8 --- /dev/null +++ b/src/Sql/Sql.Management.Sdk/Generated/Models/ServersCreateOrUpdateHeaders.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Sql.Models +{ + using System.Linq; + + public partial class ServersCreateOrUpdateHeaders + { + /// + /// Initializes a new instance of the ServersCreateOrUpdateHeaders class. + /// + public ServersCreateOrUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ServersCreateOrUpdateHeaders class. + /// + + /// + /// + public ServersCreateOrUpdateHeaders(string location = default(string)) + + { + this.Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + } +} \ No newline at end of file diff --git a/src/Sql/Sql.Management.Sdk/Generated/Models/ServersDeleteHeaders.cs b/src/Sql/Sql.Management.Sdk/Generated/Models/ServersDeleteHeaders.cs new file mode 100644 index 000000000000..219512194881 --- /dev/null +++ b/src/Sql/Sql.Management.Sdk/Generated/Models/ServersDeleteHeaders.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Sql.Models +{ + using System.Linq; + + public partial class ServersDeleteHeaders + { + /// + /// Initializes a new instance of the ServersDeleteHeaders class. + /// + public ServersDeleteHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ServersDeleteHeaders class. + /// + + /// + /// + public ServersDeleteHeaders(string location = default(string)) + + { + this.Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + } +} \ No newline at end of file diff --git a/src/Sql/Sql.Management.Sdk/Generated/Models/ServersImportDatabaseHeaders.cs b/src/Sql/Sql.Management.Sdk/Generated/Models/ServersImportDatabaseHeaders.cs new file mode 100644 index 000000000000..e8a46b6d7dcc --- /dev/null +++ b/src/Sql/Sql.Management.Sdk/Generated/Models/ServersImportDatabaseHeaders.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Sql.Models +{ + using System.Linq; + + public partial class ServersImportDatabaseHeaders + { + /// + /// Initializes a new instance of the ServersImportDatabaseHeaders class. + /// + public ServersImportDatabaseHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ServersImportDatabaseHeaders class. + /// + + /// + /// + public ServersImportDatabaseHeaders(string location = default(string)) + + { + this.Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + } +} \ No newline at end of file diff --git a/src/Sql/Sql.Management.Sdk/Generated/Models/ServersRefreshStatusHeaders.cs b/src/Sql/Sql.Management.Sdk/Generated/Models/ServersRefreshStatusHeaders.cs new file mode 100644 index 000000000000..b22e09440daa --- /dev/null +++ b/src/Sql/Sql.Management.Sdk/Generated/Models/ServersRefreshStatusHeaders.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Sql.Models +{ + using System.Linq; + + public partial class ServersRefreshStatusHeaders + { + /// + /// Initializes a new instance of the ServersRefreshStatusHeaders class. + /// + public ServersRefreshStatusHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ServersRefreshStatusHeaders class. + /// + + /// + /// + public ServersRefreshStatusHeaders(string location = default(string)) + + { + this.Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + } +} \ No newline at end of file diff --git a/src/Sql/Sql.Management.Sdk/Generated/Models/ServersUpdateHeaders.cs b/src/Sql/Sql.Management.Sdk/Generated/Models/ServersUpdateHeaders.cs new file mode 100644 index 000000000000..404ae17586df --- /dev/null +++ b/src/Sql/Sql.Management.Sdk/Generated/Models/ServersUpdateHeaders.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Sql.Models +{ + using System.Linq; + + public partial class ServersUpdateHeaders + { + /// + /// Initializes a new instance of the ServersUpdateHeaders class. + /// + public ServersUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ServersUpdateHeaders class. + /// + + /// + /// + public ServersUpdateHeaders(string location = default(string)) + + { + this.Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + } +} \ No newline at end of file diff --git a/src/Sql/Sql.Management.Sdk/Generated/Models/StorageKeyType.cs b/src/Sql/Sql.Management.Sdk/Generated/Models/StorageKeyType.cs index 63a21f02d393..03952024209f 100644 --- a/src/Sql/Sql.Management.Sdk/Generated/Models/StorageKeyType.cs +++ b/src/Sql/Sql.Management.Sdk/Generated/Models/StorageKeyType.cs @@ -15,5 +15,6 @@ public static class StorageKeyType { public const string SharedAccessKey = "SharedAccessKey"; public const string StorageAccessKey = "StorageAccessKey"; + public const string ManagedIdentity = "ManagedIdentity"; } } \ No newline at end of file diff --git a/src/Sql/Sql.Management.Sdk/Generated/ServersOperations.cs b/src/Sql/Sql.Management.Sdk/Generated/ServersOperations.cs index 02047ad67108..20c4af0ef8dc 100644 --- a/src/Sql/Sql.Management.Sdk/Generated/ServersOperations.cs +++ b/src/Sql/Sql.Management.Sdk/Generated/ServersOperations.cs @@ -84,7 +84,7 @@ internal ServersOperations (SqlManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2023-02-01-preview"; + string apiVersion = "2024-11-01-preview"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -176,14 +176,13 @@ internal ServersOperations (SqlManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -193,10 +192,6 @@ internal ServersOperations (SqlManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -285,7 +280,7 @@ internal ServersOperations (SqlManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2023-02-01-preview"; + string apiVersion = "2024-11-01-preview"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -375,14 +370,13 @@ internal ServersOperations (SqlManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -392,10 +386,6 @@ internal ServersOperations (SqlManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -493,7 +483,7 @@ internal ServersOperations (SqlManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2023-02-01-preview"; + string apiVersion = "2024-11-01-preview"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -585,14 +575,13 @@ internal ServersOperations (SqlManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -602,10 +591,6 @@ internal ServersOperations (SqlManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -711,7 +696,7 @@ internal ServersOperations (SqlManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2023-02-01-preview"; + string apiVersion = "2024-11-01-preview"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -805,14 +790,13 @@ internal ServersOperations (SqlManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -822,10 +806,6 @@ internal ServersOperations (SqlManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -894,10 +874,10 @@ internal ServersOperations (SqlManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, Server parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, Server parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -917,10 +897,10 @@ internal ServersOperations (SqlManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, serverName, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, serverName, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -943,10 +923,10 @@ internal ServersOperations (SqlManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, ServerUpdate parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, ServerUpdate parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, serverName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, serverName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -969,10 +949,10 @@ internal ServersOperations (SqlManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> ImportDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, ImportNewDatabaseDefinition parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> ImportDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, ImportNewDatabaseDefinition parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginImportDatabaseWithHttpMessagesAsync(resourceGroupName, serverName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginImportDatabaseWithHttpMessagesAsync(resourceGroupName, serverName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -992,10 +972,10 @@ internal ServersOperations (SqlManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> RefreshStatusWithHttpMessagesAsync(string resourceGroupName, string serverName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> RefreshStatusWithHttpMessagesAsync(string resourceGroupName, string serverName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginRefreshStatusWithHttpMessagesAsync(resourceGroupName, serverName, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginRefreshStatusWithHttpMessagesAsync(resourceGroupName, serverName, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -1033,7 +1013,7 @@ internal ServersOperations (SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, Server parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, Server parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -1062,7 +1042,7 @@ internal ServersOperations (SqlManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2023-02-01-preview"; + string apiVersion = "2024-11-01-preview"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1158,14 +1138,13 @@ internal ServersOperations (SqlManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1175,10 +1154,6 @@ internal ServersOperations (SqlManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -1191,7 +1166,7 @@ internal ServersOperations (SqlManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1235,6 +1210,19 @@ internal ServersOperations (SqlManagementClient client) throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -1274,7 +1262,7 @@ internal ServersOperations (SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -1295,7 +1283,7 @@ internal ServersOperations (SqlManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2023-02-01-preview"; + string apiVersion = "2024-11-01-preview"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1384,14 +1372,13 @@ internal ServersOperations (SqlManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1401,10 +1388,6 @@ internal ServersOperations (SqlManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -1417,7 +1400,7 @@ internal ServersOperations (SqlManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1425,6 +1408,19 @@ internal ServersOperations (SqlManagementClient client) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -1470,7 +1466,7 @@ internal ServersOperations (SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, ServerUpdate parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, ServerUpdate parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -1495,7 +1491,7 @@ internal ServersOperations (SqlManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2023-02-01-preview"; + string apiVersion = "2024-11-01-preview"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1591,14 +1587,13 @@ internal ServersOperations (SqlManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1608,10 +1603,6 @@ internal ServersOperations (SqlManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -1624,7 +1615,7 @@ internal ServersOperations (SqlManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1650,6 +1641,19 @@ internal ServersOperations (SqlManagementClient client) throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -1695,7 +1699,7 @@ internal ServersOperations (SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginImportDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, ImportNewDatabaseDefinition parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginImportDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, ImportNewDatabaseDefinition parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -1724,7 +1728,7 @@ internal ServersOperations (SqlManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2023-02-01-preview"; + string apiVersion = "2024-11-01-preview"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1820,14 +1824,13 @@ internal ServersOperations (SqlManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1837,10 +1840,6 @@ internal ServersOperations (SqlManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -1853,7 +1852,7 @@ internal ServersOperations (SqlManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1879,6 +1878,19 @@ internal ServersOperations (SqlManagementClient client) throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -1921,7 +1933,7 @@ internal ServersOperations (SqlManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginRefreshStatusWithHttpMessagesAsync(string resourceGroupName, string serverName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginRefreshStatusWithHttpMessagesAsync(string resourceGroupName, string serverName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -1942,7 +1954,7 @@ internal ServersOperations (SqlManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2023-02-01-preview"; + string apiVersion = "2024-11-01-preview"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2031,14 +2043,13 @@ internal ServersOperations (SqlManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2048,10 +2059,6 @@ internal ServersOperations (SqlManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -2064,7 +2071,7 @@ internal ServersOperations (SqlManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -2090,6 +2097,19 @@ internal ServersOperations (SqlManagementClient client) throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -2213,14 +2233,13 @@ internal ServersOperations (SqlManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2230,10 +2249,6 @@ internal ServersOperations (SqlManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -2395,14 +2410,13 @@ internal ServersOperations (SqlManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2412,10 +2426,6 @@ internal ServersOperations (SqlManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/Sql/Sql.Management.Sdk/Generated/ServersOperationsExtensions.cs b/src/Sql/Sql.Management.Sdk/Generated/ServersOperationsExtensions.cs index d10b18f3060e..cae53e2af7fb 100644 --- a/src/Sql/Sql.Management.Sdk/Generated/ServersOperationsExtensions.cs +++ b/src/Sql/Sql.Management.Sdk/Generated/ServersOperationsExtensions.cs @@ -214,9 +214,9 @@ public static Server CreateOrUpdate(this IServersOperations operations, string r /// /// The name of the server. /// - public static void Delete(this IServersOperations operations, string resourceGroupName, string serverName) + public static ServersDeleteHeaders Delete(this IServersOperations operations, string resourceGroupName, string serverName) { - ((IServersOperations)operations).DeleteAsync(resourceGroupName, serverName).GetAwaiter().GetResult(); + return ((IServersOperations)operations).DeleteAsync(resourceGroupName, serverName).GetAwaiter().GetResult(); } /// @@ -235,9 +235,12 @@ public static void Delete(this IServersOperations operations, string resourceGro /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this IServersOperations operations, string resourceGroupName, string serverName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task DeleteAsync(this IServersOperations operations, string resourceGroupName, string serverName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serverName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serverName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// /// Updates a server. @@ -416,9 +419,9 @@ public static Server BeginCreateOrUpdate(this IServersOperations operations, str /// /// The name of the server. /// - public static void BeginDelete(this IServersOperations operations, string resourceGroupName, string serverName) + public static ServersDeleteHeaders BeginDelete(this IServersOperations operations, string resourceGroupName, string serverName) { - ((IServersOperations)operations).BeginDeleteAsync(resourceGroupName, serverName).GetAwaiter().GetResult(); + return ((IServersOperations)operations).BeginDeleteAsync(resourceGroupName, serverName).GetAwaiter().GetResult(); } /// @@ -437,9 +440,12 @@ public static void BeginDelete(this IServersOperations operations, string resour /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginDeleteAsync(this IServersOperations operations, string resourceGroupName, string serverName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IServersOperations operations, string resourceGroupName, string serverName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, serverName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, serverName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// /// Updates a server. diff --git a/src/Sql/Sql.Management.Sdk/Generated/SqlManagementClient.cs b/src/Sql/Sql.Management.Sdk/Generated/SqlManagementClient.cs index a5bfb78d8cb9..c3b3fe70e6a7 100644 --- a/src/Sql/Sql.Management.Sdk/Generated/SqlManagementClient.cs +++ b/src/Sql/Sql.Management.Sdk/Generated/SqlManagementClient.cs @@ -633,6 +633,9 @@ public SqlManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCrede /// /// Optional. The http client handler used to handle http transport. /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// /// /// Thrown when a required parameter is null /// diff --git a/src/Sql/Sql.Management.Sdk/README.md b/src/Sql/Sql.Management.Sdk/README.md index 482c282098a2..1b3169e4c8e9 100644 --- a/src/Sql/Sql.Management.Sdk/README.md +++ b/src/Sql/Sql.Management.Sdk/README.md @@ -108,7 +108,7 @@ input-file: - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/RecoverableDatabases.json - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/RestorableDroppedDatabases.json - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/InstanceFailoverGroups.json - - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/Servers.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/Servers.json - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/ServerConfigurationOptions.json - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/ManagedLedgerDigestUploads.json - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/ManagedDatabases.json