diff --git a/eng/mgmt/mgmtmetadata/postgresql_resource-manager.txt b/eng/mgmt/mgmtmetadata/postgresql_resource-manager.txt index bba31215fef06..b7511066c88a0 100644 --- a/eng/mgmt/mgmtmetadata/postgresql_resource-manager.txt +++ b/eng/mgmt/mgmtmetadata/postgresql_resource-manager.txt @@ -1,15 +1,30 @@ -Installing AutoRest version: v2 +Installing AutoRest version: v2 +AutoRest installed successfully. +Commencing code generation +Generating CSharp code +Executing AutoRest command +cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/postgresql/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp.namespace=Microsoft.Azure.Management.PostgreSQL --tag=package-2020-01-01 --csharp.output-folder=C:\Users\daeunyim\work\SDK\azure-sdk-for-net\sdk\postgresql\Microsoft.Azure.Management.PostgreSQL\src\postgresql\Generated +Autorest CSharp Version: 2.3.82 +2021-10-06 17:11:42 UTC +Azure-rest-api-specs repository information +GitHub fork: Azure +Branch: master +Commit: 282f8b747c0f9193b6bc847a6284f56f70f829b7 +AutoRest information +Requested version: v2 +Bootstrapper version: autorest@2.0.4413 +Installing AutoRest version: v2 AutoRest installed successfully. Commencing code generation Generating CSharp code Executing AutoRest command cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/postgresql/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp.namespace=Microsoft.Azure.Management.PostgreSQL.FlexibleServers --tag=package-flexibleserver-2021-06 --csharp.output-folder=C:\Users\daeunyim\work\SDK\azure-sdk-for-net\sdk\postgresql\Microsoft.Azure.Management.PostgreSQL\src\postgresqlflexibleservers\Generated Autorest CSharp Version: 2.3.82 -2021-07-19 14:46:49 UTC +2021-10-06 17:14:43 UTC Azure-rest-api-specs repository information GitHub fork: Azure Branch: master -Commit: e7682aa897902920f3a95b2f358b6f7729d18666 +Commit: 282f8b747c0f9193b6bc847a6284f56f70f829b7 AutoRest information Requested version: v2 Bootstrapper version: autorest@2.0.4413 diff --git a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/Microsoft.Azure.Management.PostgreSQL.csproj b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/Microsoft.Azure.Management.PostgreSQL.csproj index cded00d510b81..0199b5848709b 100644 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/Microsoft.Azure.Management.PostgreSQL.csproj +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/Microsoft.Azure.Management.PostgreSQL.csproj @@ -6,13 +6,13 @@ Microsoft.Azure.Management.PostgreSQL Provides developers with libraries for the Azure Database for PostgreSQL under Azure Resource manager to deploy an instance of PostgreSQL. Create, Update, Delete, Restore, and more. - 1.0.0 + 2.0.0 Microsoft.Azure.Management.PostgreSQL PostgreSQL;Azure Database for PostgreSQL; diff --git a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/Properties/AssemblyInfo.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/Properties/AssemblyInfo.cs index 01dab27b08fe7..58d2d59cef31c 100644 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/Properties/AssemblyInfo.cs +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/Properties/AssemblyInfo.cs @@ -7,8 +7,8 @@ [assembly: AssemblyTitle("Microsoft Azure Database for PostgreSQL Management Library")] [assembly: AssemblyDescription("Provides management functionality for Microsoft Azure Database for PostgreSQL Resources.")] -[assembly: AssemblyVersion("1.0.0")] -[assembly: AssemblyFileVersion("1.0.0")] +[assembly: AssemblyVersion("2.0.0")] +[assembly: AssemblyFileVersion("2.0.0")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("Microsoft Azure .NET SDK")] diff --git a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/generate.ps1 b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/generate.ps1 index c80c4a2cbd541..85233bc639258 100644 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/generate.ps1 +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/generate.ps1 @@ -1,2 +1,2 @@ -Start-AutoRestCodeGeneration -ResourceProvider "postgresql/resource-manager" -AutoRestVersion "v2" -SdkGenerationDirectory "$PSScriptRoot\postgresql\Generated" -Start-AutoRestCodeGeneration -ResourceProvider "postgresql/resource-manager" -AutoRestVersion "v2" -SdkGenerationDirectory "$PSScriptRoot\postgresqlflexibleservers\Generated" -ConfigFileTag "package-flexibleserver-2021-06" -Namespace "Microsoft.Azure.Management.PostgreSQL.FlexibleServers" +Start-AutoRestCodeGeneration -ResourceProvider "postgresql/resource-manager" -AutoRestVersion "v2" -SdkGenerationDirectory "$PSScriptRoot\postgresql\Generated" -ConfigFileTag "package-2020-01-01" -Namespace "Microsoft.Azure.Management.PostgreSQL" +Start-AutoRestCodeGeneration -ResourceProvider "postgresql/resource-manager" -AutoRestVersion "v2" -SdkGenerationDirectory "$PSScriptRoot\postgresqlflexibleservers\Generated" -ConfigFileTag "package-flexibleserver-2021-06" -Namespace "Microsoft.Azure.Management.PostgreSQL.FlexibleServers" -ClearMetadataLog $false diff --git a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/ConfigurationsOperations.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/ConfigurationsOperations.cs index 1b401fdab9de7..5c8946ceed2eb 100644 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/ConfigurationsOperations.cs +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/ConfigurationsOperations.cs @@ -138,10 +138,6 @@ internal ConfigurationsOperations(PostgreSQLManagementClient 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) { @@ -360,10 +356,6 @@ internal ConfigurationsOperations(PostgreSQLManagementClient 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) { @@ -582,10 +574,6 @@ internal ConfigurationsOperations(PostgreSQLManagementClient 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/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/DatabasesOperations.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/DatabasesOperations.cs index bcb7a698afef2..606e94b1dada5 100644 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/DatabasesOperations.cs +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/DatabasesOperations.cs @@ -163,10 +163,6 @@ internal DatabasesOperations(PostgreSQLManagementClient 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,10 +381,6 @@ internal DatabasesOperations(PostgreSQLManagementClient 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) { @@ -607,10 +599,6 @@ internal DatabasesOperations(PostgreSQLManagementClient 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 DatabasesOperations(PostgreSQLManagementClient 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/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/FirewallRulesOperations.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/FirewallRulesOperations.cs index ce3927fb56ccb..7ec5ffca66427 100644 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/FirewallRulesOperations.cs +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/FirewallRulesOperations.cs @@ -163,10 +163,6 @@ internal FirewallRulesOperations(PostgreSQLManagementClient 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,10 +381,6 @@ internal FirewallRulesOperations(PostgreSQLManagementClient 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) { @@ -607,10 +599,6 @@ internal FirewallRulesOperations(PostgreSQLManagementClient 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) { @@ -862,10 +850,6 @@ internal FirewallRulesOperations(PostgreSQLManagementClient 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/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/IPostgreSQLManagementClient.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/IPostgreSQLManagementClient.cs index 6735268b4da60..526051de4938d 100644 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/IPostgreSQLManagementClient.cs +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/IPostgreSQLManagementClient.cs @@ -97,6 +97,11 @@ public partial interface IPostgreSQLManagementClient : System.IDisposable /// IConfigurationsOperations Configurations { get; } + /// + /// Gets the IServerParametersOperations. + /// + IServerParametersOperations ServerParameters { get; } + /// /// Gets the ILogFilesOperations. /// @@ -107,6 +112,16 @@ public partial interface IPostgreSQLManagementClient : System.IDisposable /// IServerAdministratorsOperations ServerAdministrators { get; } + /// + /// Gets the IRecoverableServersOperations. + /// + IRecoverableServersOperations RecoverableServers { get; } + + /// + /// Gets the IServerBasedPerformanceTierOperations. + /// + IServerBasedPerformanceTierOperations ServerBasedPerformanceTier { get; } + /// /// Gets the ILocationBasedPerformanceTierOperations. /// diff --git a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/IRecoverableServersOperations.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/IRecoverableServersOperations.cs new file mode 100644 index 0000000000000..42a0e2eac11bb --- /dev/null +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/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.PostgreSQL +{ + 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 PostgreSQL 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/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/IServerBasedPerformanceTierOperations.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/IServerBasedPerformanceTierOperations.cs new file mode 100644 index 0000000000000..060629abab384 --- /dev/null +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/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.PostgreSQL +{ + 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 PostgreSQL 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/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/IServerParametersOperations.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/IServerParametersOperations.cs new file mode 100644 index 0000000000000..a9759fe184eec --- /dev/null +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/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.PostgreSQL +{ + 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/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/IServerSecurityAlertPoliciesOperations.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/IServerSecurityAlertPoliciesOperations.cs index cdfb5c56c6a9d..18a6440b5fdff 100644 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/IServerSecurityAlertPoliciesOperations.cs +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/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/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/LogFilesOperations.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/LogFilesOperations.cs index 04d3d37f49d24..409ec8d7de2ff 100644 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/LogFilesOperations.cs +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/LogFilesOperations.cs @@ -107,10 +107,6 @@ internal LogFilesOperations(PostgreSQLManagementClient 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/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/AzureEntityResource.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/AzureEntityResource.cs index f2a5a62dd650d..1abb92f3a9313 100644 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/AzureEntityResource.cs +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/AzureEntityResource.cs @@ -14,9 +14,12 @@ namespace Microsoft.Azure.Management.PostgreSQL.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/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/Configuration.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/Configuration.cs index e41b79330b4b9..c468b1d222c75 100644 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/Configuration.cs +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/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/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/ConfigurationListResult.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/ConfigurationListResult.cs new file mode 100644 index 0000000000000..015b9a704a65c --- /dev/null +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/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.PostgreSQL.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/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/Database.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/Database.cs index b27e69c298d5a..29ed4ab141757 100644 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/Database.cs +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/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/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/ErrorResponse.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/ErrorResponse.cs index 83a64fe687016..ce53d2e316bef 100644 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/ErrorResponse.cs +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/ErrorResponse.cs @@ -16,8 +16,13 @@ namespace Microsoft.Azure.Management.PostgreSQL.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/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/FirewallRule.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/FirewallRule.cs index 5603a81676a6c..df18ce43ac4f8 100644 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/FirewallRule.cs +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/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/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/LogFile.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/LogFile.cs index f2d928126710c..47114f314d240 100644 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/LogFile.cs +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/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/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/PerformanceTierProperties.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/PerformanceTierProperties.cs index 586af94324194..4922308c84edb 100644 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/PerformanceTierProperties.cs +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/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/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/PrivateEndpointConnection.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/PrivateEndpointConnection.cs index d0f5e74f37c6b..91734dcd678a2 100644 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/PrivateEndpointConnection.cs +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/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/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/PrivateLinkResource.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/PrivateLinkResource.cs index d6071c15d6c7e..c50db606c02d6 100644 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/PrivateLinkResource.cs +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/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/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/ProxyResource.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/ProxyResource.cs index 2218086919479..11683104e8444 100644 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/ProxyResource.cs +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/ProxyResource.cs @@ -13,9 +13,12 @@ namespace Microsoft.Azure.Management.PostgreSQL.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/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/RecoverableServerResource.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/RecoverableServerResource.cs new file mode 100644 index 0000000000000..22adf3bdb7ca0 --- /dev/null +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/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.PostgreSQL.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 PostgreSQL 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 PostgreSQL version + /// + [JsonProperty(PropertyName = "properties.version")] + public string Version { get; private set; } + + } +} diff --git a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/Resource.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/Resource.cs index 00ee8d855eb5e..cbfe68d847726 100644 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/Resource.cs +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/Resource.cs @@ -15,6 +15,13 @@ namespace Microsoft.Azure.Management.PostgreSQL.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/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/Server.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/Server.cs index 5cb4f611fe041..05cc009e2c9c2 100644 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/Server.cs +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/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/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/ServerAdministratorResource.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/ServerAdministratorResource.cs index c410cd4202dbc..30a0fe9f31de4 100644 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/ServerAdministratorResource.cs +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/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/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/ServerKey.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/ServerKey.cs index 113635eb5fd6a..4353d11aa4fcf 100644 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/ServerKey.cs +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/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/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/ServerSecurityAlertPolicy.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/ServerSecurityAlertPolicy.cs index 06b616df3135d..574fa927abf1f 100644 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/ServerSecurityAlertPolicy.cs +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/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/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/TrackedResource.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/TrackedResource.cs index f76bdf2825eca..82b1d40a79f5c 100644 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/TrackedResource.cs +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/TrackedResource.cs @@ -17,8 +17,12 @@ namespace Microsoft.Azure.Management.PostgreSQL.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/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/VirtualNetworkRule.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/VirtualNetworkRule.cs index cffba1a1967da..bdc2c3ab1546d 100644 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/Models/VirtualNetworkRule.cs +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/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/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/PostgreSQLManagementClient.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/PostgreSQLManagementClient.cs index 0c38d863f8a79..36237ed3a614b 100644 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/PostgreSQLManagementClient.cs +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/PostgreSQLManagementClient.cs @@ -102,6 +102,11 @@ public partial class PostgreSQLManagementClient : ServiceClient public virtual IConfigurationsOperations Configurations { get; private set; } + /// + /// Gets the IServerParametersOperations. + /// + public virtual IServerParametersOperations ServerParameters { get; private set; } + /// /// Gets the ILogFilesOperations. /// @@ -112,6 +117,16 @@ public partial class PostgreSQLManagementClient : 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. /// @@ -394,8 +409,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); diff --git a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/PrivateEndpointConnectionsOperations.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/PrivateEndpointConnectionsOperations.cs index ce6bec612f892..99a8a81631aa7 100644 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/PrivateEndpointConnectionsOperations.cs +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/PrivateEndpointConnectionsOperations.cs @@ -99,10 +99,6 @@ internal PrivateEndpointConnectionsOperations(PostgreSQLManagementClient 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(PostgreSQLManagementClient 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(PostgreSQLManagementClient 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(PostgreSQLManagementClient 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(PostgreSQLManagementClient 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/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/PrivateLinkResourcesOperations.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/PrivateLinkResourcesOperations.cs index 39f329b8db20b..d55ebcf4ded86 100644 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/PrivateLinkResourcesOperations.cs +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/PrivateLinkResourcesOperations.cs @@ -96,10 +96,6 @@ internal PrivateLinkResourcesOperations(PostgreSQLManagementClient 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(PostgreSQLManagementClient 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/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/RecoverableServersOperations.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/RecoverableServersOperations.cs new file mode 100644 index 0000000000000..e606296c31d71 --- /dev/null +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/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.PostgreSQL +{ + 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(PostgreSQLManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the PostgreSQLManagementClient + /// + public PostgreSQLManagementClient Client { get; private set; } + + /// + /// Gets a recoverable PostgreSQL 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.DBforPostgreSQL/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/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/RecoverableServersOperationsExtensions.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/RecoverableServersOperationsExtensions.cs new file mode 100644 index 0000000000000..8ee64cd36d908 --- /dev/null +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/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.PostgreSQL +{ + 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 PostgreSQL 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 PostgreSQL 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/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/ReplicasOperations.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/ReplicasOperations.cs index f66dc6f04dfbf..39cad196439e6 100644 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/ReplicasOperations.cs +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/ReplicasOperations.cs @@ -107,10 +107,6 @@ internal ReplicasOperations(PostgreSQLManagementClient 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(PostgreSQLManagementClient 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.DBforPostgreSQL/servers/{serverName}/Replicas").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/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/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/SdkInfo_PostgreSQLManagementClient.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/SdkInfo_PostgreSQLManagementClient.cs index 19a89b9cc2f4a..d077e226927b7 100644 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/SdkInfo_PostgreSQLManagementClient.cs +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/SdkInfo_PostgreSQLManagementClient.cs @@ -26,27 +26,29 @@ public static IEnumerable> ApiInfo_PostgreSQLManag new Tuple("DBforPostgreSQL", "LocationBasedPerformanceTier", "2017-12-01"), new Tuple("DBforPostgreSQL", "LogFiles", "2017-12-01"), new Tuple("DBforPostgreSQL", "Operations", "2017-12-01"), - new Tuple("DBforPostgreSQL", "Replicas", "2017-12-01"), - new Tuple("DBforPostgreSQL", "ServerAdministrators", "2017-12-01"), - new Tuple("DBforPostgreSQL", "Servers", "2017-12-01"), - new Tuple("DBforPostgreSQL", "VirtualNetworkRules", "2017-12-01"), new Tuple("DBforPostgreSQL", "PrivateEndpointConnections", "2018-06-01"), new Tuple("DBforPostgreSQL", "PrivateLinkResources", "2018-06-01"), + new Tuple("DBforPostgreSQL", "RecoverableServers", "2017-12-01"), + new Tuple("DBforPostgreSQL", "Replicas", "2017-12-01"), + new Tuple("DBforPostgreSQL", "ServerAdministrators", "2017-12-01"), + new Tuple("DBforPostgreSQL", "ServerBasedPerformanceTier", "2017-12-01"), new Tuple("DBforPostgreSQL", "ServerKeys", "2020-01-01"), + new Tuple("DBforPostgreSQL", "ServerParameters", "2017-12-01"), new Tuple("DBforPostgreSQL", "ServerSecurityAlertPolicies", "2017-12-01"), + new Tuple("DBforPostgreSQL", "Servers", "2017-12-01"), + new Tuple("DBforPostgreSQL", "VirtualNetworkRules", "2017-12-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/postgresql/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp.output-folder=C:\\z\\azure-sdk-for-net\\sdk\\postgresql\\Microsoft.Azure.Management.PostgreSQL\\src\\postgresql\\Generated"; + public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/postgresql/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp.namespace=Microsoft.Azure.Management.PostgreSQL.FlexibleServers --tag=package-flexibleserver-2021-06 --csharp.output-folder=C:\\Users\\daeunyim\\work\\SDK\\azure-sdk-for-net\\sdk\\postgresql\\Microsoft.Azure.Management.PostgreSQL\\src\\postgresqlflexibleservers\\Generated"; public static readonly String GithubForkName = "Azure"; public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "faf8e1c19e3b36e6d16622bf168369a838b04a7f"; + public static readonly String GithubCommidId = "282f8b747c0f9193b6bc847a6284f56f70f829b7"; public static readonly String CodeGenerationErrors = ""; public static readonly String GithubRepoName = "azure-rest-api-specs"; // END: Code Generation Metadata Section } } - diff --git a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/ServerAdministratorsOperations.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/ServerAdministratorsOperations.cs index 9a9a3009c54c4..f67bc399e6aee 100644 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/ServerAdministratorsOperations.cs +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/ServerAdministratorsOperations.cs @@ -107,10 +107,6 @@ internal ServerAdministratorsOperations(PostgreSQLManagementClient 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(PostgreSQLManagementClient 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.DBforPostgreSQL/servers/{serverName}/Administrators/activeDirectory").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/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(PostgreSQLManagementClient 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) { @@ -593,10 +585,6 @@ internal ServerAdministratorsOperations(PostgreSQLManagementClient 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(PostgreSQLManagementClient 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.DBforPostgreSQL/servers/{serverName}/Administrators/activeDirectory").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/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(PostgreSQLManagementClient 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(PostgreSQLManagementClient 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.DBforPostgreSQL/servers/{serverName}/Administrators/activeDirectory").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/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/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/ServerBasedPerformanceTierOperations.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/ServerBasedPerformanceTierOperations.cs new file mode 100644 index 0000000000000..39c2abc328dd4 --- /dev/null +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/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.PostgreSQL +{ + 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(PostgreSQLManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the PostgreSQLManagementClient + /// + public PostgreSQLManagementClient Client { get; private set; } + + /// + /// List all the performance tiers for a PostgreSQL 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.DBforPostgreSQL/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/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/ServerBasedPerformanceTierOperationsExtensions.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/ServerBasedPerformanceTierOperationsExtensions.cs new file mode 100644 index 0000000000000..3f0085f06408e --- /dev/null +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/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.PostgreSQL +{ + 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 PostgreSQL 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 PostgreSQL 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/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/ServerKeysOperations.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/ServerKeysOperations.cs index c47ec054c22e5..6f146be24ce51 100644 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/ServerKeysOperations.cs +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/ServerKeysOperations.cs @@ -107,10 +107,6 @@ internal ServerKeysOperations(PostgreSQLManagementClient 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(PostgreSQLManagementClient 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) { @@ -621,10 +613,6 @@ internal ServerKeysOperations(PostgreSQLManagementClient 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 @@ -868,10 +856,6 @@ internal ServerKeysOperations(PostgreSQLManagementClient 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/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/ServerParametersOperations.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/ServerParametersOperations.cs new file mode 100644 index 0000000000000..07e6e6067d216 --- /dev/null +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/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.PostgreSQL +{ + 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(PostgreSQLManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the PostgreSQLManagementClient + /// + public PostgreSQLManagementClient 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.DBforPostgreSQL/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/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/ServerParametersOperationsExtensions.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/ServerParametersOperationsExtensions.cs new file mode 100644 index 0000000000000..dea467e36bb7e --- /dev/null +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/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.PostgreSQL +{ + 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/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/ServerSecurityAlertPoliciesOperations.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/ServerSecurityAlertPoliciesOperations.cs index 37e18c157e871..492728588988d 100644 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/ServerSecurityAlertPoliciesOperations.cs +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/ServerSecurityAlertPoliciesOperations.cs @@ -96,10 +96,6 @@ internal ServerSecurityAlertPoliciesOperations(PostgreSQLManagementClient 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(PostgreSQLManagementClient 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.DBforPostgreSQL/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(PostgreSQLManagementClient 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(PostgreSQLManagementClient 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/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/ServerSecurityAlertPoliciesOperationsExtensions.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/ServerSecurityAlertPoliciesOperationsExtensions.cs index fa076ed76475f..6d65f1d60a8cc 100644 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/ServerSecurityAlertPoliciesOperationsExtensions.cs +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/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/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/ServersOperations.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/ServersOperations.cs index 90a4cf4fafbd3..6e03f3ed0c03c 100644 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/ServersOperations.cs +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/ServersOperations.cs @@ -180,10 +180,6 @@ internal ServersOperations(PostgreSQLManagementClient 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) { @@ -393,10 +389,6 @@ internal ServersOperations(PostgreSQLManagementClient 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 @@ -811,10 +803,6 @@ internal ServersOperations(PostgreSQLManagementClient 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) { @@ -1064,10 +1052,6 @@ internal ServersOperations(PostgreSQLManagementClient 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) { @@ -1288,10 +1272,6 @@ internal ServersOperations(PostgreSQLManagementClient 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) { @@ -1483,10 +1463,6 @@ internal ServersOperations(PostgreSQLManagementClient 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/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/VirtualNetworkRulesOperations.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/VirtualNetworkRulesOperations.cs index 7d9b7d9d06a95..7148743d2911e 100644 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/VirtualNetworkRulesOperations.cs +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresql/Generated/VirtualNetworkRulesOperations.cs @@ -99,10 +99,6 @@ internal VirtualNetworkRulesOperations(PostgreSQLManagementClient 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) { @@ -374,10 +370,6 @@ internal VirtualNetworkRulesOperations(PostgreSQLManagementClient 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) { @@ -596,10 +588,6 @@ internal VirtualNetworkRulesOperations(PostgreSQLManagementClient 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) { @@ -851,10 +839,6 @@ internal VirtualNetworkRulesOperations(PostgreSQLManagementClient 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/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresqlflexibleservers/Generated/Models/FailoverMode.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresqlflexibleservers/Generated/Models/FailoverMode.cs new file mode 100644 index 0000000000000..dfc928b5de226 --- /dev/null +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresqlflexibleservers/Generated/Models/FailoverMode.cs @@ -0,0 +1,24 @@ +// +// 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.PostgreSQL.FlexibleServers.Models +{ + + /// + /// Defines values for FailoverMode. + /// + public static class FailoverMode + { + public const string PlannedFailover = "PlannedFailover"; + public const string ForcedFailover = "ForcedFailover"; + public const string PlannedSwitchover = "PlannedSwitchover"; + public const string ForcedSwitchover = "ForcedSwitchover"; + } +} diff --git a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresqlflexibleservers/Generated/Models/Identity.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresqlflexibleservers/Generated/Models/Identity.cs deleted file mode 100644 index 623fff21f1f4c..0000000000000 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresqlflexibleservers/Generated/Models/Identity.cs +++ /dev/null @@ -1,70 +0,0 @@ -// -// 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.PostgreSQL.FlexibleServers.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Identity for the resource. - /// - public partial class Identity - { - /// - /// Initializes a new instance of the Identity class. - /// - public Identity() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Identity class. - /// - /// The principal ID of resource - /// identity. - /// The tenant ID of resource. - /// The identity type. Possible values include: - /// 'SystemAssigned' - public Identity(string principalId = default(string), string tenantId = default(string), ResourceIdentityType? type = default(ResourceIdentityType?)) - { - PrincipalId = principalId; - TenantId = tenantId; - Type = type; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the principal ID of resource identity. - /// - [JsonProperty(PropertyName = "principalId")] - public string PrincipalId { get; private set; } - - /// - /// Gets the tenant ID of resource. - /// - [JsonProperty(PropertyName = "tenantId")] - public string TenantId { get; private set; } - - /// - /// Gets or sets the identity type. Possible values include: - /// 'SystemAssigned' - /// - [JsonProperty(PropertyName = "type")] - public ResourceIdentityType? Type { get; set; } - - } -} diff --git a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresqlflexibleservers/Generated/Models/Plan.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresqlflexibleservers/Generated/Models/Plan.cs deleted file mode 100644 index 59d857a94464f..0000000000000 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresqlflexibleservers/Generated/Models/Plan.cs +++ /dev/null @@ -1,116 +0,0 @@ -// -// 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.PostgreSQL.FlexibleServers.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Plan for the resource. - /// - public partial class Plan - { - /// - /// Initializes a new instance of the Plan class. - /// - public Plan() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Plan class. - /// - /// A user defined name of the 3rd Party Artifact - /// that is being procured. - /// The publisher of the 3rd Party Artifact - /// that is being bought. E.g. NewRelic - /// The 3rd Party artifact that is being - /// procured. E.g. NewRelic. Product maps to the OfferID specified for - /// the artifact at the time of Data Market onboarding. - /// A publisher provided promotion code as - /// provisioned in Data Market for the said product/artifact. - /// The version of the desired - /// product/artifact. - public Plan(string name, string publisher, string product, string promotionCode = default(string), string version = default(string)) - { - Name = name; - Publisher = publisher; - Product = product; - PromotionCode = promotionCode; - Version = version; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets a user defined name of the 3rd Party Artifact that is - /// being procured. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets the publisher of the 3rd Party Artifact that is being - /// bought. E.g. NewRelic - /// - [JsonProperty(PropertyName = "publisher")] - public string Publisher { get; set; } - - /// - /// Gets or sets the 3rd Party artifact that is being procured. E.g. - /// NewRelic. Product maps to the OfferID specified for the artifact at - /// the time of Data Market onboarding. - /// - [JsonProperty(PropertyName = "product")] - public string Product { get; set; } - - /// - /// Gets or sets a publisher provided promotion code as provisioned in - /// Data Market for the said product/artifact. - /// - [JsonProperty(PropertyName = "promotionCode")] - public string PromotionCode { get; set; } - - /// - /// Gets or sets the version of the desired product/artifact. - /// - [JsonProperty(PropertyName = "version")] - public string Version { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - if (Publisher == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Publisher"); - } - if (Product == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Product"); - } - } - } -} diff --git a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresqlflexibleservers/Generated/Models/ResourceIdentityType.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresqlflexibleservers/Generated/Models/ResourceIdentityType.cs deleted file mode 100644 index 761fd25b52eab..0000000000000 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresqlflexibleservers/Generated/Models/ResourceIdentityType.cs +++ /dev/null @@ -1,54 +0,0 @@ -// -// 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.PostgreSQL.FlexibleServers.Models -{ - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for ResourceIdentityType. - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum ResourceIdentityType - { - [EnumMember(Value = "SystemAssigned")] - SystemAssigned - } - internal static class ResourceIdentityTypeEnumExtension - { - internal static string ToSerializedValue(this ResourceIdentityType? value) - { - return value == null ? null : ((ResourceIdentityType)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this ResourceIdentityType value) - { - switch( value ) - { - case ResourceIdentityType.SystemAssigned: - return "SystemAssigned"; - } - return null; - } - - internal static ResourceIdentityType? ParseResourceIdentityType(this string value) - { - switch( value ) - { - case "SystemAssigned": - return ResourceIdentityType.SystemAssigned; - } - return null; - } - } -} diff --git a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresqlflexibleservers/Generated/Models/ResourceModelWithAllowedPropertySet.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresqlflexibleservers/Generated/Models/ResourceModelWithAllowedPropertySet.cs deleted file mode 100644 index ec7e2ea268630..0000000000000 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresqlflexibleservers/Generated/Models/ResourceModelWithAllowedPropertySet.cs +++ /dev/null @@ -1,190 +0,0 @@ -// -// 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.PostgreSQL.FlexibleServers.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The resource model definition containing the full set of allowed - /// properties for a resource. Except properties bag, there cannot be a top - /// level property outside of this set. - /// - public partial class ResourceModelWithAllowedPropertySet : IResource - { - /// - /// Initializes a new instance of the - /// ResourceModelWithAllowedPropertySet class. - /// - public ResourceModelWithAllowedPropertySet() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// ResourceModelWithAllowedPropertySet 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 geo-location where the resource - /// lives - /// The fully qualified resource ID of the - /// resource that manages this resource. Indicates if this resource is - /// managed by another Azure resource. If this is present, complete - /// mode deployment will not delete the resource if it is removed from - /// the template since it is managed by another resource. - /// Metadata used by portal/tooling/etc to render - /// different UX experiences for resources of the same type; e.g. - /// ApiApps are a kind of Microsoft.Web/sites type. If supported, the - /// resource provider must validate and persist this value. - /// The etag field is *not* required. If it is - /// provided in the response body, it must also be provided as a header - /// per the normal etag convention. Entity tags are used for comparing - /// two or more entities from the same requested resource. HTTP/1.1 - /// uses entity tags in the etag (section 14.19), If-Match (section - /// 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) - /// header fields. - /// Resource tags. - public ResourceModelWithAllowedPropertySet(string id = default(string), string name = default(string), string type = default(string), string location = default(string), string managedBy = default(string), string kind = default(string), string etag = default(string), IDictionary tags = default(IDictionary), ResourceModelWithAllowedPropertySetIdentity identity = default(ResourceModelWithAllowedPropertySetIdentity), ResourceModelWithAllowedPropertySetSku sku = default(ResourceModelWithAllowedPropertySetSku), ResourceModelWithAllowedPropertySetPlan plan = default(ResourceModelWithAllowedPropertySetPlan)) - { - Id = id; - Name = name; - Type = type; - Location = location; - ManagedBy = managedBy; - Kind = kind; - Etag = etag; - Tags = tags; - Identity = identity; - Sku = sku; - Plan = plan; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets fully qualified resource ID for the resource. Ex - - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } - - /// - /// Gets the name of the resource - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } - - /// - /// Gets the type of the resource. E.g. - /// "Microsoft.Compute/virtualMachines" or - /// "Microsoft.Storage/storageAccounts" - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - - /// - /// Gets or sets the geo-location where the resource lives - /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } - - /// - /// Gets or sets the fully qualified resource ID of the resource that - /// manages this resource. Indicates if this resource is managed by - /// another Azure resource. If this is present, complete mode - /// deployment will not delete the resource if it is removed from the - /// template since it is managed by another resource. - /// - [JsonProperty(PropertyName = "managedBy")] - public string ManagedBy { get; set; } - - /// - /// Gets or sets metadata used by portal/tooling/etc to render - /// different UX experiences for resources of the same type; e.g. - /// ApiApps are a kind of Microsoft.Web/sites type. If supported, the - /// resource provider must validate and persist this value. - /// - [JsonProperty(PropertyName = "kind")] - public string Kind { get; set; } - - /// - /// Gets the etag field is *not* required. If it is provided in the - /// response body, it must also be provided as a header per the normal - /// etag convention. Entity tags are used for comparing two or more - /// entities from the same requested resource. HTTP/1.1 uses entity - /// tags in the etag (section 14.19), If-Match (section 14.24), - /// If-None-Match (section 14.26), and If-Range (section 14.27) header - /// fields. - /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - - /// - /// Gets or sets resource tags. - /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - - /// - /// - [JsonProperty(PropertyName = "identity")] - public ResourceModelWithAllowedPropertySetIdentity Identity { get; set; } - - /// - /// - [JsonProperty(PropertyName = "sku")] - public ResourceModelWithAllowedPropertySetSku Sku { get; set; } - - /// - /// - [JsonProperty(PropertyName = "plan")] - public ResourceModelWithAllowedPropertySetPlan Plan { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Kind != null) - { - if (!System.Text.RegularExpressions.Regex.IsMatch(Kind, "^[-\\w\\._,\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "Kind", "^[-\\w\\._,\\(\\)]+$"); - } - } - if (Sku != null) - { - Sku.Validate(); - } - if (Plan != null) - { - Plan.Validate(); - } - } - } -} diff --git a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresqlflexibleservers/Generated/Models/ResourceModelWithAllowedPropertySetIdentity.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresqlflexibleservers/Generated/Models/ResourceModelWithAllowedPropertySetIdentity.cs deleted file mode 100644 index 838af20c1b52b..0000000000000 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresqlflexibleservers/Generated/Models/ResourceModelWithAllowedPropertySetIdentity.cs +++ /dev/null @@ -1,47 +0,0 @@ -// -// 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.PostgreSQL.FlexibleServers.Models -{ - using System.Linq; - - public partial class ResourceModelWithAllowedPropertySetIdentity : Identity - { - /// - /// Initializes a new instance of the - /// ResourceModelWithAllowedPropertySetIdentity class. - /// - public ResourceModelWithAllowedPropertySetIdentity() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// ResourceModelWithAllowedPropertySetIdentity class. - /// - /// The principal ID of resource - /// identity. - /// The tenant ID of resource. - /// The identity type. Possible values include: - /// 'SystemAssigned' - public ResourceModelWithAllowedPropertySetIdentity(string principalId = default(string), string tenantId = default(string), ResourceIdentityType? type = default(ResourceIdentityType?)) - : base(principalId, tenantId, type) - { - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - } -} diff --git a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresqlflexibleservers/Generated/Models/ResourceModelWithAllowedPropertySetPlan.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresqlflexibleservers/Generated/Models/ResourceModelWithAllowedPropertySetPlan.cs deleted file mode 100644 index 0fcea4ee366e6..0000000000000 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresqlflexibleservers/Generated/Models/ResourceModelWithAllowedPropertySetPlan.cs +++ /dev/null @@ -1,63 +0,0 @@ -// -// 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.PostgreSQL.FlexibleServers.Models -{ - using System.Linq; - - public partial class ResourceModelWithAllowedPropertySetPlan : Plan - { - /// - /// Initializes a new instance of the - /// ResourceModelWithAllowedPropertySetPlan class. - /// - public ResourceModelWithAllowedPropertySetPlan() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// ResourceModelWithAllowedPropertySetPlan class. - /// - /// A user defined name of the 3rd Party Artifact - /// that is being procured. - /// The publisher of the 3rd Party Artifact - /// that is being bought. E.g. NewRelic - /// The 3rd Party artifact that is being - /// procured. E.g. NewRelic. Product maps to the OfferID specified for - /// the artifact at the time of Data Market onboarding. - /// A publisher provided promotion code as - /// provisioned in Data Market for the said product/artifact. - /// The version of the desired - /// product/artifact. - public ResourceModelWithAllowedPropertySetPlan(string name, string publisher, string product, string promotionCode = default(string), string version = default(string)) - : base(name, publisher, product, promotionCode, version) - { - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - } - } -} diff --git a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresqlflexibleservers/Generated/Models/ResourceModelWithAllowedPropertySetSku.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresqlflexibleservers/Generated/Models/ResourceModelWithAllowedPropertySetSku.cs deleted file mode 100644 index 9b40bddbe98a0..0000000000000 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresqlflexibleservers/Generated/Models/ResourceModelWithAllowedPropertySetSku.cs +++ /dev/null @@ -1,57 +0,0 @@ -// -// 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.PostgreSQL.FlexibleServers.Models -{ - using System.Linq; - - public partial class ResourceModelWithAllowedPropertySetSku : Sku - { - /// - /// Initializes a new instance of the - /// ResourceModelWithAllowedPropertySetSku class. - /// - public ResourceModelWithAllowedPropertySetSku() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// ResourceModelWithAllowedPropertySetSku class. - /// - /// The name of the sku, typically, tier + family + - /// cores, e.g. Standard_D4s_v3. - /// The tier of the particular SKU, e.g. Burstable. - /// Possible values include: 'Burstable', 'GeneralPurpose', - /// 'MemoryOptimized' - public ResourceModelWithAllowedPropertySetSku(string name, string tier) - : base(name, tier) - { - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - } - } -} diff --git a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresqlflexibleservers/Generated/Models/RestartParameter.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresqlflexibleservers/Generated/Models/RestartParameter.cs index 809b848d7daad..f2adf2e906f39 100644 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresqlflexibleservers/Generated/Models/RestartParameter.cs +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresqlflexibleservers/Generated/Models/RestartParameter.cs @@ -31,7 +31,9 @@ public RestartParameter() /// /// Indicates whether to restart the /// server with failover. - /// Failover mode. + /// Failover mode. Possible values include: + /// 'PlannedFailover', 'ForcedFailover', 'PlannedSwitchover', + /// 'ForcedSwitchover' public RestartParameter(bool? restartWithFailover = default(bool?), string failoverMode = default(string)) { RestartWithFailover = restartWithFailover; @@ -51,7 +53,9 @@ public RestartParameter() public bool? RestartWithFailover { get; set; } /// - /// Gets or sets failover mode. + /// Gets or sets failover mode. Possible values include: + /// 'PlannedFailover', 'ForcedFailover', 'PlannedSwitchover', + /// 'ForcedSwitchover' /// [JsonProperty(PropertyName = "failoverMode")] public string FailoverMode { get; set; } diff --git a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresqlflexibleservers/Generated/Models/Server.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresqlflexibleservers/Generated/Models/Server.cs index 3cb57bbd83e72..e5c4b3f4df4ac 100644 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresqlflexibleservers/Generated/Models/Server.cs +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresqlflexibleservers/Generated/Models/Server.cs @@ -43,8 +43,6 @@ public Server() /// "Microsoft.Compute/virtualMachines" or /// "Microsoft.Storage/storageAccounts" /// Resource tags. - /// The Azure Active Directory identity of the - /// server. /// The SKU (pricing tier) of the server. /// The administrator's login name of /// a server. Can only be specified when the server is being created @@ -81,10 +79,9 @@ public Server() /// of key-value pairs. /// The system metadata relating to this /// resource. - public Server(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), Identity identity = default(Identity), Sku sku = default(Sku), string administratorLogin = default(string), string administratorLoginPassword = default(string), string version = default(string), string minorVersion = default(string), string state = default(string), string fullyQualifiedDomainName = default(string), Storage storage = default(Storage), Backup backup = default(Backup), Network network = default(Network), HighAvailability highAvailability = default(HighAvailability), MaintenanceWindow maintenanceWindow = default(MaintenanceWindow), string sourceServerResourceId = default(string), System.DateTime? pointInTimeUTC = default(System.DateTime?), string availabilityZone = default(string), string createMode = default(string), IDictionary serverTags = default(IDictionary), SystemData systemData = default(SystemData)) + public Server(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), string administratorLogin = default(string), string administratorLoginPassword = default(string), string version = default(string), string minorVersion = default(string), string state = default(string), string fullyQualifiedDomainName = default(string), Storage storage = default(Storage), Backup backup = default(Backup), Network network = default(Network), HighAvailability highAvailability = default(HighAvailability), MaintenanceWindow maintenanceWindow = default(MaintenanceWindow), string sourceServerResourceId = default(string), System.DateTime? pointInTimeUTC = default(System.DateTime?), string availabilityZone = default(string), string createMode = default(string), IDictionary serverTags = default(IDictionary), SystemData systemData = default(SystemData)) : base(location, id, name, type, tags) { - Identity = identity; Sku = sku; AdministratorLogin = administratorLogin; AdministratorLoginPassword = administratorLoginPassword; @@ -111,12 +108,6 @@ public Server() /// partial void CustomInit(); - /// - /// Gets or sets the Azure Active Directory identity of the server. - /// - [JsonProperty(PropertyName = "identity")] - public Identity Identity { get; set; } - /// /// Gets or sets the SKU (pricing tier) of the server. /// diff --git a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresqlflexibleservers/Generated/SdkInfo_PostgreSQLManagementClient.cs b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresqlflexibleservers/Generated/SdkInfo_PostgreSQLManagementClient.cs index 6192e57101373..e3f05663d2b52 100644 --- a/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresqlflexibleservers/Generated/SdkInfo_PostgreSQLManagementClient.cs +++ b/sdk/postgresql/Microsoft.Azure.Management.PostgreSQL/src/postgresqlflexibleservers/Generated/SdkInfo_PostgreSQLManagementClient.cs @@ -31,5 +31,15 @@ public static IEnumerable> ApiInfo_PostgreSQLManag }.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/postgresql/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp.namespace=Microsoft.Azure.Management.PostgreSQL.FlexibleServers --tag=package-flexibleserver-2021-06 --csharp.output-folder=C:\\Users\\daeunyim\\work\\SDK\\azure-sdk-for-net\\sdk\\postgresql\\Microsoft.Azure.Management.PostgreSQL\\src\\postgresqlflexibleservers\\Generated"; + public static readonly String GithubForkName = "Azure"; + public static readonly String GithubBranchName = "master"; + public static readonly String GithubCommidId = "282f8b747c0f9193b6bc847a6284f56f70f829b7"; + public static readonly String CodeGenerationErrors = ""; + public static readonly String GithubRepoName = "azure-rest-api-specs"; + // END: Code Generation Metadata Section } }