From bedb5a1668ddce1b4c23c44cb705f8f376a0cea6 Mon Sep 17 00:00:00 2001 From: colawwj <70128817+colawwj@users.noreply.github.com> Date: Fri, 8 Oct 2021 11:16:00 +0800 Subject: [PATCH] mysql-flexibleserver-track1 (#17924) * mysql-flexibleserver-track1 * update --- eng/pipelines/mgmt-ci.yml | 1 + eng/pipelines/mgmt-pr.yml | 1 + sdk/mysql/arm-mysql-flexible/LICENSE.txt | 21 + sdk/mysql/arm-mysql-flexible/README.md | 110 ++ sdk/mysql/arm-mysql-flexible/package.json | 59 + sdk/mysql/arm-mysql-flexible/rollup.config.js | 37 + .../src/models/backupsMappers.ts | 31 + .../models/checkNameAvailabilityMappers.ts | 15 + .../checkVirtualNetworkSubnetUsageMappers.ts | 16 + .../src/models/configurationsMappers.ts | 33 + .../src/models/databasesMappers.ts | 31 + .../src/models/firewallRulesMappers.ts | 31 + .../models/getPrivateDnsZoneSuffixMappers.ts | 14 + .../arm-mysql-flexible/src/models/index.ts | 1755 +++++++++++++++++ .../locationBasedCapabilitiesMappers.ts | 19 + .../arm-mysql-flexible/src/models/mappers.ts | 1481 ++++++++++++++ .../src/models/operationsMappers.ts | 16 + .../src/models/parameters.ts | 132 ++ .../src/models/replicasMappers.ts | 31 + .../src/models/serversMappers.ts | 33 + .../src/mySQLManagementClient.ts | 67 + .../src/mySQLManagementClientContext.ts | 67 + .../src/operations/backups.ts | 200 ++ .../src/operations/checkNameAvailability.ts | 92 + .../checkVirtualNetworkSubnetUsage.ts | 92 + .../src/operations/configurations.ts | 337 ++++ .../src/operations/databases.ts | 333 ++++ .../src/operations/firewallRules.ts | 333 ++++ .../src/operations/getPrivateDnsZoneSuffix.ts | 73 + .../src/operations/index.ts | 20 + .../operations/locationBasedCapabilities.ts | 133 ++ .../src/operations/operations.ts | 125 ++ .../src/operations/replicas.ts | 138 ++ .../src/operations/servers.ts | 710 +++++++ sdk/mysql/arm-mysql-flexible/tsconfig.json | 19 + 35 files changed, 6606 insertions(+) create mode 100644 sdk/mysql/arm-mysql-flexible/LICENSE.txt create mode 100644 sdk/mysql/arm-mysql-flexible/README.md create mode 100644 sdk/mysql/arm-mysql-flexible/package.json create mode 100644 sdk/mysql/arm-mysql-flexible/rollup.config.js create mode 100644 sdk/mysql/arm-mysql-flexible/src/models/backupsMappers.ts create mode 100644 sdk/mysql/arm-mysql-flexible/src/models/checkNameAvailabilityMappers.ts create mode 100644 sdk/mysql/arm-mysql-flexible/src/models/checkVirtualNetworkSubnetUsageMappers.ts create mode 100644 sdk/mysql/arm-mysql-flexible/src/models/configurationsMappers.ts create mode 100644 sdk/mysql/arm-mysql-flexible/src/models/databasesMappers.ts create mode 100644 sdk/mysql/arm-mysql-flexible/src/models/firewallRulesMappers.ts create mode 100644 sdk/mysql/arm-mysql-flexible/src/models/getPrivateDnsZoneSuffixMappers.ts create mode 100644 sdk/mysql/arm-mysql-flexible/src/models/index.ts create mode 100644 sdk/mysql/arm-mysql-flexible/src/models/locationBasedCapabilitiesMappers.ts create mode 100644 sdk/mysql/arm-mysql-flexible/src/models/mappers.ts create mode 100644 sdk/mysql/arm-mysql-flexible/src/models/operationsMappers.ts create mode 100644 sdk/mysql/arm-mysql-flexible/src/models/parameters.ts create mode 100644 sdk/mysql/arm-mysql-flexible/src/models/replicasMappers.ts create mode 100644 sdk/mysql/arm-mysql-flexible/src/models/serversMappers.ts create mode 100644 sdk/mysql/arm-mysql-flexible/src/mySQLManagementClient.ts create mode 100644 sdk/mysql/arm-mysql-flexible/src/mySQLManagementClientContext.ts create mode 100644 sdk/mysql/arm-mysql-flexible/src/operations/backups.ts create mode 100644 sdk/mysql/arm-mysql-flexible/src/operations/checkNameAvailability.ts create mode 100644 sdk/mysql/arm-mysql-flexible/src/operations/checkVirtualNetworkSubnetUsage.ts create mode 100644 sdk/mysql/arm-mysql-flexible/src/operations/configurations.ts create mode 100644 sdk/mysql/arm-mysql-flexible/src/operations/databases.ts create mode 100644 sdk/mysql/arm-mysql-flexible/src/operations/firewallRules.ts create mode 100644 sdk/mysql/arm-mysql-flexible/src/operations/getPrivateDnsZoneSuffix.ts create mode 100644 sdk/mysql/arm-mysql-flexible/src/operations/index.ts create mode 100644 sdk/mysql/arm-mysql-flexible/src/operations/locationBasedCapabilities.ts create mode 100644 sdk/mysql/arm-mysql-flexible/src/operations/operations.ts create mode 100644 sdk/mysql/arm-mysql-flexible/src/operations/replicas.ts create mode 100644 sdk/mysql/arm-mysql-flexible/src/operations/servers.ts create mode 100644 sdk/mysql/arm-mysql-flexible/tsconfig.json diff --git a/eng/pipelines/mgmt-ci.yml b/eng/pipelines/mgmt-ci.yml index 6d4117d438a6..ae4accffdf63 100644 --- a/eng/pipelines/mgmt-ci.yml +++ b/eng/pipelines/mgmt-ci.yml @@ -200,6 +200,7 @@ trigger: - sdk/storage/storage-internal-avro - sdk/resources-subscriptions/arm-resources-subscriptions - sdk/templatespecs/arm-templatespecs + - sdk/mysql/arm-mysql-flexible pr: none diff --git a/eng/pipelines/mgmt-pr.yml b/eng/pipelines/mgmt-pr.yml index da7074913da0..7980eae4a188 100644 --- a/eng/pipelines/mgmt-pr.yml +++ b/eng/pipelines/mgmt-pr.yml @@ -205,6 +205,7 @@ pr: - sdk/storage/storage-internal-avro - sdk/resources-subscriptions/arm-resources-subscriptions - sdk/templatespecs/arm-templatespecs + - sdk/mysql/arm-mysql-flexible variables: NodeVersion: 10.x diff --git a/sdk/mysql/arm-mysql-flexible/LICENSE.txt b/sdk/mysql/arm-mysql-flexible/LICENSE.txt new file mode 100644 index 000000000000..2d3163745319 --- /dev/null +++ b/sdk/mysql/arm-mysql-flexible/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2021 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/sdk/mysql/arm-mysql-flexible/README.md b/sdk/mysql/arm-mysql-flexible/README.md new file mode 100644 index 000000000000..c6cd29cf5ffd --- /dev/null +++ b/sdk/mysql/arm-mysql-flexible/README.md @@ -0,0 +1,110 @@ +## Azure MySQLManagementClient SDK for JavaScript + +This package contains an isomorphic SDK (runs both in node.js and in browsers) for MySQLManagementClient. + +### Currently supported environments + +- [LTS versions of Node.js](https://nodejs.org/about/releases/) +- Latest versions of Safari, Chrome, Edge and Firefox. + +### Prerequisites + +You must have an [Azure subscription](https://azure.microsoft.com/free/). + +### How to install + +To use this SDK in your project, you will need to install two packages. +- `@azure/arm-mysql-flexible` that contains the client. +- `@azure/identity` that provides different mechanisms for the client to authenticate your requests using Azure Active Directory. + +Install both packages using the below command: +```bash +npm install --save @azure/arm-mysql-flexible @azure/identity +``` +> **Note**: You may have used either `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` in the past. These packages are in maintenance mode receiving critical bug fixes, but no new features. +If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to `@azure/identity` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options. + +### How to use + +- If you are writing a client side browser application, + - Follow the instructions in the section on Authenticating client side browser applications in [Azure Identity examples](https://aka.ms/azsdk/js/identity/examples) to register your application in the Microsoft identity platform and set the right permissions. + - Copy the client ID and tenant ID from the Overview section of your app registration in Azure portal and use it in the browser sample below. +- If you are writing a server side application, + - [Select a credential from `@azure/identity` based on the authentication method of your choice](https://aka.ms/azsdk/js/identity/examples) + - Complete the set up steps required by the credential if any. + - Use the credential you picked in the place of `DefaultAzureCredential` in the Node.js sample below. + +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 servers as an example written in JavaScript. + +##### Sample code + +```javascript +const { DefaultAzureCredential } = require("@azure/identity"); +const { MySQLManagementClient } = require("@azure/arm-mysql-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 MySQLManagementClient(creds, subscriptionId); +const resourceGroupName = "testresourceGroupName"; +const serverName = "testserverName"; +client.servers.get(resourceGroupName, serverName).then((result) => { + console.log("The result is:"); + console.log(result); +}).catch((err) => { + console.log("An error occurred:"); + console.error(err); +}); +``` + +#### 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. + - Note down the client Id from the previous step and use it in the browser sample below. + +##### Sample code + +- index.html + +```html + + + + @azure/arm-mysql-flexible sample + + + + + + + +``` + +## Related projects + +- [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/mysql/arm-mysql-flexible//README.png) diff --git a/sdk/mysql/arm-mysql-flexible/package.json b/sdk/mysql/arm-mysql-flexible/package.json new file mode 100644 index 000000000000..43aa456fab73 --- /dev/null +++ b/sdk/mysql/arm-mysql-flexible/package.json @@ -0,0 +1,59 @@ +{ + "name": "@azure/arm-mysql-flexible", + "author": "Microsoft Corporation", + "description": "MySQLManagementClient Library with typescript type definitions for node.js and browser.", + "version": "1.0.0", + "dependencies": { + "@azure/ms-rest-azure-js": "^2.1.0", + "@azure/ms-rest-js": "^2.2.0", + "@azure/core-auth": "^1.1.4", + "tslib": "^1.10.0" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "license": "MIT", + "main": "./dist/arm-mysql-flexible.js", + "module": "./esm/mySQLManagementClient.js", + "types": "./esm/mySQLManagementClient.d.ts", + "devDependencies": { + "typescript": "^3.6.0", + "rollup": "^1.18.0", + "rollup-plugin-node-resolve": "^5.2.0", + "rollup-plugin-sourcemaps": "^0.4.2", + "uglify-js": "^3.6.0" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/feature/v4/sdk/mysql/arm-mysql-flexible/", + "repository": { + "type": "git", + "url": "https://github.com/Azure/azure-sdk-for-js.git" + }, + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "files": [ + "dist/**/*.js", + "dist/**/*.js.map", + "dist/**/*.d.ts", + "dist/**/*.d.ts.map", + "esm/**/*.js", + "esm/**/*.js.map", + "esm/**/*.d.ts", + "esm/**/*.d.ts.map", + "src/**/*.ts", + "README.md", + "rollup.config.js", + "tsconfig.json" + ], + "scripts": { + "build": "tsc && rollup -c rollup.config.js && npm run minify", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-mysql-flexible.js.map'\" -o ./dist/arm-mysql-flexible.min.js ./dist/arm-mysql-flexible.js", + "prepack": "npm install && npm run build" + }, + "sideEffects": false, + "autoPublish": true +} diff --git a/sdk/mysql/arm-mysql-flexible/rollup.config.js b/sdk/mysql/arm-mysql-flexible/rollup.config.js new file mode 100644 index 000000000000..944fff69be18 --- /dev/null +++ b/sdk/mysql/arm-mysql-flexible/rollup.config.js @@ -0,0 +1,37 @@ +import rollup from "rollup"; +import nodeResolve from "rollup-plugin-node-resolve"; +import sourcemaps from "rollup-plugin-sourcemaps"; + +/** + * @type {rollup.RollupFileOptions} + */ +const config = { + input: "./esm/mySQLManagementClient.js", + external: [ + "@azure/ms-rest-js", + "@azure/ms-rest-azure-js" + ], + output: { + file: "./dist/arm-mysql-flexible.js", + format: "umd", + name: "Azure.ArmMysqlFlexible", + sourcemap: true, + globals: { + "@azure/ms-rest-js": "msRest", + "@azure/ms-rest-azure-js": "msRestAzure" + }, + banner: `/* + * 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. + */` + }, + plugins: [ + nodeResolve({ mainFields: ['module', 'main'] }), + sourcemaps() + ] +}; + +export default config; diff --git a/sdk/mysql/arm-mysql-flexible/src/models/backupsMappers.ts b/sdk/mysql/arm-mysql-flexible/src/models/backupsMappers.ts new file mode 100644 index 000000000000..17d8170ade79 --- /dev/null +++ b/sdk/mysql/arm-mysql-flexible/src/models/backupsMappers.ts @@ -0,0 +1,31 @@ +/* + * 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, + Backup, + BaseResource, + CloudError, + Configuration, + Database, + ErrorAdditionalInfo, + ErrorResponse, + FirewallRule, + HighAvailability, + MaintenanceWindow, + Network, + ProxyResource, + Resource, + Server, + ServerBackup, + ServerBackupListResult, + Sku, + Storage, + SystemData, + TrackedResource +} from "../models/mappers"; diff --git a/sdk/mysql/arm-mysql-flexible/src/models/checkNameAvailabilityMappers.ts b/sdk/mysql/arm-mysql-flexible/src/models/checkNameAvailabilityMappers.ts new file mode 100644 index 000000000000..675c9f6c5fd6 --- /dev/null +++ b/sdk/mysql/arm-mysql-flexible/src/models/checkNameAvailabilityMappers.ts @@ -0,0 +1,15 @@ +/* + * 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 { + CloudError, + ErrorAdditionalInfo, + ErrorResponse, + NameAvailability, + NameAvailabilityRequest +} from "../models/mappers"; diff --git a/sdk/mysql/arm-mysql-flexible/src/models/checkVirtualNetworkSubnetUsageMappers.ts b/sdk/mysql/arm-mysql-flexible/src/models/checkVirtualNetworkSubnetUsageMappers.ts new file mode 100644 index 000000000000..f575f25ddb83 --- /dev/null +++ b/sdk/mysql/arm-mysql-flexible/src/models/checkVirtualNetworkSubnetUsageMappers.ts @@ -0,0 +1,16 @@ +/* + * 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 { + CloudError, + DelegatedSubnetUsage, + ErrorAdditionalInfo, + ErrorResponse, + VirtualNetworkSubnetUsageParameter, + VirtualNetworkSubnetUsageResult +} from "../models/mappers"; diff --git a/sdk/mysql/arm-mysql-flexible/src/models/configurationsMappers.ts b/sdk/mysql/arm-mysql-flexible/src/models/configurationsMappers.ts new file mode 100644 index 000000000000..e63e788686da --- /dev/null +++ b/sdk/mysql/arm-mysql-flexible/src/models/configurationsMappers.ts @@ -0,0 +1,33 @@ +/* + * 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, + Backup, + BaseResource, + CloudError, + Configuration, + ConfigurationForBatchUpdate, + ConfigurationListForBatchUpdate, + ConfigurationListResult, + Database, + ErrorAdditionalInfo, + ErrorResponse, + FirewallRule, + HighAvailability, + MaintenanceWindow, + Network, + ProxyResource, + Resource, + Server, + ServerBackup, + Sku, + Storage, + SystemData, + TrackedResource +} from "../models/mappers"; diff --git a/sdk/mysql/arm-mysql-flexible/src/models/databasesMappers.ts b/sdk/mysql/arm-mysql-flexible/src/models/databasesMappers.ts new file mode 100644 index 000000000000..888d3b058490 --- /dev/null +++ b/sdk/mysql/arm-mysql-flexible/src/models/databasesMappers.ts @@ -0,0 +1,31 @@ +/* + * 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, + Backup, + BaseResource, + CloudError, + Configuration, + Database, + DatabaseListResult, + ErrorAdditionalInfo, + ErrorResponse, + FirewallRule, + HighAvailability, + MaintenanceWindow, + Network, + ProxyResource, + Resource, + Server, + ServerBackup, + Sku, + Storage, + SystemData, + TrackedResource +} from "../models/mappers"; diff --git a/sdk/mysql/arm-mysql-flexible/src/models/firewallRulesMappers.ts b/sdk/mysql/arm-mysql-flexible/src/models/firewallRulesMappers.ts new file mode 100644 index 000000000000..c03bef24f86b --- /dev/null +++ b/sdk/mysql/arm-mysql-flexible/src/models/firewallRulesMappers.ts @@ -0,0 +1,31 @@ +/* + * 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, + Backup, + BaseResource, + CloudError, + Configuration, + Database, + ErrorAdditionalInfo, + ErrorResponse, + FirewallRule, + FirewallRuleListResult, + HighAvailability, + MaintenanceWindow, + Network, + ProxyResource, + Resource, + Server, + ServerBackup, + Sku, + Storage, + SystemData, + TrackedResource +} from "../models/mappers"; diff --git a/sdk/mysql/arm-mysql-flexible/src/models/getPrivateDnsZoneSuffixMappers.ts b/sdk/mysql/arm-mysql-flexible/src/models/getPrivateDnsZoneSuffixMappers.ts new file mode 100644 index 000000000000..267a129c265d --- /dev/null +++ b/sdk/mysql/arm-mysql-flexible/src/models/getPrivateDnsZoneSuffixMappers.ts @@ -0,0 +1,14 @@ +/* + * 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 { + CloudError, + ErrorAdditionalInfo, + ErrorResponse, + GetPrivateDnsZoneSuffixResponse +} from "../models/mappers"; diff --git a/sdk/mysql/arm-mysql-flexible/src/models/index.ts b/sdk/mysql/arm-mysql-flexible/src/models/index.ts new file mode 100644 index 000000000000..023203a2ea4b --- /dev/null +++ b/sdk/mysql/arm-mysql-flexible/src/models/index.ts @@ -0,0 +1,1755 @@ +/* + * 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 { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/ms-rest-js"; + +export { BaseResource, CloudError }; + +/** + * Maintenance window of a server. + */ +export interface MaintenanceWindow { + /** + * indicates whether custom window is enabled or disabled + */ + customWindow?: string; + /** + * start hour for maintenance window + */ + startHour?: number; + /** + * start minute for maintenance window + */ + startMinute?: number; + /** + * day of week for maintenance window + */ + dayOfWeek?: number; +} + +/** + * Storage Profile properties of a server + */ +export interface Backup { + /** + * Backup retention days for the server. + */ + backupRetentionDays?: number; + /** + * Whether or not geo redundant backup is enabled. Possible values include: 'Enabled', 'Disabled' + */ + geoRedundantBackup?: EnableStatusEnum; + /** + * Earliest restore point creation time (ISO8601 format) + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly earliestRestoreDate?: Date; +} + +/** + * Storage Profile properties of a server + */ +export interface Storage { + /** + * Max storage size allowed for a server. + */ + storageSizeGB?: number; + /** + * Storage IOPS for a server. + */ + iops?: number; + /** + * Enable Storage Auto Grow or not. Possible values include: 'Enabled', 'Disabled' + */ + autoGrow?: EnableStatusEnum; + /** + * The sku name of the server storage. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly storageSku?: string; +} + +/** + * Billing information related properties of a server. + */ +export interface Sku { + /** + * The name of the sku, e.g. Standard_D32s_v3. + */ + name: string; + /** + * The tier of the particular SKU, e.g. GeneralPurpose. Possible values include: 'Burstable', + * 'GeneralPurpose', 'MemoryOptimized' + */ + tier: SkuTier; +} + +/** + * Network related properties of a server + */ +export interface Network { + /** + * Whether or not public network access is allowed for this server. Value is 'Disabled' when + * server has VNet integration. Possible values include: 'Enabled', 'Disabled' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly publicNetworkAccess?: EnableStatusEnum; + /** + * Delegated subnet resource id used to setup vnet for a server. + */ + delegatedSubnetResourceId?: string; + /** + * Private DNS zone resource id. + */ + privateDnsZoneResourceId?: string; +} + +/** + * Network related properties of a server + */ +export interface HighAvailability { + /** + * High availability mode for a server. Possible values include: 'Disabled', 'ZoneRedundant', + * 'SameZone' + */ + mode?: HighAvailabilityMode; + /** + * The state of server high availability. Possible values include: 'NotEnabled', + * 'CreatingStandby', 'Healthy', 'FailingOver', 'RemovingStandby' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly state?: HighAvailabilityState; + /** + * Availability zone of the standby server. + */ + standbyAvailabilityZone?: string; +} + +/** + * Metadata pertaining to creation and last modification of the resource. + */ +export interface SystemData { + /** + * 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 id?: string; + /** + * The name of the resource + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * 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.** + */ + 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; +} + +/** + * Represents a server. + */ +export interface Server extends TrackedResource { + /** + * The SKU (pricing tier) of the server. + */ + sku?: Sku; + /** + * The administrator's login name of a server. Can only be specified when the server is being + * created (and is required for creation). + */ + administratorLogin?: string; + /** + * The password of the administrator login (required for server creation). + */ + administratorLoginPassword?: string; + /** + * Server version. Possible values include: '5.7', '8.0.21' + */ + version?: ServerVersion; + /** + * availability Zone information of the server. + */ + availabilityZone?: string; + /** + * The mode to create a new MySQL server. Possible values include: 'Default', + * 'PointInTimeRestore', 'Replica', 'GeoRestore' + */ + createMode?: CreateMode; + /** + * The source MySQL server id. + */ + sourceServerResourceId?: string; + /** + * Restore point creation time (ISO8601 format), specifying the time to restore from. + */ + restorePointInTime?: Date; + /** + * The replication role. Possible values include: 'None', 'Source', 'Replica' + */ + replicationRole?: ReplicationRole; + /** + * The maximum number of replicas that a primary server can have. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly replicaCapacity?: number; + /** + * The state of a server. 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 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; + /** + * Storage related properties of a server. + */ + storage?: Storage; + /** + * Backup related properties of a server. + */ + backup?: Backup; + /** + * High availability related properties of a server. + */ + highAvailability?: HighAvailability; + /** + * Network related properties of a server. + */ + network?: Network; + /** + * Maintenance window of a server. + */ + maintenanceWindow?: MaintenanceWindow; + /** + * 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; +} + +/** + * Parameters allowed to update for a server. + */ +export interface ServerForUpdate { + /** + * The SKU (pricing tier) of the server. + */ + sku?: Sku; + /** + * The password of the administrator login. + */ + administratorLoginPassword?: string; + /** + * Storage related properties of a server. + */ + storage?: Storage; + /** + * Backup related properties of a server. + */ + backup?: Backup; + /** + * High availability related properties of a server. + */ + highAvailability?: HighAvailability; + /** + * Maintenance window of a server. + */ + maintenanceWindow?: MaintenanceWindow; + /** + * The replication role of the server. Possible values include: 'None', 'Source', 'Replica' + */ + replicationRole?: ReplicationRole; + /** + * Application-specific metadata in the form of key-value pairs. + */ + tags?: { [propertyName: string]: string }; +} + +/** + * Server restart parameters. + */ +export interface ServerRestartParameter { + /** + * Whether or not failover to standby server when restarting a server with high availability + * enabled. Possible values include: 'Enabled', 'Disabled' + */ + restartWithFailover?: EnableStatusEnum; + /** + * The maximum allowed failover time in seconds. + */ + maxFailoverSeconds?: number; +} + +/** + * 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 { +} + +/** + * Server backup properties + */ +export interface ServerBackup extends ProxyResource { + /** + * Backup type. + */ + backupType?: string; + /** + * Backup completed time (ISO8601 format). + */ + completedTime?: Date; + /** + * Backup source + */ + 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; +} + +/** + * Represents a server firewall rule. + */ +export interface FirewallRule extends ProxyResource { + /** + * The start IP address of the server firewall rule. Must be IPv4 format. + */ + startIpAddress: string; + /** + * 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; +} + +/** + * Represents a Database. + */ +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; +} + +/** + * Represents a Configuration. + */ +export interface Configuration extends ProxyResource { + /** + * Value of the configuration. + */ + value?: string; + /** + * Description of the configuration. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly description?: string; + /** + * Default value of the configuration. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly defaultValue?: string; + /** + * Data type of the configuration. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly dataType?: string; + /** + * Allowed values of the configuration. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly allowedValues?: string; + /** + * Source of the configuration. Possible values include: 'system-default', 'user-override' + */ + source?: ConfigurationSource; + /** + * If is the configuration read only. Possible values include: 'True', 'False' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly isReadOnly?: IsReadOnly; + /** + * If is the configuration pending restart or not. Possible values include: 'True', 'False' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly isConfigPendingRestart?: IsConfigPendingRestart; + /** + * If is the configuration dynamic. Possible values include: 'True', 'False' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly isDynamicConfig?: IsDynamicConfig; + /** + * 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; +} + +/** + * Represents a Configuration. + */ +export interface ConfigurationForBatchUpdate { + /** + * Name of the configuration. + */ + name?: string; + /** + * Value of the configuration. + */ + value?: string; + /** + * Source of the configuration. + */ + source?: string; +} + +/** + * A list of server configurations to update. + */ +export interface ConfigurationListForBatchUpdate { + /** + * The list of server configurations. + */ + value?: ConfigurationForBatchUpdate[]; +} + +/** + * Virtual network subnet usage parameter + */ +export interface VirtualNetworkSubnetUsageParameter { + /** + * Virtual network resource id. + */ + virtualNetworkResourceId?: string; +} + +/** + * Delegated subnet usage data. + */ +export interface DelegatedSubnetUsage { + /** + * name of the subnet + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly subnetName?: string; + /** + * Number of used delegated subnets + * **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 { + /** + * A list of delegated subnet usage + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly delegatedSubnetsUsage?: DelegatedSubnetUsage[]; +} + +/** + * Sku capability + */ +export interface SkuCapability { + /** + * vCore name + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * supported vCores + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly vCores?: number; + /** + * supported IOPS + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly supportedIops?: number; + /** + * supported memory per vCore in MB + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly supportedMemoryPerVCoreMB?: number; +} + +/** + * Server version capabilities. + */ +export interface ServerVersionCapability { + /** + * server version + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * A list of supported Skus + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly supportedSkus?: SkuCapability[]; +} + +/** + * storage edition capability + */ +export interface StorageEditionCapability { + /** + * storage edition name + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * The minimal supported storage size. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly minStorageSize?: number; + /** + * The maximum supported storage size. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly maxStorageSize?: number; + /** + * Minimal backup retention days + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly minBackupRetentionDays?: number; + /** + * Maximum backup retention days + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly maxBackupRetentionDays?: number; +} + +/** + * Server edition capabilities. + */ +export interface ServerEditionCapability { + /** + * Server edition name + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * A list of supported storage editions + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly supportedStorageEditions?: StorageEditionCapability[]; + /** + * A list of supported server versions. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly supportedServerVersions?: ServerVersionCapability[]; +} + +/** + * Location capabilities. + */ +export interface CapabilityProperties { + /** + * zone name + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly zone?: string; + /** + * Supported high availability mode + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly supportedHAMode?: string[]; + /** + * supported geo backup regions + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly supportedGeoBackupRegions?: string[]; + /** + * A list of supported flexible server editions. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly supportedFlexibleServerEditions?: ServerEditionCapability[]; +} + +/** + * The response of get private dns zone suffix. + */ +export interface GetPrivateDnsZoneSuffixResponse { + /** + * Represents the private DNS zone suffix. + */ + privateDnsZoneSuffix?: string; +} + +/** + * Request from client to check resource name availability. + */ +export interface NameAvailabilityRequest { + /** + * Resource name to verify. + */ + name: string; + /** + * Resource type used for verification. + */ + type?: string; +} + +/** + * Represents a resource name availability. + */ +export interface NameAvailability { + /** + * Error Message. + */ + message?: string; + /** + * Indicates whether the resource name is available. + */ + nameAvailable?: boolean; + /** + * Reason for name being unavailable. + */ + reason?: string; +} + +/** + * Display metadata associated with the operation. + */ +export interface OperationDisplay { + /** + * Operation resource provider name. + */ + provider?: string; + /** + * Resource on which the operation is performed. + */ + resource?: string; + /** + * Localized friendly name for the operation. + */ + operation?: string; + /** + * Operation description. + */ + description?: string; +} + +/** + * REST API operation definition. + */ +export interface Operation { + /** + * The name of the operation being performed on this particular object. + */ + name?: string; + /** + * The localized display information for this particular operation or action. + */ + display?: OperationDisplay; + /** + * The intended executor of the operation. + */ + origin?: string; + /** + * Additional descriptions for the operation. + */ + properties?: { [propertyName: string]: any }; +} + +/** + * 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 MySQLManagementClientOptions. + */ +export interface MySQLManagementClientOptions extends AzureServiceClientOptions { + baseUri?: string; +} + +/** + * @interface + * A list of servers. + * @extends Array + */ +export interface ServerListResult extends Array { + /** + * The link used to get the next page of operations. + */ + nextLink?: string; +} + +/** + * @interface + * A list of server backups. + * @extends Array + */ +export interface ServerBackupListResult extends Array { + /** + * The link used to get the next page of operations. + */ + nextLink?: string; +} + +/** + * @interface + * A list of firewall rules. + * @extends Array + */ +export interface FirewallRuleListResult extends Array { + /** + * The link used to get the next page of operations. + */ + nextLink?: string; +} + +/** + * @interface + * A List of databases. + * @extends Array + */ +export interface DatabaseListResult extends Array { + /** + * The link used to get the next page of operations. + */ + nextLink?: string; +} + +/** + * @interface + * A list of server configurations. + * @extends Array + */ +export interface ConfigurationListResult extends Array { + /** + * The link used to get the next page of operations. + */ + nextLink?: string; +} + +/** + * @interface + * location capability + * @extends Array + */ +export interface CapabilitiesListResult extends Array { + /** + * Link to retrieve next page of results. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * A list of resource provider operations. + * @extends Array + */ +export interface OperationListResult extends Array { + /** + * URL client should use to fetch the next page (per server side paging). + */ + nextLink?: string; +} + +/** + * Defines values for ServerVersion. + * Possible values include: '5.7', '8.0.21' + * @readonly + * @enum {string} + */ +export type ServerVersion = '5.7' | '8.0.21'; + +/** + * Defines values for EnableStatusEnum. + * Possible values include: 'Enabled', 'Disabled' + * @readonly + * @enum {string} + */ +export type EnableStatusEnum = 'Enabled' | 'Disabled'; + +/** + * Defines values for ReplicationRole. + * Possible values include: 'None', 'Source', 'Replica' + * @readonly + * @enum {string} + */ +export type ReplicationRole = 'None' | 'Source' | 'Replica'; + +/** + * Defines values for SkuTier. + * Possible values include: 'Burstable', 'GeneralPurpose', 'MemoryOptimized' + * @readonly + * @enum {string} + */ +export type SkuTier = 'Burstable' | 'GeneralPurpose' | 'MemoryOptimized'; + +/** + * Defines values for HighAvailabilityMode. + * Possible values include: 'Disabled', 'ZoneRedundant', 'SameZone' + * @readonly + * @enum {string} + */ +export type HighAvailabilityMode = 'Disabled' | 'ZoneRedundant' | 'SameZone'; + +/** + * Defines values for HighAvailabilityState. + * Possible values include: 'NotEnabled', 'CreatingStandby', 'Healthy', 'FailingOver', + * 'RemovingStandby' + * @readonly + * @enum {string} + */ +export type HighAvailabilityState = 'NotEnabled' | 'CreatingStandby' | 'Healthy' | 'FailingOver' | 'RemovingStandby'; + +/** + * Defines values for CreateMode. + * Possible values include: 'Default', 'PointInTimeRestore', 'Replica', 'GeoRestore' + * @readonly + * @enum {string} + */ +export type CreateMode = 'Default' | 'PointInTimeRestore' | 'Replica' | 'GeoRestore'; + +/** + * Defines values for ServerState. + * Possible values include: 'Ready', 'Dropping', 'Disabled', 'Starting', 'Stopping', 'Stopped', + * 'Updating' + * @readonly + * @enum {string} + */ +export type ServerState = 'Ready' | 'Dropping' | 'Disabled' | 'Starting' | 'Stopping' | 'Stopped' | 'Updating'; + +/** + * Defines values for CreatedByType. + * Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + * @readonly + * @enum {string} + */ +export type CreatedByType = 'User' | 'Application' | 'ManagedIdentity' | 'Key'; + +/** + * Defines values for ConfigurationSource. + * Possible values include: 'system-default', 'user-override' + * @readonly + * @enum {string} + */ +export type ConfigurationSource = 'system-default' | 'user-override'; + +/** + * Defines values for IsReadOnly. + * Possible values include: 'True', 'False' + * @readonly + * @enum {string} + */ +export type IsReadOnly = 'True' | 'False'; + +/** + * Defines values for IsConfigPendingRestart. + * Possible values include: 'True', 'False' + * @readonly + * @enum {string} + */ +export type IsConfigPendingRestart = 'True' | 'False'; + +/** + * Defines values for IsDynamicConfig. + * Possible values include: 'True', 'False' + * @readonly + * @enum {string} + */ +export type IsDynamicConfig = 'True' | 'False'; + +/** + * Contains response data for the create operation. + */ +export type ServersCreateResponse = Server & { + /** + * The underlying HTTP response. + */ + _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 update operation. + */ +export type ServersUpdateResponse = Server & { + /** + * The underlying HTTP response. + */ + _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 get operation. + */ +export type ServersGetResponse = Server & { + /** + * The underlying HTTP response. + */ + _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 listByResourceGroup operation. + */ +export type ServersListByResourceGroupResponse = ServerListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ServerListResult; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type ServersListResponse = ServerListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ServerListResult; + }; +}; + +/** + * Contains response data for the beginCreate operation. + */ +export type ServersBeginCreateResponse = Server & { + /** + * The underlying HTTP response. + */ + _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. + */ + _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 listByResourceGroupNext operation. + */ +export type ServersListByResourceGroupNextResponse = ServerListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ServerListResult; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type ServersListNextResponse = ServerListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ServerListResult; + }; +}; + +/** + * Contains response data for the listByServer operation. + */ +export type ReplicasListByServerResponse = ServerListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ServerListResult; + }; +}; + +/** + * Contains response data for the listByServerNext operation. + */ +export type ReplicasListByServerNextResponse = ServerListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ServerListResult; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type BackupsGetResponse = ServerBackup & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ServerBackup; + }; +}; + +/** + * Contains response data for the listByServer operation. + */ +export type BackupsListByServerResponse = ServerBackupListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ServerBackupListResult; + }; +}; + +/** + * Contains response data for the listByServerNext operation. + */ +export type BackupsListByServerNextResponse = ServerBackupListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ServerBackupListResult; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type FirewallRulesCreateOrUpdateResponse = FirewallRule & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: FirewallRule; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type FirewallRulesGetResponse = FirewallRule & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: FirewallRule; + }; +}; + +/** + * Contains response data for the listByServer operation. + */ +export type FirewallRulesListByServerResponse = FirewallRuleListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: FirewallRuleListResult; + }; +}; + +/** + * Contains response data for the beginCreateOrUpdate operation. + */ +export type FirewallRulesBeginCreateOrUpdateResponse = FirewallRule & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: FirewallRule; + }; +}; + +/** + * Contains response data for the listByServerNext operation. + */ +export type FirewallRulesListByServerNextResponse = FirewallRuleListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: FirewallRuleListResult; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type DatabasesCreateOrUpdateResponse = Database & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Database; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type DatabasesGetResponse = Database & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Database; + }; +}; + +/** + * Contains response data for the listByServer operation. + */ +export type DatabasesListByServerResponse = DatabaseListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: DatabaseListResult; + }; +}; + +/** + * Contains response data for the beginCreateOrUpdate operation. + */ +export type DatabasesBeginCreateOrUpdateResponse = Database & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Database; + }; +}; + +/** + * Contains response data for the listByServerNext operation. + */ +export type DatabasesListByServerNextResponse = DatabaseListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: DatabaseListResult; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type ConfigurationsUpdateResponse = Configuration & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Configuration; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type ConfigurationsGetResponse = Configuration & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Configuration; + }; +}; + +/** + * Contains response data for the batchUpdate operation. + */ +export type ConfigurationsBatchUpdateResponse = ConfigurationListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ConfigurationListResult; + }; +}; + +/** + * Contains response data for the listByServer operation. + */ +export type ConfigurationsListByServerResponse = ConfigurationListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ConfigurationListResult; + }; +}; + +/** + * Contains response data for the beginUpdate operation. + */ +export type ConfigurationsBeginUpdateResponse = Configuration & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Configuration; + }; +}; + +/** + * Contains response data for the beginBatchUpdate operation. + */ +export type ConfigurationsBeginBatchUpdateResponse = ConfigurationListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ConfigurationListResult; + }; +}; + +/** + * Contains response data for the listByServerNext operation. + */ +export type ConfigurationsListByServerNextResponse = ConfigurationListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ConfigurationListResult; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type LocationBasedCapabilitiesListResponse = CapabilitiesListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CapabilitiesListResult; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type LocationBasedCapabilitiesListNextResponse = CapabilitiesListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: CapabilitiesListResult; + }; +}; + +/** + * Contains response data for the execute operation. + */ +export type CheckVirtualNetworkSubnetUsageExecuteResponse = VirtualNetworkSubnetUsageResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: VirtualNetworkSubnetUsageResult; + }; +}; + +/** + * Contains response data for the execute operation. + */ +export type CheckNameAvailabilityExecuteResponse = NameAvailability & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: NameAvailability; + }; +}; + +/** + * Contains response data for the execute operation. + */ +export type GetPrivateDnsZoneSuffixExecuteResponse = GetPrivateDnsZoneSuffixResponse & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: GetPrivateDnsZoneSuffixResponse; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type OperationsListResponse = OperationListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: OperationListResult; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type OperationsListNextResponse = OperationListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: OperationListResult; + }; +}; diff --git a/sdk/mysql/arm-mysql-flexible/src/models/locationBasedCapabilitiesMappers.ts b/sdk/mysql/arm-mysql-flexible/src/models/locationBasedCapabilitiesMappers.ts new file mode 100644 index 000000000000..e94495954dc1 --- /dev/null +++ b/sdk/mysql/arm-mysql-flexible/src/models/locationBasedCapabilitiesMappers.ts @@ -0,0 +1,19 @@ +/* + * 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 { + CapabilitiesListResult, + CapabilityProperties, + CloudError, + ErrorAdditionalInfo, + ErrorResponse, + ServerEditionCapability, + ServerVersionCapability, + SkuCapability, + StorageEditionCapability +} from "../models/mappers"; diff --git a/sdk/mysql/arm-mysql-flexible/src/models/mappers.ts b/sdk/mysql/arm-mysql-flexible/src/models/mappers.ts new file mode 100644 index 000000000000..2febb34c531d --- /dev/null +++ b/sdk/mysql/arm-mysql-flexible/src/models/mappers.ts @@ -0,0 +1,1481 @@ +/* + * 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 { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/ms-rest-js"; + +export const CloudError = CloudErrorMapper; +export const BaseResource = BaseResourceMapper; + +export const MaintenanceWindow: msRest.CompositeMapper = { + serializedName: "MaintenanceWindow", + type: { + name: "Composite", + className: "MaintenanceWindow", + modelProperties: { + customWindow: { + serializedName: "customWindow", + type: { + name: "String" + } + }, + startHour: { + serializedName: "startHour", + type: { + name: "Number" + } + }, + startMinute: { + serializedName: "startMinute", + type: { + name: "Number" + } + }, + dayOfWeek: { + serializedName: "dayOfWeek", + type: { + name: "Number" + } + } + } + } +}; + +export const Backup: msRest.CompositeMapper = { + serializedName: "Backup", + type: { + name: "Composite", + className: "Backup", + modelProperties: { + backupRetentionDays: { + serializedName: "backupRetentionDays", + type: { + name: "Number" + } + }, + geoRedundantBackup: { + serializedName: "geoRedundantBackup", + type: { + name: "String" + } + }, + earliestRestoreDate: { + readOnly: true, + serializedName: "earliestRestoreDate", + type: { + name: "DateTime" + } + } + } + } +}; + +export const Storage: msRest.CompositeMapper = { + serializedName: "Storage", + type: { + name: "Composite", + className: "Storage", + modelProperties: { + storageSizeGB: { + serializedName: "storageSizeGB", + type: { + name: "Number" + } + }, + iops: { + serializedName: "iops", + type: { + name: "Number" + } + }, + autoGrow: { + serializedName: "autoGrow", + type: { + name: "String" + } + }, + storageSku: { + readOnly: true, + serializedName: "storageSku", + 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 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" + } + }, + privateDnsZoneResourceId: { + serializedName: "privateDnsZoneResourceId", + 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" + } + } + } + } +}; + +export const SystemData: msRest.CompositeMapper = { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData", + modelProperties: { + 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: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + 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" + } + } + } + } +}; + +export const Server: msRest.CompositeMapper = { + serializedName: "Server", + type: { + name: "Composite", + className: "Server", + modelProperties: { + ...TrackedResource.type.modelProperties, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "Sku" + } + }, + administratorLogin: { + serializedName: "properties.administratorLogin", + type: { + name: "String" + } + }, + administratorLoginPassword: { + serializedName: "properties.administratorLoginPassword", + type: { + name: "String" + } + }, + version: { + serializedName: "properties.version", + type: { + name: "String" + } + }, + availabilityZone: { + serializedName: "properties.availabilityZone", + type: { + name: "String" + } + }, + createMode: { + serializedName: "properties.createMode", + type: { + name: "String" + } + }, + sourceServerResourceId: { + serializedName: "properties.sourceServerResourceId", + type: { + name: "String" + } + }, + restorePointInTime: { + serializedName: "properties.restorePointInTime", + type: { + name: "DateTime" + } + }, + replicationRole: { + serializedName: "properties.replicationRole", + type: { + name: "String" + } + }, + replicaCapacity: { + readOnly: true, + serializedName: "properties.replicaCapacity", + constraints: { + InclusiveMinimum: 0 + }, + type: { + name: "Number" + } + }, + state: { + readOnly: true, + serializedName: "properties.state", + type: { + name: "String" + } + }, + fullyQualifiedDomainName: { + readOnly: true, + serializedName: "properties.fullyQualifiedDomainName", + type: { + name: "String" + } + }, + storage: { + serializedName: "properties.storage", + type: { + name: "Composite", + className: "Storage" + } + }, + backup: { + serializedName: "properties.backup", + type: { + name: "Composite", + className: "Backup" + } + }, + highAvailability: { + serializedName: "properties.highAvailability", + type: { + name: "Composite", + className: "HighAvailability" + } + }, + network: { + serializedName: "properties.network", + type: { + name: "Composite", + className: "Network" + } + }, + maintenanceWindow: { + serializedName: "properties.maintenanceWindow", + type: { + name: "Composite", + className: "MaintenanceWindow" + } + }, + systemData: { + readOnly: true, + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + +export const ServerForUpdate: msRest.CompositeMapper = { + serializedName: "ServerForUpdate", + type: { + name: "Composite", + className: "ServerForUpdate", + modelProperties: { + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "Sku" + } + }, + administratorLoginPassword: { + serializedName: "properties.administratorLoginPassword", + type: { + name: "String" + } + }, + storage: { + serializedName: "properties.storage", + type: { + name: "Composite", + className: "Storage" + } + }, + backup: { + serializedName: "properties.backup", + type: { + name: "Composite", + className: "Backup" + } + }, + highAvailability: { + serializedName: "properties.highAvailability", + type: { + name: "Composite", + className: "HighAvailability" + } + }, + maintenanceWindow: { + serializedName: "properties.maintenanceWindow", + type: { + name: "Composite", + className: "MaintenanceWindow" + } + }, + replicationRole: { + serializedName: "properties.replicationRole", + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const ServerRestartParameter: msRest.CompositeMapper = { + serializedName: "ServerRestartParameter", + type: { + name: "Composite", + className: "ServerRestartParameter", + modelProperties: { + restartWithFailover: { + serializedName: "restartWithFailover", + type: { + name: "String" + } + }, + maxFailoverSeconds: { + serializedName: "maxFailoverSeconds", + type: { + name: "Number" + } + } + } + } +}; + +export const ProxyResource: msRest.CompositeMapper = { + serializedName: "ProxyResource", + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties + } + } +}; + +export const ServerBackup: msRest.CompositeMapper = { + serializedName: "ServerBackup", + type: { + name: "Composite", + className: "ServerBackup", + modelProperties: { + ...ProxyResource.type.modelProperties, + backupType: { + serializedName: "properties.backupType", + type: { + name: "String" + } + }, + completedTime: { + serializedName: "properties.completedTime", + type: { + name: "DateTime" + } + }, + source: { + serializedName: "properties.source", + type: { + name: "String" + } + }, + systemData: { + readOnly: true, + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + +export const FirewallRule: msRest.CompositeMapper = { + serializedName: "FirewallRule", + type: { + name: "Composite", + className: "FirewallRule", + modelProperties: { + ...ProxyResource.type.modelProperties, + startIpAddress: { + required: true, + serializedName: "properties.startIpAddress", + constraints: { + Pattern: /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/ + }, + type: { + name: "String" + } + }, + endIpAddress: { + required: true, + serializedName: "properties.endIpAddress", + constraints: { + Pattern: /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/ + }, + type: { + name: "String" + } + }, + systemData: { + readOnly: true, + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + +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" + } + }, + systemData: { + readOnly: true, + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + +export const Configuration: msRest.CompositeMapper = { + serializedName: "Configuration", + type: { + name: "Composite", + className: "Configuration", + modelProperties: { + ...ProxyResource.type.modelProperties, + value: { + serializedName: "properties.value", + type: { + name: "String" + } + }, + description: { + readOnly: true, + serializedName: "properties.description", + type: { + name: "String" + } + }, + defaultValue: { + readOnly: true, + serializedName: "properties.defaultValue", + type: { + name: "String" + } + }, + dataType: { + readOnly: true, + serializedName: "properties.dataType", + type: { + name: "String" + } + }, + allowedValues: { + readOnly: true, + serializedName: "properties.allowedValues", + type: { + name: "String" + } + }, + source: { + serializedName: "properties.source", + type: { + name: "String" + } + }, + isReadOnly: { + readOnly: true, + serializedName: "properties.isReadOnly", + type: { + name: "String" + } + }, + isConfigPendingRestart: { + readOnly: true, + serializedName: "properties.isConfigPendingRestart", + type: { + name: "String" + } + }, + isDynamicConfig: { + readOnly: true, + serializedName: "properties.isDynamicConfig", + type: { + name: "String" + } + }, + systemData: { + readOnly: true, + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + +export const ConfigurationForBatchUpdate: msRest.CompositeMapper = { + serializedName: "ConfigurationForBatchUpdate", + type: { + name: "Composite", + className: "ConfigurationForBatchUpdate", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + value: { + serializedName: "properties.value", + type: { + name: "String" + } + }, + source: { + serializedName: "properties.source", + type: { + name: "String" + } + } + } + } +}; + +export const ConfigurationListForBatchUpdate: msRest.CompositeMapper = { + serializedName: "ConfigurationListForBatchUpdate", + type: { + name: "Composite", + className: "ConfigurationListForBatchUpdate", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ConfigurationForBatchUpdate" + } + } + } + } + } + } +}; + +export const VirtualNetworkSubnetUsageParameter: msRest.CompositeMapper = { + serializedName: "VirtualNetworkSubnetUsageParameter", + type: { + name: "Composite", + className: "VirtualNetworkSubnetUsageParameter", + modelProperties: { + virtualNetworkResourceId: { + serializedName: "virtualNetworkResourceId", + type: { + name: "String" + } + } + } + } +}; + +export const DelegatedSubnetUsage: msRest.CompositeMapper = { + serializedName: "DelegatedSubnetUsage", + type: { + name: "Composite", + className: "DelegatedSubnetUsage", + modelProperties: { + subnetName: { + readOnly: true, + serializedName: "subnetName", + type: { + name: "String" + } + }, + usage: { + readOnly: true, + serializedName: "usage", + type: { + name: "Number" + } + } + } + } +}; + +export const VirtualNetworkSubnetUsageResult: msRest.CompositeMapper = { + serializedName: "VirtualNetworkSubnetUsageResult", + type: { + name: "Composite", + className: "VirtualNetworkSubnetUsageResult", + modelProperties: { + delegatedSubnetsUsage: { + readOnly: true, + serializedName: "delegatedSubnetsUsage", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DelegatedSubnetUsage" + } + } + } + } + } + } +}; + +export const SkuCapability: msRest.CompositeMapper = { + serializedName: "SkuCapability", + type: { + name: "Composite", + className: "SkuCapability", + modelProperties: { + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + vCores: { + readOnly: true, + serializedName: "vCores", + type: { + name: "Number" + } + }, + supportedIops: { + readOnly: true, + serializedName: "supportedIops", + type: { + name: "Number" + } + }, + supportedMemoryPerVCoreMB: { + readOnly: true, + serializedName: "supportedMemoryPerVCoreMB", + type: { + name: "Number" + } + } + } + } +}; + +export const ServerVersionCapability: msRest.CompositeMapper = { + serializedName: "ServerVersionCapability", + type: { + name: "Composite", + className: "ServerVersionCapability", + modelProperties: { + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + supportedSkus: { + readOnly: true, + serializedName: "supportedSkus", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SkuCapability" + } + } + } + } + } + } +}; + +export const StorageEditionCapability: msRest.CompositeMapper = { + serializedName: "StorageEditionCapability", + type: { + name: "Composite", + className: "StorageEditionCapability", + modelProperties: { + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + minStorageSize: { + readOnly: true, + serializedName: "minStorageSize", + type: { + name: "Number" + } + }, + maxStorageSize: { + readOnly: true, + serializedName: "maxStorageSize", + type: { + name: "Number" + } + }, + minBackupRetentionDays: { + readOnly: true, + serializedName: "minBackupRetentionDays", + type: { + name: "Number" + } + }, + maxBackupRetentionDays: { + readOnly: true, + serializedName: "maxBackupRetentionDays", + type: { + name: "Number" + } + } + } + } +}; + +export const ServerEditionCapability: msRest.CompositeMapper = { + serializedName: "ServerEditionCapability", + type: { + name: "Composite", + className: "ServerEditionCapability", + modelProperties: { + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + supportedStorageEditions: { + readOnly: true, + serializedName: "supportedStorageEditions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "StorageEditionCapability" + } + } + } + }, + supportedServerVersions: { + readOnly: true, + serializedName: "supportedServerVersions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ServerVersionCapability" + } + } + } + } + } + } +}; + +export const CapabilityProperties: msRest.CompositeMapper = { + serializedName: "CapabilityProperties", + type: { + name: "Composite", + className: "CapabilityProperties", + modelProperties: { + zone: { + readOnly: true, + serializedName: "zone", + type: { + name: "String" + } + }, + supportedHAMode: { + readOnly: true, + serializedName: "supportedHAMode", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + supportedGeoBackupRegions: { + readOnly: true, + serializedName: "supportedGeoBackupRegions", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + supportedFlexibleServerEditions: { + readOnly: true, + serializedName: "supportedFlexibleServerEditions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ServerEditionCapability" + } + } + } + } + } + } +}; + +export const GetPrivateDnsZoneSuffixResponse: msRest.CompositeMapper = { + serializedName: "GetPrivateDnsZoneSuffixResponse", + type: { + name: "Composite", + className: "GetPrivateDnsZoneSuffixResponse", + modelProperties: { + privateDnsZoneSuffix: { + serializedName: "privateDnsZoneSuffix", + type: { + name: "String" + } + } + } + } +}; + +export const NameAvailabilityRequest: msRest.CompositeMapper = { + serializedName: "NameAvailabilityRequest", + type: { + name: "Composite", + className: "NameAvailabilityRequest", + modelProperties: { + name: { + required: true, + serializedName: "name", + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const NameAvailability: msRest.CompositeMapper = { + serializedName: "NameAvailability", + type: { + name: "Composite", + className: "NameAvailability", + modelProperties: { + message: { + serializedName: "message", + type: { + name: "String" + } + }, + nameAvailable: { + serializedName: "nameAvailable", + type: { + name: "Boolean" + } + }, + reason: { + serializedName: "reason", + type: { + name: "String" + } + } + } + } +}; + +export const OperationDisplay: msRest.CompositeMapper = { + serializedName: "OperationDisplay", + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + } + } + } +}; + +export const Operation: msRest.CompositeMapper = { + serializedName: "Operation", + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + }, + origin: { + serializedName: "origin", + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Dictionary", + value: { + type: { + name: "Object" + } + } + } + } + } + } +}; + +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 ServerListResult: msRest.CompositeMapper = { + serializedName: "ServerListResult", + type: { + name: "Composite", + className: "ServerListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Server" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const ServerBackupListResult: msRest.CompositeMapper = { + serializedName: "ServerBackupListResult", + type: { + name: "Composite", + className: "ServerBackupListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ServerBackup" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const FirewallRuleListResult: msRest.CompositeMapper = { + serializedName: "FirewallRuleListResult", + type: { + name: "Composite", + className: "FirewallRuleListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "FirewallRule" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +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" + } + } + } + } +}; + +export const ConfigurationListResult: msRest.CompositeMapper = { + serializedName: "ConfigurationListResult", + type: { + name: "Composite", + className: "ConfigurationListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Configuration" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const CapabilitiesListResult: msRest.CompositeMapper = { + serializedName: "CapabilitiesListResult", + type: { + name: "Composite", + className: "CapabilitiesListResult", + modelProperties: { + value: { + readOnly: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CapabilityProperties" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const OperationListResult: msRest.CompositeMapper = { + serializedName: "OperationListResult", + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/mysql/arm-mysql-flexible/src/models/operationsMappers.ts b/sdk/mysql/arm-mysql-flexible/src/models/operationsMappers.ts new file mode 100644 index 000000000000..cdbd10423173 --- /dev/null +++ b/sdk/mysql/arm-mysql-flexible/src/models/operationsMappers.ts @@ -0,0 +1,16 @@ +/* + * 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 { + CloudError, + ErrorAdditionalInfo, + ErrorResponse, + Operation, + OperationDisplay, + OperationListResult +} from "../models/mappers"; diff --git a/sdk/mysql/arm-mysql-flexible/src/models/parameters.ts b/sdk/mysql/arm-mysql-flexible/src/models/parameters.ts new file mode 100644 index 000000000000..f286a9409b17 --- /dev/null +++ b/sdk/mysql/arm-mysql-flexible/src/models/parameters.ts @@ -0,0 +1,132 @@ +/* + * 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"; + +export const acceptLanguage: msRest.OperationParameter = { + parameterPath: "acceptLanguage", + mapper: { + serializedName: "accept-language", + defaultValue: 'en-US', + type: { + name: "String" + } + } +}; +export const apiVersion: msRest.OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + required: true, + serializedName: "api-version", + constraints: { + MinLength: 1 + }, + type: { + name: "String" + } + } +}; +export const backupName: msRest.OperationURLParameter = { + parameterPath: "backupName", + mapper: { + required: true, + serializedName: "backupName", + type: { + name: "String" + } + } +}; +export const configurationName: msRest.OperationURLParameter = { + parameterPath: "configurationName", + mapper: { + required: true, + serializedName: "configurationName", + type: { + name: "String" + } + } +}; +export const databaseName: msRest.OperationURLParameter = { + parameterPath: "databaseName", + mapper: { + required: true, + serializedName: "databaseName", + type: { + name: "String" + } + } +}; +export const firewallRuleName: msRest.OperationURLParameter = { + parameterPath: "firewallRuleName", + mapper: { + required: true, + serializedName: "firewallRuleName", + type: { + name: "String" + } + } +}; +export const locationName: msRest.OperationURLParameter = { + parameterPath: "locationName", + mapper: { + required: true, + serializedName: "locationName", + type: { + name: "String" + } + } +}; +export const nextPageLink: msRest.OperationURLParameter = { + parameterPath: "nextPageLink", + mapper: { + required: true, + serializedName: "nextLink", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const resourceGroupName: msRest.OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + required: true, + serializedName: "resourceGroupName", + constraints: { + MaxLength: 90, + MinLength: 1 + }, + type: { + name: "String" + } + } +}; +export const serverName: msRest.OperationURLParameter = { + parameterPath: "serverName", + mapper: { + required: true, + serializedName: "serverName", + type: { + name: "String" + } + } +}; +export const subscriptionId: msRest.OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + required: true, + serializedName: "subscriptionId", + constraints: { + MinLength: 1 + }, + type: { + name: "String" + } + } +}; diff --git a/sdk/mysql/arm-mysql-flexible/src/models/replicasMappers.ts b/sdk/mysql/arm-mysql-flexible/src/models/replicasMappers.ts new file mode 100644 index 000000000000..72b39ef477ac --- /dev/null +++ b/sdk/mysql/arm-mysql-flexible/src/models/replicasMappers.ts @@ -0,0 +1,31 @@ +/* + * 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, + Backup, + BaseResource, + CloudError, + Configuration, + Database, + ErrorAdditionalInfo, + ErrorResponse, + FirewallRule, + HighAvailability, + MaintenanceWindow, + Network, + ProxyResource, + Resource, + Server, + ServerBackup, + ServerListResult, + Sku, + Storage, + SystemData, + TrackedResource +} from "../models/mappers"; diff --git a/sdk/mysql/arm-mysql-flexible/src/models/serversMappers.ts b/sdk/mysql/arm-mysql-flexible/src/models/serversMappers.ts new file mode 100644 index 000000000000..8b910719cfb4 --- /dev/null +++ b/sdk/mysql/arm-mysql-flexible/src/models/serversMappers.ts @@ -0,0 +1,33 @@ +/* + * 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, + Backup, + BaseResource, + CloudError, + Configuration, + Database, + ErrorAdditionalInfo, + ErrorResponse, + FirewallRule, + HighAvailability, + MaintenanceWindow, + Network, + ProxyResource, + Resource, + Server, + ServerBackup, + ServerForUpdate, + ServerListResult, + ServerRestartParameter, + Sku, + Storage, + SystemData, + TrackedResource +} from "../models/mappers"; diff --git a/sdk/mysql/arm-mysql-flexible/src/mySQLManagementClient.ts b/sdk/mysql/arm-mysql-flexible/src/mySQLManagementClient.ts new file mode 100644 index 000000000000..282ea611e3ae --- /dev/null +++ b/sdk/mysql/arm-mysql-flexible/src/mySQLManagementClient.ts @@ -0,0 +1,67 @@ +/* + * 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 { TokenCredential } from "@azure/core-auth"; +import * as Models from "./models"; +import * as Mappers from "./models/mappers"; +import * as operations from "./operations"; +import { MySQLManagementClientContext } from "./mySQLManagementClientContext"; + + +class MySQLManagementClient extends MySQLManagementClientContext { + // Operation groups + servers: operations.Servers; + replicas: operations.Replicas; + backups: operations.Backups; + firewallRules: operations.FirewallRules; + databases: operations.Databases; + configurations: operations.Configurations; + locationBasedCapabilities: operations.LocationBasedCapabilities; + checkVirtualNetworkSubnetUsage: operations.CheckVirtualNetworkSubnetUsage; + checkNameAvailability: operations.CheckNameAvailability; + getPrivateDnsZoneSuffix: operations.GetPrivateDnsZoneSuffix; + operations: operations.Operations; + + /** + * Initializes a new instance of the MySQLManagementClient 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 + * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the + * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and + * @azure/ms-rest-browserauth are also supported. + * @param subscriptionId The ID of the target subscription. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.MySQLManagementClientOptions) { + super(credentials, subscriptionId, options); + this.servers = new operations.Servers(this); + this.replicas = new operations.Replicas(this); + this.backups = new operations.Backups(this); + this.firewallRules = new operations.FirewallRules(this); + this.databases = new operations.Databases(this); + this.configurations = new operations.Configurations(this); + this.locationBasedCapabilities = new operations.LocationBasedCapabilities(this); + this.checkVirtualNetworkSubnetUsage = new operations.CheckVirtualNetworkSubnetUsage(this); + this.checkNameAvailability = new operations.CheckNameAvailability(this); + this.getPrivateDnsZoneSuffix = new operations.GetPrivateDnsZoneSuffix(this); + this.operations = new operations.Operations(this); + } +} + +// Operation Specifications + +export { + MySQLManagementClient, + MySQLManagementClientContext, + Models as MySQLManagementModels, + Mappers as MySQLManagementMappers +}; +export * from "./operations"; diff --git a/sdk/mysql/arm-mysql-flexible/src/mySQLManagementClientContext.ts b/sdk/mysql/arm-mysql-flexible/src/mySQLManagementClientContext.ts new file mode 100644 index 000000000000..e1d29499530f --- /dev/null +++ b/sdk/mysql/arm-mysql-flexible/src/mySQLManagementClientContext.ts @@ -0,0 +1,67 @@ +/* + * 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 Models from "./models"; +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; +import { TokenCredential } from "@azure/core-auth"; + +const packageName = "@azure/arm-mysql-flexible"; +const packageVersion = "1.0.0"; + +export class MySQLManagementClientContext extends msRestAzure.AzureServiceClient { + credentials: msRest.ServiceClientCredentials | TokenCredential; + apiVersion?: string; + subscriptionId: string; + + /** + * Initializes a new instance of the MySQLManagementClient 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 + * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the + * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and + * @azure/ms-rest-browserauth are also supported. + * @param subscriptionId The ID of the target subscription. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.MySQLManagementClientOptions) { + if (credentials == undefined) { + throw new Error('\'credentials\' cannot be null.'); + } + if (subscriptionId == undefined) { + throw new Error('\'subscriptionId\' cannot be null.'); + } + + if (!options) { + options = {}; + } + if (!options.userAgent) { + const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); + options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; + } + + super(credentials, options); + + this.apiVersion = '2021-05-01'; + this.acceptLanguage = 'en-US'; + this.longRunningOperationRetryTimeout = 30; + this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; + this.requestContentType = "application/json; charset=utf-8"; + this.credentials = credentials; + this.subscriptionId = subscriptionId; + + if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + this.acceptLanguage = options.acceptLanguage; + } + if (options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; + } + } +} diff --git a/sdk/mysql/arm-mysql-flexible/src/operations/backups.ts b/sdk/mysql/arm-mysql-flexible/src/operations/backups.ts new file mode 100644 index 000000000000..79cdf78a9256 --- /dev/null +++ b/sdk/mysql/arm-mysql-flexible/src/operations/backups.ts @@ -0,0 +1,200 @@ +/* + * 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/backupsMappers"; +import * as Parameters from "../models/parameters"; +import { MySQLManagementClientContext } from "../mySQLManagementClientContext"; + +/** Class representing a Backups. */ +export class Backups { + private readonly client: MySQLManagementClientContext; + + /** + * Create a Backups. + * @param {MySQLManagementClientContext} client Reference to the service client. + */ + constructor(client: MySQLManagementClientContext) { + this.client = client; + } + + /** + * List all the backups for a given server. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param backupName The name of the backup. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, serverName: string, backupName: 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 backupName The name of the backup. + * @param callback The callback + */ + get(resourceGroupName: string, serverName: string, backupName: 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 backupName The name of the backup. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, serverName: string, backupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, serverName: string, backupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + serverName, + backupName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * List all the backups for a given 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 + */ + listByServer(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 + */ + listByServer(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 + */ + listByServer(resourceGroupName: string, serverName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + serverName, + options + }, + listByServerOperationSpec, + callback) as Promise; + } + + /** + * List all the backups for a given server. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByServerNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByServerNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listByServerNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByServerNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByServerNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/backups/{backupName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName, + Parameters.backupName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ServerBackup + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listByServerOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/backups", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ServerBackupListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listByServerNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ServerBackupListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/mysql/arm-mysql-flexible/src/operations/checkNameAvailability.ts b/sdk/mysql/arm-mysql-flexible/src/operations/checkNameAvailability.ts new file mode 100644 index 000000000000..278343fd85d6 --- /dev/null +++ b/sdk/mysql/arm-mysql-flexible/src/operations/checkNameAvailability.ts @@ -0,0 +1,92 @@ +/* + * 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/checkNameAvailabilityMappers"; +import * as Parameters from "../models/parameters"; +import { MySQLManagementClientContext } from "../mySQLManagementClientContext"; + +/** Class representing a CheckNameAvailability. */ +export class CheckNameAvailability { + private readonly client: MySQLManagementClientContext; + + /** + * Create a CheckNameAvailability. + * @param {MySQLManagementClientContext} client Reference to the service client. + */ + constructor(client: MySQLManagementClientContext) { + this.client = client; + } + + /** + * Check the availability of name for server + * @param locationName The name of the location. + * @param nameAvailabilityRequest The required parameters for checking if server name is available. + * @param [options] The optional parameters + * @returns Promise + */ + execute(locationName: string, nameAvailabilityRequest: Models.NameAvailabilityRequest, options?: msRest.RequestOptionsBase): Promise; + /** + * @param locationName The name of the location. + * @param nameAvailabilityRequest The required parameters for checking if server name is available. + * @param callback The callback + */ + execute(locationName: string, nameAvailabilityRequest: Models.NameAvailabilityRequest, callback: msRest.ServiceCallback): void; + /** + * @param locationName The name of the location. + * @param nameAvailabilityRequest The required parameters for checking if server name is available. + * @param options The optional parameters + * @param callback The callback + */ + execute(locationName: string, nameAvailabilityRequest: Models.NameAvailabilityRequest, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + execute(locationName: string, nameAvailabilityRequest: Models.NameAvailabilityRequest, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + locationName, + nameAvailabilityRequest, + options + }, + executeOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const executeOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/checkNameAvailability", + urlParameters: [ + Parameters.subscriptionId, + Parameters.locationName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "nameAvailabilityRequest", + mapper: { + ...Mappers.NameAvailabilityRequest, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.NameAvailability + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/mysql/arm-mysql-flexible/src/operations/checkVirtualNetworkSubnetUsage.ts b/sdk/mysql/arm-mysql-flexible/src/operations/checkVirtualNetworkSubnetUsage.ts new file mode 100644 index 000000000000..adfe73c1ed9f --- /dev/null +++ b/sdk/mysql/arm-mysql-flexible/src/operations/checkVirtualNetworkSubnetUsage.ts @@ -0,0 +1,92 @@ +/* + * 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/checkVirtualNetworkSubnetUsageMappers"; +import * as Parameters from "../models/parameters"; +import { MySQLManagementClientContext } from "../mySQLManagementClientContext"; + +/** Class representing a CheckVirtualNetworkSubnetUsage. */ +export class CheckVirtualNetworkSubnetUsage { + private readonly client: MySQLManagementClientContext; + + /** + * Create a CheckVirtualNetworkSubnetUsage. + * @param {MySQLManagementClientContext} client Reference to the service client. + */ + constructor(client: MySQLManagementClientContext) { + this.client = client; + } + + /** + * Get virtual network subnet usage for a given vNet resource id. + * @param locationName The name of the location. + * @param parameters The required parameters for creating or updating a server. + * @param [options] The optional parameters + * @returns Promise + */ + execute(locationName: string, parameters: Models.VirtualNetworkSubnetUsageParameter, options?: msRest.RequestOptionsBase): Promise; + /** + * @param locationName The name of the location. + * @param parameters The required parameters for creating or updating a server. + * @param callback The callback + */ + execute(locationName: string, parameters: Models.VirtualNetworkSubnetUsageParameter, callback: msRest.ServiceCallback): void; + /** + * @param locationName The name of the location. + * @param parameters The required parameters for creating or updating a server. + * @param options The optional parameters + * @param callback The callback + */ + execute(locationName: string, parameters: Models.VirtualNetworkSubnetUsageParameter, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + execute(locationName: string, parameters: Models.VirtualNetworkSubnetUsageParameter, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + locationName, + parameters, + options + }, + executeOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const executeOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/checkVirtualNetworkSubnetUsage", + urlParameters: [ + Parameters.subscriptionId, + Parameters.locationName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.VirtualNetworkSubnetUsageParameter, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.VirtualNetworkSubnetUsageResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/mysql/arm-mysql-flexible/src/operations/configurations.ts b/sdk/mysql/arm-mysql-flexible/src/operations/configurations.ts new file mode 100644 index 000000000000..b1c5ee009caa --- /dev/null +++ b/sdk/mysql/arm-mysql-flexible/src/operations/configurations.ts @@ -0,0 +1,337 @@ +/* + * 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 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 { MySQLManagementClientContext } from "../mySQLManagementClientContext"; + +/** Class representing a Configurations. */ +export class Configurations { + private readonly client: MySQLManagementClientContext; + + /** + * Create a Configurations. + * @param {MySQLManagementClientContext} client Reference to the service client. + */ + constructor(client: MySQLManagementClientContext) { + this.client = client; + } + + /** + * 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 + */ + update(resourceGroupName: string, serverName: string, configurationName: string, parameters: Models.Configuration, options?: msRest.RequestOptionsBase): Promise { + return this.beginUpdate(resourceGroupName,serverName,configurationName,parameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Gets information about a configuration of 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 [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, serverName: string, configurationName: 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 configurationName The name of the server configuration. + * @param callback The callback + */ + get(resourceGroupName: string, serverName: string, configurationName: 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 configurationName The name of the server configuration. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, serverName: string, configurationName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, serverName: string, configurationName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + serverName, + configurationName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Update a list of configurations in a given server. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The parameters for updating a list of server configuration. + * @param [options] The optional parameters + * @returns Promise + */ + batchUpdate(resourceGroupName: string, serverName: string, parameters: Models.ConfigurationListForBatchUpdate, options?: msRest.RequestOptionsBase): Promise { + return this.beginBatchUpdate(resourceGroupName,serverName,parameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * List all the configurations in a given 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 + */ + listByServer(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 + */ + listByServer(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 + */ + listByServer(resourceGroupName: string, serverName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + serverName, + options + }, + listByServerOperationSpec, + callback) 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 + */ + beginUpdate(resourceGroupName: string, serverName: string, configurationName: string, parameters: Models.Configuration, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + serverName, + configurationName, + parameters, + options + }, + beginUpdateOperationSpec, + options); + } + + /** + * Update a list of configurations in a given server. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The parameters for updating a list of server configuration. + * @param [options] The optional parameters + * @returns Promise + */ + beginBatchUpdate(resourceGroupName: string, serverName: string, parameters: Models.ConfigurationListForBatchUpdate, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + serverName, + parameters, + options + }, + beginBatchUpdateOperationSpec, + options); + } + + /** + * List all the configurations in a given server. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByServerNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByServerNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listByServerNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByServerNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByServerNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/configurations/{configurationName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName, + Parameters.configurationName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Configuration + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listByServerOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/configurations", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ConfigurationListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/configurations/{configurationName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName, + Parameters.configurationName + ], + queryParameters: [ + 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 beginBatchUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/updateConfigurations", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.ConfigurationListForBatchUpdate, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.ConfigurationListResult + }, + 202: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listByServerNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ConfigurationListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/mysql/arm-mysql-flexible/src/operations/databases.ts b/sdk/mysql/arm-mysql-flexible/src/operations/databases.ts new file mode 100644 index 000000000000..ec1a34495100 --- /dev/null +++ b/sdk/mysql/arm-mysql-flexible/src/operations/databases.ts @@ -0,0 +1,333 @@ +/* + * 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 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 { MySQLManagementClientContext } from "../mySQLManagementClientContext"; + +/** Class representing a Databases. */ +export class Databases { + private readonly client: MySQLManagementClientContext; + + /** + * Create a Databases. + * @param {MySQLManagementClientContext} client Reference to the service client. + */ + constructor(client: MySQLManagementClientContext) { + this.client = client; + } + + /** + * Creates a new database or updates an existing database. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param databaseName The name of the database. + * @param parameters The required parameters for creating or updating a database. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: Models.Database, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateOrUpdate(resourceGroupName,serverName,databaseName,parameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Deletes a database. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param databaseName The name of the database. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteMethod(resourceGroupName,serverName,databaseName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Gets information about a database. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param databaseName The name of the database. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, serverName: string, databaseName: 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 databaseName The name of the database. + * @param callback The callback + */ + get(resourceGroupName: string, serverName: string, databaseName: 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 databaseName The name of the database. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, serverName: string, databaseName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + serverName, + databaseName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * List all the databases in a given 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 + */ + listByServer(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 + */ + listByServer(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 + */ + listByServer(resourceGroupName: string, serverName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + serverName, + options + }, + listByServerOperationSpec, + callback) as Promise; + } + + /** + * Creates a new database or updates an existing database. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param databaseName The name of the database. + * @param parameters The required parameters for creating or updating a database. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: Models.Database, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + serverName, + databaseName, + parameters, + options + }, + beginCreateOrUpdateOperationSpec, + options); + } + + /** + * Deletes a database. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param databaseName The name of the database. + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteMethod(resourceGroupName: string, serverName: string, databaseName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + serverName, + databaseName, + options + }, + beginDeleteMethodOperationSpec, + options); + } + + /** + * List all the databases in a given server. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByServerNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByServerNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listByServerNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByServerNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByServerNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/databases/{databaseName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName, + Parameters.databaseName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Database + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listByServerOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/databases", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DatabaseListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/databases/{databaseName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName, + Parameters.databaseName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.Database, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Database + }, + 201: { + bodyMapper: Mappers.Database + }, + 202: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginDeleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/databases/{databaseName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName, + Parameters.databaseName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listByServerNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DatabaseListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/mysql/arm-mysql-flexible/src/operations/firewallRules.ts b/sdk/mysql/arm-mysql-flexible/src/operations/firewallRules.ts new file mode 100644 index 000000000000..7a8d7f73ae55 --- /dev/null +++ b/sdk/mysql/arm-mysql-flexible/src/operations/firewallRules.ts @@ -0,0 +1,333 @@ +/* + * 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 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 { MySQLManagementClientContext } from "../mySQLManagementClientContext"; + +/** Class representing a FirewallRules. */ +export class FirewallRules { + private readonly client: MySQLManagementClientContext; + + /** + * Create a FirewallRules. + * @param {MySQLManagementClientContext} client Reference to the service client. + */ + constructor(client: MySQLManagementClientContext) { + this.client = client; + } + + /** + * Creates a new firewall rule or updates an existing firewall rule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @param parameters The required parameters for creating or updating a firewall rule. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, serverName: string, firewallRuleName: string, parameters: Models.FirewallRule, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateOrUpdate(resourceGroupName,serverName,firewallRuleName,parameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Deletes a firewall rule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, serverName: string, firewallRuleName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteMethod(resourceGroupName,serverName,firewallRuleName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Gets information about a server firewall rule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, serverName: string, firewallRuleName: 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 firewallRuleName The name of the server firewall rule. + * @param callback The callback + */ + get(resourceGroupName: string, serverName: string, firewallRuleName: 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 firewallRuleName The name of the server firewall rule. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, serverName: string, firewallRuleName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, serverName: string, firewallRuleName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + serverName, + firewallRuleName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * List all the firewall rules in a given 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 + */ + listByServer(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 + */ + listByServer(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 + */ + listByServer(resourceGroupName: string, serverName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + serverName, + options + }, + listByServerOperationSpec, + callback) as Promise; + } + + /** + * Creates a new firewall rule or updates an existing firewall rule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @param parameters The required parameters for creating or updating a firewall rule. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateOrUpdate(resourceGroupName: string, serverName: string, firewallRuleName: string, parameters: Models.FirewallRule, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + serverName, + firewallRuleName, + parameters, + options + }, + beginCreateOrUpdateOperationSpec, + options); + } + + /** + * Deletes a firewall rule. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param firewallRuleName The name of the server firewall rule. + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteMethod(resourceGroupName: string, serverName: string, firewallRuleName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + serverName, + firewallRuleName, + options + }, + beginDeleteMethodOperationSpec, + options); + } + + /** + * List all the firewall rules in a given server. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByServerNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByServerNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listByServerNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByServerNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByServerNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/firewallRules/{firewallRuleName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName, + Parameters.firewallRuleName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.FirewallRule + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listByServerOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/firewallRules", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.FirewallRuleListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/firewallRules/{firewallRuleName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName, + Parameters.firewallRuleName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.FirewallRule, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.FirewallRule + }, + 201: { + bodyMapper: Mappers.FirewallRule + }, + 202: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginDeleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/firewallRules/{firewallRuleName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName, + Parameters.firewallRuleName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listByServerNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.FirewallRuleListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/mysql/arm-mysql-flexible/src/operations/getPrivateDnsZoneSuffix.ts b/sdk/mysql/arm-mysql-flexible/src/operations/getPrivateDnsZoneSuffix.ts new file mode 100644 index 000000000000..44d672f25614 --- /dev/null +++ b/sdk/mysql/arm-mysql-flexible/src/operations/getPrivateDnsZoneSuffix.ts @@ -0,0 +1,73 @@ +/* + * 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/getPrivateDnsZoneSuffixMappers"; +import * as Parameters from "../models/parameters"; +import { MySQLManagementClientContext } from "../mySQLManagementClientContext"; + +/** Class representing a GetPrivateDnsZoneSuffix. */ +export class GetPrivateDnsZoneSuffix { + private readonly client: MySQLManagementClientContext; + + /** + * Create a GetPrivateDnsZoneSuffix. + * @param {MySQLManagementClientContext} client Reference to the service client. + */ + constructor(client: MySQLManagementClientContext) { + this.client = client; + } + + /** + * Get private DNS zone suffix in the cloud. + * @param [options] The optional parameters + * @returns Promise + */ + execute(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + execute(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + execute(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + execute(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + executeOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const executeOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "providers/Microsoft.DBforMySQL/getPrivateDnsZoneSuffix", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.GetPrivateDnsZoneSuffixResponse + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/mysql/arm-mysql-flexible/src/operations/index.ts b/sdk/mysql/arm-mysql-flexible/src/operations/index.ts new file mode 100644 index 000000000000..14f81875fb37 --- /dev/null +++ b/sdk/mysql/arm-mysql-flexible/src/operations/index.ts @@ -0,0 +1,20 @@ +/* + * 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 * from "./servers"; +export * from "./replicas"; +export * from "./backups"; +export * from "./firewallRules"; +export * from "./databases"; +export * from "./configurations"; +export * from "./locationBasedCapabilities"; +export * from "./checkVirtualNetworkSubnetUsage"; +export * from "./checkNameAvailability"; +export * from "./getPrivateDnsZoneSuffix"; +export * from "./operations"; diff --git a/sdk/mysql/arm-mysql-flexible/src/operations/locationBasedCapabilities.ts b/sdk/mysql/arm-mysql-flexible/src/operations/locationBasedCapabilities.ts new file mode 100644 index 000000000000..8deba489feec --- /dev/null +++ b/sdk/mysql/arm-mysql-flexible/src/operations/locationBasedCapabilities.ts @@ -0,0 +1,133 @@ +/* + * 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/locationBasedCapabilitiesMappers"; +import * as Parameters from "../models/parameters"; +import { MySQLManagementClientContext } from "../mySQLManagementClientContext"; + +/** Class representing a LocationBasedCapabilities. */ +export class LocationBasedCapabilities { + private readonly client: MySQLManagementClientContext; + + /** + * Create a LocationBasedCapabilities. + * @param {MySQLManagementClientContext} client Reference to the service client. + */ + constructor(client: MySQLManagementClientContext) { + this.client = client; + } + + /** + * Get capabilities at specified location in a given subscription. + * @param locationName The name of the location. + * @param [options] The optional parameters + * @returns Promise + */ + list(locationName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param locationName The name of the location. + * @param callback The callback + */ + list(locationName: string, callback: msRest.ServiceCallback): void; + /** + * @param locationName The name of the location. + * @param options The optional parameters + * @param callback The callback + */ + list(locationName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(locationName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + locationName, + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Get capabilities at specified location in a given subscription. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/capabilities", + urlParameters: [ + Parameters.subscriptionId, + Parameters.locationName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CapabilitiesListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CapabilitiesListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/mysql/arm-mysql-flexible/src/operations/operations.ts b/sdk/mysql/arm-mysql-flexible/src/operations/operations.ts new file mode 100644 index 000000000000..966ebe7ebb85 --- /dev/null +++ b/sdk/mysql/arm-mysql-flexible/src/operations/operations.ts @@ -0,0 +1,125 @@ +/* + * 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/operationsMappers"; +import * as Parameters from "../models/parameters"; +import { MySQLManagementClientContext } from "../mySQLManagementClientContext"; + +/** Class representing a Operations. */ +export class Operations { + private readonly client: MySQLManagementClientContext; + + /** + * Create a Operations. + * @param {MySQLManagementClientContext} client Reference to the service client. + */ + constructor(client: MySQLManagementClientContext) { + this.client = client; + } + + /** + * Lists all of the available REST API operations. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Lists all of the available REST API operations. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.DBforMySQL/operations", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/mysql/arm-mysql-flexible/src/operations/replicas.ts b/sdk/mysql/arm-mysql-flexible/src/operations/replicas.ts new file mode 100644 index 000000000000..eff0702780eb --- /dev/null +++ b/sdk/mysql/arm-mysql-flexible/src/operations/replicas.ts @@ -0,0 +1,138 @@ +/* + * 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/replicasMappers"; +import * as Parameters from "../models/parameters"; +import { MySQLManagementClientContext } from "../mySQLManagementClientContext"; + +/** Class representing a Replicas. */ +export class Replicas { + private readonly client: MySQLManagementClientContext; + + /** + * Create a Replicas. + * @param {MySQLManagementClientContext} client Reference to the service client. + */ + constructor(client: MySQLManagementClientContext) { + this.client = client; + } + + /** + * List all the replicas for a given 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 + */ + listByServer(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 + */ + listByServer(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 + */ + listByServer(resourceGroupName: string, serverName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + serverName, + options + }, + listByServerOperationSpec, + callback) as Promise; + } + + /** + * List all the replicas for a given server. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByServerNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByServerNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listByServerNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByServerNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByServerNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listByServerOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/replicas", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ServerListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listByServerNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ServerListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/mysql/arm-mysql-flexible/src/operations/servers.ts b/sdk/mysql/arm-mysql-flexible/src/operations/servers.ts new file mode 100644 index 000000000000..9487fd9b7044 --- /dev/null +++ b/sdk/mysql/arm-mysql-flexible/src/operations/servers.ts @@ -0,0 +1,710 @@ +/* + * 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 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 { MySQLManagementClientContext } from "../mySQLManagementClientContext"; + +/** Class representing a Servers. */ +export class Servers { + private readonly client: MySQLManagementClientContext; + + /** + * Create a Servers. + * @param {MySQLManagementClientContext} client Reference to the service client. + */ + constructor(client: MySQLManagementClientContext) { + this.client = client; + } + + /** + * Creates a new server or updates an existing server. The update action will overwrite the + * existing server. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for creating or updating a server. + * @param [options] The optional parameters + * @returns Promise + */ + create(resourceGroupName: string, serverName: string, parameters: Models.Server, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreate(resourceGroupName,serverName,parameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Updates an existing server. The request body can contain one to many of the properties present + * in the normal server definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for updating a server. + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, serverName: string, parameters: Models.ServerForUpdate, options?: msRest.RequestOptionsBase): Promise { + return this.beginUpdate(resourceGroupName,serverName,parameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Deletes a 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 + */ + deleteMethod(resourceGroupName: string, serverName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteMethod(resourceGroupName,serverName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Gets information about a 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; + } + + /** + * List all the servers in a given resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The optional parameters + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + options + }, + listByResourceGroupOperationSpec, + callback) as Promise; + } + + /** + * List all the servers in a given subscription. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Manual failover a 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 + */ + failover(resourceGroupName: string, serverName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginFailover(resourceGroupName,serverName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Restarts a server. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for restarting a server. + * @param [options] The optional parameters + * @returns Promise + */ + restart(resourceGroupName: string, serverName: string, parameters: Models.ServerRestartParameter, options?: msRest.RequestOptionsBase): Promise { + return this.beginRestart(resourceGroupName,serverName,parameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Starts a 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 + */ + start(resourceGroupName: string, serverName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginStart(resourceGroupName,serverName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Stops a 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 + */ + stop(resourceGroupName: string, serverName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginStop(resourceGroupName,serverName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Creates a new server or updates an existing server. The update action will overwrite the + * existing server. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for creating or updating a server. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreate(resourceGroupName: string, serverName: string, parameters: Models.Server, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + serverName, + parameters, + options + }, + beginCreateOperationSpec, + options); + } + + /** + * Updates an existing server. The request body can contain one to many of the properties present + * in the normal server definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for updating a server. + * @param [options] The optional parameters + * @returns Promise + */ + beginUpdate(resourceGroupName: string, serverName: string, parameters: Models.ServerForUpdate, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + serverName, + parameters, + options + }, + beginUpdateOperationSpec, + options); + } + + /** + * Deletes a 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 + */ + beginDeleteMethod(resourceGroupName: string, serverName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + serverName, + options + }, + beginDeleteMethodOperationSpec, + options); + } + + /** + * Manual failover a 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 + */ + beginFailover(resourceGroupName: string, serverName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + serverName, + options + }, + beginFailoverOperationSpec, + options); + } + + /** + * Restarts a server. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serverName The name of the server. + * @param parameters The required parameters for restarting a server. + * @param [options] The optional parameters + * @returns Promise + */ + beginRestart(resourceGroupName: string, serverName: string, parameters: Models.ServerRestartParameter, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + serverName, + parameters, + options + }, + beginRestartOperationSpec, + options); + } + + /** + * Starts a 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 + */ + beginStart(resourceGroupName: string, serverName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + serverName, + options + }, + beginStartOperationSpec, + options); + } + + /** + * Stops a 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 + */ + beginStop(resourceGroupName: string, serverName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + serverName, + options + }, + beginStopOperationSpec, + options); + } + + /** + * List all the servers in a given resource group. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByResourceGroupNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByResourceGroupNextOperationSpec, + callback) as Promise; + } + + /** + * List all the servers in a given subscription. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Server + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listByResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ServerListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/flexibleServers", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ServerListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginCreateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.Server, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Server + }, + 201: { + bodyMapper: Mappers.Server + }, + 202: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.ServerForUpdate, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Server + }, + 202: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginDeleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginFailoverOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/failover", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 202: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginRestartOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/restart", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.ServerRestartParameter, + required: true + } + }, + responses: { + 200: {}, + 202: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginStartOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/start", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 202: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginStopOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/stop", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serverName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 202: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ServerListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ServerListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/mysql/arm-mysql-flexible/tsconfig.json b/sdk/mysql/arm-mysql-flexible/tsconfig.json new file mode 100644 index 000000000000..422b584abd5e --- /dev/null +++ b/sdk/mysql/arm-mysql-flexible/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es5", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": ["es6", "dom"], + "declaration": true, + "outDir": "./esm", + "importHelpers": true + }, + "include": ["./src/**/*.ts"], + "exclude": ["node_modules"] +}