From 982c517b5a89b6858f6aa71b30705a752714f4c7 Mon Sep 17 00:00:00 2001
From: Bogdan Ostojic <49651629+ostojicb@users.noreply.github.com>
Date: Thu, 5 May 2022 11:26:36 +0200
Subject: [PATCH] [SQL] Generate SDK for Endpoint Certificates API (#27910)
* initial generate
* Add tests
* run generate.ps1 script
* Bump versions
* revert collateral damage
* run generate.ps1, take 2
* revive replication links
* run generate.ps1
* bump to 3.0.0
* Bump AssemblyVersion
---
.../mgmtmetadata/sql_resource-manager.txt | 10 +-
.../DatabaseBlobAuditingPoliciesOperations.cs | 122 +--
...lobAuditingPoliciesOperationsExtensions.cs | 48 +-
...DistributedAvailabilityGroupsOperations.cs | 10 +-
.../EndpointCertificatesOperations.cs | 626 +++++++++++++
...ndpointCertificatesOperationsExtensions.cs | 149 ++++
...dDatabaseBlobAuditingPoliciesOperations.cs | 122 +--
...lobAuditingPoliciesOperationsExtensions.cs | 48 +-
...dedServerBlobAuditingPoliciesOperations.cs | 88 +-
...lobAuditingPoliciesOperationsExtensions.cs | 48 +-
...IDatabaseBlobAuditingPoliciesOperations.cs | 18 +-
.../IEndpointCertificatesOperations.cs | 106 +++
...dDatabaseBlobAuditingPoliciesOperations.cs | 18 +-
...dedServerBlobAuditingPoliciesOperations.cs | 18 +-
.../Generated/IIPv6FirewallRulesOperations.cs | 36 +-
.../Generated/IPv6FirewallRulesOperations.cs | 180 ++--
.../IPv6FirewallRulesOperationsExtensions.cs | 78 +-
.../IServerBlobAuditingPoliciesOperations.cs | 18 +-
.../IServerTrustCertificatesOperations.cs | 52 +-
.../src/Generated/ISqlManagementClient.cs | 85 +-
.../src/Generated/Models/Database.cs | 13 +-
.../Models/DatabaseBlobAuditingPolicy.cs | 20 +-
.../src/Generated/Models/DatabaseIdentity.cs | 12 +-
.../src/Generated/Models/DatabaseUpdate.cs | 13 +-
.../src/Generated/Models/Delegation.cs | 63 --
.../Generated/Models/EndpointCertificate.cs | 58 ++
.../ExtendedDatabaseBlobAuditingPolicy.cs | 20 +-
.../ExtendedServerBlobAuditingPolicy.cs | 20 +-
.../Generated/Models/IPv6FirewallRuleList.cs | 51 --
.../Models/ServerBlobAuditingPolicy.cs | 20 +-
.../Generated/SdkInfo_SqlManagementClient.cs | 22 +-
.../ServerBlobAuditingPoliciesOperations.cs | 88 +-
...lobAuditingPoliciesOperationsExtensions.cs | 48 +-
.../ServerTrustCertificatesOperations.cs | 168 ++--
...erTrustCertificatesOperationsExtensions.cs | 100 +--
.../src/Generated/SqlManagementClient.cs | 102 ++-
.../src/Microsoft.Azure.Management.Sql.csproj | 6 +-
.../src/Properties/AssemblyInfo.cs | 4 +-
.../tests/ManagedInstanceHybridLinkTests.cs | 64 +-
.../TestDistributedAvailabilityGroup.json | 410 ++++-----
.../TestEndpointCertificates.json | 639 ++++++++++++++
.../TestServerTrustCertificates.json | 825 +++++++++++-------
42 files changed, 3194 insertions(+), 1452 deletions(-)
create mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/EndpointCertificatesOperations.cs
create mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/EndpointCertificatesOperationsExtensions.cs
create mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IEndpointCertificatesOperations.cs
delete mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/Delegation.cs
create mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/EndpointCertificate.cs
delete mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/Models/IPv6FirewallRuleList.cs
create mode 100644 sdk/sqlmanagement/Microsoft.Azure.Management.Sql/tests/SessionRecords/ManagedInstanceHybridLinkTests/TestEndpointCertificates.json
diff --git a/eng/mgmt/mgmtmetadata/sql_resource-manager.txt b/eng/mgmt/mgmtmetadata/sql_resource-manager.txt
index 8b5245a9515e2..fae5e723c9ab7 100644
--- a/eng/mgmt/mgmtmetadata/sql_resource-manager.txt
+++ b/eng/mgmt/mgmtmetadata/sql_resource-manager.txt
@@ -1,15 +1,15 @@
-Installing AutoRest version: v2
+Installing AutoRest version: v2
AutoRest installed successfully.
Commencing code generation
Generating CSharp code
Executing AutoRest command
-cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/main/specification/sql/resource-manager/readme.md --csharp --version=2.0.4421 --reflect-api-versions --csharp-sdks-folder=D:\OpenSourceProjects\azure-sdk-for-net\sdk
+cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/main/specification/sql/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=D:\vs\gh_repos\azure-sdk-for-net\sdk
Autorest CSharp Version: 2.3.82
-2022-03-10 19:08:59 UTC
+2022-04-30 15:52:36 UTC
Azure-rest-api-specs repository information
GitHub fork: Azure
Branch: main
-Commit: 2b92c256213dfd230dabe819bb901c197188773a
+Commit: ea9af04161c73743cdb40c1439a3046f16f35f71
AutoRest information
-Requested version: 2.0.4421
+Requested version: v2
Bootstrapper version: autorest@3.5.1
diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/DatabaseBlobAuditingPoliciesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/DatabaseBlobAuditingPoliciesOperations.cs
index 3b6ca4f05a6c4..caf02b5e9a955 100644
--- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/DatabaseBlobAuditingPoliciesOperations.cs
+++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/DatabaseBlobAuditingPoliciesOperations.cs
@@ -51,7 +51,7 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client)
public SqlManagementClient Client { get; private set; }
///
- /// Gets a database's blob auditing policy.
+ /// Lists auditing settings of a database.
///
///
/// The name of the resource group that contains the resource. You can obtain
@@ -84,7 +84,7 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceGroupName == null)
{
@@ -102,8 +102,7 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string blobAuditingPolicyName = "default";
- string apiVersion = "2020-11-01-preview";
+ string apiVersion = "2021-11-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -114,18 +113,16 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client)
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serverName", serverName);
tracingParameters.Add("databaseName", databaseName);
- tracingParameters.Add("blobAuditingPolicyName", blobAuditingPolicyName);
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "ListByDatabase", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings/{blobAuditingPolicyName}").ToString();
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings").ToString();
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName));
_url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName));
- _url = _url.Replace("{blobAuditingPolicyName}", System.Uri.EscapeDataString(blobAuditingPolicyName));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
if (apiVersion != null)
@@ -225,7 +222,7 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -238,7 +235,7 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -258,7 +255,7 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client)
}
///
- /// Creates or updates a database's blob auditing policy.
+ /// Gets a database's blob auditing policy.
///
///
/// The name of the resource group that contains the resource. You can obtain
@@ -270,9 +267,6 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client)
///
/// The name of the database.
///
- ///
- /// The database blob auditing policy.
- ///
///
/// Headers that will be added to request.
///
@@ -294,7 +288,7 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, DatabaseBlobAuditingPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceGroupName == null)
{
@@ -308,20 +302,12 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "databaseName");
}
- if (parameters == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
- }
- if (parameters != null)
- {
- parameters.Validate();
- }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
string blobAuditingPolicyName = "default";
- string apiVersion = "2020-11-01-preview";
+ string apiVersion = "2021-11-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -333,10 +319,9 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client)
tracingParameters.Add("serverName", serverName);
tracingParameters.Add("databaseName", databaseName);
tracingParameters.Add("blobAuditingPolicyName", blobAuditingPolicyName);
- tracingParameters.Add("parameters", parameters);
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
@@ -358,7 +343,7 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client)
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("PUT");
+ _httpRequest.Method = new HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
@@ -389,12 +374,6 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client)
// Serialize Request
string _requestContent = null;
- if(parameters != null)
- {
- _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings);
- _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
- _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
- }
// Set Credentials
if (Client.Credentials != null)
{
@@ -415,7 +394,7 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 200 && (int)_statusCode != 201)
+ if ((int)_statusCode != 200)
{
var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -475,24 +454,6 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client)
throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
- // Deserialize Response
- if ((int)_statusCode == 201)
- {
- _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- try
- {
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
- }
- catch (JsonException ex)
- {
- _httpRequest.Dispose();
- if (_httpResponse != null)
- {
- _httpResponse.Dispose();
- }
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
- }
- }
if (_shouldTrace)
{
ServiceClientTracing.Exit(_invocationId, _result);
@@ -501,7 +462,7 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client)
}
///
- /// Lists auditing settings of a database.
+ /// Creates or updates a database's blob auditing policy.
///
///
/// The name of the resource group that contains the resource. You can obtain
@@ -513,6 +474,9 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client)
///
/// The name of the database.
///
+ ///
+ /// The database blob auditing policy.
+ ///
///
/// Headers that will be added to request.
///
@@ -534,7 +498,7 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, DatabaseBlobAuditingPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceGroupName == null)
{
@@ -548,11 +512,20 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "databaseName");
}
+ if (parameters == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
+ }
+ if (parameters != null)
+ {
+ parameters.Validate();
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2020-11-01-preview";
+ string blobAuditingPolicyName = "default";
+ string apiVersion = "2021-11-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -563,16 +536,19 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client)
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serverName", serverName);
tracingParameters.Add("databaseName", databaseName);
+ tracingParameters.Add("blobAuditingPolicyName", blobAuditingPolicyName);
+ tracingParameters.Add("parameters", parameters);
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListByDatabase", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings").ToString();
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings/{blobAuditingPolicyName}").ToString();
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName));
_url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName));
+ _url = _url.Replace("{blobAuditingPolicyName}", System.Uri.EscapeDataString(blobAuditingPolicyName));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
if (apiVersion != null)
@@ -586,7 +562,7 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client)
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.Method = new HttpMethod("PUT");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
@@ -617,6 +593,12 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client)
// Serialize Request
string _requestContent = null;
+ if(parameters != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
// Set Credentials
if (Client.Credentials != null)
{
@@ -637,7 +619,7 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 200)
+ if ((int)_statusCode != 200 && (int)_statusCode != 201)
{
var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -672,7 +654,7 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse>();
+ var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -685,7 +667,25 @@ internal DatabaseBlobAuditingPoliciesOperations(SqlManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 201)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/DatabaseBlobAuditingPoliciesOperationsExtensions.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/DatabaseBlobAuditingPoliciesOperationsExtensions.cs
index 1ee6a5241f17d..3ae1fc2f3381a 100644
--- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/DatabaseBlobAuditingPoliciesOperationsExtensions.cs
+++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/DatabaseBlobAuditingPoliciesOperationsExtensions.cs
@@ -22,7 +22,7 @@ namespace Microsoft.Azure.Management.Sql
public static partial class DatabaseBlobAuditingPoliciesOperationsExtensions
{
///
- /// Gets a database's blob auditing policy.
+ /// Lists auditing settings of a database.
///
///
/// The operations group for this extension method.
@@ -37,13 +37,13 @@ public static partial class DatabaseBlobAuditingPoliciesOperationsExtensions
///
/// The name of the database.
///
- public static DatabaseBlobAuditingPolicy Get(this IDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName)
+ public static IPage ListByDatabase(this IDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName)
{
- return operations.GetAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult();
+ return operations.ListByDatabaseAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult();
}
///
- /// Gets a database's blob auditing policy.
+ /// Lists auditing settings of a database.
///
///
/// The operations group for this extension method.
@@ -61,16 +61,16 @@ public static DatabaseBlobAuditingPolicy Get(this IDatabaseBlobAuditingPoliciesO
///
/// The cancellation token.
///
- public static async Task GetAsync(this IDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> ListByDatabaseAsync(this IDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.ListByDatabaseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
///
- /// Creates or updates a database's blob auditing policy.
+ /// Gets a database's blob auditing policy.
///
///
/// The operations group for this extension method.
@@ -85,16 +85,13 @@ public static DatabaseBlobAuditingPolicy Get(this IDatabaseBlobAuditingPoliciesO
///
/// The name of the database.
///
- ///
- /// The database blob auditing policy.
- ///
- public static DatabaseBlobAuditingPolicy CreateOrUpdate(this IDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName, DatabaseBlobAuditingPolicy parameters)
+ public static DatabaseBlobAuditingPolicy Get(this IDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName)
{
- return operations.CreateOrUpdateAsync(resourceGroupName, serverName, databaseName, parameters).GetAwaiter().GetResult();
+ return operations.GetAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult();
}
///
- /// Creates or updates a database's blob auditing policy.
+ /// Gets a database's blob auditing policy.
///
///
/// The operations group for this extension method.
@@ -109,22 +106,19 @@ public static DatabaseBlobAuditingPolicy CreateOrUpdate(this IDatabaseBlobAuditi
///
/// The name of the database.
///
- ///
- /// The database blob auditing policy.
- ///
///
/// The cancellation token.
///
- public static async Task CreateOrUpdateAsync(this IDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName, DatabaseBlobAuditingPolicy parameters, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task GetAsync(this IDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
///
- /// Lists auditing settings of a database.
+ /// Creates or updates a database's blob auditing policy.
///
///
/// The operations group for this extension method.
@@ -139,13 +133,16 @@ public static DatabaseBlobAuditingPolicy CreateOrUpdate(this IDatabaseBlobAuditi
///
/// The name of the database.
///
- public static IPage ListByDatabase(this IDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName)
+ ///
+ /// The database blob auditing policy.
+ ///
+ public static DatabaseBlobAuditingPolicy CreateOrUpdate(this IDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName, DatabaseBlobAuditingPolicy parameters)
{
- return operations.ListByDatabaseAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult();
+ return operations.CreateOrUpdateAsync(resourceGroupName, serverName, databaseName, parameters).GetAwaiter().GetResult();
}
///
- /// Lists auditing settings of a database.
+ /// Creates or updates a database's blob auditing policy.
///
///
/// The operations group for this extension method.
@@ -160,12 +157,15 @@ public static IPage ListByDatabase(this IDatabaseBlo
///
/// The name of the database.
///
+ ///
+ /// The database blob auditing policy.
+ ///
///
/// The cancellation token.
///
- public static async Task> ListByDatabaseAsync(this IDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task CreateOrUpdateAsync(this IDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName, DatabaseBlobAuditingPolicy parameters, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.ListByDatabaseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/DistributedAvailabilityGroupsOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/DistributedAvailabilityGroupsOperations.cs
index 9b1a283e74ef2..8772ac4969987 100644
--- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/DistributedAvailabilityGroupsOperations.cs
+++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/DistributedAvailabilityGroupsOperations.cs
@@ -95,7 +95,7 @@ internal DistributedAvailabilityGroupsOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2021-05-01-preview";
+ string apiVersion = "2021-11-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -297,7 +297,7 @@ internal DistributedAvailabilityGroupsOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2021-05-01-preview";
+ string apiVersion = "2021-11-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -595,7 +595,7 @@ internal DistributedAvailabilityGroupsOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2021-05-01-preview";
+ string apiVersion = "2021-11-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -822,7 +822,7 @@ internal DistributedAvailabilityGroupsOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2021-05-01-preview";
+ string apiVersion = "2021-11-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1015,7 +1015,7 @@ internal DistributedAvailabilityGroupsOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2021-05-01-preview";
+ string apiVersion = "2021-11-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/EndpointCertificatesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/EndpointCertificatesOperations.cs
new file mode 100644
index 0000000000000..cd4ba3e5558f9
--- /dev/null
+++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/EndpointCertificatesOperations.cs
@@ -0,0 +1,626 @@
+//
+// 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
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Net;
+ using System.Net.Http;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// EndpointCertificatesOperations operations.
+ ///
+ internal partial class EndpointCertificatesOperations : IServiceOperations, IEndpointCertificatesOperations
+ {
+ ///
+ /// Initializes a new instance of the EndpointCertificatesOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal EndpointCertificatesOperations(SqlManagementClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the SqlManagementClient
+ ///
+ public SqlManagementClient Client { get; private set; }
+
+ ///
+ /// List certificates used on endpoints on the target instance.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The name of the managed instance.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListByInstanceWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (managedInstanceName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "managedInstanceName");
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ string apiVersion = "2021-11-01-preview";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("managedInstanceName", managedInstanceName);
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListByInstance", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/endpointCertificates").ToString();
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Gets a certificate used on the endpoint with the given id.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The name of the managed instance.
+ ///
+ ///
+ /// Type of the endpoint whose certificate the customer is looking for.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string endpointType, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (managedInstanceName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "managedInstanceName");
+ }
+ if (endpointType == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "endpointType");
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ string apiVersion = "2021-11-01-preview";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("managedInstanceName", managedInstanceName);
+ tracingParameters.Add("endpointType", endpointType);
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/endpointCertificates/{endpointType}").ToString();
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{managedInstanceName}", System.Uri.EscapeDataString(managedInstanceName));
+ _url = _url.Replace("{endpointType}", System.Uri.EscapeDataString(endpointType));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// List certificates used on endpoints on the target instance.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListByInstanceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (nextPageLink == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("nextPageLink", nextPageLink);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListByInstanceNext", tracingParameters);
+ }
+ // Construct URL
+ string _url = "{nextLink}";
+ _url = _url.Replace("{nextLink}", nextPageLink);
+ List _queryParameters = new List();
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ }
+}
diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/EndpointCertificatesOperationsExtensions.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/EndpointCertificatesOperationsExtensions.cs
new file mode 100644
index 0000000000000..09699a3ed9690
--- /dev/null
+++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/EndpointCertificatesOperationsExtensions.cs
@@ -0,0 +1,149 @@
+//
+// 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
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// Extension methods for EndpointCertificatesOperations.
+ ///
+ public static partial class EndpointCertificatesOperationsExtensions
+ {
+ ///
+ /// List certificates used on endpoints on the target instance.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The name of the managed instance.
+ ///
+ public static IPage ListByInstance(this IEndpointCertificatesOperations operations, string resourceGroupName, string managedInstanceName)
+ {
+ return operations.ListByInstanceAsync(resourceGroupName, managedInstanceName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// List certificates used on endpoints on the target instance.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The name of the managed instance.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListByInstanceAsync(this IEndpointCertificatesOperations operations, string resourceGroupName, string managedInstanceName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListByInstanceWithHttpMessagesAsync(resourceGroupName, managedInstanceName, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Gets a certificate used on the endpoint with the given id.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The name of the managed instance.
+ ///
+ ///
+ /// Type of the endpoint whose certificate the customer is looking for.
+ ///
+ public static EndpointCertificate Get(this IEndpointCertificatesOperations operations, string resourceGroupName, string managedInstanceName, string endpointType)
+ {
+ return operations.GetAsync(resourceGroupName, managedInstanceName, endpointType).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Gets a certificate used on the endpoint with the given id.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The name of the managed instance.
+ ///
+ ///
+ /// Type of the endpoint whose certificate the customer is looking for.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task GetAsync(this IEndpointCertificatesOperations operations, string resourceGroupName, string managedInstanceName, string endpointType, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, managedInstanceName, endpointType, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// List certificates used on endpoints on the target instance.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ public static IPage ListByInstanceNext(this IEndpointCertificatesOperations operations, string nextPageLink)
+ {
+ return operations.ListByInstanceNextAsync(nextPageLink).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// List certificates used on endpoints on the target instance.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListByInstanceNextAsync(this IEndpointCertificatesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListByInstanceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ }
+}
diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ExtendedDatabaseBlobAuditingPoliciesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ExtendedDatabaseBlobAuditingPoliciesOperations.cs
index fa780931433ac..84a14ccedb33c 100644
--- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ExtendedDatabaseBlobAuditingPoliciesOperations.cs
+++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ExtendedDatabaseBlobAuditingPoliciesOperations.cs
@@ -51,7 +51,7 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie
public SqlManagementClient Client { get; private set; }
///
- /// Gets an extended database's blob auditing policy.
+ /// Lists extended auditing settings of a database.
///
///
/// The name of the resource group that contains the resource. You can obtain
@@ -84,7 +84,7 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie
///
/// A response object containing the response body and response headers.
///
- public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceGroupName == null)
{
@@ -102,8 +102,7 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string blobAuditingPolicyName = "default";
- string apiVersion = "2020-11-01-preview";
+ string apiVersion = "2021-11-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -114,18 +113,16 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serverName", serverName);
tracingParameters.Add("databaseName", databaseName);
- tracingParameters.Add("blobAuditingPolicyName", blobAuditingPolicyName);
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "ListByDatabase", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings/{blobAuditingPolicyName}").ToString();
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings").ToString();
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName));
_url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName));
- _url = _url.Replace("{blobAuditingPolicyName}", System.Uri.EscapeDataString(blobAuditingPolicyName));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
if (apiVersion != null)
@@ -225,7 +222,7 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -238,7 +235,7 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -258,7 +255,7 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie
}
///
- /// Creates or updates an extended database's blob auditing policy.
+ /// Gets an extended database's blob auditing policy.
///
///
/// The name of the resource group that contains the resource. You can obtain
@@ -270,9 +267,6 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie
///
/// The name of the database.
///
- ///
- /// The extended database blob auditing policy.
- ///
///
/// Headers that will be added to request.
///
@@ -294,7 +288,7 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie
///
/// A response object containing the response body and response headers.
///
- public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ExtendedDatabaseBlobAuditingPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceGroupName == null)
{
@@ -308,20 +302,12 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie
{
throw new ValidationException(ValidationRules.CannotBeNull, "databaseName");
}
- if (parameters == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
- }
- if (parameters != null)
- {
- parameters.Validate();
- }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
string blobAuditingPolicyName = "default";
- string apiVersion = "2020-11-01-preview";
+ string apiVersion = "2021-11-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -333,10 +319,9 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie
tracingParameters.Add("serverName", serverName);
tracingParameters.Add("databaseName", databaseName);
tracingParameters.Add("blobAuditingPolicyName", blobAuditingPolicyName);
- tracingParameters.Add("parameters", parameters);
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
@@ -358,7 +343,7 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("PUT");
+ _httpRequest.Method = new HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
@@ -389,12 +374,6 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie
// Serialize Request
string _requestContent = null;
- if(parameters != null)
- {
- _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings);
- _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
- _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
- }
// Set Credentials
if (Client.Credentials != null)
{
@@ -415,7 +394,7 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 200 && (int)_statusCode != 201)
+ if ((int)_statusCode != 200)
{
var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -475,24 +454,6 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie
throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
- // Deserialize Response
- if ((int)_statusCode == 201)
- {
- _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- try
- {
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
- }
- catch (JsonException ex)
- {
- _httpRequest.Dispose();
- if (_httpResponse != null)
- {
- _httpResponse.Dispose();
- }
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
- }
- }
if (_shouldTrace)
{
ServiceClientTracing.Exit(_invocationId, _result);
@@ -501,7 +462,7 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie
}
///
- /// Lists extended auditing settings of a database.
+ /// Creates or updates an extended database's blob auditing policy.
///
///
/// The name of the resource group that contains the resource. You can obtain
@@ -513,6 +474,9 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie
///
/// The name of the database.
///
+ ///
+ /// The extended database blob auditing policy.
+ ///
///
/// Headers that will be added to request.
///
@@ -534,7 +498,7 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ExtendedDatabaseBlobAuditingPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceGroupName == null)
{
@@ -548,11 +512,20 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie
{
throw new ValidationException(ValidationRules.CannotBeNull, "databaseName");
}
+ if (parameters == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
+ }
+ if (parameters != null)
+ {
+ parameters.Validate();
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2020-11-01-preview";
+ string blobAuditingPolicyName = "default";
+ string apiVersion = "2021-11-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -563,16 +536,19 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serverName", serverName);
tracingParameters.Add("databaseName", databaseName);
+ tracingParameters.Add("blobAuditingPolicyName", blobAuditingPolicyName);
+ tracingParameters.Add("parameters", parameters);
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListByDatabase", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings").ToString();
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings/{blobAuditingPolicyName}").ToString();
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName));
_url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName));
+ _url = _url.Replace("{blobAuditingPolicyName}", System.Uri.EscapeDataString(blobAuditingPolicyName));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
if (apiVersion != null)
@@ -586,7 +562,7 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.Method = new HttpMethod("PUT");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
@@ -617,6 +593,12 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie
// Serialize Request
string _requestContent = null;
+ if(parameters != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
// Set Credentials
if (Client.Credentials != null)
{
@@ -637,7 +619,7 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 200)
+ if ((int)_statusCode != 200 && (int)_statusCode != 201)
{
var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -672,7 +654,7 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse>();
+ var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -685,7 +667,25 @@ internal ExtendedDatabaseBlobAuditingPoliciesOperations(SqlManagementClient clie
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 201)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ExtendedDatabaseBlobAuditingPoliciesOperationsExtensions.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ExtendedDatabaseBlobAuditingPoliciesOperationsExtensions.cs
index 58645764ac82a..791bb305bb0d9 100644
--- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ExtendedDatabaseBlobAuditingPoliciesOperationsExtensions.cs
+++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ExtendedDatabaseBlobAuditingPoliciesOperationsExtensions.cs
@@ -22,7 +22,7 @@ namespace Microsoft.Azure.Management.Sql
public static partial class ExtendedDatabaseBlobAuditingPoliciesOperationsExtensions
{
///
- /// Gets an extended database's blob auditing policy.
+ /// Lists extended auditing settings of a database.
///
///
/// The operations group for this extension method.
@@ -37,13 +37,13 @@ public static partial class ExtendedDatabaseBlobAuditingPoliciesOperationsExtens
///
/// The name of the database.
///
- public static ExtendedDatabaseBlobAuditingPolicy Get(this IExtendedDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName)
+ public static IPage ListByDatabase(this IExtendedDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName)
{
- return operations.GetAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult();
+ return operations.ListByDatabaseAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult();
}
///
- /// Gets an extended database's blob auditing policy.
+ /// Lists extended auditing settings of a database.
///
///
/// The operations group for this extension method.
@@ -61,16 +61,16 @@ public static ExtendedDatabaseBlobAuditingPolicy Get(this IExtendedDatabaseBlobA
///
/// The cancellation token.
///
- public static async Task GetAsync(this IExtendedDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> ListByDatabaseAsync(this IExtendedDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.ListByDatabaseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
///
- /// Creates or updates an extended database's blob auditing policy.
+ /// Gets an extended database's blob auditing policy.
///
///
/// The operations group for this extension method.
@@ -85,16 +85,13 @@ public static ExtendedDatabaseBlobAuditingPolicy Get(this IExtendedDatabaseBlobA
///
/// The name of the database.
///
- ///
- /// The extended database blob auditing policy.
- ///
- public static ExtendedDatabaseBlobAuditingPolicy CreateOrUpdate(this IExtendedDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName, ExtendedDatabaseBlobAuditingPolicy parameters)
+ public static ExtendedDatabaseBlobAuditingPolicy Get(this IExtendedDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName)
{
- return operations.CreateOrUpdateAsync(resourceGroupName, serverName, databaseName, parameters).GetAwaiter().GetResult();
+ return operations.GetAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult();
}
///
- /// Creates or updates an extended database's blob auditing policy.
+ /// Gets an extended database's blob auditing policy.
///
///
/// The operations group for this extension method.
@@ -109,22 +106,19 @@ public static ExtendedDatabaseBlobAuditingPolicy CreateOrUpdate(this IExtendedDa
///
/// The name of the database.
///
- ///
- /// The extended database blob auditing policy.
- ///
///
/// The cancellation token.
///
- public static async Task CreateOrUpdateAsync(this IExtendedDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName, ExtendedDatabaseBlobAuditingPolicy parameters, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task GetAsync(this IExtendedDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
///
- /// Lists extended auditing settings of a database.
+ /// Creates or updates an extended database's blob auditing policy.
///
///
/// The operations group for this extension method.
@@ -139,13 +133,16 @@ public static ExtendedDatabaseBlobAuditingPolicy CreateOrUpdate(this IExtendedDa
///
/// The name of the database.
///
- public static IPage ListByDatabase(this IExtendedDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName)
+ ///
+ /// The extended database blob auditing policy.
+ ///
+ public static ExtendedDatabaseBlobAuditingPolicy CreateOrUpdate(this IExtendedDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName, ExtendedDatabaseBlobAuditingPolicy parameters)
{
- return operations.ListByDatabaseAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult();
+ return operations.CreateOrUpdateAsync(resourceGroupName, serverName, databaseName, parameters).GetAwaiter().GetResult();
}
///
- /// Lists extended auditing settings of a database.
+ /// Creates or updates an extended database's blob auditing policy.
///
///
/// The operations group for this extension method.
@@ -160,12 +157,15 @@ public static IPage ListByDatabase(this IExt
///
/// The name of the database.
///
+ ///
+ /// The extended database blob auditing policy.
+ ///
///
/// The cancellation token.
///
- public static async Task> ListByDatabaseAsync(this IExtendedDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task CreateOrUpdateAsync(this IExtendedDatabaseBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, string databaseName, ExtendedDatabaseBlobAuditingPolicy parameters, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.ListByDatabaseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ExtendedServerBlobAuditingPoliciesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ExtendedServerBlobAuditingPoliciesOperations.cs
index 3b32da5af6afc..8f21dfee8e80b 100644
--- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ExtendedServerBlobAuditingPoliciesOperations.cs
+++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ExtendedServerBlobAuditingPoliciesOperations.cs
@@ -51,7 +51,7 @@ internal ExtendedServerBlobAuditingPoliciesOperations(SqlManagementClient client
public SqlManagementClient Client { get; private set; }
///
- /// Gets an extended server's blob auditing policy.
+ /// Lists extended auditing settings of a server.
///
///
/// The name of the resource group that contains the resource. You can obtain
@@ -81,7 +81,7 @@ internal ExtendedServerBlobAuditingPoliciesOperations(SqlManagementClient client
///
/// A response object containing the response body and response headers.
///
- public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceGroupName == null)
{
@@ -95,8 +95,7 @@ internal ExtendedServerBlobAuditingPoliciesOperations(SqlManagementClient client
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string blobAuditingPolicyName = "default";
- string apiVersion = "2020-11-01-preview";
+ string apiVersion = "2021-11-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -106,17 +105,15 @@ internal ExtendedServerBlobAuditingPoliciesOperations(SqlManagementClient client
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serverName", serverName);
- tracingParameters.Add("blobAuditingPolicyName", blobAuditingPolicyName);
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "ListByServer", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings/{blobAuditingPolicyName}").ToString();
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings").ToString();
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName));
- _url = _url.Replace("{blobAuditingPolicyName}", System.Uri.EscapeDataString(blobAuditingPolicyName));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
if (apiVersion != null)
@@ -216,7 +213,7 @@ internal ExtendedServerBlobAuditingPoliciesOperations(SqlManagementClient client
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -229,7 +226,7 @@ internal ExtendedServerBlobAuditingPoliciesOperations(SqlManagementClient client
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -249,33 +246,7 @@ internal ExtendedServerBlobAuditingPoliciesOperations(SqlManagementClient client
}
///
- /// Creates or updates an extended server's blob auditing policy.
- ///
- ///
- /// The name of the resource group that contains the resource. You can obtain
- /// this value from the Azure Resource Manager API or the portal.
- ///
- ///
- /// The name of the server.
- ///
- ///
- /// Properties of extended blob auditing policy
- ///
- ///
- /// The headers that will be added to request.
- ///
- ///
- /// The cancellation token.
- ///
- public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, ExtendedServerBlobAuditingPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
- {
- // Send Request
- AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, parameters, customHeaders, cancellationToken).ConfigureAwait(false);
- return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
- }
-
- ///
- /// Lists extended auditing settings of a server.
+ /// Gets an extended server's blob auditing policy.
///
///
/// The name of the resource group that contains the resource. You can obtain
@@ -305,7 +276,7 @@ internal ExtendedServerBlobAuditingPoliciesOperations(SqlManagementClient client
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceGroupName == null)
{
@@ -319,7 +290,8 @@ internal ExtendedServerBlobAuditingPoliciesOperations(SqlManagementClient client
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2020-11-01-preview";
+ string blobAuditingPolicyName = "default";
+ string apiVersion = "2021-11-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -329,15 +301,17 @@ internal ExtendedServerBlobAuditingPoliciesOperations(SqlManagementClient client
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serverName", serverName);
+ tracingParameters.Add("blobAuditingPolicyName", blobAuditingPolicyName);
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListByServer", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings").ToString();
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings/{blobAuditingPolicyName}").ToString();
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName));
+ _url = _url.Replace("{blobAuditingPolicyName}", System.Uri.EscapeDataString(blobAuditingPolicyName));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
if (apiVersion != null)
@@ -437,7 +411,7 @@ internal ExtendedServerBlobAuditingPoliciesOperations(SqlManagementClient client
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse>();
+ var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -450,7 +424,7 @@ internal ExtendedServerBlobAuditingPoliciesOperations(SqlManagementClient client
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -469,6 +443,32 @@ internal ExtendedServerBlobAuditingPoliciesOperations(SqlManagementClient client
return _result;
}
+ ///
+ /// Creates or updates an extended server's blob auditing policy.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can obtain
+ /// this value from the Azure Resource Manager API or the portal.
+ ///
+ ///
+ /// The name of the server.
+ ///
+ ///
+ /// Properties of extended blob auditing policy
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, ExtendedServerBlobAuditingPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ // Send Request
+ AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, parameters, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ }
+
///
/// Creates or updates an extended server's blob auditing policy.
///
@@ -526,7 +526,7 @@ internal ExtendedServerBlobAuditingPoliciesOperations(SqlManagementClient client
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
string blobAuditingPolicyName = "default";
- string apiVersion = "2020-11-01-preview";
+ string apiVersion = "2021-11-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ExtendedServerBlobAuditingPoliciesOperationsExtensions.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ExtendedServerBlobAuditingPoliciesOperationsExtensions.cs
index 3d6509c3d1a18..58300f319ff3b 100644
--- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ExtendedServerBlobAuditingPoliciesOperationsExtensions.cs
+++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/ExtendedServerBlobAuditingPoliciesOperationsExtensions.cs
@@ -22,7 +22,7 @@ namespace Microsoft.Azure.Management.Sql
public static partial class ExtendedServerBlobAuditingPoliciesOperationsExtensions
{
///
- /// Gets an extended server's blob auditing policy.
+ /// Lists extended auditing settings of a server.
///
///
/// The operations group for this extension method.
@@ -34,13 +34,13 @@ public static partial class ExtendedServerBlobAuditingPoliciesOperationsExtensio
///
/// The name of the server.
///
- public static ExtendedServerBlobAuditingPolicy Get(this IExtendedServerBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName)
+ public static IPage ListByServer(this IExtendedServerBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName)
{
- return operations.GetAsync(resourceGroupName, serverName).GetAwaiter().GetResult();
+ return operations.ListByServerAsync(resourceGroupName, serverName).GetAwaiter().GetResult();
}
///
- /// Gets an extended server's blob auditing policy.
+ /// Lists extended auditing settings of a server.
///
///
/// The operations group for this extension method.
@@ -55,16 +55,16 @@ public static ExtendedServerBlobAuditingPolicy Get(this IExtendedServerBlobAudit
///
/// The cancellation token.
///
- public static async Task GetAsync(this IExtendedServerBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> ListByServerAsync(this IExtendedServerBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.ListByServerWithHttpMessagesAsync(resourceGroupName, serverName, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
///
- /// Creates or updates an extended server's blob auditing policy.
+ /// Gets an extended server's blob auditing policy.
///
///
/// The operations group for this extension method.
@@ -76,16 +76,13 @@ public static ExtendedServerBlobAuditingPolicy Get(this IExtendedServerBlobAudit
///
/// The name of the server.
///
- ///
- /// Properties of extended blob auditing policy
- ///
- public static ExtendedServerBlobAuditingPolicy CreateOrUpdate(this IExtendedServerBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, ExtendedServerBlobAuditingPolicy parameters)
+ public static ExtendedServerBlobAuditingPolicy Get(this IExtendedServerBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName)
{
- return operations.CreateOrUpdateAsync(resourceGroupName, serverName, parameters).GetAwaiter().GetResult();
+ return operations.GetAsync(resourceGroupName, serverName).GetAwaiter().GetResult();
}
///
- /// Creates or updates an extended server's blob auditing policy.
+ /// Gets an extended server's blob auditing policy.
///
///
/// The operations group for this extension method.
@@ -97,22 +94,19 @@ public static ExtendedServerBlobAuditingPolicy CreateOrUpdate(this IExtendedServ
///
/// The name of the server.
///
- ///
- /// Properties of extended blob auditing policy
- ///
///
/// The cancellation token.
///
- public static async Task CreateOrUpdateAsync(this IExtendedServerBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, ExtendedServerBlobAuditingPolicy parameters, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task GetAsync(this IExtendedServerBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, parameters, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
///
- /// Lists extended auditing settings of a server.
+ /// Creates or updates an extended server's blob auditing policy.
///
///
/// The operations group for this extension method.
@@ -124,13 +118,16 @@ public static ExtendedServerBlobAuditingPolicy CreateOrUpdate(this IExtendedServ
///
/// The name of the server.
///
- public static IPage ListByServer(this IExtendedServerBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName)
+ ///
+ /// Properties of extended blob auditing policy
+ ///
+ public static ExtendedServerBlobAuditingPolicy CreateOrUpdate(this IExtendedServerBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, ExtendedServerBlobAuditingPolicy parameters)
{
- return operations.ListByServerAsync(resourceGroupName, serverName).GetAwaiter().GetResult();
+ return operations.CreateOrUpdateAsync(resourceGroupName, serverName, parameters).GetAwaiter().GetResult();
}
///
- /// Lists extended auditing settings of a server.
+ /// Creates or updates an extended server's blob auditing policy.
///
///
/// The operations group for this extension method.
@@ -142,12 +139,15 @@ public static IPage ListByServer(this IExtende
///
/// The name of the server.
///
+ ///
+ /// Properties of extended blob auditing policy
+ ///
///
/// The cancellation token.
///
- public static async Task> ListByServerAsync(this IExtendedServerBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task CreateOrUpdateAsync(this IExtendedServerBlobAuditingPoliciesOperations operations, string resourceGroupName, string serverName, ExtendedServerBlobAuditingPolicy parameters, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.ListByServerWithHttpMessagesAsync(resourceGroupName, serverName, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, parameters, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IDatabaseBlobAuditingPoliciesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IDatabaseBlobAuditingPoliciesOperations.cs
index 0c98786e3f936..c0c3775f112bb 100644
--- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IDatabaseBlobAuditingPoliciesOperations.cs
+++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IDatabaseBlobAuditingPoliciesOperations.cs
@@ -24,7 +24,7 @@ namespace Microsoft.Azure.Management.Sql
public partial interface IDatabaseBlobAuditingPoliciesOperations
{
///
- /// Gets a database's blob auditing policy.
+ /// Lists auditing settings of a database.
///
///
/// The name of the resource group that contains the resource. You can
@@ -52,9 +52,9 @@ public partial interface IDatabaseBlobAuditingPoliciesOperations
///
/// Thrown when a required parameter is null
///
- Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// Creates or updates a database's blob auditing policy.
+ /// Gets a database's blob auditing policy.
///
///
/// The name of the resource group that contains the resource. You can
@@ -67,9 +67,6 @@ public partial interface IDatabaseBlobAuditingPoliciesOperations
///
/// The name of the database.
///
- ///
- /// The database blob auditing policy.
- ///
///
/// The headers that will be added to request.
///
@@ -85,9 +82,9 @@ public partial interface IDatabaseBlobAuditingPoliciesOperations
///
/// Thrown when a required parameter is null
///
- Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, DatabaseBlobAuditingPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// Lists auditing settings of a database.
+ /// Creates or updates a database's blob auditing policy.
///
///
/// The name of the resource group that contains the resource. You can
@@ -100,6 +97,9 @@ public partial interface IDatabaseBlobAuditingPoliciesOperations
///
/// The name of the database.
///
+ ///
+ /// The database blob auditing policy.
+ ///
///
/// The headers that will be added to request.
///
@@ -115,7 +115,7 @@ public partial interface IDatabaseBlobAuditingPoliciesOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, DatabaseBlobAuditingPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Lists auditing settings of a database.
///
diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IEndpointCertificatesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IEndpointCertificatesOperations.cs
new file mode 100644
index 0000000000000..20e057aa266ad
--- /dev/null
+++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IEndpointCertificatesOperations.cs
@@ -0,0 +1,106 @@
+//
+// 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
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// EndpointCertificatesOperations operations.
+ ///
+ public partial interface IEndpointCertificatesOperations
+ {
+ ///
+ /// List certificates used on endpoints on the target instance.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can
+ /// obtain this value from the Azure Resource Manager API or the
+ /// portal.
+ ///
+ ///
+ /// The name of the managed instance.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListByInstanceWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Gets a certificate used on the endpoint with the given id.
+ ///
+ ///
+ /// The name of the resource group that contains the resource. You can
+ /// obtain this value from the Azure Resource Manager API or the
+ /// portal.
+ ///
+ ///
+ /// The name of the managed instance.
+ ///
+ ///
+ /// Type of the endpoint whose certificate the customer is looking for.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> GetWithHttpMessagesAsync(string resourceGroupName, string managedInstanceName, string endpointType, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// List certificates used on endpoints on the target instance.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListByInstanceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IExtendedDatabaseBlobAuditingPoliciesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IExtendedDatabaseBlobAuditingPoliciesOperations.cs
index a98f848751675..73782a6cc7421 100644
--- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IExtendedDatabaseBlobAuditingPoliciesOperations.cs
+++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IExtendedDatabaseBlobAuditingPoliciesOperations.cs
@@ -24,7 +24,7 @@ namespace Microsoft.Azure.Management.Sql
public partial interface IExtendedDatabaseBlobAuditingPoliciesOperations
{
///
- /// Gets an extended database's blob auditing policy.
+ /// Lists extended auditing settings of a database.
///
///
/// The name of the resource group that contains the resource. You can
@@ -52,9 +52,9 @@ public partial interface IExtendedDatabaseBlobAuditingPoliciesOperations
///
/// Thrown when a required parameter is null
///
- Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// Creates or updates an extended database's blob auditing policy.
+ /// Gets an extended database's blob auditing policy.
///
///
/// The name of the resource group that contains the resource. You can
@@ -67,9 +67,6 @@ public partial interface IExtendedDatabaseBlobAuditingPoliciesOperations
///
/// The name of the database.
///
- ///
- /// The extended database blob auditing policy.
- ///
///
/// The headers that will be added to request.
///
@@ -85,9 +82,9 @@ public partial interface IExtendedDatabaseBlobAuditingPoliciesOperations
///
/// Thrown when a required parameter is null
///
- Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ExtendedDatabaseBlobAuditingPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// Lists extended auditing settings of a database.
+ /// Creates or updates an extended database's blob auditing policy.
///
///
/// The name of the resource group that contains the resource. You can
@@ -100,6 +97,9 @@ public partial interface IExtendedDatabaseBlobAuditingPoliciesOperations
///
/// The name of the database.
///
+ ///
+ /// The extended database blob auditing policy.
+ ///
///
/// The headers that will be added to request.
///
@@ -115,7 +115,7 @@ public partial interface IExtendedDatabaseBlobAuditingPoliciesOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListByDatabaseWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string databaseName, ExtendedDatabaseBlobAuditingPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Lists extended auditing settings of a database.
///
diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IExtendedServerBlobAuditingPoliciesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IExtendedServerBlobAuditingPoliciesOperations.cs
index 5be793c266746..020e9acf3819f 100644
--- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IExtendedServerBlobAuditingPoliciesOperations.cs
+++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IExtendedServerBlobAuditingPoliciesOperations.cs
@@ -24,7 +24,7 @@ namespace Microsoft.Azure.Management.Sql
public partial interface IExtendedServerBlobAuditingPoliciesOperations
{
///
- /// Gets an extended server's blob auditing policy.
+ /// Lists extended auditing settings of a server.
///
///
/// The name of the resource group that contains the resource. You can
@@ -49,9 +49,9 @@ public partial interface IExtendedServerBlobAuditingPoliciesOperations
///
/// Thrown when a required parameter is null
///
- Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// Creates or updates an extended server's blob auditing policy.
+ /// Gets an extended server's blob auditing policy.
///
///
/// The name of the resource group that contains the resource. You can
@@ -61,9 +61,6 @@ public partial interface IExtendedServerBlobAuditingPoliciesOperations
///
/// The name of the server.
///
- ///
- /// Properties of extended blob auditing policy
- ///
///
/// The headers that will be added to request.
///
@@ -79,9 +76,9 @@ public partial interface IExtendedServerBlobAuditingPoliciesOperations
///
/// Thrown when a required parameter is null
///
- Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, ExtendedServerBlobAuditingPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// Lists extended auditing settings of a server.
+ /// Creates or updates an extended server's blob auditing policy.
///
///
/// The name of the resource group that contains the resource. You can
@@ -91,6 +88,9 @@ public partial interface IExtendedServerBlobAuditingPoliciesOperations
///
/// The name of the server.
///
+ ///
+ /// Properties of extended blob auditing policy
+ ///
///
/// The headers that will be added to request.
///
@@ -106,7 +106,7 @@ public partial interface IExtendedServerBlobAuditingPoliciesOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, ExtendedServerBlobAuditingPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Creates or updates an extended server's blob auditing policy.
///
diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IIPv6FirewallRulesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IIPv6FirewallRulesOperations.cs
index b083f7fbd36b2..67df5526acafe 100644
--- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IIPv6FirewallRulesOperations.cs
+++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IIPv6FirewallRulesOperations.cs
@@ -24,7 +24,7 @@ namespace Microsoft.Azure.Management.Sql
public partial interface IIPv6FirewallRulesOperations
{
///
- /// Gets an IPv6 firewall rule.
+ /// Gets a list of IPv6 firewall rules.
///
///
/// The name of the resource group that contains the resource. You can
@@ -34,9 +34,6 @@ public partial interface IIPv6FirewallRulesOperations
///
/// The name of the server.
///
- ///
- /// The name of the firewall rule.
- ///
///
/// The headers that will be added to request.
///
@@ -52,9 +49,9 @@ public partial interface IIPv6FirewallRulesOperations
///
/// Thrown when a required parameter is null
///
- Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// Creates or updates an IPv6 firewall rule.
+ /// Gets an IPv6 firewall rule.
///
///
/// The name of the resource group that contains the resource. You can
@@ -67,10 +64,6 @@ public partial interface IIPv6FirewallRulesOperations
///
/// The name of the firewall rule.
///
- ///
- /// The required parameters for creating or updating an IPv6 firewall
- /// rule.
- ///
///
/// The headers that will be added to request.
///
@@ -86,9 +79,9 @@ public partial interface IIPv6FirewallRulesOperations
///
/// Thrown when a required parameter is null
///
- Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, IPv6FirewallRule parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// Deletes an IPv6 firewall rule.
+ /// Creates or updates an IPv6 firewall rule.
///
///
/// The name of the resource group that contains the resource. You can
@@ -101,6 +94,10 @@ public partial interface IIPv6FirewallRulesOperations
///
/// The name of the firewall rule.
///
+ ///
+ /// The required parameters for creating or updating an IPv6 firewall
+ /// rule.
+ ///
///
/// The headers that will be added to request.
///
@@ -110,12 +107,15 @@ public partial interface IIPv6FirewallRulesOperations
///
/// Thrown when the operation returned an invalid status code
///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
///
/// Thrown when a required parameter is null
///
- Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, IPv6FirewallRule parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// Gets a list of IPv6 firewall rules.
+ /// Deletes an IPv6 firewall rule.
///
///
/// The name of the resource group that contains the resource. You can
@@ -125,6 +125,9 @@ public partial interface IIPv6FirewallRulesOperations
///
/// The name of the server.
///
+ ///
+ /// The name of the firewall rule.
+ ///
///
/// The headers that will be added to request.
///
@@ -134,13 +137,10 @@ public partial interface IIPv6FirewallRulesOperations
///
/// Thrown when the operation returned an invalid status code
///
- ///
- /// Thrown when unable to deserialize the response
- ///
///
/// Thrown when a required parameter is null
///
- Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Gets a list of IPv6 firewall rules.
///
diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IPv6FirewallRulesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IPv6FirewallRulesOperations.cs
index a11276bd290da..796a2a063278d 100644
--- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IPv6FirewallRulesOperations.cs
+++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IPv6FirewallRulesOperations.cs
@@ -51,7 +51,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client)
public SqlManagementClient Client { get; private set; }
///
- /// Gets an IPv6 firewall rule.
+ /// Gets a list of IPv6 firewall rules.
///
///
/// The name of the resource group that contains the resource. You can obtain
@@ -60,9 +60,6 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client)
///
/// The name of the server.
///
- ///
- /// The name of the firewall rule.
- ///
///
/// Headers that will be added to request.
///
@@ -84,7 +81,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceGroupName == null)
{
@@ -94,15 +91,11 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "serverName");
}
- if (firewallRuleName == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "firewallRuleName");
- }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2021-08-01-preview";
+ string apiVersion = "2021-11-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -112,17 +105,15 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serverName", serverName);
- tracingParameters.Add("firewallRuleName", firewallRuleName);
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "ListByServer", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}").ToString();
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules").ToString();
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName));
- _url = _url.Replace("{firewallRuleName}", System.Uri.EscapeDataString(firewallRuleName));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
if (apiVersion != null)
@@ -222,7 +213,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -235,7 +226,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -255,7 +246,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client)
}
///
- /// Creates or updates an IPv6 firewall rule.
+ /// Gets an IPv6 firewall rule.
///
///
/// The name of the resource group that contains the resource. You can obtain
@@ -267,9 +258,6 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client)
///
/// The name of the firewall rule.
///
- ///
- /// The required parameters for creating or updating an IPv6 firewall rule.
- ///
///
/// Headers that will be added to request.
///
@@ -291,7 +279,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, IPv6FirewallRule parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceGroupName == null)
{
@@ -305,15 +293,11 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "firewallRuleName");
}
- if (parameters == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
- }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2021-08-01-preview";
+ string apiVersion = "2021-11-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -324,10 +308,9 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client)
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serverName", serverName);
tracingParameters.Add("firewallRuleName", firewallRuleName);
- tracingParameters.Add("parameters", parameters);
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
@@ -348,7 +331,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client)
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("PUT");
+ _httpRequest.Method = new HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
@@ -379,12 +362,6 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client)
// Serialize Request
string _requestContent = null;
- if(parameters != null)
- {
- _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings);
- _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
- _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
- }
// Set Credentials
if (Client.Credentials != null)
{
@@ -405,7 +382,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 200 && (int)_statusCode != 201)
+ if ((int)_statusCode != 200)
{
var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -465,24 +442,6 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client)
throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
- // Deserialize Response
- if ((int)_statusCode == 201)
- {
- _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- try
- {
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
- }
- catch (JsonException ex)
- {
- _httpRequest.Dispose();
- if (_httpResponse != null)
- {
- _httpResponse.Dispose();
- }
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
- }
- }
if (_shouldTrace)
{
ServiceClientTracing.Exit(_invocationId, _result);
@@ -491,7 +450,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client)
}
///
- /// Deletes an IPv6 firewall rule.
+ /// Creates or updates an IPv6 firewall rule.
///
///
/// The name of the resource group that contains the resource. You can obtain
@@ -503,6 +462,9 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client)
///
/// The name of the firewall rule.
///
+ ///
+ /// The required parameters for creating or updating an IPv6 firewall rule.
+ ///
///
/// Headers that will be added to request.
///
@@ -512,6 +474,9 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client)
///
/// Thrown when the operation returned an invalid status code
///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
///
/// Thrown when a required parameter is null
///
@@ -521,7 +486,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, IPv6FirewallRule parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceGroupName == null)
{
@@ -535,11 +500,15 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "firewallRuleName");
}
+ if (parameters == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2021-08-01-preview";
+ string apiVersion = "2021-11-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -550,9 +519,10 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client)
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serverName", serverName);
tracingParameters.Add("firewallRuleName", firewallRuleName);
+ tracingParameters.Add("parameters", parameters);
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
@@ -573,7 +543,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client)
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("DELETE");
+ _httpRequest.Method = new HttpMethod("PUT");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
@@ -604,6 +574,12 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client)
// Serialize Request
string _requestContent = null;
+ if(parameters != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
// Set Credentials
if (Client.Credentials != null)
{
@@ -624,7 +600,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 200 && (int)_statusCode != 204)
+ if ((int)_statusCode != 200 && (int)_statusCode != 201)
{
var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -659,13 +635,49 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 201)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
if (_shouldTrace)
{
ServiceClientTracing.Exit(_invocationId, _result);
@@ -674,7 +686,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client)
}
///
- /// Gets a list of IPv6 firewall rules.
+ /// Deletes an IPv6 firewall rule.
///
///
/// The name of the resource group that contains the resource. You can obtain
@@ -683,6 +695,9 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client)
///
/// The name of the server.
///
+ ///
+ /// The name of the firewall rule.
+ ///
///
/// Headers that will be added to request.
///
@@ -692,9 +707,6 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client)
///
/// Thrown when the operation returned an invalid status code
///
- ///
- /// Thrown when unable to deserialize the response
- ///
///
/// Thrown when a required parameter is null
///
@@ -704,7 +716,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serverName, string firewallRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceGroupName == null)
{
@@ -714,11 +726,15 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "serverName");
}
+ if (firewallRuleName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "firewallRuleName");
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2021-08-01-preview";
+ string apiVersion = "2021-11-01-preview";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -728,15 +744,17 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("serverName", serverName);
+ tracingParameters.Add("firewallRuleName", firewallRuleName);
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListByServer", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules").ToString();
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}").ToString();
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName));
+ _url = _url.Replace("{firewallRuleName}", System.Uri.EscapeDataString(firewallRuleName));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List _queryParameters = new List();
if (apiVersion != null)
@@ -750,7 +768,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client)
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.Method = new HttpMethod("DELETE");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
@@ -801,7 +819,7 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 200)
+ if ((int)_statusCode != 200 && (int)_statusCode != 204)
{
var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -836,31 +854,13 @@ internal IPv6FirewallRulesOperations(SqlManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse>();
+ var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
- // Deserialize Response
- if ((int)_statusCode == 200)
- {
- _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- try
- {
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
- }
- catch (JsonException ex)
- {
- _httpRequest.Dispose();
- if (_httpResponse != null)
- {
- _httpResponse.Dispose();
- }
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
- }
- }
if (_shouldTrace)
{
ServiceClientTracing.Exit(_invocationId, _result);
diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IPv6FirewallRulesOperationsExtensions.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IPv6FirewallRulesOperationsExtensions.cs
index e632d77599d74..487adb33c94e4 100644
--- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IPv6FirewallRulesOperationsExtensions.cs
+++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IPv6FirewallRulesOperationsExtensions.cs
@@ -22,7 +22,7 @@ namespace Microsoft.Azure.Management.Sql
public static partial class IPv6FirewallRulesOperationsExtensions
{
///
- /// Gets an IPv6 firewall rule.
+ /// Gets a list of IPv6 firewall rules.
///
///
/// The operations group for this extension method.
@@ -34,16 +34,13 @@ public static partial class IPv6FirewallRulesOperationsExtensions
///
/// The name of the server.
///
- ///
- /// The name of the firewall rule.
- ///
- public static IPv6FirewallRule Get(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName)
+ public static IPage ListByServer(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName)
{
- return operations.GetAsync(resourceGroupName, serverName, firewallRuleName).GetAwaiter().GetResult();
+ return operations.ListByServerAsync(resourceGroupName, serverName).GetAwaiter().GetResult();
}
///
- /// Gets an IPv6 firewall rule.
+ /// Gets a list of IPv6 firewall rules.
///
///
/// The operations group for this extension method.
@@ -55,22 +52,19 @@ public static IPv6FirewallRule Get(this IIPv6FirewallRulesOperations operations,
///
/// The name of the server.
///
- ///
- /// The name of the firewall rule.
- ///
///
/// The cancellation token.
///
- public static async Task GetAsync(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> ListByServerAsync(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, firewallRuleName, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.ListByServerWithHttpMessagesAsync(resourceGroupName, serverName, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
///
- /// Creates or updates an IPv6 firewall rule.
+ /// Gets an IPv6 firewall rule.
///
///
/// The operations group for this extension method.
@@ -85,16 +79,13 @@ public static IPv6FirewallRule Get(this IIPv6FirewallRulesOperations operations,
///
/// The name of the firewall rule.
///
- ///
- /// The required parameters for creating or updating an IPv6 firewall rule.
- ///
- public static IPv6FirewallRule CreateOrUpdate(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName, IPv6FirewallRule parameters)
+ public static IPv6FirewallRule Get(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName)
{
- return operations.CreateOrUpdateAsync(resourceGroupName, serverName, firewallRuleName, parameters).GetAwaiter().GetResult();
+ return operations.GetAsync(resourceGroupName, serverName, firewallRuleName).GetAwaiter().GetResult();
}
///
- /// Creates or updates an IPv6 firewall rule.
+ /// Gets an IPv6 firewall rule.
///
///
/// The operations group for this extension method.
@@ -109,22 +100,19 @@ public static IPv6FirewallRule CreateOrUpdate(this IIPv6FirewallRulesOperations
///
/// The name of the firewall rule.
///
- ///
- /// The required parameters for creating or updating an IPv6 firewall rule.
- ///
///
/// The cancellation token.
///
- public static async Task CreateOrUpdateAsync(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName, IPv6FirewallRule parameters, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task GetAsync(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, firewallRuleName, parameters, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, firewallRuleName, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
///
- /// Deletes an IPv6 firewall rule.
+ /// Creates or updates an IPv6 firewall rule.
///
///
/// The operations group for this extension method.
@@ -139,13 +127,16 @@ public static IPv6FirewallRule CreateOrUpdate(this IIPv6FirewallRulesOperations
///
/// The name of the firewall rule.
///
- public static void Delete(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName)
+ ///
+ /// The required parameters for creating or updating an IPv6 firewall rule.
+ ///
+ public static IPv6FirewallRule CreateOrUpdate(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName, IPv6FirewallRule parameters)
{
- operations.DeleteAsync(resourceGroupName, serverName, firewallRuleName).GetAwaiter().GetResult();
+ return operations.CreateOrUpdateAsync(resourceGroupName, serverName, firewallRuleName, parameters).GetAwaiter().GetResult();
}
///
- /// Deletes an IPv6 firewall rule.
+ /// Creates or updates an IPv6 firewall rule.
///
///
/// The operations group for this extension method.
@@ -160,16 +151,22 @@ public static void Delete(this IIPv6FirewallRulesOperations operations, string r
///
/// The name of the firewall rule.
///
+ ///
+ /// The required parameters for creating or updating an IPv6 firewall rule.
+ ///
///
/// The cancellation token.
///
- public static async Task DeleteAsync(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task CreateOrUpdateAsync(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName, IPv6FirewallRule parameters, CancellationToken cancellationToken = default(CancellationToken))
{
- (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serverName, firewallRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, firewallRuleName, parameters, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
}
///
- /// Gets a list of IPv6 firewall rules.
+ /// Deletes an IPv6 firewall rule.
///
///
/// The operations group for this extension method.
@@ -181,13 +178,16 @@ public static void Delete(this IIPv6FirewallRulesOperations operations, string r
///
/// The name of the server.
///
- public static IPage ListByServer(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName)
+ ///
+ /// The name of the firewall rule.
+ ///
+ public static void Delete(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName)
{
- return operations.ListByServerAsync(resourceGroupName, serverName).GetAwaiter().GetResult();
+ operations.DeleteAsync(resourceGroupName, serverName, firewallRuleName).GetAwaiter().GetResult();
}
///
- /// Gets a list of IPv6 firewall rules.
+ /// Deletes an IPv6 firewall rule.
///
///
/// The operations group for this extension method.
@@ -199,15 +199,15 @@ public static IPage ListByServer(this IIPv6FirewallRulesOperat
///
/// The name of the server.
///
+ ///
+ /// The name of the firewall rule.
+ ///
///
/// The cancellation token.
///
- public static async Task> ListByServerAsync(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task DeleteAsync(this IIPv6FirewallRulesOperations operations, string resourceGroupName, string serverName, string firewallRuleName, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.ListByServerWithHttpMessagesAsync(resourceGroupName, serverName, null, cancellationToken).ConfigureAwait(false))
- {
- return _result.Body;
- }
+ (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serverName, firewallRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose();
}
///
diff --git a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IServerBlobAuditingPoliciesOperations.cs b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IServerBlobAuditingPoliciesOperations.cs
index 2713643b8354f..1d8af9d959633 100644
--- a/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IServerBlobAuditingPoliciesOperations.cs
+++ b/sdk/sqlmanagement/Microsoft.Azure.Management.Sql/src/Generated/IServerBlobAuditingPoliciesOperations.cs
@@ -24,7 +24,7 @@ namespace Microsoft.Azure.Management.Sql
public partial interface IServerBlobAuditingPoliciesOperations
{
///
- /// Gets a server's blob auditing policy.
+ /// Lists auditing settings of a server.
///
///
/// The name of the resource group that contains the resource. You can
@@ -49,9 +49,9 @@ public partial interface IServerBlobAuditingPoliciesOperations
///
/// Thrown when a required parameter is null
///
- Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// Creates or updates a server's blob auditing policy.
+ /// Gets a server's blob auditing policy.
///
///
/// The name of the resource group that contains the resource. You can
@@ -61,9 +61,6 @@ public partial interface IServerBlobAuditingPoliciesOperations
///
/// The name of the server.
///
- ///
- /// Properties of blob auditing policy
- ///
///
/// The headers that will be added to request.
///
@@ -79,9 +76,9 @@ public partial interface IServerBlobAuditingPoliciesOperations
///
/// Thrown when a required parameter is null
///
- Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, ServerBlobAuditingPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> GetWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// Lists auditing settings of a server.
+ /// Creates or updates a server's blob auditing policy.
///
///
/// The name of the resource group that contains the resource. You can
@@ -91,6 +88,9 @@ public partial interface IServerBlobAuditingPoliciesOperations
///
/// The name of the server.
///
+ ///
+ /// Properties of blob auditing policy
+ ///
///
/// The headers that will be added to request.
///
@@ -106,7 +106,7 @@ public partial interface IServerBlobAuditingPoliciesOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task