From 3637417713090fbab92ec4a27dd94f256d2e41bf Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 2 Jul 2021 15:15:09 +0000 Subject: [PATCH] CodeGen from PR 15016 in Azure/azure-rest-api-specs Changes to fix the Resource Provider name casing issue for Azure Postgres, MySQL and MariaDB (#15016) * Changes to fix the Resource provided name casing issue for Azure Postgres, MySQL and MariaDB services * Changes to fix the Resource provided name casing issue for Azure Postgres, MySQL and MariaDB services * Revert "Changes to fix the Resource provided name casing issue for Azure Postgres, MySQL and MariaDB services" This reverts commit ecc38dc560b77de750350143fd80bdd6e3823882. --- .../src/mysql/Generated/AdvisorsOperations.cs | 8 - .../CheckNameAvailabilityOperations.cs | 2 +- .../Generated/ConfigurationsOperations.cs | 18 +- .../mysql/Generated/DatabasesOperations.cs | 24 +- .../Generated/FirewallRulesOperations.cs | 24 +- .../mysql/Generated/IMySQLManagementClient.cs | 32 ++ .../IRecoverableServersOperations.cs | 52 +++ .../IServerBasedPerformanceTierOperations.cs | 52 +++ .../Generated/IServerParametersOperations.cs | 83 ++++ .../IServerSecurityAlertPoliciesOperations.cs | 47 +++ .../LocationBasedPerformanceTierOperations.cs | 2 +- .../src/mysql/Generated/LogFilesOperations.cs | 6 +- .../src/mysql/Generated/Models/Advisor.cs | 8 +- .../Generated/Models/AzureEntityResource.cs | 15 +- .../mysql/Generated/Models/Configuration.cs | 8 +- .../Models/ConfigurationListResult.cs | 53 +++ .../src/mysql/Generated/Models/Database.cs | 8 +- .../mysql/Generated/Models/ErrorResponse.cs | 7 +- .../mysql/Generated/Models/FirewallRule.cs | 8 +- .../src/mysql/Generated/Models/LogFile.cs | 8 +- .../Models/PerformanceTierProperties.cs | 58 ++- .../Models/PrivateEndpointConnection.cs | 8 +- .../Generated/Models/PrivateLinkResource.cs | 8 +- .../mysql/Generated/Models/ProxyResource.cs | 15 +- .../QueryPerformanceInsightResetDataResult.cs | 63 +++ ...yPerformanceInsightResetDataResultState.cs | 22 + .../mysql/Generated/Models/QueryStatistic.cs | 8 +- .../src/mysql/Generated/Models/QueryText.cs | 8 +- .../Generated/Models/RecommendationAction.cs | 8 +- .../Models/RecoverableServerResource.cs | 106 +++++ .../src/mysql/Generated/Models/Resource.cs | 23 +- .../src/mysql/Generated/Models/Server.cs | 8 +- .../Models/ServerAdministratorResource.cs | 8 +- .../src/mysql/Generated/Models/ServerKey.cs | 8 +- .../Models/ServerSecurityAlertPolicy.cs | 8 +- .../mysql/Generated/Models/TrackedResource.cs | 14 +- .../Generated/Models/VirtualNetworkRule.cs | 8 +- .../mysql/Generated/Models/WaitStatistic.cs | 8 +- .../mysql/Generated/MySQLManagementClient.cs | 234 ++++++++++- .../MySQLManagementClientExtensions.cs | 40 ++ .../src/mysql/Generated/Operations.cs | 2 +- .../PrivateEndpointConnectionsOperations.cs | 20 - .../PrivateLinkResourcesOperations.cs | 8 - .../mysql/Generated/QueryTextsOperations.cs | 8 - .../Generated/RecommendedActionsOperations.cs | 8 - .../Generated/RecoverableServersOperations.cs | 266 ++++++++++++ .../RecoverableServersOperationsExtensions.cs | 65 +++ .../src/mysql/Generated/ReplicasOperations.cs | 6 +- .../SdkInfo_MySQLManagementClient.cs | 37 +- .../ServerAdministratorsOperations.cs | 24 +- .../ServerBasedPerformanceTierOperations.cs | 266 ++++++++++++ ...asedPerformanceTierOperationsExtensions.cs | 67 +++ .../mysql/Generated/ServerKeysOperations.cs | 16 - .../Generated/ServerParametersOperations.cs | 305 ++++++++++++++ .../ServerParametersOperationsExtensions.cs | 117 ++++++ .../ServerSecurityAlertPoliciesOperations.cs | 393 +++++++++++++++++- ...curityAlertPoliciesOperationsExtensions.cs | 74 ++++ .../src/mysql/Generated/ServersOperations.cs | 50 +-- .../Generated/TopQueryStatisticsOperations.cs | 8 - .../VirtualNetworkRulesOperations.cs | 24 +- .../Generated/WaitStatisticsOperations.cs | 8 - 61 files changed, 2540 insertions(+), 360 deletions(-) create mode 100644 sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/IRecoverableServersOperations.cs create mode 100644 sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/IServerBasedPerformanceTierOperations.cs create mode 100644 sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/IServerParametersOperations.cs create mode 100644 sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/ConfigurationListResult.cs create mode 100644 sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/QueryPerformanceInsightResetDataResult.cs create mode 100644 sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/QueryPerformanceInsightResetDataResultState.cs create mode 100644 sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/RecoverableServerResource.cs create mode 100644 sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/RecoverableServersOperations.cs create mode 100644 sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/RecoverableServersOperationsExtensions.cs create mode 100644 sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ServerBasedPerformanceTierOperations.cs create mode 100644 sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ServerBasedPerformanceTierOperationsExtensions.cs create mode 100644 sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ServerParametersOperations.cs create mode 100644 sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ServerParametersOperationsExtensions.cs diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/AdvisorsOperations.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/AdvisorsOperations.cs index cb4191b4e7f2..12ed55a49baa 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/AdvisorsOperations.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/AdvisorsOperations.cs @@ -110,10 +110,6 @@ internal AdvisorsOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -332,10 +328,6 @@ internal AdvisorsOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/CheckNameAvailabilityOperations.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/CheckNameAvailabilityOperations.cs index 4e3d905d8d47..e600b530be7c 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/CheckNameAvailabilityOperations.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/CheckNameAvailabilityOperations.cs @@ -113,7 +113,7 @@ internal CheckNameAvailabilityOperations(MySQLManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DBForMySQL/checkNameAvailability").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/checkNameAvailability").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ConfigurationsOperations.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ConfigurationsOperations.cs index ed68ee2c1d30..4eab88f9fad0 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ConfigurationsOperations.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ConfigurationsOperations.cs @@ -138,10 +138,6 @@ internal ConfigurationsOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -168,7 +164,7 @@ internal ConfigurationsOperations(MySQLManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMySQL/servers/{serverName}/configurations/{configurationName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/configurations/{configurationName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); @@ -360,10 +356,6 @@ internal ConfigurationsOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -385,7 +377,7 @@ internal ConfigurationsOperations(MySQLManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMySQL/servers/{serverName}/configurations").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/configurations").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); @@ -582,10 +574,6 @@ internal ConfigurationsOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -617,7 +605,7 @@ internal ConfigurationsOperations(MySQLManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMySQL/servers/{serverName}/configurations/{configurationName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/configurations/{configurationName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/DatabasesOperations.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/DatabasesOperations.cs index e632a17ba2f3..b1367db7bb2f 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/DatabasesOperations.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/DatabasesOperations.cs @@ -163,10 +163,6 @@ internal DatabasesOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -193,7 +189,7 @@ internal DatabasesOperations(MySQLManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMySQL/servers/{serverName}/databases/{databaseName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/databases/{databaseName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); @@ -385,10 +381,6 @@ internal DatabasesOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -410,7 +402,7 @@ internal DatabasesOperations(MySQLManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMySQL/servers/{serverName}/databases").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/databases").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); @@ -607,10 +599,6 @@ internal DatabasesOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -642,7 +630,7 @@ internal DatabasesOperations(MySQLManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMySQL/servers/{serverName}/databases/{databaseName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/databases/{databaseName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); @@ -858,10 +846,6 @@ internal DatabasesOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -888,7 +872,7 @@ internal DatabasesOperations(MySQLManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMySQL/servers/{serverName}/databases/{databaseName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/databases/{databaseName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/FirewallRulesOperations.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/FirewallRulesOperations.cs index b1ed420a0d79..b1410083eb1b 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/FirewallRulesOperations.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/FirewallRulesOperations.cs @@ -163,10 +163,6 @@ internal FirewallRulesOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -193,7 +189,7 @@ internal FirewallRulesOperations(MySQLManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMySQL/servers/{serverName}/firewallRules/{firewallRuleName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/firewallRules/{firewallRuleName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); @@ -385,10 +381,6 @@ internal FirewallRulesOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -410,7 +402,7 @@ internal FirewallRulesOperations(MySQLManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMySQL/servers/{serverName}/firewallRules").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/firewallRules").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); @@ -607,10 +599,6 @@ internal FirewallRulesOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -646,7 +634,7 @@ internal FirewallRulesOperations(MySQLManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMySQL/servers/{serverName}/firewallRules/{firewallRuleName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/firewallRules/{firewallRuleName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); @@ -862,10 +850,6 @@ internal FirewallRulesOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -892,7 +876,7 @@ internal FirewallRulesOperations(MySQLManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMySQL/servers/{serverName}/firewallRules/{firewallRuleName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/firewallRules/{firewallRuleName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/IMySQLManagementClient.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/IMySQLManagementClient.cs index ea43fcdeef2a..f36dc75ea313 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/IMySQLManagementClient.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/IMySQLManagementClient.cs @@ -101,6 +101,11 @@ public partial interface IMySQLManagementClient : System.IDisposable /// IConfigurationsOperations Configurations { get; } + /// + /// Gets the IServerParametersOperations. + /// + IServerParametersOperations ServerParameters { get; } + /// /// Gets the ILogFilesOperations. /// @@ -111,6 +116,16 @@ public partial interface IMySQLManagementClient : System.IDisposable /// IServerAdministratorsOperations ServerAdministrators { get; } + /// + /// Gets the IRecoverableServersOperations. + /// + IRecoverableServersOperations RecoverableServers { get; } + + /// + /// Gets the IServerBasedPerformanceTierOperations. + /// + IServerBasedPerformanceTierOperations ServerBasedPerformanceTier { get; } + /// /// Gets the ILocationBasedPerformanceTierOperations. /// @@ -181,6 +196,23 @@ public partial interface IMySQLManagementClient : System.IDisposable /// IServerKeysOperations ServerKeys { get; } + /// + /// Reset data for Query Performance Insight. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the server. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> ResetQueryPerformanceInsightDataWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Create recommendation action session for the advisor. /// diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/IRecoverableServersOperations.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/IRecoverableServersOperations.cs new file mode 100644 index 000000000000..e2fbae7e6a3c --- /dev/null +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/IRecoverableServersOperations.cs @@ -0,0 +1,52 @@ +// +// 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.MySQL +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// RecoverableServersOperations operations. + /// + public partial interface IRecoverableServersOperations + { + /// + /// Gets a recoverable MySQL Server. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the server. + /// + /// + /// 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 serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/IServerBasedPerformanceTierOperations.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/IServerBasedPerformanceTierOperations.cs new file mode 100644 index 000000000000..3531e3d3f7e1 --- /dev/null +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/IServerBasedPerformanceTierOperations.cs @@ -0,0 +1,52 @@ +// +// 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.MySQL +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ServerBasedPerformanceTierOperations operations. + /// + public partial interface IServerBasedPerformanceTierOperations + { + /// + /// List all the performance tiers for a MySQL server. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the server. + /// + /// + /// 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>> ListWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/IServerParametersOperations.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/IServerParametersOperations.cs new file mode 100644 index 000000000000..3637624d5625 --- /dev/null +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/IServerParametersOperations.cs @@ -0,0 +1,83 @@ +// +// 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.MySQL +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ServerParametersOperations operations. + /// + public partial interface IServerParametersOperations + { + /// + /// Update a list of configurations in a given server. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the server. + /// + /// + /// The parameters for updating a list of server configuration. + /// + /// + /// 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> ListUpdateConfigurationsWithHttpMessagesAsync(string resourceGroupName, string serverName, ConfigurationListResult value, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update a list of configurations in a given server. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the server. + /// + /// + /// The parameters for updating a list of server configuration. + /// + /// + /// 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> BeginListUpdateConfigurationsWithHttpMessagesAsync(string resourceGroupName, string serverName, ConfigurationListResult value, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/IServerSecurityAlertPoliciesOperations.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/IServerSecurityAlertPoliciesOperations.cs index e233bddf4ac4..d52ccbbe0202 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/IServerSecurityAlertPoliciesOperations.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/IServerSecurityAlertPoliciesOperations.cs @@ -77,6 +77,31 @@ public partial interface IServerSecurityAlertPoliciesOperations /// Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, ServerSecurityAlertPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Get the server's threat detection policies. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the server. + /// + /// + /// 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>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Creates or updates a threat detection policy. /// /// @@ -104,5 +129,27 @@ public partial interface IServerSecurityAlertPoliciesOperations /// Thrown when a required parameter is null /// Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serverName, ServerSecurityAlertPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get the server's threat detection policies. + /// + /// + /// 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>> ListByServerNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/LocationBasedPerformanceTierOperations.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/LocationBasedPerformanceTierOperations.cs index de6b419d063e..3d327c7b7924 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/LocationBasedPerformanceTierOperations.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/LocationBasedPerformanceTierOperations.cs @@ -110,7 +110,7 @@ internal LocationBasedPerformanceTierOperations(MySQLManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DBForMySQL/locations/{locationName}/performanceTiers").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/performanceTiers").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{locationName}", System.Uri.EscapeDataString(locationName)); List _queryParameters = new List(); diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/LogFilesOperations.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/LogFilesOperations.cs index 245bb02b7620..4de9cb818a0c 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/LogFilesOperations.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/LogFilesOperations.cs @@ -107,10 +107,6 @@ internal LogFilesOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -132,7 +128,7 @@ internal LogFilesOperations(MySQLManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMySQL/servers/{serverName}/logFiles").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/logFiles").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/Advisor.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/Advisor.cs index 071c8bfb8240..e8c14d36b83e 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/Advisor.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/Advisor.cs @@ -29,12 +29,12 @@ public Advisor() /// /// Initializes a new instance of the Advisor class. /// - /// Fully qualified resource Id for the resource. Ex - + /// Fully qualified resource ID for the resource. Ex - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// The name of the resource - /// The type of the resource. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// The properties of a recommendation action /// advisor. public Advisor(string id = default(string), string name = default(string), string type = default(string), object properties = default(object)) diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/AzureEntityResource.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/AzureEntityResource.cs index ba6e09549ef2..8ab7f0d6941b 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/AzureEntityResource.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/AzureEntityResource.cs @@ -14,9 +14,12 @@ namespace Microsoft.Azure.Management.MySQL.Models using System.Linq; /// - /// The resource model definition for a Azure Resource Manager resource - /// with an etag. + /// Entity Resource /// + /// + /// The resource model definition for an Azure Resource Manager resource + /// with an etag. + /// public partial class AzureEntityResource : Resource { /// @@ -30,12 +33,12 @@ public AzureEntityResource() /// /// Initializes a new instance of the AzureEntityResource class. /// - /// Fully qualified resource Id for the resource. Ex - + /// Fully qualified resource ID for the resource. Ex - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// The name of the resource - /// The type of the resource. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// Resource Etag. public AzureEntityResource(string id = default(string), string name = default(string), string type = default(string), string etag = default(string)) : base(id, name, type) diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/Configuration.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/Configuration.cs index 2036b43ea74f..3aeac5befd93 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/Configuration.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/Configuration.cs @@ -32,12 +32,12 @@ public Configuration() /// /// Initializes a new instance of the Configuration class. /// - /// Fully qualified resource Id for the resource. Ex - + /// Fully qualified resource ID for the resource. Ex - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// The name of the resource - /// The type of the resource. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// Value of the configuration. /// Description of the configuration. /// Default value of the diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/ConfigurationListResult.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/ConfigurationListResult.cs new file mode 100644 index 000000000000..dc2aa65a642f --- /dev/null +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/ConfigurationListResult.cs @@ -0,0 +1,53 @@ +// +// 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.MySQL.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A list of server configurations. + /// + public partial class ConfigurationListResult + { + /// + /// Initializes a new instance of the ConfigurationListResult class. + /// + public ConfigurationListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ConfigurationListResult class. + /// + /// The list of server configurations. + public ConfigurationListResult(IList value = default(IList)) + { + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the list of server configurations. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + } +} diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/Database.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/Database.cs index b069bbd62750..1cccdfdad72f 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/Database.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/Database.cs @@ -32,12 +32,12 @@ public Database() /// /// Initializes a new instance of the Database class. /// - /// Fully qualified resource Id for the resource. Ex - + /// Fully qualified resource ID for the resource. Ex - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// The name of the resource - /// The type of the resource. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// The charset of the database. /// The collation of the database. public Database(string id = default(string), string name = default(string), string type = default(string), string charset = default(string), string collation = default(string)) diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/ErrorResponse.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/ErrorResponse.cs index 2c001449ca73..b7bed6b77371 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/ErrorResponse.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/ErrorResponse.cs @@ -16,8 +16,13 @@ namespace Microsoft.Azure.Management.MySQL.Models using System.Linq; /// - /// The resource management error response. + /// Error Response /// + /// + /// Common error response for all Azure Resource Manager APIs to return + /// error details for failed operations. (This also follows the OData error + /// response format.) + /// public partial class ErrorResponse { /// diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/FirewallRule.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/FirewallRule.cs index 77088a18cca4..1cae4073869e 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/FirewallRule.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/FirewallRule.cs @@ -36,12 +36,12 @@ public FirewallRule() /// firewall rule. Must be IPv4 format. /// The end IP address of the server /// firewall rule. Must be IPv4 format. - /// Fully qualified resource Id for the resource. Ex - + /// Fully qualified resource ID for the resource. Ex - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// The name of the resource - /// The type of the resource. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" public FirewallRule(string startIpAddress, string endIpAddress, string id = default(string), string name = default(string), string type = default(string)) : base(id, name, type) { diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/LogFile.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/LogFile.cs index 651fe80ce51f..4e9c8abbe295 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/LogFile.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/LogFile.cs @@ -32,12 +32,12 @@ public LogFile() /// /// Initializes a new instance of the LogFile class. /// - /// Fully qualified resource Id for the resource. Ex - + /// Fully qualified resource ID for the resource. Ex - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// The name of the resource - /// The type of the resource. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// Size of the log file. /// Creation timestamp of the log /// file. diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/PerformanceTierProperties.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/PerformanceTierProperties.cs index 5381e92dc630..8b1eadb1f264 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/PerformanceTierProperties.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/PerformanceTierProperties.cs @@ -32,11 +32,29 @@ public PerformanceTierProperties() /// Initializes a new instance of the PerformanceTierProperties class. /// /// ID of the performance tier. + /// Maximum Backup retention in + /// days for the performance tier edition + /// Minimum Backup retention in + /// days for the performance tier edition + /// Max storage allowed for a + /// server. + /// Max storage allowed for a + /// server. + /// Max storage allowed for a + /// server. + /// Max storage allowed for a + /// server. /// Service level objectives /// associated with the performance tier - public PerformanceTierProperties(string id = default(string), IList serviceLevelObjectives = default(IList)) + public PerformanceTierProperties(string id = default(string), int? maxBackupRetentionDays = default(int?), int? minBackupRetentionDays = default(int?), int? maxStorageMB = default(int?), int? minLargeStorageMB = default(int?), int? maxLargeStorageMB = default(int?), int? minStorageMB = default(int?), IList serviceLevelObjectives = default(IList)) { Id = id; + MaxBackupRetentionDays = maxBackupRetentionDays; + MinBackupRetentionDays = minBackupRetentionDays; + MaxStorageMB = maxStorageMB; + MinLargeStorageMB = minLargeStorageMB; + MaxLargeStorageMB = maxLargeStorageMB; + MinStorageMB = minStorageMB; ServiceLevelObjectives = serviceLevelObjectives; CustomInit(); } @@ -52,6 +70,44 @@ public PerformanceTierProperties() [JsonProperty(PropertyName = "id")] public string Id { get; set; } + /// + /// Gets or sets maximum Backup retention in days for the performance + /// tier edition + /// + [JsonProperty(PropertyName = "maxBackupRetentionDays")] + public int? MaxBackupRetentionDays { get; set; } + + /// + /// Gets or sets minimum Backup retention in days for the performance + /// tier edition + /// + [JsonProperty(PropertyName = "minBackupRetentionDays")] + public int? MinBackupRetentionDays { get; set; } + + /// + /// Gets or sets max storage allowed for a server. + /// + [JsonProperty(PropertyName = "maxStorageMB")] + public int? MaxStorageMB { get; set; } + + /// + /// Gets or sets max storage allowed for a server. + /// + [JsonProperty(PropertyName = "minLargeStorageMB")] + public int? MinLargeStorageMB { get; set; } + + /// + /// Gets or sets max storage allowed for a server. + /// + [JsonProperty(PropertyName = "maxLargeStorageMB")] + public int? MaxLargeStorageMB { get; set; } + + /// + /// Gets or sets max storage allowed for a server. + /// + [JsonProperty(PropertyName = "minStorageMB")] + public int? MinStorageMB { get; set; } + /// /// Gets or sets service level objectives associated with the /// performance tier diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/PrivateEndpointConnection.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/PrivateEndpointConnection.cs index bf2fc1b5ea60..abe8755a53ec 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/PrivateEndpointConnection.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/PrivateEndpointConnection.cs @@ -32,12 +32,12 @@ public PrivateEndpointConnection() /// /// Initializes a new instance of the PrivateEndpointConnection class. /// - /// Fully qualified resource Id for the resource. Ex - + /// Fully qualified resource ID for the resource. Ex - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// The name of the resource - /// The type of the resource. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// Private endpoint which the connection /// belongs to. /// Connection state of diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/PrivateLinkResource.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/PrivateLinkResource.cs index 6296f6dfd989..43a670f2273d 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/PrivateLinkResource.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/PrivateLinkResource.cs @@ -29,12 +29,12 @@ public PrivateLinkResource() /// /// Initializes a new instance of the PrivateLinkResource class. /// - /// Fully qualified resource Id for the resource. Ex - + /// Fully qualified resource ID for the resource. Ex - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// The name of the resource - /// The type of the resource. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// The private link resource group /// id. public PrivateLinkResource(string id = default(string), string name = default(string), string type = default(string), PrivateLinkResourceProperties properties = default(PrivateLinkResourceProperties)) diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/ProxyResource.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/ProxyResource.cs index 5eadc4cc9fc0..ac252937c25b 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/ProxyResource.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/ProxyResource.cs @@ -13,9 +13,12 @@ namespace Microsoft.Azure.Management.MySQL.Models using System.Linq; /// - /// The resource model definition for a ARM proxy resource. It will have - /// everything other than required location and tags + /// Proxy Resource /// + /// + /// The resource model definition for a Azure Resource Manager proxy + /// resource. It will not have tags and a location + /// public partial class ProxyResource : Resource { /// @@ -29,12 +32,12 @@ public ProxyResource() /// /// Initializes a new instance of the ProxyResource class. /// - /// Fully qualified resource Id for the resource. Ex - + /// Fully qualified resource ID for the resource. Ex - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// The name of the resource - /// The type of the resource. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" public ProxyResource(string id = default(string), string name = default(string), string type = default(string)) : base(id, name, type) { diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/QueryPerformanceInsightResetDataResult.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/QueryPerformanceInsightResetDataResult.cs new file mode 100644 index 000000000000..5e25314691bc --- /dev/null +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/QueryPerformanceInsightResetDataResult.cs @@ -0,0 +1,63 @@ +// +// 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.MySQL.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Result of Query Performance Insight data reset. + /// + public partial class QueryPerformanceInsightResetDataResult + { + /// + /// Initializes a new instance of the + /// QueryPerformanceInsightResetDataResult class. + /// + public QueryPerformanceInsightResetDataResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// QueryPerformanceInsightResetDataResult class. + /// + /// Indicates result of the operation. Possible + /// values include: 'Succeeded', 'Failed' + /// operation message. + public QueryPerformanceInsightResetDataResult(string status = default(string), string message = default(string)) + { + Status = status; + Message = message; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets indicates result of the operation. Possible values + /// include: 'Succeeded', 'Failed' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets operation message. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; set; } + + } +} diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/QueryPerformanceInsightResetDataResultState.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/QueryPerformanceInsightResetDataResultState.cs new file mode 100644 index 000000000000..e6bbe7120477 --- /dev/null +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/QueryPerformanceInsightResetDataResultState.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.MySQL.Models +{ + + /// + /// Defines values for QueryPerformanceInsightResetDataResultState. + /// + public static class QueryPerformanceInsightResetDataResultState + { + public const string Succeeded = "Succeeded"; + public const string Failed = "Failed"; + } +} diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/QueryStatistic.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/QueryStatistic.cs index 4b4d91393e6a..fdd05ef74c7e 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/QueryStatistic.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/QueryStatistic.cs @@ -34,12 +34,12 @@ public QueryStatistic() /// /// Initializes a new instance of the QueryStatistic class. /// - /// Fully qualified resource Id for the resource. Ex - + /// Fully qualified resource ID for the resource. Ex - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// The name of the resource - /// The type of the resource. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// Database query identifier. /// Observation start time. /// Observation end time. diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/QueryText.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/QueryText.cs index e962901f930c..3e765107c330 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/QueryText.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/QueryText.cs @@ -32,12 +32,12 @@ public QueryText() /// /// Initializes a new instance of the QueryText class. /// - /// Fully qualified resource Id for the resource. Ex - + /// Fully qualified resource ID for the resource. Ex - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// The name of the resource - /// The type of the resource. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// Query identifier unique to the /// server. /// Query text. diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/RecommendationAction.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/RecommendationAction.cs index 86337e87f670..cffed60a4a9e 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/RecommendationAction.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/RecommendationAction.cs @@ -34,12 +34,12 @@ public RecommendationAction() /// /// Initializes a new instance of the RecommendationAction class. /// - /// Fully qualified resource Id for the resource. Ex - + /// Fully qualified resource ID for the resource. Ex - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// The name of the resource - /// The type of the resource. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// Advisor name. /// Recommendation action session /// identifier. diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/RecoverableServerResource.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/RecoverableServerResource.cs new file mode 100644 index 000000000000..34c9dfdecc36 --- /dev/null +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/RecoverableServerResource.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.MySQL.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// A recoverable server resource. + /// + [Rest.Serialization.JsonTransformation] + public partial class RecoverableServerResource : ProxyResource + { + /// + /// Initializes a new instance of the RecoverableServerResource class. + /// + public RecoverableServerResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RecoverableServerResource class. + /// + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// The last available backup + /// date time. + /// The service level + /// objective + /// Edition of the performance tier. + /// vCore associated with the service level + /// objective + /// Hardware generation associated + /// with the service level objective + /// The MySQL version + public RecoverableServerResource(string id = default(string), string name = default(string), string type = default(string), string lastAvailableBackupDateTime = default(string), string serviceLevelObjective = default(string), string edition = default(string), int? vCore = default(int?), string hardwareGeneration = default(string), string version = default(string)) + : base(id, name, type) + { + LastAvailableBackupDateTime = lastAvailableBackupDateTime; + ServiceLevelObjective = serviceLevelObjective; + Edition = edition; + VCore = vCore; + HardwareGeneration = hardwareGeneration; + Version = version; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the last available backup date time. + /// + [JsonProperty(PropertyName = "properties.lastAvailableBackupDateTime")] + public string LastAvailableBackupDateTime { get; private set; } + + /// + /// Gets the service level objective + /// + [JsonProperty(PropertyName = "properties.serviceLevelObjective")] + public string ServiceLevelObjective { get; private set; } + + /// + /// Gets edition of the performance tier. + /// + [JsonProperty(PropertyName = "properties.edition")] + public string Edition { get; private set; } + + /// + /// Gets vCore associated with the service level objective + /// + [JsonProperty(PropertyName = "properties.vCore")] + public int? VCore { get; private set; } + + /// + /// Gets hardware generation associated with the service level + /// objective + /// + [JsonProperty(PropertyName = "properties.hardwareGeneration")] + public string HardwareGeneration { get; private set; } + + /// + /// Gets the MySQL version + /// + [JsonProperty(PropertyName = "properties.version")] + public string Version { get; private set; } + + } +} diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/Resource.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/Resource.cs index 8e7b7551af33..f52e693d285a 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/Resource.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/Resource.cs @@ -15,6 +15,13 @@ namespace Microsoft.Azure.Management.MySQL.Models using Newtonsoft.Json; using System.Linq; + /// + /// Resource + /// + /// + /// Common fields that are returned in the response for all Azure Resource + /// Manager resources + /// public partial class Resource : IResource { /// @@ -28,12 +35,12 @@ public Resource() /// /// Initializes a new instance of the Resource class. /// - /// Fully qualified resource Id for the resource. Ex - + /// Fully qualified resource ID for the resource. Ex - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// The name of the resource - /// The type of the resource. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" public Resource(string id = default(string), string name = default(string), string type = default(string)) { Id = id; @@ -48,7 +55,7 @@ public Resource() partial void CustomInit(); /// - /// Gets fully qualified resource Id for the resource. Ex - + /// Gets fully qualified resource ID for the resource. Ex - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// [JsonProperty(PropertyName = "id")] @@ -61,9 +68,9 @@ public Resource() public string Name { get; private set; } /// - /// Gets the type of the resource. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// Gets the type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// [JsonProperty(PropertyName = "type")] public string Type { get; private set; } diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/Server.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/Server.cs index c8a8dc76f4b3..01c9ebd92cad 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/Server.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/Server.cs @@ -36,12 +36,12 @@ public Server() /// /// The geo-location where the resource /// lives - /// Fully qualified resource Id for the resource. Ex - + /// Fully qualified resource ID for the resource. Ex - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// The name of the resource - /// The type of the resource. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// Resource tags. /// The Azure Active Directory identity of the /// server. diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/ServerAdministratorResource.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/ServerAdministratorResource.cs index 914a9b87f50a..f0eb67f3e496 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/ServerAdministratorResource.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/ServerAdministratorResource.cs @@ -39,12 +39,12 @@ public ServerAdministratorResource() /// The server administrator Sid (Secure ID). /// The server Active Directory Administrator /// tenant id. - /// Fully qualified resource Id for the resource. Ex - + /// Fully qualified resource ID for the resource. Ex - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// The name of the resource - /// The type of the resource. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" public ServerAdministratorResource(string login, System.Guid sid, System.Guid tenantId, string id = default(string), string name = default(string), string type = default(string)) : base(id, name, type) { diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/ServerKey.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/ServerKey.cs index 36fdfeac518e..22b6c33ba42a 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/ServerKey.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/ServerKey.cs @@ -32,12 +32,12 @@ public ServerKey() /// /// Initializes a new instance of the ServerKey class. /// - /// Fully qualified resource Id for the resource. Ex - + /// Fully qualified resource ID for the resource. Ex - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// The name of the resource - /// The type of the resource. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// Kind of encryption protector used to protect the /// key. /// The URI of the key. diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/ServerSecurityAlertPolicy.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/ServerSecurityAlertPolicy.cs index 594e3e95db63..f718d4895b51 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/ServerSecurityAlertPolicy.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/ServerSecurityAlertPolicy.cs @@ -37,12 +37,12 @@ public ServerSecurityAlertPolicy() /// Specifies the state of the policy, whether it /// is enabled or disabled. Possible values include: 'Enabled', /// 'Disabled' - /// Fully qualified resource Id for the resource. Ex - + /// Fully qualified resource ID for the resource. Ex - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// The name of the resource - /// The type of the resource. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// Specifies an array of alerts that are /// disabled. Allowed values are: Sql_Injection, /// Sql_Injection_Vulnerability, Access_Anomaly diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/TrackedResource.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/TrackedResource.cs index acda19538196..68be1e1e7d91 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/TrackedResource.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/TrackedResource.cs @@ -17,8 +17,12 @@ namespace Microsoft.Azure.Management.MySQL.Models using System.Linq; /// - /// The resource model definition for a ARM tracked top level resource + /// Tracked Resource /// + /// + /// The resource model definition for an Azure Resource Manager tracked top + /// level resource which has 'tags' and a 'location' + /// public partial class TrackedResource : Resource { /// @@ -34,12 +38,12 @@ public TrackedResource() /// /// The geo-location where the resource /// lives - /// Fully qualified resource Id for the resource. Ex - + /// Fully qualified resource ID for the resource. Ex - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// The name of the resource - /// The type of the resource. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// Resource tags. public TrackedResource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary)) : base(id, name, type) diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/VirtualNetworkRule.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/VirtualNetworkRule.cs index 8a039c8aad42..8190be2fd56b 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/VirtualNetworkRule.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/VirtualNetworkRule.cs @@ -34,12 +34,12 @@ public VirtualNetworkRule() /// /// The ARM resource id of the /// virtual network subnet. - /// Fully qualified resource Id for the resource. Ex - + /// Fully qualified resource ID for the resource. Ex - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// The name of the resource - /// The type of the resource. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// Create firewall rule /// before the virtual network has vnet service endpoint /// enabled. diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/WaitStatistic.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/WaitStatistic.cs index 4fb4ba5eadfd..61311dd74e15 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/WaitStatistic.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Models/WaitStatistic.cs @@ -32,12 +32,12 @@ public WaitStatistic() /// /// Initializes a new instance of the WaitStatistic class. /// - /// Fully qualified resource Id for the resource. Ex - + /// Fully qualified resource ID for the resource. Ex - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// The name of the resource - /// The type of the resource. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// Observation start time. /// Observation end time. /// Wait event name. diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/MySQLManagementClient.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/MySQLManagementClient.cs index d4a2530d2a71..5d91533c88cc 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/MySQLManagementClient.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/MySQLManagementClient.cs @@ -104,6 +104,11 @@ public partial class MySQLManagementClient : ServiceClient public virtual IConfigurationsOperations Configurations { get; private set; } + /// + /// Gets the IServerParametersOperations. + /// + public virtual IServerParametersOperations ServerParameters { get; private set; } + /// /// Gets the ILogFilesOperations. /// @@ -114,6 +119,16 @@ public partial class MySQLManagementClient : ServiceClient public virtual IServerAdministratorsOperations ServerAdministrators { get; private set; } + /// + /// Gets the IRecoverableServersOperations. + /// + public virtual IRecoverableServersOperations RecoverableServers { get; private set; } + + /// + /// Gets the IServerBasedPerformanceTierOperations. + /// + public virtual IServerBasedPerformanceTierOperations ServerBasedPerformanceTier { get; private set; } + /// /// Gets the ILocationBasedPerformanceTierOperations. /// @@ -431,8 +446,11 @@ private void Initialize() VirtualNetworkRules = new VirtualNetworkRulesOperations(this); Databases = new DatabasesOperations(this); Configurations = new ConfigurationsOperations(this); + ServerParameters = new ServerParametersOperations(this); LogFiles = new LogFilesOperations(this); ServerAdministrators = new ServerAdministratorsOperations(this); + RecoverableServers = new RecoverableServersOperations(this); + ServerBasedPerformanceTier = new ServerBasedPerformanceTierOperations(this); LocationBasedPerformanceTier = new LocationBasedPerformanceTierOperations(this); CheckNameAvailability = new CheckNameAvailabilityOperations(this); Operations = new Operations(this); @@ -483,6 +501,218 @@ private void Initialize() DeserializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); } + /// + /// Reset data for Query Performance Insight. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the server. + /// + /// + /// 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> ResetQueryPerformanceInsightDataWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + } + if (SubscriptionId != null) + { + if (SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + string apiVersion = "2018-06-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serverName", serverName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ResetQueryPerformanceInsightData", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/resetQueryPerformanceInsightData").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + 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("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", 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 (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await 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 = SafeJsonConvert.DeserializeObject(_responseContent, 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 = SafeJsonConvert.DeserializeObject(_responseContent, 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; + } + /// /// Create recommendation action session for the advisor. /// @@ -571,10 +801,6 @@ private void Initialize() { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/MySQLManagementClientExtensions.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/MySQLManagementClientExtensions.cs index 89dc9ddee89f..a3c4f2360543 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/MySQLManagementClientExtensions.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/MySQLManagementClientExtensions.cs @@ -21,6 +21,46 @@ namespace Microsoft.Azure.Management.MySQL /// public static partial class MySQLManagementClientExtensions { + /// + /// Reset data for Query Performance Insight. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the server. + /// + public static QueryPerformanceInsightResetDataResult ResetQueryPerformanceInsightData(this IMySQLManagementClient operations, string resourceGroupName, string serverName) + { + return operations.ResetQueryPerformanceInsightDataAsync(resourceGroupName, serverName).GetAwaiter().GetResult(); + } + + /// + /// Reset data for Query Performance Insight. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the server. + /// + /// + /// The cancellation token. + /// + public static async Task ResetQueryPerformanceInsightDataAsync(this IMySQLManagementClient operations, string resourceGroupName, string serverName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ResetQueryPerformanceInsightDataWithHttpMessagesAsync(resourceGroupName, serverName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Create recommendation action session for the advisor. /// diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Operations.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Operations.cs index ff6859d3826f..94fa55261ab4 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Operations.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/Operations.cs @@ -84,7 +84,7 @@ internal Operations(MySQLManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.DBForMySQL/operations").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.DBforMySQL/operations").ToString(); List _queryParameters = new List(); if (apiVersion != null) { diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/PrivateEndpointConnectionsOperations.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/PrivateEndpointConnectionsOperations.cs index 30e1ce3b67b7..194d63913532 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/PrivateEndpointConnectionsOperations.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/PrivateEndpointConnectionsOperations.cs @@ -99,10 +99,6 @@ internal PrivateEndpointConnectionsOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -402,10 +398,6 @@ internal PrivateEndpointConnectionsOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -622,10 +614,6 @@ internal PrivateEndpointConnectionsOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -858,10 +846,6 @@ internal PrivateEndpointConnectionsOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -1082,10 +1066,6 @@ internal PrivateEndpointConnectionsOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/PrivateLinkResourcesOperations.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/PrivateLinkResourcesOperations.cs index fbc9af8decb7..b3438a8c54a2 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/PrivateLinkResourcesOperations.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/PrivateLinkResourcesOperations.cs @@ -96,10 +96,6 @@ internal PrivateLinkResourcesOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -315,10 +311,6 @@ internal PrivateLinkResourcesOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/QueryTextsOperations.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/QueryTextsOperations.cs index 4bb4958f0fe2..4658527e0b35 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/QueryTextsOperations.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/QueryTextsOperations.cs @@ -110,10 +110,6 @@ internal QueryTextsOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -335,10 +331,6 @@ internal QueryTextsOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/RecommendedActionsOperations.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/RecommendedActionsOperations.cs index 4b15f4666f53..9306f3623c7b 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/RecommendedActionsOperations.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/RecommendedActionsOperations.cs @@ -113,10 +113,6 @@ internal RecommendedActionsOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -347,10 +343,6 @@ internal RecommendedActionsOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/RecoverableServersOperations.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/RecoverableServersOperations.cs new file mode 100644 index 000000000000..a8afffdb91c4 --- /dev/null +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/RecoverableServersOperations.cs @@ -0,0 +1,266 @@ +// +// 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.MySQL +{ + 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; + + /// + /// RecoverableServersOperations operations. + /// + internal partial class RecoverableServersOperations : IServiceOperations, IRecoverableServersOperations + { + /// + /// Initializes a new instance of the RecoverableServersOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal RecoverableServersOperations(MySQLManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the MySQLManagementClient + /// + public MySQLManagementClient Client { get; private set; } + + /// + /// Gets a recoverable MySQL Server. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the server. + /// + /// + /// 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 serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + string apiVersion = "2017-12-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serverName", serverName); + 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.DBforMySQL/servers/{serverName}/recoverableServers").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + 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; + } + + } +} diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/RecoverableServersOperationsExtensions.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/RecoverableServersOperationsExtensions.cs new file mode 100644 index 000000000000..2aca0190acfa --- /dev/null +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/RecoverableServersOperationsExtensions.cs @@ -0,0 +1,65 @@ +// +// 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.MySQL +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for RecoverableServersOperations. + /// + public static partial class RecoverableServersOperationsExtensions + { + /// + /// Gets a recoverable MySQL Server. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the server. + /// + public static RecoverableServerResource Get(this IRecoverableServersOperations operations, string resourceGroupName, string serverName) + { + return operations.GetAsync(resourceGroupName, serverName).GetAwaiter().GetResult(); + } + + /// + /// Gets a recoverable MySQL Server. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the server. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IRecoverableServersOperations operations, string resourceGroupName, string serverName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ReplicasOperations.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ReplicasOperations.cs index feddfe47e21e..c0dab2b427da 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ReplicasOperations.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ReplicasOperations.cs @@ -107,10 +107,6 @@ internal ReplicasOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -132,7 +128,7 @@ internal ReplicasOperations(MySQLManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMySQL/servers/{serverName}/replicas").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/replicas").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/SdkInfo_MySQLManagementClient.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/SdkInfo_MySQLManagementClient.cs index 291a4962765a..e0dca49b9d22 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/SdkInfo_MySQLManagementClient.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/SdkInfo_MySQLManagementClient.cs @@ -19,43 +19,36 @@ public static IEnumerable> ApiInfo_MySQLManagement { return new Tuple[] { - new Tuple("DBForMySQL", "CheckNameAvailability", "2017-12-01"), - new Tuple("DBForMySQL", "Configurations", "2017-12-01"), - new Tuple("DBForMySQL", "Databases", "2017-12-01"), - new Tuple("DBForMySQL", "FirewallRules", "2017-12-01"), - new Tuple("DBForMySQL", "LocationBasedPerformanceTier", "2017-12-01"), - new Tuple("DBForMySQL", "LogFiles", "2017-12-01"), - new Tuple("DBForMySQL", "Operations", "2017-12-01"), - new Tuple("DBForMySQL", "Replicas", "2017-12-01"), - new Tuple("DBForMySQL", "ServerAdministrators", "2017-12-01"), - new Tuple("DBForMySQL", "Servers", "2017-12-01"), - new Tuple("DBForMySQL", "VirtualNetworkRules", "2017-12-01"), new Tuple("DBforMySQL", "Advisors", "2018-06-01"), + new Tuple("DBforMySQL", "CheckNameAvailability", "2017-12-01"), + new Tuple("DBforMySQL", "Configurations", "2017-12-01"), new Tuple("DBforMySQL", "CreateRecommendedActionSession", "2018-06-01"), + new Tuple("DBforMySQL", "Databases", "2017-12-01"), + new Tuple("DBforMySQL", "FirewallRules", "2017-12-01"), + new Tuple("DBforMySQL", "LocationBasedPerformanceTier", "2017-12-01"), new Tuple("DBforMySQL", "LocationBasedRecommendedActionSessionsOperationStatus", "2018-06-01"), new Tuple("DBforMySQL", "LocationBasedRecommendedActionSessionsResult", "2018-06-01"), + new Tuple("DBforMySQL", "LogFiles", "2017-12-01"), + new Tuple("DBforMySQL", "Operations", "2017-12-01"), new Tuple("DBforMySQL", "PrivateEndpointConnections", "2018-06-01"), new Tuple("DBforMySQL", "PrivateLinkResources", "2018-06-01"), new Tuple("DBforMySQL", "QueryTexts", "2018-06-01"), new Tuple("DBforMySQL", "RecommendedActions", "2018-06-01"), + new Tuple("DBforMySQL", "RecoverableServers", "2017-12-01"), + new Tuple("DBforMySQL", "Replicas", "2017-12-01"), + new Tuple("DBforMySQL", "ResetQueryPerformanceInsightData", "2018-06-01"), + new Tuple("DBforMySQL", "ServerAdministrators", "2017-12-01"), + new Tuple("DBforMySQL", "ServerBasedPerformanceTier", "2017-12-01"), new Tuple("DBforMySQL", "ServerKeys", "2020-01-01"), + new Tuple("DBforMySQL", "ServerParameters", "2017-12-01"), new Tuple("DBforMySQL", "ServerSecurityAlertPolicies", "2017-12-01"), + new Tuple("DBforMySQL", "Servers", "2017-12-01"), new Tuple("DBforMySQL", "Servers", "2020-01-01"), new Tuple("DBforMySQL", "TopQueryStatistics", "2018-06-01"), + new Tuple("DBforMySQL", "VirtualNetworkRules", "2017-12-01"), new Tuple("DBforMySQL", "WaitStatistics", "2018-06-01"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "v2"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4413"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/mysql/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp.output-folder=C:\\z\\azure-sdk-for-net\\sdk\\mysql\\Microsoft.Azure.Management.MySQL\\src\\mysql\\Generated"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "faf8e1c19e3b36e6d16622bf168369a838b04a7f"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ServerAdministratorsOperations.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ServerAdministratorsOperations.cs index 6fbec3ecd3a4..fa315967db86 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ServerAdministratorsOperations.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ServerAdministratorsOperations.cs @@ -107,10 +107,6 @@ internal ServerAdministratorsOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -132,7 +128,7 @@ internal ServerAdministratorsOperations(MySQLManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMySQL/servers/{serverName}/Administrators/activeDirectory").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/administrators/activeDirectory").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); @@ -372,10 +368,6 @@ internal ServerAdministratorsOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -397,7 +389,7 @@ internal ServerAdministratorsOperations(MySQLManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMySQL/servers/{serverName}/administrators").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/administrators").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); @@ -593,10 +585,6 @@ internal ServerAdministratorsOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -627,7 +615,7 @@ internal ServerAdministratorsOperations(MySQLManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMySQL/servers/{serverName}/Administrators/activeDirectory").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/administrators/activeDirectory").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); @@ -839,10 +827,6 @@ internal ServerAdministratorsOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -864,7 +848,7 @@ internal ServerAdministratorsOperations(MySQLManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMySQL/servers/{serverName}/Administrators/activeDirectory").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/administrators/activeDirectory").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ServerBasedPerformanceTierOperations.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ServerBasedPerformanceTierOperations.cs new file mode 100644 index 000000000000..aa488a3810f5 --- /dev/null +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ServerBasedPerformanceTierOperations.cs @@ -0,0 +1,266 @@ +// +// 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.MySQL +{ + 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; + + /// + /// ServerBasedPerformanceTierOperations operations. + /// + internal partial class ServerBasedPerformanceTierOperations : IServiceOperations, IServerBasedPerformanceTierOperations + { + /// + /// Initializes a new instance of the ServerBasedPerformanceTierOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ServerBasedPerformanceTierOperations(MySQLManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the MySQLManagementClient + /// + public MySQLManagementClient Client { get; private set; } + + /// + /// List all the performance tiers for a MySQL server. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the server. + /// + /// + /// 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>> ListWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + string apiVersion = "2017-12-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serverName", serverName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", 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.DBforMySQL/servers/{serverName}/performanceTiers").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + 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; + } + + } +} diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ServerBasedPerformanceTierOperationsExtensions.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ServerBasedPerformanceTierOperationsExtensions.cs new file mode 100644 index 000000000000..efa69d5ba44b --- /dev/null +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ServerBasedPerformanceTierOperationsExtensions.cs @@ -0,0 +1,67 @@ +// +// 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.MySQL +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ServerBasedPerformanceTierOperations. + /// + public static partial class ServerBasedPerformanceTierOperationsExtensions + { + /// + /// List all the performance tiers for a MySQL server. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the server. + /// + public static IEnumerable List(this IServerBasedPerformanceTierOperations operations, string resourceGroupName, string serverName) + { + return operations.ListAsync(resourceGroupName, serverName).GetAwaiter().GetResult(); + } + + /// + /// List all the performance tiers for a MySQL server. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the server. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IServerBasedPerformanceTierOperations operations, string resourceGroupName, string serverName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, serverName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ServerKeysOperations.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ServerKeysOperations.cs index b498936a5e1e..e96654ada422 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ServerKeysOperations.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ServerKeysOperations.cs @@ -107,10 +107,6 @@ internal ServerKeysOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -315,10 +311,6 @@ internal ServerKeysOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -619,10 +611,6 @@ internal ServerKeysOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } string apiVersion = "2020-01-01"; // Tracing @@ -866,10 +854,6 @@ internal ServerKeysOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } string apiVersion = "2020-01-01"; // Tracing diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ServerParametersOperations.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ServerParametersOperations.cs new file mode 100644 index 000000000000..343c0fd1a3a1 --- /dev/null +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ServerParametersOperations.cs @@ -0,0 +1,305 @@ +// +// 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.MySQL +{ + 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; + + /// + /// ServerParametersOperations operations. + /// + internal partial class ServerParametersOperations : IServiceOperations, IServerParametersOperations + { + /// + /// Initializes a new instance of the ServerParametersOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ServerParametersOperations(MySQLManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the MySQLManagementClient + /// + public MySQLManagementClient Client { get; private set; } + + /// + /// Update a list of configurations in a given server. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the server. + /// + /// + /// The parameters for updating a list of server configuration. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> ListUpdateConfigurationsWithHttpMessagesAsync(string resourceGroupName, string serverName, ConfigurationListResult value, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginListUpdateConfigurationsWithHttpMessagesAsync(resourceGroupName, serverName, value, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Update a list of configurations in a given server. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the server. + /// + /// + /// The parameters for updating a list of server configuration. + /// + /// + /// 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> BeginListUpdateConfigurationsWithHttpMessagesAsync(string resourceGroupName, string serverName, ConfigurationListResult value, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + if (value == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "value"); + } + string apiVersion = "2017-12-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serverName", serverName); + tracingParameters.Add("value", value); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginListUpdateConfigurations", 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.DBforMySQL/servers/{serverName}/updateConfigurations").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + 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("POST"); + _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; + if(value != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(value, 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) + { + 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 && (int)_statusCode != 202) + { + 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/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ServerParametersOperationsExtensions.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ServerParametersOperationsExtensions.cs new file mode 100644 index 000000000000..ed15237ba9a3 --- /dev/null +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ServerParametersOperationsExtensions.cs @@ -0,0 +1,117 @@ +// +// 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.MySQL +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ServerParametersOperations. + /// + public static partial class ServerParametersOperationsExtensions + { + /// + /// Update a list of configurations in a given server. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the server. + /// + /// + /// The parameters for updating a list of server configuration. + /// + public static ConfigurationListResult ListUpdateConfigurations(this IServerParametersOperations operations, string resourceGroupName, string serverName, ConfigurationListResult value) + { + return operations.ListUpdateConfigurationsAsync(resourceGroupName, serverName, value).GetAwaiter().GetResult(); + } + + /// + /// Update a list of configurations in a given server. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the server. + /// + /// + /// The parameters for updating a list of server configuration. + /// + /// + /// The cancellation token. + /// + public static async Task ListUpdateConfigurationsAsync(this IServerParametersOperations operations, string resourceGroupName, string serverName, ConfigurationListResult value, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListUpdateConfigurationsWithHttpMessagesAsync(resourceGroupName, serverName, value, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update a list of configurations in a given server. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the server. + /// + /// + /// The parameters for updating a list of server configuration. + /// + public static ConfigurationListResult BeginListUpdateConfigurations(this IServerParametersOperations operations, string resourceGroupName, string serverName, ConfigurationListResult value) + { + return operations.BeginListUpdateConfigurationsAsync(resourceGroupName, serverName, value).GetAwaiter().GetResult(); + } + + /// + /// Update a list of configurations in a given server. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the server. + /// + /// + /// The parameters for updating a list of server configuration. + /// + /// + /// The cancellation token. + /// + public static async Task BeginListUpdateConfigurationsAsync(this IServerParametersOperations operations, string resourceGroupName, string serverName, ConfigurationListResult value, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginListUpdateConfigurationsWithHttpMessagesAsync(resourceGroupName, serverName, value, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ServerSecurityAlertPoliciesOperations.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ServerSecurityAlertPoliciesOperations.cs index e4d3b5c34fb5..d320a77aee23 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ServerSecurityAlertPoliciesOperations.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ServerSecurityAlertPoliciesOperations.cs @@ -96,10 +96,6 @@ internal ServerSecurityAlertPoliciesOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -294,6 +290,218 @@ internal ServerSecurityAlertPoliciesOperations(MySQLManagementClient client) return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } + /// + /// Get the server's threat detection policies. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the server. + /// + /// + /// 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>> ListByServerWithHttpMessagesAsync(string resourceGroupName, string serverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (serverName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serverName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2017-12-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serverName", serverName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + 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.DBforMySQL/servers/{serverName}/securityAlertPolicies").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); + _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; + } + /// /// Creates or updates a threat detection policy. /// @@ -343,10 +551,6 @@ internal ServerSecurityAlertPoliciesOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -531,5 +735,178 @@ internal ServerSecurityAlertPoliciesOperations(MySQLManagementClient client) return _result; } + /// + /// Get the server's threat detection policies. + /// + /// + /// 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>> ListByServerNextWithHttpMessagesAsync(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, "ListByServerNext", 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/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ServerSecurityAlertPoliciesOperationsExtensions.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ServerSecurityAlertPoliciesOperationsExtensions.cs index 77642e865d84..5540e344ef61 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ServerSecurityAlertPoliciesOperationsExtensions.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ServerSecurityAlertPoliciesOperationsExtensions.cs @@ -107,6 +107,46 @@ public static ServerSecurityAlertPolicy CreateOrUpdate(this IServerSecurityAlert } } + /// + /// Get the server's threat detection policies. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the server. + /// + public static IPage ListByServer(this IServerSecurityAlertPoliciesOperations operations, string resourceGroupName, string serverName) + { + return operations.ListByServerAsync(resourceGroupName, serverName).GetAwaiter().GetResult(); + } + + /// + /// Get the server's threat detection policies. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the server. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByServerAsync(this IServerSecurityAlertPoliciesOperations operations, string resourceGroupName, string serverName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByServerWithHttpMessagesAsync(resourceGroupName, serverName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Creates or updates a threat detection policy. /// @@ -153,5 +193,39 @@ public static ServerSecurityAlertPolicy BeginCreateOrUpdate(this IServerSecurity } } + /// + /// Get the server's threat detection policies. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByServerNext(this IServerSecurityAlertPoliciesOperations operations, string nextPageLink) + { + return operations.ListByServerNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Get the server's threat detection policies. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByServerNextAsync(this IServerSecurityAlertPoliciesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByServerNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } } diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ServersOperations.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ServersOperations.cs index a47deb8b17bd..24c95981cdd4 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ServersOperations.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/ServersOperations.cs @@ -181,10 +181,6 @@ internal ServersOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -206,7 +202,7 @@ internal ServersOperations(MySQLManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMySQL/servers/{serverName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); @@ -394,10 +390,6 @@ internal ServersOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } string apiVersion = "2017-12-01"; // Tracing @@ -414,7 +406,7 @@ internal ServersOperations(MySQLManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMySQL/servers").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); List _queryParameters = new List(); @@ -598,7 +590,7 @@ internal ServersOperations(MySQLManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DBForMySQL/servers").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/servers").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -882,10 +874,6 @@ internal ServersOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -916,7 +904,7 @@ internal ServersOperations(MySQLManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMySQL/servers/{serverName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); @@ -1135,10 +1123,6 @@ internal ServersOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -1165,7 +1149,7 @@ internal ServersOperations(MySQLManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMySQL/servers/{serverName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); @@ -1359,10 +1343,6 @@ internal ServersOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -1384,7 +1364,7 @@ internal ServersOperations(MySQLManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMySQL/servers/{serverName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); @@ -1554,10 +1534,6 @@ internal ServersOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -1579,7 +1555,7 @@ internal ServersOperations(MySQLManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMySQL/servers/{serverName}/restart").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/restart").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); @@ -1749,10 +1725,6 @@ internal ServersOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -1944,10 +1916,6 @@ internal ServersOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -2142,10 +2110,6 @@ internal ServersOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/TopQueryStatisticsOperations.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/TopQueryStatisticsOperations.cs index 70cae5fd40ac..f073dc5415ac 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/TopQueryStatisticsOperations.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/TopQueryStatisticsOperations.cs @@ -110,10 +110,6 @@ internal TopQueryStatisticsOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -335,10 +331,6 @@ internal TopQueryStatisticsOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/VirtualNetworkRulesOperations.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/VirtualNetworkRulesOperations.cs index 4462ef6d6f1f..be5c63567d1e 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/VirtualNetworkRulesOperations.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/VirtualNetworkRulesOperations.cs @@ -99,10 +99,6 @@ internal VirtualNetworkRulesOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -140,7 +136,7 @@ internal VirtualNetworkRulesOperations(MySQLManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMySQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -374,10 +370,6 @@ internal VirtualNetworkRulesOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -410,7 +402,7 @@ internal VirtualNetworkRulesOperations(MySQLManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMySQL/servers/{serverName}/virtualNetworkRules").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/virtualNetworkRules").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -596,10 +588,6 @@ internal VirtualNetworkRulesOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -646,7 +634,7 @@ internal VirtualNetworkRulesOperations(MySQLManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMySQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -851,10 +839,6 @@ internal VirtualNetworkRulesOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -892,7 +876,7 @@ internal VirtualNetworkRulesOperations(MySQLManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMySQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serverName}", System.Uri.EscapeDataString(serverName)); _url = _url.Replace("{virtualNetworkRuleName}", System.Uri.EscapeDataString(virtualNetworkRuleName)); diff --git a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/WaitStatisticsOperations.cs b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/WaitStatisticsOperations.cs index ddef3573901f..9518fa989777 100644 --- a/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/WaitStatisticsOperations.cs +++ b/sdk/mysql/Microsoft.Azure.Management.MySQL/src/mysql/Generated/WaitStatisticsOperations.cs @@ -110,10 +110,6 @@ internal WaitStatisticsOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) { @@ -335,10 +331,6 @@ internal WaitStatisticsOperations(MySQLManagementClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } } if (serverName == null) {