From 4171a4f9eac25aeddd449c29cbee2a0da77962cd Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 18 Jun 2021 01:50:57 +0000 Subject: [PATCH] CodeGen from PR 14859 in Azure/azure-rest-api-specs Merge b9cf4a4e60139f70d7ddcc5b4b0ae56dbca8cb2c into a6302e8490871f3619de9cd7001fd5f9cba887bf --- .../arm-postgresql-flexible/README.md | 26 +- .../arm-postgresql-flexible/package.json | 8 +- .../arm-postgresql-flexible/rollup.config.js | 2 +- .../src/models/configurationsMappers.ts | 9 +- .../src/models/databasesMappers.ts | 9 +- .../src/models/firewallRulesMappers.ts | 9 +- .../src/models/index.ts | 931 +++++++++------ .../locationBasedCapabilitiesMappers.ts | 4 +- .../src/models/mappers.ts | 1018 ++++++++++------- .../src/models/parameters.ts | 37 +- .../src/models/recoverableServersMappers.ts | 34 - .../src/models/serversMappers.ts | 10 +- .../src/operations/checkNameAvailability.ts | 10 +- .../src/operations/configurations.ts | 86 +- .../src/operations/databases.ts | 18 +- .../src/operations/firewallRules.ts | 18 +- .../src/operations/getPrivateDnsZoneSuffix.ts | 40 +- .../src/operations/index.ts | 5 +- .../operations/locationBasedCapabilities.ts | 12 +- .../src/operations/operations.ts | 10 +- .../src/operations/recoverableServers.ts | 86 -- .../src/operations/servers.ts | 41 +- .../operations/virtualNetworkSubnetUsage.ts | 10 +- ...lient.ts => postgreSQLManagementClient.ts} | 26 +- ...s => postgreSQLManagementClientContext.ts} | 8 +- 25 files changed, 1408 insertions(+), 1059 deletions(-) delete mode 100644 sdk/postgresql/arm-postgresql-flexible/src/models/recoverableServersMappers.ts delete mode 100644 sdk/postgresql/arm-postgresql-flexible/src/operations/recoverableServers.ts rename sdk/postgresql/arm-postgresql-flexible/src/{postgreSQLFlexibleManagementClient.ts => postgreSQLManagementClient.ts} (79%) rename sdk/postgresql/arm-postgresql-flexible/src/{postgreSQLFlexibleManagementClientContext.ts => postgreSQLManagementClientContext.ts} (90%) diff --git a/sdk/postgresql/arm-postgresql-flexible/README.md b/sdk/postgresql/arm-postgresql-flexible/README.md index a7a178bd0a19..e6aa6c9a5d5c 100644 --- a/sdk/postgresql/arm-postgresql-flexible/README.md +++ b/sdk/postgresql/arm-postgresql-flexible/README.md @@ -1,11 +1,11 @@ -## Azure PostgreSQLFlexibleManagementClient SDK for JavaScript +## Azure PostgreSQLManagementClient SDK for JavaScript -This package contains an isomorphic SDK (runs both in node.js and in browsers) for PostgreSQLFlexibleManagementClient. +This package contains an isomorphic SDK (runs both in node.js and in browsers) for PostgreSQLManagementClient. ### Currently supported environments -- Node.js version 8.x.x or higher -- Browser JavaScript +- [LTS versions of Node.js](https://nodejs.org/about/releases/) +- Latest versions of Safari, Chrome, Edge and Firefox. ### Prerequisites @@ -36,23 +36,22 @@ If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/ In the below samples, we pass the credential and the Azure subscription id to instantiate the client. Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started. -#### nodejs - Authentication, client creation, and get databases as an example written in JavaScript. +#### nodejs - Authentication, client creation, and get servers as an example written in JavaScript. ##### Sample code ```javascript const { DefaultAzureCredential } = require("@azure/identity"); -const { PostgreSQLFlexibleManagementClient } = require("@azure/arm-postgresql-flexible"); +const { PostgreSQLManagementClient } = require("@azure/arm-postgresql-flexible"); const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; // Use `DefaultAzureCredential` or any other credential of your choice based on https://aka.ms/azsdk/js/identity/examples // Please note that you can also use credentials from the `@azure/ms-rest-nodeauth` package instead. const creds = new DefaultAzureCredential(); -const client = new PostgreSQLFlexibleManagementClient(creds, subscriptionId); +const client = new PostgreSQLManagementClient(creds, subscriptionId); const resourceGroupName = "testresourceGroupName"; const serverName = "testserverName"; -const databaseName = "testdatabaseName"; -client.databases.get(resourceGroupName, serverName, databaseName).then((result) => { +client.servers.get(resourceGroupName, serverName).then((result) => { console.log("The result is:"); console.log(result); }).catch((err) => { @@ -61,7 +60,7 @@ client.databases.get(resourceGroupName, serverName, databaseName).then((result) }); ``` -#### browser - Authentication, client creation, and get databases as an example written in JavaScript. +#### browser - Authentication, client creation, and get servers as an example written in JavaScript. In browser applications, we recommend using the `InteractiveBrowserCredential` that interactively authenticates using the default system browser. - See [Single-page application: App registration guide](https://docs.microsoft.com/azure/active-directory/develop/scenario-spa-app-registration) to configure your app registration for the browser. @@ -88,11 +87,10 @@ In browser applications, we recommend using the `InteractiveBrowserCredential` t clientId: "", tenant: "" }); - const client = new Azure.ArmPostgresql.PostgreSQLFlexibleManagementClient(creds, subscriptionId); + const client = new Azure.ArmPostgresqlFlexible.PostgreSQLManagementClient(creds, subscriptionId); const resourceGroupName = "testresourceGroupName"; const serverName = "testserverName"; - const databaseName = "testdatabaseName"; - client.databases.get(resourceGroupName, serverName, databaseName).then((result) => { + client.servers.get(resourceGroupName, serverName).then((result) => { console.log("The result is:"); console.log(result); }).catch((err) => { @@ -109,4 +107,4 @@ In browser applications, we recommend using the `InteractiveBrowserCredential` t - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/README.png) +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/postgresql/arm-postgresql-flexible//README.png) diff --git a/sdk/postgresql/arm-postgresql-flexible/package.json b/sdk/postgresql/arm-postgresql-flexible/package.json index 68183b512288..9766b3329965 100644 --- a/sdk/postgresql/arm-postgresql-flexible/package.json +++ b/sdk/postgresql/arm-postgresql-flexible/package.json @@ -1,7 +1,7 @@ { "name": "@azure/arm-postgresql-flexible", "author": "Microsoft Corporation", - "description": "PostgreSQLFlexibleManagementClient Library with typescript type definitions for node.js and browser.", + "description": "PostgreSQLManagementClient Library with typescript type definitions for node.js and browser.", "version": "1.0.0", "dependencies": { "@azure/ms-rest-azure-js": "^2.1.0", @@ -18,8 +18,8 @@ ], "license": "MIT", "main": "./dist/arm-postgresql-flexible.js", - "module": "./esm/postgreSQLFlexibleManagementClient.js", - "types": "./esm/postgreSQLFlexibleManagementClient.d.ts", + "module": "./esm/postgreSQLManagementClient.js", + "types": "./esm/postgreSQLManagementClient.d.ts", "devDependencies": { "typescript": "^3.6.0", "rollup": "^1.18.0", @@ -27,7 +27,7 @@ "rollup-plugin-sourcemaps": "^0.4.2", "uglify-js": "^3.6.0" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/postgresql/arm-postgresql-flexible", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/postgresql/arm-postgresql-flexible/", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" diff --git a/sdk/postgresql/arm-postgresql-flexible/rollup.config.js b/sdk/postgresql/arm-postgresql-flexible/rollup.config.js index d522032c4e23..b71f63ce341d 100644 --- a/sdk/postgresql/arm-postgresql-flexible/rollup.config.js +++ b/sdk/postgresql/arm-postgresql-flexible/rollup.config.js @@ -6,7 +6,7 @@ import sourcemaps from "rollup-plugin-sourcemaps"; * @type {rollup.RollupFileOptions} */ const config = { - input: "./esm/postgreSQLFlexibleManagementClient.js", + input: "./esm/postgreSQLManagementClient.js", external: [ "@azure/ms-rest-js", "@azure/ms-rest-azure-js" diff --git a/sdk/postgresql/arm-postgresql-flexible/src/models/configurationsMappers.ts b/sdk/postgresql/arm-postgresql-flexible/src/models/configurationsMappers.ts index f3b49032720a..e63c693ddc6d 100644 --- a/sdk/postgresql/arm-postgresql-flexible/src/models/configurationsMappers.ts +++ b/sdk/postgresql/arm-postgresql-flexible/src/models/configurationsMappers.ts @@ -8,6 +8,7 @@ export { AzureEntityResource, + Backup, BaseResource, CloudError, Configuration, @@ -16,20 +17,20 @@ export { ErrorAdditionalInfo, ErrorResponse, FirewallRule, + HighAvailability, Identity, MaintenanceWindow, + Network, Plan, ProxyResource, - RecoverableServerResource, Resource, ResourceModelWithAllowedPropertySet, ResourceModelWithAllowedPropertySetIdentity, ResourceModelWithAllowedPropertySetPlan, ResourceModelWithAllowedPropertySetSku, Server, - ServerPropertiesDelegatedSubnetArguments, - ServerPropertiesPrivateDnsZoneArguments, Sku, - StorageProfile, + Storage, + SystemData, TrackedResource } from "../models/mappers"; diff --git a/sdk/postgresql/arm-postgresql-flexible/src/models/databasesMappers.ts b/sdk/postgresql/arm-postgresql-flexible/src/models/databasesMappers.ts index 7df3290b5d68..3ac50955c92d 100644 --- a/sdk/postgresql/arm-postgresql-flexible/src/models/databasesMappers.ts +++ b/sdk/postgresql/arm-postgresql-flexible/src/models/databasesMappers.ts @@ -8,6 +8,7 @@ export { AzureEntityResource, + Backup, BaseResource, CloudError, Configuration, @@ -16,20 +17,20 @@ export { ErrorAdditionalInfo, ErrorResponse, FirewallRule, + HighAvailability, Identity, MaintenanceWindow, + Network, Plan, ProxyResource, - RecoverableServerResource, Resource, ResourceModelWithAllowedPropertySet, ResourceModelWithAllowedPropertySetIdentity, ResourceModelWithAllowedPropertySetPlan, ResourceModelWithAllowedPropertySetSku, Server, - ServerPropertiesDelegatedSubnetArguments, - ServerPropertiesPrivateDnsZoneArguments, Sku, - StorageProfile, + Storage, + SystemData, TrackedResource } from "../models/mappers"; diff --git a/sdk/postgresql/arm-postgresql-flexible/src/models/firewallRulesMappers.ts b/sdk/postgresql/arm-postgresql-flexible/src/models/firewallRulesMappers.ts index 280cb8bdd0ea..19d3f36b91aa 100644 --- a/sdk/postgresql/arm-postgresql-flexible/src/models/firewallRulesMappers.ts +++ b/sdk/postgresql/arm-postgresql-flexible/src/models/firewallRulesMappers.ts @@ -8,6 +8,7 @@ export { AzureEntityResource, + Backup, BaseResource, CloudError, Configuration, @@ -16,20 +17,20 @@ export { ErrorResponse, FirewallRule, FirewallRuleListResult, + HighAvailability, Identity, MaintenanceWindow, + Network, Plan, ProxyResource, - RecoverableServerResource, Resource, ResourceModelWithAllowedPropertySet, ResourceModelWithAllowedPropertySetIdentity, ResourceModelWithAllowedPropertySetPlan, ResourceModelWithAllowedPropertySetSku, Server, - ServerPropertiesDelegatedSubnetArguments, - ServerPropertiesPrivateDnsZoneArguments, Sku, - StorageProfile, + Storage, + SystemData, TrackedResource } from "../models/mappers"; diff --git a/sdk/postgresql/arm-postgresql-flexible/src/models/index.ts b/sdk/postgresql/arm-postgresql-flexible/src/models/index.ts index c4f0485be563..9ad7cffe0b82 100644 --- a/sdk/postgresql/arm-postgresql-flexible/src/models/index.ts +++ b/sdk/postgresql/arm-postgresql-flexible/src/models/index.ts @@ -12,339 +12,326 @@ import * as msRest from "@azure/ms-rest-js"; export { BaseResource, CloudError }; /** - * Common fields that are returned in the response for all Azure Resource Manager resources - * @summary Resource + * Virtual network subnet usage parameter */ -export interface Resource extends BaseResource { +export interface VirtualNetworkSubnetUsageParameter { /** - * Fully qualified resource ID for the resource. Ex - - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Virtual network resource id. */ - readonly id?: string; + virtualNetworkArmResourceId?: string; +} + +/** + * Delegated subnet usage data. + */ +export interface DelegatedSubnetUsage { /** - * The name of the resource + * name of the subnet * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly name?: string; + readonly subnetName?: string; /** - * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - * "Microsoft.Storage/storageAccounts" + * Number of used delegated subnets * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly type?: string; + readonly usage?: number; } /** - * The resource model definition for a Azure Resource Manager proxy resource. It will not have tags - * and a location - * @summary Proxy Resource + * Virtual network subnet usage data. */ -export interface ProxyResource extends Resource { +export interface VirtualNetworkSubnetUsageResult { + /** + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly delegatedSubnetsUsage?: DelegatedSubnetUsage[]; } /** - * Represents a Database. + * storage size in MB capability */ -export interface Database extends ProxyResource { +export interface StorageMBCapability { /** - * The charset of the database. + * storage MB name + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - charset?: string; + readonly name?: string; /** - * The collation of the database. + * supported IOPS + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - collation?: string; -} - -/** - * The resource management error additional info. - */ -export interface ErrorAdditionalInfo { + readonly supportedIops?: number; /** - * The additional info type. + * storage size in MB * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly type?: string; + readonly storageSizeMB?: number; /** - * The additional info. + * The status * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly info?: any; + readonly status?: string; } /** - * Common error response for all Azure Resource Manager APIs to return error details for failed - * operations. (This also follows the OData error response format.) - * @summary Error Response + * Vcores capability */ -export interface ErrorResponse { +export interface VcoreCapability { /** - * The error code. + * vCore name * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly code?: string; + readonly name?: string; /** - * The error message. + * supported vCores * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly message?: string; + readonly vCores?: number; /** - * The error target. + * supported IOPS * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly target?: string; + readonly supportedIops?: number; /** - * The error details. + * supported memory per vCore in MB * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly details?: ErrorResponse[]; + readonly supportedMemoryPerVcoreMB?: number; /** - * The error additional info. + * The status * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly status?: string; } /** - * The resource model definition for an Azure Resource Manager tracked top level resource which has - * 'tags' and a 'location' - * @summary Tracked Resource + * Server version capabilities. */ -export interface TrackedResource extends Resource { +export interface ServerVersionCapability { /** - * Resource tags. + * server version + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - tags?: { [propertyName: string]: string }; + readonly name?: string; /** - * The geo-location where the resource lives + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - location: string; -} - -/** - * The resource model definition for an Azure Resource Manager resource with an etag. - * @summary Entity Resource - */ -export interface AzureEntityResource extends Resource { + readonly supportedVcores?: VcoreCapability[]; /** - * Resource Etag. + * The status * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly etag?: string; + readonly status?: string; } /** - * Sku information related properties of a server. + * storage edition capability */ -export interface Sku { +export interface StorageEditionCapability { /** - * The name of the sku, typically, tier + family + cores, e.g. Standard_D4s_v3. + * storage edition name + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - name: string; + readonly name?: string; /** - * The tier of the particular SKU, e.g. Burstable. Possible values include: 'Burstable', - * 'GeneralPurpose', 'MemoryOptimized' + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - tier: SkuTier; + readonly supportedStorageMB?: StorageMBCapability[]; + /** + * The status + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly status?: string; } /** - * Represents a recoverable server resource. + * node type capability */ -export interface RecoverableServerResource extends ProxyResource { +export interface NodeTypeCapability { /** - * The SKU (pricing tier) of the server. - */ - sku?: Sku; - /** - * The location the resource resides in. - */ - location?: string; - /** - * Availability zone of the server + * note type name * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly availabilityZone?: string; + readonly name?: string; /** - * Edition of the performance tier. + * note type * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly serverEdition?: string; + readonly nodeType?: string; /** - * The PostgreSQL version + * The status * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly version?: string; + readonly status?: string; } /** - * Virtual network subnet usage parameter + * Flexible server edition capabilities. */ -export interface VirtualNetworkSubnetUsageParameter { +export interface FlexibleServerEditionCapability { /** - * Virtual network resource id. + * Server edition name + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - virtualNetworkArmResourceId?: string; -} - -/** - * Delegated subnet usage data. - */ -export interface DelegatedSubnetUsage { + readonly name?: string; /** - * name of the subnet + * The list of editions supported by this server edition. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly subnetName?: string; + readonly supportedStorageEditions?: StorageEditionCapability[]; /** - * Number of used delegated subnets + * The list of server versions supported by this server edition. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly usage?: number; -} - -/** - * Virtual network subnet usage data. - */ -export interface VirtualNetworkSubnetUsageResult { + readonly supportedServerVersions?: ServerVersionCapability[]; /** + * The status * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly delegatedSubnetsUsage?: DelegatedSubnetUsage[]; + readonly status?: string; } /** - * storage size in MB capability + * Hyperscale node edition capabilities. */ -export interface StorageMBCapability { +export interface HyperscaleNodeEditionCapability { /** - * storage MB name + * Server edition name * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly name?: string; /** - * supported IOPS + * The list of editions supported by this server edition. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly supportedIops?: number; + readonly supportedStorageEditions?: StorageEditionCapability[]; /** - * storage size in MB + * The list of server versions supported by this server edition. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly storageSizeMB?: number; + readonly supportedServerVersions?: ServerVersionCapability[]; + /** + * The list of Node Types supported by this server edition. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly supportedNodeTypes?: NodeTypeCapability[]; + /** + * The status + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly status?: string; } /** - * Vcores capability + * Location capabilities. */ -export interface VcoreCapability { +export interface CapabilityProperties { /** - * vCore name + * zone name * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly name?: string; + readonly zone?: string; /** - * supported vCores + * A value indicating whether a new server in this region can have geo-backups to paired region. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly vCores?: number; + readonly geoBackupSupported?: boolean; /** - * supported IOPS + * A value indicating whether a new server in this region can support multi zone HA. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly supportedIops?: number; + readonly zoneRedundantHaSupported?: boolean; /** - * supported memory per vCore in MB + * A value indicating whether a new server in this region can have geo-backups to paired region. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly supportedMemoryPerVcoreMB?: number; -} - -/** - * Server version capabilities. - */ -export interface ServerVersionCapability { + readonly zoneRedundantHaAndGeoBackupSupported?: boolean; /** - * server version * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly name?: string; + readonly supportedFlexibleServerEditions?: FlexibleServerEditionCapability[]; /** * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly supportedVcores?: VcoreCapability[]; + readonly supportedHyperscaleNodeEditions?: HyperscaleNodeEditionCapability[]; + /** + * The status + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly status?: string; } /** - * storage edition capability + * Storage properties of a server */ -export interface StorageEditionCapability { - /** - * storage edition name - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly name?: string; +export interface Storage { /** - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Max storage allowed for a server. */ - readonly supportedStorageMB?: StorageMBCapability[]; + storageSizeGB?: number; } /** - * Server edition capabilities. + * Backup properties of a server */ -export interface ServerEditionCapability { +export interface Backup { /** - * Server edition name - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Backup retention days for the server. */ - readonly name?: string; + backupRetentionDays?: number; /** - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * A value indicating whether Geo-Redundant backup is enabled on the server. Possible values + * include: 'Enabled', 'Disabled' */ - readonly supportedStorageEditions?: StorageEditionCapability[]; + geoRedundantBackup?: GeoRedundantBackupEnum; /** + * The earliest restore point time (ISO8601 format) for server. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly supportedServerVersions?: ServerVersionCapability[]; + readonly earliestRestoreDate?: Date; } /** - * Location capabilities. + * Network properties of a server */ -export interface CapabilityProperties { +export interface Network { /** - * zone name + * public network access is enabled or not. Possible values include: 'Enabled', 'Disabled' * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly zone?: string; + readonly publicNetworkAccess?: ServerPublicNetworkAccessState; /** - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * delegated subnet arm resource id. + */ + delegatedSubnetResourceId?: string; + /** + * private dns zone arm resource id. */ - readonly supportedFlexibleServerEditions?: ServerEditionCapability[]; + privateDnsZoneArmResourceId?: string; } /** - * Storage Profile properties of a server + * High availability properties of a server */ -export interface StorageProfile { +export interface HighAvailability { /** - * Backup retention days for the server. + * The HA mode for the server. Possible values include: 'Disabled', 'ZoneRedundant' */ - backupRetentionDays?: number; + mode?: HighAvailabilityMode; /** - * Max storage allowed for a server. + * A state of a HA server that is visible to user. Possible values include: 'NotEnabled', + * 'CreatingStandby', 'ReplicatingData', 'FailingOver', 'Healthy', 'RemovingStandby' + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - storageMB?: number; + readonly state?: ServerHAState; /** - * Geo Backup redundancy option. Possible values include: 'Enabled', 'Disabled' + * availability zone information of the standby. */ - geoRedundantBackup?: GeoRedundantBackupOption; + standbyAvailabilityZone?: string; } /** - * Maintenance window of a server. + * Maintenance window properties of a server. */ export interface MaintenanceWindow { /** @@ -366,43 +353,110 @@ export interface MaintenanceWindow { } /** - * An interface representing ServerPropertiesDelegatedSubnetArguments. + * Identity for the resource. */ -export interface ServerPropertiesDelegatedSubnetArguments { +export interface Identity { /** - * delegated subnet arm resource id. + * The principal ID of resource identity. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly principalId?: string; + /** + * The tenant ID of resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly tenantId?: string; + /** + * The identity type. Possible values include: 'SystemAssigned' */ - subnetArmResourceId?: string; + type?: ResourceIdentityType; } /** - * An interface representing ServerPropertiesPrivateDnsZoneArguments. + * Sku information related properties of a server. */ -export interface ServerPropertiesPrivateDnsZoneArguments { +export interface Sku { /** - * private dns zone arm resource id. + * The name of the sku, typically, tier + family + cores, e.g. Standard_D4s_v3. */ - privateDnsZoneArmResourceId?: string; + name: string; + /** + * The tier of the particular SKU, e.g. Burstable. Possible values include: 'Burstable', + * 'GeneralPurpose', 'MemoryOptimized' + */ + tier: SkuTier; } /** - * Identity for the resource. + * Metadata pertaining to creation and last modification of the resource. */ -export interface Identity { +export interface SystemData { /** - * The principal ID of resource identity. + * The identity that created the resource. + */ + createdBy?: string; + /** + * The type of identity that created the resource. Possible values include: 'User', + * 'Application', 'ManagedIdentity', 'Key' + */ + createdByType?: CreatedByType; + /** + * The timestamp of resource creation (UTC). + */ + createdAt?: Date; + /** + * The identity that last modified the resource. + */ + lastModifiedBy?: string; + /** + * The type of identity that last modified the resource. Possible values include: 'User', + * 'Application', 'ManagedIdentity', 'Key' + */ + lastModifiedByType?: CreatedByType; + /** + * The timestamp of resource last modification (UTC) + */ + lastModifiedAt?: Date; +} + +/** + * Common fields that are returned in the response for all Azure Resource Manager resources + * @summary Resource + */ +export interface Resource extends BaseResource { + /** + * Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly principalId?: string; + readonly id?: string; /** - * The tenant ID of resource. + * The name of the resource * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly tenantId?: string; + readonly name?: string; /** - * The identity type. Possible values include: 'SystemAssigned' + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + * "Microsoft.Storage/storageAccounts" + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - type?: ResourceIdentityType; + readonly type?: string; +} + +/** + * The resource model definition for an Azure Resource Manager tracked top level resource which has + * 'tags' and a 'location' + * @summary Tracked Resource + */ +export interface TrackedResource extends Resource { + /** + * Resource tags. + */ + tags?: { [propertyName: string]: string }; + /** + * The geo-location where the resource lives + */ + location: string; } /** @@ -427,89 +481,73 @@ export interface Server extends TrackedResource { */ administratorLoginPassword?: string; /** - * PostgreSQL Server version. Possible values include: '12', '11' + * PostgreSQL Server version. Possible values include: '13', '12', '11' */ version?: ServerVersion; /** - * A state of a server that is visible to user. Possible values include: 'Ready', 'Dropping', - * 'Disabled', 'Starting', 'Stopping', 'Stopped', 'Updating' + * The minor version of the server. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly state?: ServerState; + readonly minorVersion?: string; /** - * A state of a HA server that is visible to user. Possible values include: 'NotEnabled', - * 'CreatingStandby', 'ReplicatingData', 'FailingOver', 'Healthy', 'RemovingStandby' + * A state of a server that is visible to user. Possible values include: 'Ready', 'Dropping', + * 'Disabled', 'Starting', 'Stopping', 'Stopped', 'Updating' * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly haState?: ServerHAState; + readonly state?: ServerState; /** * The fully qualified domain name of a server. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly fullyQualifiedDomainName?: string; /** - * The display name of a server. - */ - displayName?: string; - /** - * Storage profile of a server. - */ - storageProfile?: StorageProfile; - /** - * public network access is enabled or not. Possible values include: 'Enabled', 'Disabled' - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Storage properties of a server. */ - readonly publicNetworkAccess?: ServerPublicNetworkAccessState; + storage?: Storage; /** - * Maintenance window of a server. + * Backup properties of a server. */ - maintenanceWindow?: MaintenanceWindow; + backup?: Backup; /** - * stand by count value can be either enabled or disabled. Possible values include: 'Enabled', - * 'Disabled' + * Network properties of a server. */ - haEnabled?: HAEnabledEnum; + network?: Network; /** - * The source PostgreSQL server name to restore from. + * High availability properties of a server. */ - sourceServerName?: string; + highAvailability?: HighAvailability; /** - * The subscription id of source PostgreSQL server name to restore from. + * Maintenance window properties of a server. */ - sourceSubscriptionId?: string; + maintenanceWindow?: MaintenanceWindow; /** - * The resource group name of source PostgreSQL server name to restore from. + * The source server resource ID to restore from. It's required when 'createMode' is + * 'PointInTimeRestore'. */ - sourceResourceGroupName?: string; + sourceServerResourceId?: string; /** - * Restore point creation time (ISO8601 format), specifying the time to restore from. + * Restore point creation time (ISO8601 format), specifying the time to restore from. It's + * required when 'createMode' is 'PointInTimeRestore'. */ pointInTimeUTC?: Date; /** - * availability Zone information of the server. + * availability zone information of the server. */ availabilityZone?: string; /** - * availability Zone information of the server. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly standbyAvailabilityZone?: string; - /** - * Status showing whether the data encryption is enabled with customer-managed keys. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly byokEnforcement?: string; - delegatedSubnetArguments?: ServerPropertiesDelegatedSubnetArguments; - privateDnsZoneArguments?: ServerPropertiesPrivateDnsZoneArguments; - /** - * The mode to create a new PostgreSQL server. Possible values include: 'Default', - * 'PointInTimeRestore', 'GeoRestore' + * The mode to create a new PostgreSQL server. Possible values include: 'Default', 'Create', + * 'Update', 'PointInTimeRestore' */ createMode?: CreateMode; /** * Application-specific metadata in the form of key-value pairs. */ serverTags?: { [propertyName: string]: string }; + /** + * The system metadata relating to this resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly systemData?: SystemData; } /** @@ -529,24 +567,39 @@ export interface ServerForUpdate { */ administratorLoginPassword?: string; /** - * Storage profile of a server. + * Storage properties of a server. */ - storageProfile?: StorageProfile; + storage?: Storage; /** - * stand by count value can be either enabled or disabled. Possible values include: 'Enabled', - * 'Disabled' + * Backup properties of a server. */ - haEnabled?: HAEnabledEnum; + backup?: Backup; /** - * Maintenance window of a server. + * High availability properties of a server. + */ + highAvailability?: HighAvailability; + /** + * Maintenance window properties of a server. */ maintenanceWindow?: MaintenanceWindow; + /** + * The mode to update a new PostgreSQL server. Possible values include: 'Default', 'Update' + */ + createMode?: CreateModeForUpdate; /** * Application-specific metadata in the form of key-value pairs. */ tags?: { [propertyName: string]: string }; } +/** + * The resource model definition for a Azure Resource Manager proxy resource. It will not have tags + * and a location + * @summary Proxy Resource + */ +export interface ProxyResource extends Resource { +} + /** * Represents a server firewall rule. */ @@ -559,6 +612,11 @@ export interface FirewallRule extends ProxyResource { * The end IP address of the server firewall rule. Must be IPv4 format. */ endIpAddress: string; + /** + * The system metadata relating to this resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly systemData?: SystemData; } /** @@ -594,6 +652,11 @@ export interface Configuration extends ProxyResource { * Source of the configuration. */ source?: string; + /** + * The system metadata relating to this resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly systemData?: SystemData; } /** @@ -704,6 +767,81 @@ export interface NameAvailability { type?: string; } +/** + * Represents server restart parameters. + */ +export interface RestartParameter { + /** + * Indicates whether to restart the server with failover. + */ + restartWithFailover?: boolean; + /** + * Failover mode. + */ + failoverMode?: string; +} + +/** + * The resource management error additional info. + */ +export interface ErrorAdditionalInfo { + /** + * The additional info type. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; + /** + * The additional info. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly info?: any; +} + +/** + * Common error response for all Azure Resource Manager APIs to return error details for failed + * operations. (This also follows the OData error response format.) + * @summary Error Response + */ +export interface ErrorResponse { + /** + * The error code. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly code?: string; + /** + * The error message. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly message?: string; + /** + * The error target. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly target?: string; + /** + * The error details. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly details?: ErrorResponse[]; + /** + * The error additional info. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +/** + * The resource model definition for an Azure Resource Manager resource with an etag. + * @summary Entity Resource + */ +export interface AzureEntityResource extends Resource { + /** + * Resource Etag. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly etag?: string; +} + /** * An interface representing ResourceModelWithAllowedPropertySetIdentity. */ @@ -808,22 +946,49 @@ export interface ResourceModelWithAllowedPropertySet extends BaseResource { } /** - * An interface representing PostgreSQLFlexibleManagementClientOptions. + * Represents a Database. */ -export interface PostgreSQLFlexibleManagementClientOptions extends AzureServiceClientOptions { - baseUri?: string; +export interface Database extends ProxyResource { + /** + * The charset of the database. + */ + charset?: string; + /** + * The collation of the database. + */ + collation?: string; + /** + * The system metadata relating to this resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly systemData?: SystemData; } /** - * @interface - * A List of databases. - * @extends Array + * Optional Parameters. */ -export interface DatabaseListResult extends Array { +export interface ServersRestartOptionalParams extends msRest.RequestOptionsBase { /** - * The link used to get the next page of databases. + * The parameters for restarting a server. */ - nextLink?: string; + parameters?: RestartParameter; +} + +/** + * Optional Parameters. + */ +export interface ServersBeginRestartOptionalParams extends msRest.RequestOptionsBase { + /** + * The parameters for restarting a server. + */ + parameters?: RestartParameter; +} + +/** + * An interface representing PostgreSQLManagementClientOptions. + */ +export interface PostgreSQLManagementClientOptions extends AzureServiceClientOptions { + baseUri?: string; } /** @@ -876,20 +1041,24 @@ export interface CapabilitiesListResult extends Array { } /** - * Defines values for SkuTier. - * Possible values include: 'Burstable', 'GeneralPurpose', 'MemoryOptimized' - * @readonly - * @enum {string} + * @interface + * A List of databases. + * @extends Array */ -export type SkuTier = 'Burstable' | 'GeneralPurpose' | 'MemoryOptimized'; +export interface DatabaseListResult extends Array { + /** + * The link used to get the next page of databases. + */ + nextLink?: string; +} /** * Defines values for ServerVersion. - * Possible values include: '12', '11' + * Possible values include: '13', '12', '11' * @readonly * @enum {string} */ -export type ServerVersion = '12' | '11'; +export type ServerVersion = '13' | '12' | '11'; /** * Defines values for ServerState. @@ -901,45 +1070,45 @@ export type ServerVersion = '12' | '11'; export type ServerState = 'Ready' | 'Dropping' | 'Disabled' | 'Starting' | 'Stopping' | 'Stopped' | 'Updating'; /** - * Defines values for ServerHAState. - * Possible values include: 'NotEnabled', 'CreatingStandby', 'ReplicatingData', 'FailingOver', - * 'Healthy', 'RemovingStandby' + * Defines values for GeoRedundantBackupEnum. + * Possible values include: 'Enabled', 'Disabled' * @readonly * @enum {string} */ -export type ServerHAState = 'NotEnabled' | 'CreatingStandby' | 'ReplicatingData' | 'FailingOver' | 'Healthy' | 'RemovingStandby'; +export type GeoRedundantBackupEnum = 'Enabled' | 'Disabled'; /** - * Defines values for GeoRedundantBackupOption. + * Defines values for ServerPublicNetworkAccessState. * Possible values include: 'Enabled', 'Disabled' * @readonly * @enum {string} */ -export type GeoRedundantBackupOption = 'Enabled' | 'Disabled'; +export type ServerPublicNetworkAccessState = 'Enabled' | 'Disabled'; /** - * Defines values for ServerPublicNetworkAccessState. - * Possible values include: 'Enabled', 'Disabled' + * Defines values for HighAvailabilityMode. + * Possible values include: 'Disabled', 'ZoneRedundant' * @readonly * @enum {string} */ -export type ServerPublicNetworkAccessState = 'Enabled' | 'Disabled'; +export type HighAvailabilityMode = 'Disabled' | 'ZoneRedundant'; /** - * Defines values for HAEnabledEnum. - * Possible values include: 'Enabled', 'Disabled' + * Defines values for ServerHAState. + * Possible values include: 'NotEnabled', 'CreatingStandby', 'ReplicatingData', 'FailingOver', + * 'Healthy', 'RemovingStandby' * @readonly * @enum {string} */ -export type HAEnabledEnum = 'Enabled' | 'Disabled'; +export type ServerHAState = 'NotEnabled' | 'CreatingStandby' | 'ReplicatingData' | 'FailingOver' | 'Healthy' | 'RemovingStandby'; /** * Defines values for CreateMode. - * Possible values include: 'Default', 'PointInTimeRestore', 'GeoRestore' + * Possible values include: 'Default', 'Create', 'Update', 'PointInTimeRestore' * @readonly * @enum {string} */ -export type CreateMode = 'Default' | 'PointInTimeRestore' | 'GeoRestore'; +export type CreateMode = 'Default' | 'Create' | 'Update' | 'PointInTimeRestore'; /** * Defines values for ResourceIdentityType. @@ -949,6 +1118,30 @@ export type CreateMode = 'Default' | 'PointInTimeRestore' | 'GeoRestore'; */ export type ResourceIdentityType = 'SystemAssigned'; +/** + * Defines values for SkuTier. + * Possible values include: 'Burstable', 'GeneralPurpose', 'MemoryOptimized' + * @readonly + * @enum {string} + */ +export type SkuTier = 'Burstable' | 'GeneralPurpose' | 'MemoryOptimized'; + +/** + * Defines values for CreatedByType. + * Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + * @readonly + * @enum {string} + */ +export type CreatedByType = 'User' | 'Application' | 'ManagedIdentity' | 'Key'; + +/** + * Defines values for CreateModeForUpdate. + * Possible values include: 'Default', 'Update' + * @readonly + * @enum {string} + */ +export type CreateModeForUpdate = 'Default' | 'Update'; + /** * Defines values for ConfigurationDataType. * Possible values include: 'Boolean', 'Numeric', 'Integer', 'Enumeration' @@ -965,18 +1158,10 @@ export type ConfigurationDataType = 'Boolean' | 'Numeric' | 'Integer' | 'Enumera */ export type OperationOrigin = 'NotSpecified' | 'user' | 'system'; -/** - * Defines values for Body. - * Possible values include: 'PostgreSQL', 'PostgreSQLCitus', 'MySQL', 'MariaDb', 'Oracle' - * @readonly - * @enum {string} - */ -export type Body = 'PostgreSQL' | 'PostgreSQLCitus' | 'MySQL' | 'MariaDb' | 'Oracle'; - /** * Contains response data for the create operation. */ -export type DatabasesCreateResponse = Database & { +export type ServersCreateResponse = Server & { /** * The underlying HTTP response. */ @@ -989,14 +1174,14 @@ export type DatabasesCreateResponse = Database & { /** * The response body as parsed JSON or XML */ - parsedBody: Database; + parsedBody: Server; }; }; /** - * Contains response data for the get operation. + * Contains response data for the update operation. */ -export type DatabasesGetResponse = Database & { +export type ServersUpdateResponse = Server & { /** * The underlying HTTP response. */ @@ -1009,14 +1194,14 @@ export type DatabasesGetResponse = Database & { /** * The response body as parsed JSON or XML */ - parsedBody: Database; + parsedBody: Server; }; }; /** - * Contains response data for the listByServer operation. + * Contains response data for the get operation. */ -export type DatabasesListByServerResponse = DatabaseListResult & { +export type ServersGetResponse = Server & { /** * The underlying HTTP response. */ @@ -1029,14 +1214,14 @@ export type DatabasesListByServerResponse = DatabaseListResult & { /** * The response body as parsed JSON or XML */ - parsedBody: DatabaseListResult; + parsedBody: Server; }; }; /** - * Contains response data for the beginCreate operation. + * Contains response data for the listByResourceGroup operation. */ -export type DatabasesBeginCreateResponse = Database & { +export type ServersListByResourceGroupResponse = ServerListResult & { /** * The underlying HTTP response. */ @@ -1049,14 +1234,14 @@ export type DatabasesBeginCreateResponse = Database & { /** * The response body as parsed JSON or XML */ - parsedBody: Database; + parsedBody: ServerListResult; }; }; /** - * Contains response data for the listByServerNext operation. + * Contains response data for the list operation. */ -export type DatabasesListByServerNextResponse = DatabaseListResult & { +export type ServersListResponse = ServerListResult & { /** * The underlying HTTP response. */ @@ -1069,19 +1254,34 @@ export type DatabasesListByServerNextResponse = DatabaseListResult & { /** * The response body as parsed JSON or XML */ - parsedBody: DatabaseListResult; + parsedBody: ServerListResult; }; }; /** - * Contains response data for the execute operation. + * Contains response data for the beginCreate operation. */ -export type GetPrivateDnsZoneSuffixExecuteResponse = { +export type ServersBeginCreateResponse = Server & { /** - * The parsed response body. + * The underlying HTTP response. */ - body: string; + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: Server; + }; +}; + +/** + * Contains response data for the beginUpdate operation. + */ +export type ServersBeginUpdateResponse = Server & { /** * The underlying HTTP response. */ @@ -1094,14 +1294,14 @@ export type GetPrivateDnsZoneSuffixExecuteResponse = { /** * The response body as parsed JSON or XML */ - parsedBody: string; + parsedBody: Server; }; }; /** - * Contains response data for the create operation. + * Contains response data for the listByResourceGroupNext operation. */ -export type ServersCreateResponse = Server & { +export type ServersListByResourceGroupNextResponse = ServerListResult & { /** * The underlying HTTP response. */ @@ -1114,14 +1314,14 @@ export type ServersCreateResponse = Server & { /** * The response body as parsed JSON or XML */ - parsedBody: Server; + parsedBody: ServerListResult; }; }; /** - * Contains response data for the update operation. + * Contains response data for the listNext operation. */ -export type ServersUpdateResponse = Server & { +export type ServersListNextResponse = ServerListResult & { /** * The underlying HTTP response. */ @@ -1134,14 +1334,14 @@ export type ServersUpdateResponse = Server & { /** * The response body as parsed JSON or XML */ - parsedBody: Server; + parsedBody: ServerListResult; }; }; /** - * Contains response data for the get operation. + * Contains response data for the createOrUpdate operation. */ -export type ServersGetResponse = Server & { +export type FirewallRulesCreateOrUpdateResponse = FirewallRule & { /** * The underlying HTTP response. */ @@ -1154,14 +1354,14 @@ export type ServersGetResponse = Server & { /** * The response body as parsed JSON or XML */ - parsedBody: Server; + parsedBody: FirewallRule; }; }; /** - * Contains response data for the listByResourceGroup operation. + * Contains response data for the get operation. */ -export type ServersListByResourceGroupResponse = ServerListResult & { +export type FirewallRulesGetResponse = FirewallRule & { /** * The underlying HTTP response. */ @@ -1174,14 +1374,14 @@ export type ServersListByResourceGroupResponse = ServerListResult & { /** * The response body as parsed JSON or XML */ - parsedBody: ServerListResult; + parsedBody: FirewallRule; }; }; /** - * Contains response data for the list operation. + * Contains response data for the listByServer operation. */ -export type ServersListResponse = ServerListResult & { +export type FirewallRulesListByServerResponse = FirewallRuleListResult & { /** * The underlying HTTP response. */ @@ -1194,14 +1394,14 @@ export type ServersListResponse = ServerListResult & { /** * The response body as parsed JSON or XML */ - parsedBody: ServerListResult; + parsedBody: FirewallRuleListResult; }; }; /** - * Contains response data for the beginCreate operation. + * Contains response data for the beginCreateOrUpdate operation. */ -export type ServersBeginCreateResponse = Server & { +export type FirewallRulesBeginCreateOrUpdateResponse = FirewallRule & { /** * The underlying HTTP response. */ @@ -1214,14 +1414,14 @@ export type ServersBeginCreateResponse = Server & { /** * The response body as parsed JSON or XML */ - parsedBody: Server; + parsedBody: FirewallRule; }; }; /** - * Contains response data for the beginUpdate operation. + * Contains response data for the listByServerNext operation. */ -export type ServersBeginUpdateResponse = Server & { +export type FirewallRulesListByServerNextResponse = FirewallRuleListResult & { /** * The underlying HTTP response. */ @@ -1234,14 +1434,14 @@ export type ServersBeginUpdateResponse = Server & { /** * The response body as parsed JSON or XML */ - parsedBody: Server; + parsedBody: FirewallRuleListResult; }; }; /** - * Contains response data for the listByResourceGroupNext operation. + * Contains response data for the listByServer operation. */ -export type ServersListByResourceGroupNextResponse = ServerListResult & { +export type ConfigurationsListByServerResponse = ConfigurationListResult & { /** * The underlying HTTP response. */ @@ -1254,14 +1454,14 @@ export type ServersListByResourceGroupNextResponse = ServerListResult & { /** * The response body as parsed JSON or XML */ - parsedBody: ServerListResult; + parsedBody: ConfigurationListResult; }; }; /** - * Contains response data for the listNext operation. + * Contains response data for the get operation. */ -export type ServersListNextResponse = ServerListResult & { +export type ConfigurationsGetResponse = Configuration & { /** * The underlying HTTP response. */ @@ -1274,14 +1474,14 @@ export type ServersListNextResponse = ServerListResult & { /** * The response body as parsed JSON or XML */ - parsedBody: ServerListResult; + parsedBody: Configuration; }; }; /** - * Contains response data for the createOrUpdate operation. + * Contains response data for the update operation. */ -export type FirewallRulesCreateOrUpdateResponse = FirewallRule & { +export type ConfigurationsUpdateResponse = Configuration & { /** * The underlying HTTP response. */ @@ -1294,14 +1494,14 @@ export type FirewallRulesCreateOrUpdateResponse = FirewallRule & { /** * The response body as parsed JSON or XML */ - parsedBody: FirewallRule; + parsedBody: Configuration; }; }; /** - * Contains response data for the get operation. + * Contains response data for the put operation. */ -export type FirewallRulesGetResponse = FirewallRule & { +export type ConfigurationsPutResponse = Configuration & { /** * The underlying HTTP response. */ @@ -1314,14 +1514,14 @@ export type FirewallRulesGetResponse = FirewallRule & { /** * The response body as parsed JSON or XML */ - parsedBody: FirewallRule; + parsedBody: Configuration; }; }; /** - * Contains response data for the listByServer operation. + * Contains response data for the beginUpdate operation. */ -export type FirewallRulesListByServerResponse = FirewallRuleListResult & { +export type ConfigurationsBeginUpdateResponse = Configuration & { /** * The underlying HTTP response. */ @@ -1334,14 +1534,14 @@ export type FirewallRulesListByServerResponse = FirewallRuleListResult & { /** * The response body as parsed JSON or XML */ - parsedBody: FirewallRuleListResult; + parsedBody: Configuration; }; }; /** - * Contains response data for the beginCreateOrUpdate operation. + * Contains response data for the beginPut operation. */ -export type FirewallRulesBeginCreateOrUpdateResponse = FirewallRule & { +export type ConfigurationsBeginPutResponse = Configuration & { /** * The underlying HTTP response. */ @@ -1354,14 +1554,14 @@ export type FirewallRulesBeginCreateOrUpdateResponse = FirewallRule & { /** * The response body as parsed JSON or XML */ - parsedBody: FirewallRule; + parsedBody: Configuration; }; }; /** * Contains response data for the listByServerNext operation. */ -export type FirewallRulesListByServerNextResponse = FirewallRuleListResult & { +export type ConfigurationsListByServerNextResponse = ConfigurationListResult & { /** * The underlying HTTP response. */ @@ -1374,14 +1574,14 @@ export type FirewallRulesListByServerNextResponse = FirewallRuleListResult & { /** * The response body as parsed JSON or XML */ - parsedBody: FirewallRuleListResult; + parsedBody: ConfigurationListResult; }; }; /** - * Contains response data for the listByServer operation. + * Contains response data for the execute operation. */ -export type ConfigurationsListByServerResponse = ConfigurationListResult & { +export type CheckNameAvailabilityExecuteResponse = NameAvailability & { /** * The underlying HTTP response. */ @@ -1394,14 +1594,14 @@ export type ConfigurationsListByServerResponse = ConfigurationListResult & { /** * The response body as parsed JSON or XML */ - parsedBody: ConfigurationListResult; + parsedBody: NameAvailability; }; }; /** - * Contains response data for the get operation. + * Contains response data for the execute operation. */ -export type ConfigurationsGetResponse = Configuration & { +export type LocationBasedCapabilitiesExecuteResponse = CapabilitiesListResult & { /** * The underlying HTTP response. */ @@ -1414,14 +1614,14 @@ export type ConfigurationsGetResponse = Configuration & { /** * The response body as parsed JSON or XML */ - parsedBody: Configuration; + parsedBody: CapabilitiesListResult; }; }; /** - * Contains response data for the update operation. + * Contains response data for the executeNext operation. */ -export type ConfigurationsUpdateResponse = Configuration & { +export type LocationBasedCapabilitiesExecuteNextResponse = CapabilitiesListResult & { /** * The underlying HTTP response. */ @@ -1434,14 +1634,14 @@ export type ConfigurationsUpdateResponse = Configuration & { /** * The response body as parsed JSON or XML */ - parsedBody: Configuration; + parsedBody: CapabilitiesListResult; }; }; /** - * Contains response data for the beginUpdate operation. + * Contains response data for the execute operation. */ -export type ConfigurationsBeginUpdateResponse = Configuration & { +export type VirtualNetworkSubnetUsageExecuteResponse = VirtualNetworkSubnetUsageResult & { /** * The underlying HTTP response. */ @@ -1454,14 +1654,14 @@ export type ConfigurationsBeginUpdateResponse = Configuration & { /** * The response body as parsed JSON or XML */ - parsedBody: Configuration; + parsedBody: VirtualNetworkSubnetUsageResult; }; }; /** - * Contains response data for the listByServerNext operation. + * Contains response data for the list operation. */ -export type ConfigurationsListByServerNextResponse = ConfigurationListResult & { +export type OperationsListResponse = OperationListResult & { /** * The underlying HTTP response. */ @@ -1474,14 +1674,14 @@ export type ConfigurationsListByServerNextResponse = ConfigurationListResult & { /** * The response body as parsed JSON or XML */ - parsedBody: ConfigurationListResult; + parsedBody: OperationListResult; }; }; /** - * Contains response data for the execute operation. + * Contains response data for the create operation. */ -export type CheckNameAvailabilityExecuteResponse = NameAvailability & { +export type DatabasesCreateResponse = Database & { /** * The underlying HTTP response. */ @@ -1494,14 +1694,14 @@ export type CheckNameAvailabilityExecuteResponse = NameAvailability & { /** * The response body as parsed JSON or XML */ - parsedBody: NameAvailability; + parsedBody: Database; }; }; /** - * Contains response data for the execute operation. + * Contains response data for the get operation. */ -export type LocationBasedCapabilitiesExecuteResponse = CapabilitiesListResult & { +export type DatabasesGetResponse = Database & { /** * The underlying HTTP response. */ @@ -1514,14 +1714,14 @@ export type LocationBasedCapabilitiesExecuteResponse = CapabilitiesListResult & /** * The response body as parsed JSON or XML */ - parsedBody: CapabilitiesListResult; + parsedBody: Database; }; }; /** - * Contains response data for the executeNext operation. + * Contains response data for the listByServer operation. */ -export type LocationBasedCapabilitiesExecuteNextResponse = CapabilitiesListResult & { +export type DatabasesListByServerResponse = DatabaseListResult & { /** * The underlying HTTP response. */ @@ -1534,14 +1734,14 @@ export type LocationBasedCapabilitiesExecuteNextResponse = CapabilitiesListResul /** * The response body as parsed JSON or XML */ - parsedBody: CapabilitiesListResult; + parsedBody: DatabaseListResult; }; }; /** - * Contains response data for the execute operation. + * Contains response data for the beginCreate operation. */ -export type VirtualNetworkSubnetUsageExecuteResponse = VirtualNetworkSubnetUsageResult & { +export type DatabasesBeginCreateResponse = Database & { /** * The underlying HTTP response. */ @@ -1554,14 +1754,14 @@ export type VirtualNetworkSubnetUsageExecuteResponse = VirtualNetworkSubnetUsage /** * The response body as parsed JSON or XML */ - parsedBody: VirtualNetworkSubnetUsageResult; + parsedBody: Database; }; }; /** - * Contains response data for the get operation. + * Contains response data for the listByServerNext operation. */ -export type RecoverableServersGetResponse = RecoverableServerResource & { +export type DatabasesListByServerNextResponse = DatabaseListResult & { /** * The underlying HTTP response. */ @@ -1574,14 +1774,19 @@ export type RecoverableServersGetResponse = RecoverableServerResource & { /** * The response body as parsed JSON or XML */ - parsedBody: RecoverableServerResource; + parsedBody: DatabaseListResult; }; }; /** - * Contains response data for the list operation. + * Contains response data for the execute operation. */ -export type OperationsListResponse = OperationListResult & { +export type GetPrivateDnsZoneSuffixExecuteResponse = { + /** + * The parsed response body. + */ + body: string; + /** * The underlying HTTP response. */ @@ -1594,6 +1799,6 @@ export type OperationsListResponse = OperationListResult & { /** * The response body as parsed JSON or XML */ - parsedBody: OperationListResult; + parsedBody: string; }; }; diff --git a/sdk/postgresql/arm-postgresql-flexible/src/models/locationBasedCapabilitiesMappers.ts b/sdk/postgresql/arm-postgresql-flexible/src/models/locationBasedCapabilitiesMappers.ts index d8ca8f65034d..731cba513de0 100644 --- a/sdk/postgresql/arm-postgresql-flexible/src/models/locationBasedCapabilitiesMappers.ts +++ b/sdk/postgresql/arm-postgresql-flexible/src/models/locationBasedCapabilitiesMappers.ts @@ -12,7 +12,9 @@ export { CloudError, ErrorAdditionalInfo, ErrorResponse, - ServerEditionCapability, + FlexibleServerEditionCapability, + HyperscaleNodeEditionCapability, + NodeTypeCapability, ServerVersionCapability, StorageEditionCapability, StorageMBCapability, diff --git a/sdk/postgresql/arm-postgresql-flexible/src/models/mappers.ts b/sdk/postgresql/arm-postgresql-flexible/src/models/mappers.ts index b1e27facb697..0069331612de 100644 --- a/sdk/postgresql/arm-postgresql-flexible/src/models/mappers.ts +++ b/sdk/postgresql/arm-postgresql-flexible/src/models/mappers.ts @@ -12,268 +12,6 @@ import * as msRest from "@azure/ms-rest-js"; export const CloudError = CloudErrorMapper; export const BaseResource = BaseResourceMapper; -export const Resource: msRest.CompositeMapper = { - serializedName: "Resource", - type: { - name: "Composite", - className: "Resource", - modelProperties: { - id: { - readOnly: true, - serializedName: "id", - type: { - name: "String" - } - }, - name: { - readOnly: true, - serializedName: "name", - type: { - name: "String" - } - }, - type: { - readOnly: true, - serializedName: "type", - type: { - name: "String" - } - } - } - } -}; - -export const ProxyResource: msRest.CompositeMapper = { - serializedName: "ProxyResource", - type: { - name: "Composite", - className: "ProxyResource", - modelProperties: { - ...Resource.type.modelProperties - } - } -}; - -export const Database: msRest.CompositeMapper = { - serializedName: "Database", - type: { - name: "Composite", - className: "Database", - modelProperties: { - ...ProxyResource.type.modelProperties, - charset: { - serializedName: "properties.charset", - type: { - name: "String" - } - }, - collation: { - serializedName: "properties.collation", - type: { - name: "String" - } - } - } - } -}; - -export const ErrorAdditionalInfo: msRest.CompositeMapper = { - serializedName: "ErrorAdditionalInfo", - type: { - name: "Composite", - className: "ErrorAdditionalInfo", - modelProperties: { - type: { - readOnly: true, - serializedName: "type", - type: { - name: "String" - } - }, - info: { - readOnly: true, - serializedName: "info", - type: { - name: "Object" - } - } - } - } -}; - -export const ErrorResponse: msRest.CompositeMapper = { - serializedName: "ErrorResponse", - type: { - name: "Composite", - className: "ErrorResponse", - modelProperties: { - code: { - readOnly: true, - serializedName: "code", - type: { - name: "String" - } - }, - message: { - readOnly: true, - serializedName: "message", - type: { - name: "String" - } - }, - target: { - readOnly: true, - serializedName: "target", - type: { - name: "String" - } - }, - details: { - readOnly: true, - serializedName: "details", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorResponse" - } - } - } - }, - additionalInfo: { - readOnly: true, - serializedName: "additionalInfo", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorAdditionalInfo" - } - } - } - } - } - } -}; - -export const TrackedResource: msRest.CompositeMapper = { - serializedName: "TrackedResource", - type: { - name: "Composite", - className: "TrackedResource", - modelProperties: { - ...Resource.type.modelProperties, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } - } - }, - location: { - required: true, - serializedName: "location", - type: { - name: "String" - } - } - } - } -}; - -export const AzureEntityResource: msRest.CompositeMapper = { - serializedName: "AzureEntityResource", - type: { - name: "Composite", - className: "AzureEntityResource", - modelProperties: { - ...Resource.type.modelProperties, - etag: { - readOnly: true, - serializedName: "etag", - type: { - name: "String" - } - } - } - } -}; - -export const Sku: msRest.CompositeMapper = { - serializedName: "Sku", - type: { - name: "Composite", - className: "Sku", - modelProperties: { - name: { - required: true, - serializedName: "name", - type: { - name: "String" - } - }, - tier: { - required: true, - serializedName: "tier", - type: { - name: "String" - } - } - } - } -}; - -export const RecoverableServerResource: msRest.CompositeMapper = { - serializedName: "RecoverableServerResource", - type: { - name: "Composite", - className: "RecoverableServerResource", - modelProperties: { - ...ProxyResource.type.modelProperties, - sku: { - serializedName: "sku", - type: { - name: "Composite", - className: "Sku" - } - }, - location: { - serializedName: "location", - type: { - name: "String" - } - }, - availabilityZone: { - readOnly: true, - serializedName: "properties.availabilityZone", - type: { - name: "String" - } - }, - serverEdition: { - readOnly: true, - serializedName: "properties.serverEdition", - type: { - name: "String" - } - }, - version: { - readOnly: true, - serializedName: "properties.version", - type: { - name: "String" - } - } - } - } -}; - export const VirtualNetworkSubnetUsageParameter: msRest.CompositeMapper = { serializedName: "VirtualNetworkSubnetUsageParameter", type: { @@ -363,6 +101,13 @@ export const StorageMBCapability: msRest.CompositeMapper = { type: { name: "Number" } + }, + status: { + readOnly: true, + serializedName: "status", + type: { + name: "String" + } } } } @@ -401,6 +146,13 @@ export const VcoreCapability: msRest.CompositeMapper = { type: { name: "Number" } + }, + status: { + readOnly: true, + serializedName: "status", + type: { + name: "String" + } } } } @@ -431,6 +183,13 @@ export const ServerVersionCapability: msRest.CompositeMapper = { } } } + }, + status: { + readOnly: true, + serializedName: "status", + type: { + name: "String" + } } } } @@ -440,7 +199,75 @@ export const StorageEditionCapability: msRest.CompositeMapper = { serializedName: "StorageEditionCapability", type: { name: "Composite", - className: "StorageEditionCapability", + className: "StorageEditionCapability", + modelProperties: { + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + supportedStorageMB: { + readOnly: true, + serializedName: "supportedStorageMB", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "StorageMBCapability" + } + } + } + }, + status: { + readOnly: true, + serializedName: "status", + type: { + name: "String" + } + } + } + } +}; + +export const NodeTypeCapability: msRest.CompositeMapper = { + serializedName: "NodeTypeCapability", + type: { + name: "Composite", + className: "NodeTypeCapability", + modelProperties: { + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + nodeType: { + readOnly: true, + serializedName: "nodeType", + type: { + name: "String" + } + }, + status: { + readOnly: true, + serializedName: "status", + type: { + name: "String" + } + } + } + } +}; + +export const FlexibleServerEditionCapability: msRest.CompositeMapper = { + serializedName: "FlexibleServerEditionCapability", + type: { + name: "Composite", + className: "FlexibleServerEditionCapability", modelProperties: { name: { readOnly: true, @@ -449,28 +276,48 @@ export const StorageEditionCapability: msRest.CompositeMapper = { name: "String" } }, - supportedStorageMB: { + supportedStorageEditions: { readOnly: true, - serializedName: "supportedStorageMB", + serializedName: "supportedStorageEditions", type: { name: "Sequence", element: { type: { name: "Composite", - className: "StorageMBCapability" + className: "StorageEditionCapability" + } + } + } + }, + supportedServerVersions: { + readOnly: true, + serializedName: "supportedServerVersions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ServerVersionCapability" } } } + }, + status: { + readOnly: true, + serializedName: "status", + type: { + name: "String" + } } } } }; -export const ServerEditionCapability: msRest.CompositeMapper = { - serializedName: "ServerEditionCapability", +export const HyperscaleNodeEditionCapability: msRest.CompositeMapper = { + serializedName: "HyperscaleNodeEditionCapability", type: { name: "Composite", - className: "ServerEditionCapability", + className: "HyperscaleNodeEditionCapability", modelProperties: { name: { readOnly: true, @@ -504,6 +351,26 @@ export const ServerEditionCapability: msRest.CompositeMapper = { } } } + }, + supportedNodeTypes: { + readOnly: true, + serializedName: "supportedNodeTypes", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NodeTypeCapability" + } + } + } + }, + status: { + readOnly: true, + serializedName: "status", + type: { + name: "String" + } } } } @@ -522,6 +389,27 @@ export const CapabilityProperties: msRest.CompositeMapper = { name: "String" } }, + geoBackupSupported: { + readOnly: true, + serializedName: "geoBackupSupported", + type: { + name: "Boolean" + } + }, + zoneRedundantHaSupported: { + readOnly: true, + serializedName: "zoneRedundantHaSupported", + type: { + name: "Boolean" + } + }, + zoneRedundantHaAndGeoBackupSupported: { + readOnly: true, + serializedName: "zoneRedundantHaAndGeoBackupSupported", + type: { + name: "Boolean" + } + }, supportedFlexibleServerEditions: { readOnly: true, serializedName: "supportedFlexibleServerEditions", @@ -530,29 +418,59 @@ export const CapabilityProperties: msRest.CompositeMapper = { element: { type: { name: "Composite", - className: "ServerEditionCapability" + className: "FlexibleServerEditionCapability" + } + } + } + }, + supportedHyperscaleNodeEditions: { + readOnly: true, + serializedName: "supportedHyperscaleNodeEditions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "HyperscaleNodeEditionCapability" } } } + }, + status: { + readOnly: true, + serializedName: "status", + type: { + name: "String" + } } } } }; -export const StorageProfile: msRest.CompositeMapper = { - serializedName: "StorageProfile", +export const Storage: msRest.CompositeMapper = { + serializedName: "Storage", type: { name: "Composite", - className: "StorageProfile", + className: "Storage", modelProperties: { - backupRetentionDays: { - serializedName: "backupRetentionDays", + storageSizeGB: { + serializedName: "storageSizeGB", type: { name: "Number" } - }, - storageMB: { - serializedName: "storageMB", + } + } + } +}; + +export const Backup: msRest.CompositeMapper = { + serializedName: "Backup", + type: { + name: "Composite", + className: "Backup", + modelProperties: { + backupRetentionDays: { + serializedName: "backupRetentionDays", type: { name: "Number" } @@ -562,6 +480,71 @@ export const StorageProfile: msRest.CompositeMapper = { type: { name: "String" } + }, + earliestRestoreDate: { + readOnly: true, + serializedName: "earliestRestoreDate", + type: { + name: "DateTime" + } + } + } + } +}; + +export const Network: msRest.CompositeMapper = { + serializedName: "Network", + type: { + name: "Composite", + className: "Network", + modelProperties: { + publicNetworkAccess: { + readOnly: true, + serializedName: "publicNetworkAccess", + type: { + name: "String" + } + }, + delegatedSubnetResourceId: { + serializedName: "delegatedSubnetResourceId", + type: { + name: "String" + } + }, + privateDnsZoneArmResourceId: { + serializedName: "privateDnsZoneArmResourceId", + type: { + name: "String" + } + } + } + } +}; + +export const HighAvailability: msRest.CompositeMapper = { + serializedName: "HighAvailability", + type: { + name: "Composite", + className: "HighAvailability", + modelProperties: { + mode: { + serializedName: "mode", + type: { + name: "String" + } + }, + state: { + readOnly: true, + serializedName: "state", + type: { + name: "String" + } + }, + standbyAvailabilityZone: { + serializedName: "standbyAvailabilityZone", + type: { + name: "String" + } } } } @@ -601,30 +584,55 @@ export const MaintenanceWindow: msRest.CompositeMapper = { } }; -export const ServerPropertiesDelegatedSubnetArguments: msRest.CompositeMapper = { - serializedName: "ServerProperties_delegatedSubnetArguments", +export const Identity: msRest.CompositeMapper = { + serializedName: "Identity", type: { name: "Composite", - className: "ServerPropertiesDelegatedSubnetArguments", + className: "Identity", modelProperties: { - subnetArmResourceId: { - serializedName: "subnetArmResourceId", + principalId: { + readOnly: true, + serializedName: "principalId", + type: { + name: "String" + } + }, + tenantId: { + readOnly: true, + serializedName: "tenantId", type: { name: "String" } + }, + type: { + serializedName: "type", + type: { + name: "Enum", + allowedValues: [ + "SystemAssigned" + ] + } } } } }; -export const ServerPropertiesPrivateDnsZoneArguments: msRest.CompositeMapper = { - serializedName: "ServerProperties_privateDnsZoneArguments", +export const Sku: msRest.CompositeMapper = { + serializedName: "Sku", type: { name: "Composite", - className: "ServerPropertiesPrivateDnsZoneArguments", + className: "Sku", modelProperties: { - privateDnsZoneArmResourceId: { - serializedName: "privateDnsZoneArmResourceId", + name: { + required: true, + serializedName: "name", + type: { + name: "String" + } + }, + tier: { + required: true, + serializedName: "tier", type: { name: "String" } @@ -633,33 +641,106 @@ export const ServerPropertiesPrivateDnsZoneArguments: msRest.CompositeMapper = { } }; -export const Identity: msRest.CompositeMapper = { - serializedName: "Identity", +export const SystemData: msRest.CompositeMapper = { + serializedName: "systemData", type: { name: "Composite", - className: "Identity", + className: "SystemData", modelProperties: { - principalId: { + createdBy: { + serializedName: "createdBy", + type: { + name: "String" + } + }, + createdByType: { + serializedName: "createdByType", + type: { + name: "String" + } + }, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime" + } + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String" + } + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String" + } + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime" + } + } + } + } +}; + +export const Resource: msRest.CompositeMapper = { + serializedName: "Resource", + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { readOnly: true, - serializedName: "principalId", + serializedName: "id", type: { name: "String" } }, - tenantId: { + name: { readOnly: true, - serializedName: "tenantId", + serializedName: "name", type: { name: "String" } }, type: { + readOnly: true, serializedName: "type", type: { - name: "Enum", - allowedValues: [ - "SystemAssigned" - ] + name: "String" + } + } + } + } +}; + +export const TrackedResource: msRest.CompositeMapper = { + serializedName: "TrackedResource", + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + }, + location: { + required: true, + serializedName: "location", + type: { + name: "String" } } } @@ -705,6 +786,13 @@ export const Server: msRest.CompositeMapper = { name: "String" } }, + minorVersion: { + readOnly: true, + serializedName: "properties.minorVersion", + type: { + name: "String" + } + }, state: { readOnly: true, serializedName: "properties.state", @@ -712,38 +800,39 @@ export const Server: msRest.CompositeMapper = { name: "String" } }, - haState: { + fullyQualifiedDomainName: { readOnly: true, - serializedName: "properties.haState", + serializedName: "properties.fullyQualifiedDomainName", type: { name: "String" } }, - fullyQualifiedDomainName: { - readOnly: true, - serializedName: "properties.fullyQualifiedDomainName", + storage: { + serializedName: "properties.storage", type: { - name: "String" + name: "Composite", + className: "Storage" } }, - displayName: { - serializedName: "properties.displayName", + backup: { + serializedName: "properties.backup", type: { - name: "String" + name: "Composite", + className: "Backup" } }, - storageProfile: { - serializedName: "properties.storageProfile", + network: { + serializedName: "properties.network", type: { name: "Composite", - className: "StorageProfile" + className: "Network" } }, - publicNetworkAccess: { - readOnly: true, - serializedName: "properties.publicNetworkAccess", + highAvailability: { + serializedName: "properties.highAvailability", type: { - name: "String" + name: "Composite", + className: "HighAvailability" } }, maintenanceWindow: { @@ -753,30 +842,8 @@ export const Server: msRest.CompositeMapper = { className: "MaintenanceWindow" } }, - haEnabled: { - serializedName: "properties.haEnabled", - type: { - name: "Enum", - allowedValues: [ - "Enabled", - "Disabled" - ] - } - }, - sourceServerName: { - serializedName: "properties.sourceServerName", - type: { - name: "String" - } - }, - sourceSubscriptionId: { - serializedName: "properties.sourceSubscriptionId", - type: { - name: "String" - } - }, - sourceResourceGroupName: { - serializedName: "properties.sourceResourceGroupName", + sourceServerResourceId: { + serializedName: "properties.sourceServerResourceId", type: { name: "String" } @@ -793,34 +860,6 @@ export const Server: msRest.CompositeMapper = { name: "String" } }, - standbyAvailabilityZone: { - readOnly: true, - serializedName: "properties.standbyAvailabilityZone", - type: { - name: "String" - } - }, - byokEnforcement: { - readOnly: true, - serializedName: "properties.byokEnforcement", - type: { - name: "String" - } - }, - delegatedSubnetArguments: { - serializedName: "properties.delegatedSubnetArguments", - type: { - name: "Composite", - className: "ServerPropertiesDelegatedSubnetArguments" - } - }, - privateDnsZoneArguments: { - serializedName: "properties.privateDnsZoneArguments", - type: { - name: "Composite", - className: "ServerPropertiesPrivateDnsZoneArguments" - } - }, createMode: { serializedName: "properties.createMode", type: { @@ -837,6 +876,14 @@ export const Server: msRest.CompositeMapper = { } } } + }, + systemData: { + readOnly: true, + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } } } } @@ -867,21 +914,25 @@ export const ServerForUpdate: msRest.CompositeMapper = { name: "String" } }, - storageProfile: { - serializedName: "properties.storageProfile", + storage: { + serializedName: "properties.storage", type: { name: "Composite", - className: "StorageProfile" + className: "Storage" } }, - haEnabled: { - serializedName: "properties.haEnabled", + backup: { + serializedName: "properties.backup", type: { - name: "Enum", - allowedValues: [ - "Enabled", - "Disabled" - ] + name: "Composite", + className: "Backup" + } + }, + highAvailability: { + serializedName: "properties.highAvailability", + type: { + name: "Composite", + className: "HighAvailability" } }, maintenanceWindow: { @@ -891,6 +942,12 @@ export const ServerForUpdate: msRest.CompositeMapper = { className: "MaintenanceWindow" } }, + createMode: { + serializedName: "properties.createMode", + type: { + name: "String" + } + }, tags: { serializedName: "tags", type: { @@ -906,6 +963,17 @@ export const ServerForUpdate: msRest.CompositeMapper = { } }; +export const ProxyResource: msRest.CompositeMapper = { + serializedName: "ProxyResource", + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties + } + } +}; + export const FirewallRule: msRest.CompositeMapper = { serializedName: "FirewallRule", type: { @@ -932,6 +1000,14 @@ export const FirewallRule: msRest.CompositeMapper = { type: { name: "String" } + }, + systemData: { + readOnly: true, + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } } } } @@ -983,6 +1059,14 @@ export const Configuration: msRest.CompositeMapper = { type: { name: "String" } + }, + systemData: { + readOnly: true, + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } } } } @@ -1161,6 +1245,127 @@ export const NameAvailability: msRest.CompositeMapper = { } }; +export const RestartParameter: msRest.CompositeMapper = { + serializedName: "RestartParameter", + type: { + name: "Composite", + className: "RestartParameter", + modelProperties: { + restartWithFailover: { + serializedName: "restartWithFailover", + type: { + name: "Boolean" + } + }, + failoverMode: { + serializedName: "failoverMode", + type: { + name: "String" + } + } + } + } +}; + +export const ErrorAdditionalInfo: msRest.CompositeMapper = { + serializedName: "ErrorAdditionalInfo", + type: { + name: "Composite", + className: "ErrorAdditionalInfo", + modelProperties: { + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + info: { + readOnly: true, + serializedName: "info", + type: { + name: "Object" + } + } + } + } +}; + +export const ErrorResponse: msRest.CompositeMapper = { + serializedName: "ErrorResponse", + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + code: { + readOnly: true, + serializedName: "code", + type: { + name: "String" + } + }, + message: { + readOnly: true, + serializedName: "message", + type: { + name: "String" + } + }, + target: { + readOnly: true, + serializedName: "target", + type: { + name: "String" + } + }, + details: { + readOnly: true, + serializedName: "details", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorResponse" + } + } + } + }, + additionalInfo: { + readOnly: true, + serializedName: "additionalInfo", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo" + } + } + } + } + } + } +}; + +export const AzureEntityResource: msRest.CompositeMapper = { + serializedName: "AzureEntityResource", + type: { + name: "Composite", + className: "AzureEntityResource", + modelProperties: { + ...Resource.type.modelProperties, + etag: { + readOnly: true, + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; + export const ResourceModelWithAllowedPropertySetIdentity: msRest.CompositeMapper = { serializedName: "ResourceModelWithAllowedPropertySet_identity", type: { @@ -1328,29 +1533,32 @@ export const ResourceModelWithAllowedPropertySet: msRest.CompositeMapper = { } }; -export const DatabaseListResult: msRest.CompositeMapper = { - serializedName: "DatabaseListResult", +export const Database: msRest.CompositeMapper = { + serializedName: "Database", type: { name: "Composite", - className: "DatabaseListResult", + className: "Database", modelProperties: { - value: { - serializedName: "", + ...ProxyResource.type.modelProperties, + charset: { + serializedName: "properties.charset", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Database" - } - } + name: "String" } }, - nextLink: { - serializedName: "nextLink", + collation: { + serializedName: "properties.collation", type: { name: "String" } + }, + systemData: { + readOnly: true, + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } } } } @@ -1469,3 +1677,31 @@ export const CapabilitiesListResult: msRest.CompositeMapper = { } } }; + +export const DatabaseListResult: msRest.CompositeMapper = { + serializedName: "DatabaseListResult", + type: { + name: "Composite", + className: "DatabaseListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Database" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/postgresql/arm-postgresql-flexible/src/models/parameters.ts b/sdk/postgresql/arm-postgresql-flexible/src/models/parameters.ts index c8fe4a8e2b16..de9e3c42451a 100644 --- a/sdk/postgresql/arm-postgresql-flexible/src/models/parameters.ts +++ b/sdk/postgresql/arm-postgresql-flexible/src/models/parameters.ts @@ -19,43 +19,11 @@ export const acceptLanguage: msRest.OperationParameter = { } } }; -export const apiVersion0: msRest.OperationQueryParameter = { +export const apiVersion: msRest.OperationQueryParameter = { parameterPath: "apiVersion", mapper: { required: true, - isConstant: true, serializedName: "api-version", - defaultValue: '2020-11-05-preview', - constraints: { - MinLength: 1 - }, - type: { - name: "String" - } - } -}; -export const apiVersion1: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - required: true, - isConstant: true, - serializedName: "api-version", - defaultValue: '2021-03-31-privatepreview', - constraints: { - MinLength: 1 - }, - type: { - name: "String" - } - } -}; -export const apiVersion2: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - required: true, - isConstant: true, - serializedName: "api-version", - defaultValue: '2021-04-10-privatepreview', constraints: { MinLength: 1 }, @@ -122,8 +90,7 @@ export const resourceGroupName: msRest.OperationURLParameter = { serializedName: "resourceGroupName", constraints: { MaxLength: 90, - MinLength: 1, - Pattern: /^[-\w\._\(\)]+$/ + MinLength: 1 }, type: { name: "String" diff --git a/sdk/postgresql/arm-postgresql-flexible/src/models/recoverableServersMappers.ts b/sdk/postgresql/arm-postgresql-flexible/src/models/recoverableServersMappers.ts deleted file mode 100644 index 217f16cfbb31..000000000000 --- a/sdk/postgresql/arm-postgresql-flexible/src/models/recoverableServersMappers.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - AzureEntityResource, - BaseResource, - CloudError, - Configuration, - Database, - ErrorAdditionalInfo, - ErrorResponse, - FirewallRule, - Identity, - MaintenanceWindow, - Plan, - ProxyResource, - RecoverableServerResource, - Resource, - ResourceModelWithAllowedPropertySet, - ResourceModelWithAllowedPropertySetIdentity, - ResourceModelWithAllowedPropertySetPlan, - ResourceModelWithAllowedPropertySetSku, - Server, - ServerPropertiesDelegatedSubnetArguments, - ServerPropertiesPrivateDnsZoneArguments, - Sku, - StorageProfile, - TrackedResource -} from "../models/mappers"; diff --git a/sdk/postgresql/arm-postgresql-flexible/src/models/serversMappers.ts b/sdk/postgresql/arm-postgresql-flexible/src/models/serversMappers.ts index c9df4ef13453..121df0cf53d1 100644 --- a/sdk/postgresql/arm-postgresql-flexible/src/models/serversMappers.ts +++ b/sdk/postgresql/arm-postgresql-flexible/src/models/serversMappers.ts @@ -8,6 +8,7 @@ export { AzureEntityResource, + Backup, BaseResource, CloudError, Configuration, @@ -15,22 +16,23 @@ export { ErrorAdditionalInfo, ErrorResponse, FirewallRule, + HighAvailability, Identity, MaintenanceWindow, + Network, Plan, ProxyResource, - RecoverableServerResource, Resource, ResourceModelWithAllowedPropertySet, ResourceModelWithAllowedPropertySetIdentity, ResourceModelWithAllowedPropertySetPlan, ResourceModelWithAllowedPropertySetSku, + RestartParameter, Server, ServerForUpdate, ServerListResult, - ServerPropertiesDelegatedSubnetArguments, - ServerPropertiesPrivateDnsZoneArguments, Sku, - StorageProfile, + Storage, + SystemData, TrackedResource } from "../models/mappers"; diff --git a/sdk/postgresql/arm-postgresql-flexible/src/operations/checkNameAvailability.ts b/sdk/postgresql/arm-postgresql-flexible/src/operations/checkNameAvailability.ts index 71b920982dc2..b91464de1da5 100644 --- a/sdk/postgresql/arm-postgresql-flexible/src/operations/checkNameAvailability.ts +++ b/sdk/postgresql/arm-postgresql-flexible/src/operations/checkNameAvailability.ts @@ -11,17 +11,17 @@ import * as msRest from "@azure/ms-rest-js"; import * as Models from "../models"; import * as Mappers from "../models/checkNameAvailabilityMappers"; import * as Parameters from "../models/parameters"; -import { PostgreSQLFlexibleManagementClientContext } from "../postgreSQLFlexibleManagementClientContext"; +import { PostgreSQLManagementClientContext } from "../postgreSQLManagementClientContext"; /** Class representing a CheckNameAvailability. */ export class CheckNameAvailability { - private readonly client: PostgreSQLFlexibleManagementClientContext; + private readonly client: PostgreSQLManagementClientContext; /** * Create a CheckNameAvailability. - * @param {PostgreSQLFlexibleManagementClientContext} client Reference to the service client. + * @param {PostgreSQLManagementClientContext} client Reference to the service client. */ - constructor(client: PostgreSQLFlexibleManagementClientContext) { + constructor(client: PostgreSQLManagementClientContext) { this.client = client; } @@ -66,7 +66,7 @@ const executeOperationSpec: msRest.OperationSpec = { Parameters.subscriptionId ], queryParameters: [ - Parameters.apiVersion2 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage diff --git a/sdk/postgresql/arm-postgresql-flexible/src/operations/configurations.ts b/sdk/postgresql/arm-postgresql-flexible/src/operations/configurations.ts index 261b32a55323..3c43d0482b49 100644 --- a/sdk/postgresql/arm-postgresql-flexible/src/operations/configurations.ts +++ b/sdk/postgresql/arm-postgresql-flexible/src/operations/configurations.ts @@ -12,17 +12,17 @@ import * as msRestAzure from "@azure/ms-rest-azure-js"; import * as Models from "../models"; import * as Mappers from "../models/configurationsMappers"; import * as Parameters from "../models/parameters"; -import { PostgreSQLFlexibleManagementClientContext } from "../postgreSQLFlexibleManagementClientContext"; +import { PostgreSQLManagementClientContext } from "../postgreSQLManagementClientContext"; /** Class representing a Configurations. */ export class Configurations { - private readonly client: PostgreSQLFlexibleManagementClientContext; + private readonly client: PostgreSQLManagementClientContext; /** * Create a Configurations. - * @param {PostgreSQLFlexibleManagementClientContext} client Reference to the service client. + * @param {PostgreSQLManagementClientContext} client Reference to the service client. */ - constructor(client: PostgreSQLFlexibleManagementClientContext) { + constructor(client: PostgreSQLManagementClientContext) { this.client = client; } @@ -108,6 +108,20 @@ export class Configurations { .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; } + /** + * Updates a configuration of a server. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @param [options] The optional parameters + * @returns Promise + */ + put(resourceGroupName: string, serverName: string, configurationName: string, parameters: Models.Configuration, options?: msRest.RequestOptionsBase): Promise { + return this.beginPut(resourceGroupName,serverName,configurationName,parameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + /** * Updates a configuration of a server. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -130,6 +144,28 @@ export class Configurations { options); } + /** + * Updates a configuration of a server. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param configurationName The name of the server configuration. + * @param parameters The required parameters for updating a server configuration. + * @param [options] The optional parameters + * @returns Promise + */ + beginPut(resourceGroupName: string, serverName: string, configurationName: string, parameters: Models.Configuration, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + serverName, + configurationName, + parameters, + options + }, + beginPutOperationSpec, + options); + } + /** * List all the configurations in a given server. * @param nextPageLink The NextLink from the previous successful call to List operation. @@ -170,7 +206,7 @@ const listByServerOperationSpec: msRest.OperationSpec = { Parameters.serverName ], queryParameters: [ - Parameters.apiVersion2 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -196,7 +232,7 @@ const getOperationSpec: msRest.OperationSpec = { Parameters.configurationName ], queryParameters: [ - Parameters.apiVersion2 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -222,7 +258,41 @@ const beginUpdateOperationSpec: msRest.OperationSpec = { Parameters.configurationName ], queryParameters: [ - Parameters.apiVersion2 + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.Configuration, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Configuration + }, + 202: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginPutOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql/flexibleServers/{serverName}/configurations/{configurationName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName, + Parameters.configurationName + ], + queryParameters: [ + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -254,7 +324,7 @@ const listByServerNextOperationSpec: msRest.OperationSpec = { Parameters.nextPageLink ], queryParameters: [ - Parameters.apiVersion2 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage diff --git a/sdk/postgresql/arm-postgresql-flexible/src/operations/databases.ts b/sdk/postgresql/arm-postgresql-flexible/src/operations/databases.ts index b9da26173ca5..92c5fdc95bd9 100644 --- a/sdk/postgresql/arm-postgresql-flexible/src/operations/databases.ts +++ b/sdk/postgresql/arm-postgresql-flexible/src/operations/databases.ts @@ -12,17 +12,17 @@ import * as msRestAzure from "@azure/ms-rest-azure-js"; import * as Models from "../models"; import * as Mappers from "../models/databasesMappers"; import * as Parameters from "../models/parameters"; -import { PostgreSQLFlexibleManagementClientContext } from "../postgreSQLFlexibleManagementClientContext"; +import { PostgreSQLManagementClientContext } from "../postgreSQLManagementClientContext"; /** Class representing a Databases. */ export class Databases { - private readonly client: PostgreSQLFlexibleManagementClientContext; + private readonly client: PostgreSQLManagementClientContext; /** * Create a Databases. - * @param {PostgreSQLFlexibleManagementClientContext} client Reference to the service client. + * @param {PostgreSQLManagementClientContext} client Reference to the service client. */ - constructor(client: PostgreSQLFlexibleManagementClientContext) { + constructor(client: PostgreSQLManagementClientContext) { this.client = client; } @@ -204,7 +204,7 @@ const getOperationSpec: msRest.OperationSpec = { Parameters.databaseName ], queryParameters: [ - Parameters.apiVersion0 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -229,7 +229,7 @@ const listByServerOperationSpec: msRest.OperationSpec = { Parameters.serverName ], queryParameters: [ - Parameters.apiVersion0 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -255,7 +255,7 @@ const beginCreateOperationSpec: msRest.OperationSpec = { Parameters.databaseName ], queryParameters: [ - Parameters.apiVersion0 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -292,7 +292,7 @@ const beginDeleteMethodOperationSpec: msRest.OperationSpec = { Parameters.databaseName ], queryParameters: [ - Parameters.apiVersion0 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -316,7 +316,7 @@ const listByServerNextOperationSpec: msRest.OperationSpec = { Parameters.nextPageLink ], queryParameters: [ - Parameters.apiVersion0 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage diff --git a/sdk/postgresql/arm-postgresql-flexible/src/operations/firewallRules.ts b/sdk/postgresql/arm-postgresql-flexible/src/operations/firewallRules.ts index a6496e4ba501..82417e785e5b 100644 --- a/sdk/postgresql/arm-postgresql-flexible/src/operations/firewallRules.ts +++ b/sdk/postgresql/arm-postgresql-flexible/src/operations/firewallRules.ts @@ -12,17 +12,17 @@ import * as msRestAzure from "@azure/ms-rest-azure-js"; import * as Models from "../models"; import * as Mappers from "../models/firewallRulesMappers"; import * as Parameters from "../models/parameters"; -import { PostgreSQLFlexibleManagementClientContext } from "../postgreSQLFlexibleManagementClientContext"; +import { PostgreSQLManagementClientContext } from "../postgreSQLManagementClientContext"; /** Class representing a FirewallRules. */ export class FirewallRules { - private readonly client: PostgreSQLFlexibleManagementClientContext; + private readonly client: PostgreSQLManagementClientContext; /** * Create a FirewallRules. - * @param {PostgreSQLFlexibleManagementClientContext} client Reference to the service client. + * @param {PostgreSQLManagementClientContext} client Reference to the service client. */ - constructor(client: PostgreSQLFlexibleManagementClientContext) { + constructor(client: PostgreSQLManagementClientContext) { this.client = client; } @@ -204,7 +204,7 @@ const getOperationSpec: msRest.OperationSpec = { Parameters.firewallRuleName ], queryParameters: [ - Parameters.apiVersion2 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -229,7 +229,7 @@ const listByServerOperationSpec: msRest.OperationSpec = { Parameters.serverName ], queryParameters: [ - Parameters.apiVersion2 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -255,7 +255,7 @@ const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { Parameters.firewallRuleName ], queryParameters: [ - Parameters.apiVersion2 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -292,7 +292,7 @@ const beginDeleteMethodOperationSpec: msRest.OperationSpec = { Parameters.firewallRuleName ], queryParameters: [ - Parameters.apiVersion2 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -316,7 +316,7 @@ const listByServerNextOperationSpec: msRest.OperationSpec = { Parameters.nextPageLink ], queryParameters: [ - Parameters.apiVersion2 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage diff --git a/sdk/postgresql/arm-postgresql-flexible/src/operations/getPrivateDnsZoneSuffix.ts b/sdk/postgresql/arm-postgresql-flexible/src/operations/getPrivateDnsZoneSuffix.ts index 9bcd159b7cd9..cf523a0e02fd 100644 --- a/sdk/postgresql/arm-postgresql-flexible/src/operations/getPrivateDnsZoneSuffix.ts +++ b/sdk/postgresql/arm-postgresql-flexible/src/operations/getPrivateDnsZoneSuffix.ts @@ -11,45 +11,38 @@ import * as msRest from "@azure/ms-rest-js"; import * as Models from "../models"; import * as Mappers from "../models/getPrivateDnsZoneSuffixMappers"; import * as Parameters from "../models/parameters"; -import { PostgreSQLFlexibleManagementClientContext } from "../postgreSQLFlexibleManagementClientContext"; +import { PostgreSQLManagementClientContext } from "../postgreSQLManagementClientContext"; /** Class representing a GetPrivateDnsZoneSuffix. */ export class GetPrivateDnsZoneSuffix { - private readonly client: PostgreSQLFlexibleManagementClientContext; + private readonly client: PostgreSQLManagementClientContext; /** * Create a GetPrivateDnsZoneSuffix. - * @param {PostgreSQLFlexibleManagementClientContext} client Reference to the service client. + * @param {PostgreSQLManagementClientContext} client Reference to the service client. */ - constructor(client: PostgreSQLFlexibleManagementClientContext) { + constructor(client: PostgreSQLManagementClientContext) { this.client = client; } /** * Get private DNS zone suffix in the cloud - * @param body The required parameters for getting private DNS zone suffix based on server type. - * Possible values include: 'PostgreSQL', 'PostgreSQLCitus', 'MySQL', 'MariaDb', 'Oracle' * @param [options] The optional parameters * @returns Promise */ - execute(body: Models.Body, options?: msRest.RequestOptionsBase): Promise; + execute(options?: msRest.RequestOptionsBase): Promise; /** - * @param body The required parameters for getting private DNS zone suffix based on server type. - * Possible values include: 'PostgreSQL', 'PostgreSQLCitus', 'MySQL', 'MariaDb', 'Oracle' * @param callback The callback */ - execute(body: Models.Body, callback: msRest.ServiceCallback): void; + execute(callback: msRest.ServiceCallback): void; /** - * @param body The required parameters for getting private DNS zone suffix based on server type. - * Possible values include: 'PostgreSQL', 'PostgreSQLCitus', 'MySQL', 'MariaDb', 'Oracle' * @param options The optional parameters * @param callback The callback */ - execute(body: Models.Body, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - execute(body: Models.Body, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + execute(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + execute(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { - body, options }, executeOperationSpec, @@ -61,26 +54,13 @@ export class GetPrivateDnsZoneSuffix { const serializer = new msRest.Serializer(Mappers); const executeOperationSpec: msRest.OperationSpec = { httpMethod: "POST", - path: "subscriptions/{subscriptionId}/providers/Microsoft.DBForPostgreSql/getPrivateDnsZoneSuffix", - urlParameters: [ - Parameters.subscriptionId - ], + path: "providers/Microsoft.DBForPostgreSql/getPrivateDnsZoneSuffix", queryParameters: [ - Parameters.apiVersion1 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage ], - requestBody: { - parameterPath: "body", - mapper: { - required: true, - serializedName: "body", - type: { - name: "String" - } - } - }, responses: { 200: { bodyMapper: { diff --git a/sdk/postgresql/arm-postgresql-flexible/src/operations/index.ts b/sdk/postgresql/arm-postgresql-flexible/src/operations/index.ts index 5054eefb8e76..7f293c100d11 100644 --- a/sdk/postgresql/arm-postgresql-flexible/src/operations/index.ts +++ b/sdk/postgresql/arm-postgresql-flexible/src/operations/index.ts @@ -7,13 +7,12 @@ * regenerated. */ -export * from "./databases"; -export * from "./getPrivateDnsZoneSuffix"; export * from "./servers"; export * from "./firewallRules"; export * from "./configurations"; export * from "./checkNameAvailability"; export * from "./locationBasedCapabilities"; export * from "./virtualNetworkSubnetUsage"; -export * from "./recoverableServers"; export * from "./operations"; +export * from "./databases"; +export * from "./getPrivateDnsZoneSuffix"; diff --git a/sdk/postgresql/arm-postgresql-flexible/src/operations/locationBasedCapabilities.ts b/sdk/postgresql/arm-postgresql-flexible/src/operations/locationBasedCapabilities.ts index c49fae36be76..0bafacc33c84 100644 --- a/sdk/postgresql/arm-postgresql-flexible/src/operations/locationBasedCapabilities.ts +++ b/sdk/postgresql/arm-postgresql-flexible/src/operations/locationBasedCapabilities.ts @@ -11,17 +11,17 @@ import * as msRest from "@azure/ms-rest-js"; import * as Models from "../models"; import * as Mappers from "../models/locationBasedCapabilitiesMappers"; import * as Parameters from "../models/parameters"; -import { PostgreSQLFlexibleManagementClientContext } from "../postgreSQLFlexibleManagementClientContext"; +import { PostgreSQLManagementClientContext } from "../postgreSQLManagementClientContext"; /** Class representing a LocationBasedCapabilities. */ export class LocationBasedCapabilities { - private readonly client: PostgreSQLFlexibleManagementClientContext; + private readonly client: PostgreSQLManagementClientContext; /** * Create a LocationBasedCapabilities. - * @param {PostgreSQLFlexibleManagementClientContext} client Reference to the service client. + * @param {PostgreSQLManagementClientContext} client Reference to the service client. */ - constructor(client: PostgreSQLFlexibleManagementClientContext) { + constructor(client: PostgreSQLManagementClientContext) { this.client = client; } @@ -92,7 +92,7 @@ const executeOperationSpec: msRest.OperationSpec = { Parameters.locationName ], queryParameters: [ - Parameters.apiVersion2 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -116,7 +116,7 @@ const executeNextOperationSpec: msRest.OperationSpec = { Parameters.nextPageLink ], queryParameters: [ - Parameters.apiVersion2 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage diff --git a/sdk/postgresql/arm-postgresql-flexible/src/operations/operations.ts b/sdk/postgresql/arm-postgresql-flexible/src/operations/operations.ts index 18a4e9afcf7a..155dbe32fe3d 100644 --- a/sdk/postgresql/arm-postgresql-flexible/src/operations/operations.ts +++ b/sdk/postgresql/arm-postgresql-flexible/src/operations/operations.ts @@ -11,17 +11,17 @@ import * as msRest from "@azure/ms-rest-js"; import * as Models from "../models"; import * as Mappers from "../models/operationsMappers"; import * as Parameters from "../models/parameters"; -import { PostgreSQLFlexibleManagementClientContext } from "../postgreSQLFlexibleManagementClientContext"; +import { PostgreSQLManagementClientContext } from "../postgreSQLManagementClientContext"; /** Class representing a Operations. */ export class Operations { - private readonly client: PostgreSQLFlexibleManagementClientContext; + private readonly client: PostgreSQLManagementClientContext; /** * Create a Operations. - * @param {PostgreSQLFlexibleManagementClientContext} client Reference to the service client. + * @param {PostgreSQLManagementClientContext} client Reference to the service client. */ - constructor(client: PostgreSQLFlexibleManagementClientContext) { + constructor(client: PostgreSQLManagementClientContext) { this.client = client; } @@ -56,7 +56,7 @@ const listOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "providers/Microsoft.DBForPostgreSql/operations", queryParameters: [ - Parameters.apiVersion2 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage diff --git a/sdk/postgresql/arm-postgresql-flexible/src/operations/recoverableServers.ts b/sdk/postgresql/arm-postgresql-flexible/src/operations/recoverableServers.ts deleted file mode 100644 index c16fbcd8f046..000000000000 --- a/sdk/postgresql/arm-postgresql-flexible/src/operations/recoverableServers.ts +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/recoverableServersMappers"; -import * as Parameters from "../models/parameters"; -import { PostgreSQLFlexibleManagementClientContext } from "../postgreSQLFlexibleManagementClientContext"; - -/** Class representing a RecoverableServers. */ -export class RecoverableServers { - private readonly client: PostgreSQLFlexibleManagementClientContext; - - /** - * Create a RecoverableServers. - * @param {PostgreSQLFlexibleManagementClientContext} client Reference to the service client. - */ - constructor(client: PostgreSQLFlexibleManagementClientContext) { - this.client = client; - } - - /** - * Gets a recoverable PostgreSQL Server. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, serverName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param callback The callback - */ - get(resourceGroupName: string, serverName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serverName The name of the server. - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, serverName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, serverName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - serverName, - options - }, - getOperationSpec, - callback) as Promise; - } -} - -// Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql/servers/{serverName}/recoverableServers", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.serverName - ], - queryParameters: [ - Parameters.apiVersion2 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.RecoverableServerResource - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; diff --git a/sdk/postgresql/arm-postgresql-flexible/src/operations/servers.ts b/sdk/postgresql/arm-postgresql-flexible/src/operations/servers.ts index 543bbb2695ba..03f8a8b190f3 100644 --- a/sdk/postgresql/arm-postgresql-flexible/src/operations/servers.ts +++ b/sdk/postgresql/arm-postgresql-flexible/src/operations/servers.ts @@ -12,17 +12,17 @@ import * as msRestAzure from "@azure/ms-rest-azure-js"; import * as Models from "../models"; import * as Mappers from "../models/serversMappers"; import * as Parameters from "../models/parameters"; -import { PostgreSQLFlexibleManagementClientContext } from "../postgreSQLFlexibleManagementClientContext"; +import { PostgreSQLManagementClientContext } from "../postgreSQLManagementClientContext"; /** Class representing a Servers. */ export class Servers { - private readonly client: PostgreSQLFlexibleManagementClientContext; + private readonly client: PostgreSQLManagementClientContext; /** * Create a Servers. - * @param {PostgreSQLFlexibleManagementClientContext} client Reference to the service client. + * @param {PostgreSQLManagementClientContext} client Reference to the service client. */ - constructor(client: PostgreSQLFlexibleManagementClientContext) { + constructor(client: PostgreSQLManagementClientContext) { this.client = client; } @@ -156,7 +156,7 @@ export class Servers { * @param [options] The optional parameters * @returns Promise */ - restart(resourceGroupName: string, serverName: string, options?: msRest.RequestOptionsBase): Promise { + restart(resourceGroupName: string, serverName: string, options?: Models.ServersRestartOptionalParams): Promise { return this.beginRestart(resourceGroupName,serverName,options) .then(lroPoller => lroPoller.pollUntilFinished()); } @@ -251,7 +251,7 @@ export class Servers { * @param [options] The optional parameters * @returns Promise */ - beginRestart(resourceGroupName: string, serverName: string, options?: msRest.RequestOptionsBase): Promise { + beginRestart(resourceGroupName: string, serverName: string, options?: Models.ServersBeginRestartOptionalParams): Promise { return this.client.sendLRORequest( { resourceGroupName, @@ -366,7 +366,7 @@ const getOperationSpec: msRest.OperationSpec = { Parameters.serverName ], queryParameters: [ - Parameters.apiVersion2 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -390,7 +390,7 @@ const listByResourceGroupOperationSpec: msRest.OperationSpec = { Parameters.resourceGroupName ], queryParameters: [ - Parameters.apiVersion2 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -413,7 +413,7 @@ const listOperationSpec: msRest.OperationSpec = { Parameters.subscriptionId ], queryParameters: [ - Parameters.apiVersion2 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -438,7 +438,7 @@ const beginCreateOperationSpec: msRest.OperationSpec = { Parameters.serverName ], queryParameters: [ - Parameters.apiVersion2 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -474,7 +474,7 @@ const beginUpdateOperationSpec: msRest.OperationSpec = { Parameters.serverName ], queryParameters: [ - Parameters.apiVersion2 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -507,7 +507,7 @@ const beginDeleteMethodOperationSpec: msRest.OperationSpec = { Parameters.serverName ], queryParameters: [ - Parameters.apiVersion2 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -532,11 +532,18 @@ const beginRestartOperationSpec: msRest.OperationSpec = { Parameters.serverName ], queryParameters: [ - Parameters.apiVersion2 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage ], + requestBody: { + parameterPath: [ + "options", + "parameters" + ], + mapper: Mappers.RestartParameter + }, responses: { 200: {}, 202: {}, @@ -556,7 +563,7 @@ const beginStartOperationSpec: msRest.OperationSpec = { Parameters.serverName ], queryParameters: [ - Parameters.apiVersion2 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -580,7 +587,7 @@ const beginStopOperationSpec: msRest.OperationSpec = { Parameters.serverName ], queryParameters: [ - Parameters.apiVersion2 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -603,7 +610,7 @@ const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { Parameters.nextPageLink ], queryParameters: [ - Parameters.apiVersion2 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -627,7 +634,7 @@ const listNextOperationSpec: msRest.OperationSpec = { Parameters.nextPageLink ], queryParameters: [ - Parameters.apiVersion2 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage diff --git a/sdk/postgresql/arm-postgresql-flexible/src/operations/virtualNetworkSubnetUsage.ts b/sdk/postgresql/arm-postgresql-flexible/src/operations/virtualNetworkSubnetUsage.ts index 3e8948a2ef7c..dbd7f7574e1f 100644 --- a/sdk/postgresql/arm-postgresql-flexible/src/operations/virtualNetworkSubnetUsage.ts +++ b/sdk/postgresql/arm-postgresql-flexible/src/operations/virtualNetworkSubnetUsage.ts @@ -11,17 +11,17 @@ import * as msRest from "@azure/ms-rest-js"; import * as Models from "../models"; import * as Mappers from "../models/virtualNetworkSubnetUsageMappers"; import * as Parameters from "../models/parameters"; -import { PostgreSQLFlexibleManagementClientContext } from "../postgreSQLFlexibleManagementClientContext"; +import { PostgreSQLManagementClientContext } from "../postgreSQLManagementClientContext"; /** Class representing a VirtualNetworkSubnetUsage. */ export class VirtualNetworkSubnetUsage { - private readonly client: PostgreSQLFlexibleManagementClientContext; + private readonly client: PostgreSQLManagementClientContext; /** * Create a VirtualNetworkSubnetUsage. - * @param {PostgreSQLFlexibleManagementClientContext} client Reference to the service client. + * @param {PostgreSQLManagementClientContext} client Reference to the service client. */ - constructor(client: PostgreSQLFlexibleManagementClientContext) { + constructor(client: PostgreSQLManagementClientContext) { this.client = client; } @@ -68,7 +68,7 @@ const executeOperationSpec: msRest.OperationSpec = { Parameters.locationName ], queryParameters: [ - Parameters.apiVersion2 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage diff --git a/sdk/postgresql/arm-postgresql-flexible/src/postgreSQLFlexibleManagementClient.ts b/sdk/postgresql/arm-postgresql-flexible/src/postgreSQLManagementClient.ts similarity index 79% rename from sdk/postgresql/arm-postgresql-flexible/src/postgreSQLFlexibleManagementClient.ts rename to sdk/postgresql/arm-postgresql-flexible/src/postgreSQLManagementClient.ts index 529b1972dc75..15926bf7b757 100644 --- a/sdk/postgresql/arm-postgresql-flexible/src/postgreSQLFlexibleManagementClient.ts +++ b/sdk/postgresql/arm-postgresql-flexible/src/postgreSQLManagementClient.ts @@ -12,24 +12,23 @@ import { TokenCredential } from "@azure/core-auth"; import * as Models from "./models"; import * as Mappers from "./models/mappers"; import * as operations from "./operations"; -import { PostgreSQLFlexibleManagementClientContext } from "./postgreSQLFlexibleManagementClientContext"; +import { PostgreSQLManagementClientContext } from "./postgreSQLManagementClientContext"; -class PostgreSQLFlexibleManagementClient extends PostgreSQLFlexibleManagementClientContext { +class PostgreSQLManagementClient extends PostgreSQLManagementClientContext { // Operation groups - databases: operations.Databases; - getPrivateDnsZoneSuffix: operations.GetPrivateDnsZoneSuffix; servers: operations.Servers; firewallRules: operations.FirewallRules; configurations: operations.Configurations; checkNameAvailability: operations.CheckNameAvailability; locationBasedCapabilities: operations.LocationBasedCapabilities; virtualNetworkSubnetUsage: operations.VirtualNetworkSubnetUsage; - recoverableServers: operations.RecoverableServers; operations: operations.Operations; + databases: operations.Databases; + getPrivateDnsZoneSuffix: operations.GetPrivateDnsZoneSuffix; /** - * Initializes a new instance of the PostgreSQLFlexibleManagementClient class. + * Initializes a new instance of the PostgreSQLManagementClient class. * @param credentials Credentials needed for the client to connect to Azure. Credentials * implementing the TokenCredential interface from the @azure/identity package are recommended. For * more information about these credentials, see @@ -39,27 +38,26 @@ class PostgreSQLFlexibleManagementClient extends PostgreSQLFlexibleManagementCli * @param subscriptionId The ID of the target subscription. * @param [options] The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.PostgreSQLFlexibleManagementClientOptions) { + constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.PostgreSQLManagementClientOptions) { super(credentials, subscriptionId, options); - this.databases = new operations.Databases(this); - this.getPrivateDnsZoneSuffix = new operations.GetPrivateDnsZoneSuffix(this); this.servers = new operations.Servers(this); this.firewallRules = new operations.FirewallRules(this); this.configurations = new operations.Configurations(this); this.checkNameAvailability = new operations.CheckNameAvailability(this); this.locationBasedCapabilities = new operations.LocationBasedCapabilities(this); this.virtualNetworkSubnetUsage = new operations.VirtualNetworkSubnetUsage(this); - this.recoverableServers = new operations.RecoverableServers(this); this.operations = new operations.Operations(this); + this.databases = new operations.Databases(this); + this.getPrivateDnsZoneSuffix = new operations.GetPrivateDnsZoneSuffix(this); } } // Operation Specifications export { - PostgreSQLFlexibleManagementClient, - PostgreSQLFlexibleManagementClientContext, - Models as PostgreSQLFlexibleManagementModels, - Mappers as PostgreSQLFlexibleManagementMappers + PostgreSQLManagementClient, + PostgreSQLManagementClientContext, + Models as PostgreSQLManagementModels, + Mappers as PostgreSQLManagementMappers }; export * from "./operations"; diff --git a/sdk/postgresql/arm-postgresql-flexible/src/postgreSQLFlexibleManagementClientContext.ts b/sdk/postgresql/arm-postgresql-flexible/src/postgreSQLManagementClientContext.ts similarity index 90% rename from sdk/postgresql/arm-postgresql-flexible/src/postgreSQLFlexibleManagementClientContext.ts rename to sdk/postgresql/arm-postgresql-flexible/src/postgreSQLManagementClientContext.ts index b68ccae65c85..4ad95cec198b 100644 --- a/sdk/postgresql/arm-postgresql-flexible/src/postgreSQLFlexibleManagementClientContext.ts +++ b/sdk/postgresql/arm-postgresql-flexible/src/postgreSQLManagementClientContext.ts @@ -15,12 +15,13 @@ import { TokenCredential } from "@azure/core-auth"; const packageName = "@azure/arm-postgresql-flexible"; const packageVersion = "1.0.0"; -export class PostgreSQLFlexibleManagementClientContext extends msRestAzure.AzureServiceClient { +export class PostgreSQLManagementClientContext extends msRestAzure.AzureServiceClient { credentials: msRest.ServiceClientCredentials | TokenCredential; + apiVersion?: string; subscriptionId: string; /** - * Initializes a new instance of the PostgreSQLFlexibleManagementClient class. + * Initializes a new instance of the PostgreSQLManagementClient class. * @param credentials Credentials needed for the client to connect to Azure. Credentials * implementing the TokenCredential interface from the @azure/identity package are recommended. For * more information about these credentials, see @@ -30,7 +31,7 @@ export class PostgreSQLFlexibleManagementClientContext extends msRestAzure.Azure * @param subscriptionId The ID of the target subscription. * @param [options] The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.PostgreSQLFlexibleManagementClientOptions) { + constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.PostgreSQLManagementClientOptions) { if (credentials == undefined) { throw new Error('\'credentials\' cannot be null.'); } @@ -48,6 +49,7 @@ export class PostgreSQLFlexibleManagementClientContext extends msRestAzure.Azure super(credentials, options); + this.apiVersion = '2021-06-01'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com";