diff --git a/lib/services/datamigrationManagement/LICENSE.txt b/lib/services/datamigrationManagement/LICENSE.txt new file mode 100644 index 0000000000..5431ba98b9 --- /dev/null +++ b/lib/services/datamigrationManagement/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018 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/lib/services/datamigrationManagement/README.md b/lib/services/datamigrationManagement/README.md new file mode 100644 index 0000000000..69a90d9ca0 --- /dev/null +++ b/lib/services/datamigrationManagement/README.md @@ -0,0 +1,40 @@ +--- +uid: azure-arm-datamigration +summary: *content + +--- +# Microsoft Azure SDK for Node.js - DataMigrationServiceClient +This project provides a Node.js package for accessing Azure. Right now it supports: +- **Node.js version 6.x.x or higher** + +## Features + + +## How to Install + +```bash +npm install azure-arm-datamigration +``` + +## How to use + +### Authentication, client creation and listSkus resourceSkus as an example. + +```javascript +const msRestAzure = require("ms-rest-azure"); +const DataMigrationServiceClient = require("azure-arm-datamigration"); +msRestAzure.interactiveLogin().then((creds) => { + const subscriptionId = ""; + const client = new DataMigrationServiceClient(creds, subscriptionId); + return client.resourceSkus.listSkus().then((result) => { + console.log("The result is:"); + console.log(result); + }); +}).catch((err) => { + console.log('An error occurred:'); + console.dir(err, {depth: null, colors: true}); +}); + +## Related projects + +- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node) diff --git a/lib/services/datamigrationManagement/lib/dataMigrationServiceClient.d.ts b/lib/services/datamigrationManagement/lib/dataMigrationServiceClient.d.ts new file mode 100644 index 0000000000..c20933af94 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/dataMigrationServiceClient.d.ts @@ -0,0 +1,66 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import { ServiceClientCredentials } from 'ms-rest'; +import { AzureServiceClient, AzureServiceClientOptions } from 'ms-rest-azure'; +import * as models from "./models"; +import * as operations from "./operations"; + +export default class DataMigrationServiceClient extends AzureServiceClient { + /** + * Initializes a new instance of the DataMigrationServiceClient class. + * @constructor + * + * @class + * @param {credentials} credentials - Credentials needed for the client to connect to Azure. + * + * @param {string} subscriptionId - Identifier of the subscription + * + * @param {string} [baseUri] - The base URI of the service. + * + * @param {object} [options] - The parameter options + * + * @param {Array} [options.filters] - Filters to be added to the request pipeline + * + * @param {object} [options.requestOptions] - Options for the underlying request object + * {@link https://github.com/request/request#requestoptions-callback Options doc} + * + * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy + * + * @param {string} [options.acceptLanguage] - The preferred language for the response. + * + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + */ + constructor(credentials: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions); + + credentials: ServiceClientCredentials; + + subscriptionId: string; + + acceptLanguage: string; + + longRunningOperationRetryTimeout: number; + + generateClientRequestId: boolean; + + // Operation groups + resourceSkus: operations.ResourceSkus; + services: operations.Services; + tasks: operations.Tasks; + projects: operations.Projects; + usages: operations.Usages; + operations: operations.Operations; + files: operations.Files; +} + +export { DataMigrationServiceClient, models as DataMigrationServiceModels }; diff --git a/lib/services/datamigrationManagement/lib/dataMigrationServiceClient.js b/lib/services/datamigrationManagement/lib/dataMigrationServiceClient.js new file mode 100644 index 0000000000..d9f6baae46 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/dataMigrationServiceClient.js @@ -0,0 +1,90 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +/* jshint latedef:false */ +/* jshint forin:false */ +/* jshint noempty:false */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const ServiceClient = msRestAzure.AzureServiceClient; + +const models = require('./models'); +const operations = require('./operations'); + + +/** Class representing a DataMigrationServiceClient. */ +class DataMigrationServiceClient extends ServiceClient { + /** + * Create a DataMigrationServiceClient. + * @param {credentials} credentials - Credentials needed for the client to connect to Azure. + * @param {string} subscriptionId - Identifier of the subscription + * @param {string} [baseUri] - The base URI of the service. + * @param {object} [options] - The parameter options + * @param {Array} [options.filters] - Filters to be added to the request pipeline + * @param {object} [options.requestOptions] - Options for the underlying request object + * {@link https://github.com/request/request#requestoptions-callback Options doc} + * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy + * @param {string} [options.acceptLanguage] - The preferred language for the response. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + */ + constructor(credentials, subscriptionId, baseUri, options) { + if (credentials === null || credentials === undefined) { + throw new Error('\'credentials\' cannot be null.'); + } + if (subscriptionId === null || subscriptionId === undefined) { + throw new Error('\'subscriptionId\' cannot be null.'); + } + + if (!options) options = {}; + + super(credentials, options); + + this.acceptLanguage = 'en-US'; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.baseUri = baseUri; + if (!this.baseUri) { + this.baseUri = 'https://management.azure.com'; + } + this.credentials = credentials; + this.subscriptionId = subscriptionId; + + let packageInfo = this.getPackageJsonInfo(__dirname); + this.addUserAgentInfo(`${packageInfo.name}/${packageInfo.version}`); + if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + this.acceptLanguage = options.acceptLanguage; + } + if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; + } + if(options.generateClientRequestId !== null && options.generateClientRequestId !== undefined) { + this.generateClientRequestId = options.generateClientRequestId; + } + this.resourceSkus = new operations.ResourceSkus(this); + this.services = new operations.Services(this); + this.tasks = new operations.Tasks(this); + this.projects = new operations.Projects(this); + this.usages = new operations.Usages(this); + this.operations = new operations.Operations(this); + this.files = new operations.Files(this); + this.models = models; + msRest.addSerializationMixin(this); + } + +} + +module.exports = DataMigrationServiceClient; +module.exports['default'] = DataMigrationServiceClient; +module.exports.DataMigrationServiceClient = DataMigrationServiceClient; +module.exports.DataMigrationServiceModels = models; diff --git a/lib/services/datamigrationManagement/lib/models/apiError.js b/lib/services/datamigrationManagement/lib/models/apiError.js new file mode 100644 index 0000000000..b7f88cd554 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/apiError.js @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Error information. + * + */ +class ApiError { + /** + * Create a ApiError. + * @member {object} [error] Error information in OData format + * @member {string} [error.code] The machine-readable description of the + * error, such as 'InvalidRequest' or 'InternalServerError' + * @member {string} [error.message] The human-readable description of the + * error + * @member {array} [error.details] Inner errors that caused this error + */ + constructor() { + } + + /** + * Defines the metadata of ApiError + * + * @returns {object} metadata of ApiError + * + */ + mapper() { + return { + required: false, + serializedName: 'ApiError', + type: { + name: 'Composite', + className: 'ApiError', + modelProperties: { + error: { + required: false, + serializedName: 'error', + type: { + name: 'Composite', + className: 'ODataError' + } + } + } + } + }; + } +} + +module.exports = ApiError; diff --git a/lib/services/datamigrationManagement/lib/models/availableServiceSku.js b/lib/services/datamigrationManagement/lib/models/availableServiceSku.js new file mode 100644 index 0000000000..4cfdb58963 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/availableServiceSku.js @@ -0,0 +1,82 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Describes the available service SKU. + * + */ +class AvailableServiceSku { + /** + * Create a AvailableServiceSku. + * @member {string} [resourceType] The resource type, including the provider + * namespace + * @member {object} [sku] SKU name, tier, etc. + * @member {string} [sku.name] The name of the SKU + * @member {string} [sku.family] SKU family + * @member {string} [sku.size] SKU size + * @member {string} [sku.tier] The tier of the SKU, such as "Basic", "General + * Purpose", or "Business Critical" + * @member {object} [capacity] A description of the scaling capacities of the + * SKU + * @member {number} [capacity.minimum] The minimum capacity, usually 0 or 1. + * @member {number} [capacity.maximum] The maximum capacity + * @member {number} [capacity.default] The default capacity + * @member {string} [capacity.scaleType] The scalability approach. Possible + * values include: 'none', 'manual', 'automatic' + */ + constructor() { + } + + /** + * Defines the metadata of AvailableServiceSku + * + * @returns {object} metadata of AvailableServiceSku + * + */ + mapper() { + return { + required: false, + serializedName: 'AvailableServiceSku', + type: { + name: 'Composite', + className: 'AvailableServiceSku', + modelProperties: { + resourceType: { + required: false, + serializedName: 'resourceType', + type: { + name: 'String' + } + }, + sku: { + required: false, + serializedName: 'sku', + type: { + name: 'Composite', + className: 'AvailableServiceSkuSku' + } + }, + capacity: { + required: false, + serializedName: 'capacity', + type: { + name: 'Composite', + className: 'AvailableServiceSkuCapacity' + } + } + } + } + }; + } +} + +module.exports = AvailableServiceSku; diff --git a/lib/services/datamigrationManagement/lib/models/availableServiceSkuCapacity.js b/lib/services/datamigrationManagement/lib/models/availableServiceSkuCapacity.js new file mode 100644 index 0000000000..63c6308f05 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/availableServiceSkuCapacity.js @@ -0,0 +1,77 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * A description of the scaling capacities of the SKU + * + */ +class AvailableServiceSkuCapacity { + /** + * Create a AvailableServiceSkuCapacity. + * @member {number} [minimum] The minimum capacity, usually 0 or 1. + * @member {number} [maximum] The maximum capacity + * @member {number} [default] The default capacity + * @member {string} [scaleType] The scalability approach. Possible values + * include: 'none', 'manual', 'automatic' + */ + constructor() { + } + + /** + * Defines the metadata of AvailableServiceSkuCapacity + * + * @returns {object} metadata of AvailableServiceSkuCapacity + * + */ + mapper() { + return { + required: false, + serializedName: 'AvailableServiceSku_capacity', + type: { + name: 'Composite', + className: 'AvailableServiceSkuCapacity', + modelProperties: { + minimum: { + required: false, + serializedName: 'minimum', + type: { + name: 'Number' + } + }, + maximum: { + required: false, + serializedName: 'maximum', + type: { + name: 'Number' + } + }, + default: { + required: false, + serializedName: 'default', + type: { + name: 'Number' + } + }, + scaleType: { + required: false, + serializedName: 'scaleType', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AvailableServiceSkuCapacity; diff --git a/lib/services/datamigrationManagement/lib/models/availableServiceSkuSku.js b/lib/services/datamigrationManagement/lib/models/availableServiceSkuSku.js new file mode 100644 index 0000000000..2191e95fca --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/availableServiceSkuSku.js @@ -0,0 +1,77 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * SKU name, tier, etc. + * + */ +class AvailableServiceSkuSku { + /** + * Create a AvailableServiceSkuSku. + * @member {string} [name] The name of the SKU + * @member {string} [family] SKU family + * @member {string} [size] SKU size + * @member {string} [tier] The tier of the SKU, such as "Basic", "General + * Purpose", or "Business Critical" + */ + constructor() { + } + + /** + * Defines the metadata of AvailableServiceSkuSku + * + * @returns {object} metadata of AvailableServiceSkuSku + * + */ + mapper() { + return { + required: false, + serializedName: 'AvailableServiceSku_sku', + type: { + name: 'Composite', + className: 'AvailableServiceSkuSku', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + family: { + required: false, + serializedName: 'family', + type: { + name: 'String' + } + }, + size: { + required: false, + serializedName: 'size', + type: { + name: 'String' + } + }, + tier: { + required: false, + serializedName: 'tier', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AvailableServiceSkuSku; diff --git a/lib/services/datamigrationManagement/lib/models/blobShare.js b/lib/services/datamigrationManagement/lib/models/blobShare.js new file mode 100644 index 0000000000..f37f0d4174 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/blobShare.js @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Blob container storage information. + * + */ +class BlobShare { + /** + * Create a BlobShare. + * @member {string} sasUri SAS URI of Azure Storage Account Container. + */ + constructor() { + } + + /** + * Defines the metadata of BlobShare + * + * @returns {object} metadata of BlobShare + * + */ + mapper() { + return { + required: false, + serializedName: 'BlobShare', + type: { + name: 'Composite', + className: 'BlobShare', + modelProperties: { + sasUri: { + required: true, + serializedName: 'sasUri', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = BlobShare; diff --git a/lib/services/datamigrationManagement/lib/models/commandProperties.js b/lib/services/datamigrationManagement/lib/models/commandProperties.js new file mode 100644 index 0000000000..8166c577c9 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/commandProperties.js @@ -0,0 +1,87 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Base class for all types of DMS command properties. If command is not + * supported by current client, this object is returned. + * + */ +class CommandProperties { + /** + * Create a CommandProperties. + * @member {array} [errors] Array of errors. This is ignored if submitted. + * @member {string} [state] The state of the command. This is ignored if + * submitted. Possible values include: 'Unknown', 'Accepted', 'Running', + * 'Succeeded', 'Failed' + * @member {string} commandType Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of CommandProperties + * + * @returns {object} metadata of CommandProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'Unknown', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'commandType', + clientName: 'commandType' + }, + uberParent: 'CommandProperties', + className: 'CommandProperties', + modelProperties: { + errors: { + required: false, + readOnly: true, + serializedName: 'errors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ODataErrorElementType', + type: { + name: 'Composite', + className: 'ODataError' + } + } + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + commandType: { + required: true, + serializedName: 'commandType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CommandProperties; diff --git a/lib/services/datamigrationManagement/lib/models/connectToMongoDbTaskProperties.js b/lib/services/datamigrationManagement/lib/models/connectToMongoDbTaskProperties.js new file mode 100644 index 0000000000..2e657313b5 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/connectToMongoDbTaskProperties.js @@ -0,0 +1,142 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Properties for the task that validates the connection to and provides + * information about a MongoDB server + * + * @extends models['ProjectTaskProperties'] + */ +class ConnectToMongoDbTaskProperties extends models['ProjectTaskProperties'] { + /** + * Create a ConnectToMongoDbTaskProperties. + * @member {object} [input] + * @member {string} [input.connectionString] A MongoDB connection string or + * blob container URL. The user name and password can be specified here or in + * the userName and password properties + * @member {array} [output] An array containing a single MongoDbClusterInfo + * object + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ConnectToMongoDbTaskProperties + * + * @returns {object} metadata of ConnectToMongoDbTaskProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'Connect.MongoDb', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'taskType', + clientName: 'taskType' + }, + uberParent: 'ProjectTaskProperties', + className: 'ConnectToMongoDbTaskProperties', + modelProperties: { + errors: { + required: false, + readOnly: true, + serializedName: 'errors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ODataErrorElementType', + type: { + name: 'Composite', + className: 'ODataError' + } + } + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + commands: { + required: false, + readOnly: true, + serializedName: 'commands', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CommandPropertiesElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'commandType', + clientName: 'commandType' + }, + uberParent: 'CommandProperties', + className: 'CommandProperties' + } + } + } + }, + taskType: { + required: true, + serializedName: 'taskType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + input: { + required: false, + serializedName: 'input', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'ConnectionInfo', + className: 'MongoDbConnectionInfo' + } + }, + output: { + required: false, + readOnly: true, + serializedName: 'output', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'MongoDbClusterInfoElementType', + type: { + name: 'Composite', + className: 'MongoDbClusterInfo' + } + } + } + } + } + } + }; + } +} + +module.exports = ConnectToMongoDbTaskProperties; diff --git a/lib/services/datamigrationManagement/lib/models/connectToSourceMySqlTaskInput.js b/lib/services/datamigrationManagement/lib/models/connectToSourceMySqlTaskInput.js new file mode 100644 index 0000000000..8c6dc57401 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/connectToSourceMySqlTaskInput.js @@ -0,0 +1,80 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Input for the task that validates MySQL database connection + * + */ +class ConnectToSourceMySqlTaskInput { + /** + * Create a ConnectToSourceMySqlTaskInput. + * @member {object} sourceConnectionInfo Information for connecting to MySQL + * source + * @member {string} [sourceConnectionInfo.serverName] Name of the server + * @member {number} [sourceConnectionInfo.port] Port for Server + * @member {string} [targetPlatform] Target Platform for the migration. + * Possible values include: 'AzureDbForMySQL' + * @member {string} [checkPermissionsGroup] Permission group for validations. + * Possible values include: 'Default', 'MigrationFromSqlServerToAzureDB', + * 'MigrationFromSqlServerToAzureMI', 'MigrationFromMySQLToAzureDBForMySQL' + */ + constructor() { + } + + /** + * Defines the metadata of ConnectToSourceMySqlTaskInput + * + * @returns {object} metadata of ConnectToSourceMySqlTaskInput + * + */ + mapper() { + return { + required: false, + serializedName: 'ConnectToSourceMySqlTaskInput', + type: { + name: 'Composite', + className: 'ConnectToSourceMySqlTaskInput', + modelProperties: { + sourceConnectionInfo: { + required: true, + serializedName: 'sourceConnectionInfo', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'ConnectionInfo', + className: 'MySqlConnectionInfo' + } + }, + targetPlatform: { + required: false, + serializedName: 'targetPlatform', + type: { + name: 'String' + } + }, + checkPermissionsGroup: { + required: false, + serializedName: 'checkPermissionsGroup', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ConnectToSourceMySqlTaskInput; diff --git a/lib/services/datamigrationManagement/lib/models/connectToSourceMySqlTaskProperties.js b/lib/services/datamigrationManagement/lib/models/connectToSourceMySqlTaskProperties.js new file mode 100644 index 0000000000..83a35d912a --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/connectToSourceMySqlTaskProperties.js @@ -0,0 +1,143 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Properties for the task that validates MySQL database connection + * + * @extends models['ProjectTaskProperties'] + */ +class ConnectToSourceMySqlTaskProperties extends models['ProjectTaskProperties'] { + /** + * Create a ConnectToSourceMySqlTaskProperties. + * @member {object} [input] Task input + * @member {object} [input.sourceConnectionInfo] Information for connecting + * to MySQL source + * @member {string} [input.sourceConnectionInfo.serverName] Name of the + * server + * @member {number} [input.sourceConnectionInfo.port] Port for Server + * @member {string} [input.targetPlatform] Target Platform for the migration. + * Possible values include: 'AzureDbForMySQL' + * @member {string} [input.checkPermissionsGroup] Permission group for + * validations. Possible values include: 'Default', + * 'MigrationFromSqlServerToAzureDB', 'MigrationFromSqlServerToAzureMI', + * 'MigrationFromMySQLToAzureDBForMySQL' + * @member {array} [output] Task output. This is ignored if submitted. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ConnectToSourceMySqlTaskProperties + * + * @returns {object} metadata of ConnectToSourceMySqlTaskProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'ConnectToSource.MySql', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'taskType', + clientName: 'taskType' + }, + uberParent: 'ProjectTaskProperties', + className: 'ConnectToSourceMySqlTaskProperties', + modelProperties: { + errors: { + required: false, + readOnly: true, + serializedName: 'errors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ODataErrorElementType', + type: { + name: 'Composite', + className: 'ODataError' + } + } + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + commands: { + required: false, + readOnly: true, + serializedName: 'commands', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CommandPropertiesElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'commandType', + clientName: 'commandType' + }, + uberParent: 'CommandProperties', + className: 'CommandProperties' + } + } + } + }, + taskType: { + required: true, + serializedName: 'taskType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + input: { + required: false, + serializedName: 'input', + type: { + name: 'Composite', + className: 'ConnectToSourceMySqlTaskInput' + } + }, + output: { + required: false, + readOnly: true, + serializedName: 'output', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ConnectToSourceNonSqlTaskOutputElementType', + type: { + name: 'Composite', + className: 'ConnectToSourceNonSqlTaskOutput' + } + } + } + } + } + } + }; + } +} + +module.exports = ConnectToSourceMySqlTaskProperties; diff --git a/lib/services/datamigrationManagement/lib/models/connectToSourceNonSqlTaskOutput.js b/lib/services/datamigrationManagement/lib/models/connectToSourceNonSqlTaskOutput.js new file mode 100644 index 0000000000..a3ba78b1f7 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/connectToSourceNonSqlTaskOutput.js @@ -0,0 +1,117 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Output for connect to Oracle, MySQL type source + * + */ +class ConnectToSourceNonSqlTaskOutput { + /** + * Create a ConnectToSourceNonSqlTaskOutput. + * @member {string} [id] Result identifier + * @member {string} [sourceServerBrandVersion] Server brand version + * @member {object} [serverProperties] Server properties + * @member {string} [serverProperties.serverPlatform] Name of the server + * platform + * @member {string} [serverProperties.serverName] Name of the server + * @member {string} [serverProperties.serverVersion] Version of the database + * server + * @member {string} [serverProperties.serverEdition] Edition of the database + * server + * @member {string} [serverProperties.serverOperatingSystemVersion] Version + * of the operating system + * @member {number} [serverProperties.serverDatabaseCount] Number of + * databases in the server + * @member {array} [databases] List of databases on the server + * @member {array} [validationErrors] Validation errors associated with the + * task + */ + constructor() { + } + + /** + * Defines the metadata of ConnectToSourceNonSqlTaskOutput + * + * @returns {object} metadata of ConnectToSourceNonSqlTaskOutput + * + */ + mapper() { + return { + required: false, + serializedName: 'ConnectToSourceNonSqlTaskOutput', + type: { + name: 'Composite', + className: 'ConnectToSourceNonSqlTaskOutput', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + sourceServerBrandVersion: { + required: false, + readOnly: true, + serializedName: 'sourceServerBrandVersion', + type: { + name: 'String' + } + }, + serverProperties: { + required: false, + readOnly: true, + serializedName: 'serverProperties', + type: { + name: 'Composite', + className: 'ServerProperties' + } + }, + databases: { + required: false, + readOnly: true, + serializedName: 'databases', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + validationErrors: { + required: false, + readOnly: true, + serializedName: 'validationErrors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ReportableExceptionElementType', + type: { + name: 'Composite', + className: 'ReportableException' + } + } + } + } + } + } + }; + } +} + +module.exports = ConnectToSourceNonSqlTaskOutput; diff --git a/lib/services/datamigrationManagement/lib/models/connectToSourceSqlServerSyncTaskProperties.js b/lib/services/datamigrationManagement/lib/models/connectToSourceSqlServerSyncTaskProperties.js new file mode 100644 index 0000000000..5b5a2f3277 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/connectToSourceSqlServerSyncTaskProperties.js @@ -0,0 +1,164 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Properties for the task that validates connection to SQL Server and source + * server requirements for online migration + * + * @extends models['ProjectTaskProperties'] + */ +class ConnectToSourceSqlServerSyncTaskProperties extends models['ProjectTaskProperties'] { + /** + * Create a ConnectToSourceSqlServerSyncTaskProperties. + * @member {object} [input] Task input + * @member {object} [input.sourceConnectionInfo] Connection information for + * Source SQL Server + * @member {string} [input.sourceConnectionInfo.dataSource] Data source in + * the format Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [input.sourceConnectionInfo.authentication] + * Authentication type to use for connection. Possible values include: + * 'None', 'WindowsAuthentication', 'SqlAuthentication', + * 'ActiveDirectoryIntegrated', 'ActiveDirectoryPassword' + * @member {boolean} [input.sourceConnectionInfo.encryptConnection] Whether + * to encrypt the connection + * @member {string} [input.sourceConnectionInfo.additionalSettings] + * Additional connection settings + * @member {boolean} [input.sourceConnectionInfo.trustServerCertificate] + * Whether to trust the server certificate + * @member {string} [input.sourceConnectionInfo.platform] Server platform + * type for connection. Possible values include: 'SqlOnPrem' + * @member {string} [input.checkPermissionsGroup] Permission group for + * validations. Possible values include: 'Default', + * 'MigrationFromSqlServerToAzureDB', 'MigrationFromSqlServerToAzureMI', + * 'MigrationFromMySQLToAzureDBForMySQL' + * @member {boolean} [input.collectLogins] Flag for whether to collect logins + * from source server. + * @member {boolean} [input.collectAgentJobs] Flag for whether to collect + * agent jobs from source server. + * @member {boolean} [input.collectTdeCertificateInfo] Flag for whether to + * collect TDE Certificate names from source server. + * @member {array} [output] Task output. This is ignored if submitted. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ConnectToSourceSqlServerSyncTaskProperties + * + * @returns {object} metadata of ConnectToSourceSqlServerSyncTaskProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'ConnectToSource.SqlServer.Sync', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'taskType', + clientName: 'taskType' + }, + uberParent: 'ProjectTaskProperties', + className: 'ConnectToSourceSqlServerSyncTaskProperties', + modelProperties: { + errors: { + required: false, + readOnly: true, + serializedName: 'errors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ODataErrorElementType', + type: { + name: 'Composite', + className: 'ODataError' + } + } + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + commands: { + required: false, + readOnly: true, + serializedName: 'commands', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CommandPropertiesElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'commandType', + clientName: 'commandType' + }, + uberParent: 'CommandProperties', + className: 'CommandProperties' + } + } + } + }, + taskType: { + required: true, + serializedName: 'taskType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + input: { + required: false, + serializedName: 'input', + type: { + name: 'Composite', + className: 'ConnectToSourceSqlServerTaskInput' + } + }, + output: { + required: false, + readOnly: true, + serializedName: 'output', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ConnectToSourceSqlServerTaskOutputElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'ConnectToSourceSqlServerTaskOutput', + className: 'ConnectToSourceSqlServerTaskOutput' + } + } + } + } + } + } + }; + } +} + +module.exports = ConnectToSourceSqlServerSyncTaskProperties; diff --git a/lib/services/datamigrationManagement/lib/models/connectToSourceSqlServerTaskInput.js b/lib/services/datamigrationManagement/lib/models/connectToSourceSqlServerTaskInput.js new file mode 100644 index 0000000000..1e14d5bdc1 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/connectToSourceSqlServerTaskInput.js @@ -0,0 +1,114 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Input for the task that validates connection to SQL Server and also + * validates source server requirements + * + */ +class ConnectToSourceSqlServerTaskInput { + /** + * Create a ConnectToSourceSqlServerTaskInput. + * @member {object} sourceConnectionInfo Connection information for Source + * SQL Server + * @member {string} [sourceConnectionInfo.dataSource] Data source in the + * format Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [sourceConnectionInfo.authentication] Authentication type + * to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [sourceConnectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [sourceConnectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [sourceConnectionInfo.trustServerCertificate] Whether to + * trust the server certificate + * @member {string} [sourceConnectionInfo.platform] Server platform type for + * connection. Possible values include: 'SqlOnPrem' + * @member {string} [checkPermissionsGroup] Permission group for validations. + * Possible values include: 'Default', 'MigrationFromSqlServerToAzureDB', + * 'MigrationFromSqlServerToAzureMI', 'MigrationFromMySQLToAzureDBForMySQL' + * @member {boolean} [collectLogins] Flag for whether to collect logins from + * source server. Default value: false . + * @member {boolean} [collectAgentJobs] Flag for whether to collect agent + * jobs from source server. Default value: false . + * @member {boolean} [collectTdeCertificateInfo] Flag for whether to collect + * TDE Certificate names from source server. Default value: false . + */ + constructor() { + } + + /** + * Defines the metadata of ConnectToSourceSqlServerTaskInput + * + * @returns {object} metadata of ConnectToSourceSqlServerTaskInput + * + */ + mapper() { + return { + required: false, + serializedName: 'ConnectToSourceSqlServerTaskInput', + type: { + name: 'Composite', + className: 'ConnectToSourceSqlServerTaskInput', + modelProperties: { + sourceConnectionInfo: { + required: true, + serializedName: 'sourceConnectionInfo', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'ConnectionInfo', + className: 'SqlConnectionInfo' + } + }, + checkPermissionsGroup: { + required: false, + serializedName: 'checkPermissionsGroup', + type: { + name: 'String' + } + }, + collectLogins: { + required: false, + serializedName: 'collectLogins', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + collectAgentJobs: { + required: false, + serializedName: 'collectAgentJobs', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + collectTdeCertificateInfo: { + required: false, + serializedName: 'collectTdeCertificateInfo', + defaultValue: false, + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = ConnectToSourceSqlServerTaskInput; diff --git a/lib/services/datamigrationManagement/lib/models/connectToSourceSqlServerTaskOutput.js b/lib/services/datamigrationManagement/lib/models/connectToSourceSqlServerTaskOutput.js new file mode 100644 index 0000000000..17e8239ebb --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/connectToSourceSqlServerTaskOutput.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Output for the task that validates connection to SQL Server and also + * validates source server requirements + * + */ +class ConnectToSourceSqlServerTaskOutput { + /** + * Create a ConnectToSourceSqlServerTaskOutput. + * @member {string} [id] Result identifier + * @member {string} resultType Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of ConnectToSourceSqlServerTaskOutput + * + * @returns {object} metadata of ConnectToSourceSqlServerTaskOutput + * + */ + mapper() { + return { + required: false, + serializedName: 'ConnectToSourceSqlServerTaskOutput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'ConnectToSourceSqlServerTaskOutput', + className: 'ConnectToSourceSqlServerTaskOutput', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ConnectToSourceSqlServerTaskOutput; diff --git a/lib/services/datamigrationManagement/lib/models/connectToSourceSqlServerTaskOutputAgentJobLevel.js b/lib/services/datamigrationManagement/lib/models/connectToSourceSqlServerTaskOutputAgentJobLevel.js new file mode 100644 index 0000000000..329378985a --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/connectToSourceSqlServerTaskOutputAgentJobLevel.js @@ -0,0 +1,148 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Agent Job level output for the task that validates connection to SQL Server + * and also validates source server requirements + * + * @extends models['ConnectToSourceSqlServerTaskOutput'] + */ +class ConnectToSourceSqlServerTaskOutputAgentJobLevel extends models['ConnectToSourceSqlServerTaskOutput'] { + /** + * Create a ConnectToSourceSqlServerTaskOutputAgentJobLevel. + * @member {string} [name] Agent Job name + * @member {string} [jobCategory] The type of Agent Job. + * @member {boolean} [isEnabled] The state of the original Agent Job. + * @member {string} [jobOwner] The owner of the Agent Job + * @member {date} [lastExecutedOn] UTC Date and time when the Agent Job was + * last executed. + * @member {array} [validationErrors] Validation errors + * @member {object} [migrationEligibility] Information about eligiblity of + * agent job for migration. + * @member {boolean} [migrationEligibility.isEligibileForMigration] Whether + * object is eligible for migration or not. + * @member {array} [migrationEligibility.validationMessages] Information + * about eligibility failure for the server object. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ConnectToSourceSqlServerTaskOutputAgentJobLevel + * + * @returns {object} metadata of ConnectToSourceSqlServerTaskOutputAgentJobLevel + * + */ + mapper() { + return { + required: false, + serializedName: 'AgentJobLevelOutput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'ConnectToSourceSqlServerTaskOutput', + className: 'ConnectToSourceSqlServerTaskOutputAgentJobLevel', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + jobCategory: { + required: false, + readOnly: true, + serializedName: 'jobCategory', + type: { + name: 'String' + } + }, + isEnabled: { + required: false, + readOnly: true, + serializedName: 'isEnabled', + type: { + name: 'Boolean' + } + }, + jobOwner: { + required: false, + readOnly: true, + serializedName: 'jobOwner', + type: { + name: 'String' + } + }, + lastExecutedOn: { + required: false, + readOnly: true, + serializedName: 'lastExecutedOn', + type: { + name: 'DateTime' + } + }, + validationErrors: { + required: false, + readOnly: true, + serializedName: 'validationErrors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ReportableExceptionElementType', + type: { + name: 'Composite', + className: 'ReportableException' + } + } + } + }, + migrationEligibility: { + required: false, + readOnly: true, + serializedName: 'migrationEligibility', + type: { + name: 'Composite', + className: 'MigrationEligibilityInfo' + } + } + } + } + }; + } +} + +module.exports = ConnectToSourceSqlServerTaskOutputAgentJobLevel; diff --git a/lib/services/datamigrationManagement/lib/models/connectToSourceSqlServerTaskOutputDatabaseLevel.js b/lib/services/datamigrationManagement/lib/models/connectToSourceSqlServerTaskOutputDatabaseLevel.js new file mode 100644 index 0000000000..084b69c1cc --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/connectToSourceSqlServerTaskOutputDatabaseLevel.js @@ -0,0 +1,128 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Database level output for the task that validates connection to SQL Server + * and also validates source server requirements + * + * @extends models['ConnectToSourceSqlServerTaskOutput'] + */ +class ConnectToSourceSqlServerTaskOutputDatabaseLevel extends models['ConnectToSourceSqlServerTaskOutput'] { + /** + * Create a ConnectToSourceSqlServerTaskOutputDatabaseLevel. + * @member {string} [name] Database name + * @member {number} [sizeMB] Size of the file in megabytes + * @member {array} [databaseFiles] The list of database files + * @member {string} [compatibilityLevel] SQL Server compatibility level of + * database. Possible values include: 'CompatLevel80', 'CompatLevel90', + * 'CompatLevel100', 'CompatLevel110', 'CompatLevel120', 'CompatLevel130', + * 'CompatLevel140' + * @member {string} [databaseState] State of the database. Possible values + * include: 'Online', 'Restoring', 'Recovering', 'RecoveryPending', + * 'Suspect', 'Emergency', 'Offline', 'Copying', 'OfflineSecondary' + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ConnectToSourceSqlServerTaskOutputDatabaseLevel + * + * @returns {object} metadata of ConnectToSourceSqlServerTaskOutputDatabaseLevel + * + */ + mapper() { + return { + required: false, + serializedName: 'DatabaseLevelOutput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'ConnectToSourceSqlServerTaskOutput', + className: 'ConnectToSourceSqlServerTaskOutputDatabaseLevel', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + sizeMB: { + required: false, + readOnly: true, + serializedName: 'sizeMB', + type: { + name: 'Number' + } + }, + databaseFiles: { + required: false, + readOnly: true, + serializedName: 'databaseFiles', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DatabaseFileInfoElementType', + type: { + name: 'Composite', + className: 'DatabaseFileInfo' + } + } + } + }, + compatibilityLevel: { + required: false, + readOnly: true, + serializedName: 'compatibilityLevel', + type: { + name: 'String' + } + }, + databaseState: { + required: false, + readOnly: true, + serializedName: 'databaseState', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ConnectToSourceSqlServerTaskOutputDatabaseLevel; diff --git a/lib/services/datamigrationManagement/lib/models/connectToSourceSqlServerTaskOutputLoginLevel.js b/lib/services/datamigrationManagement/lib/models/connectToSourceSqlServerTaskOutputLoginLevel.js new file mode 100644 index 0000000000..56f6059199 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/connectToSourceSqlServerTaskOutputLoginLevel.js @@ -0,0 +1,123 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Login level output for the task that validates connection to SQL Server and + * also validates source server requirements + * + * @extends models['ConnectToSourceSqlServerTaskOutput'] + */ +class ConnectToSourceSqlServerTaskOutputLoginLevel extends models['ConnectToSourceSqlServerTaskOutput'] { + /** + * Create a ConnectToSourceSqlServerTaskOutputLoginLevel. + * @member {string} [name] Login name. + * @member {string} [loginType] The type of login. Possible values include: + * 'WindowsUser', 'WindowsGroup', 'SqlLogin', 'Certificate', 'AsymmetricKey', + * 'ExternalUser', 'ExternalGroup' + * @member {string} [defaultDatabase] The default database for the login. + * @member {boolean} [isEnabled] The state of the login. + * @member {object} [migrationEligibility] Information about eligiblity of + * login for migration. + * @member {boolean} [migrationEligibility.isEligibileForMigration] Whether + * object is eligible for migration or not. + * @member {array} [migrationEligibility.validationMessages] Information + * about eligibility failure for the server object. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ConnectToSourceSqlServerTaskOutputLoginLevel + * + * @returns {object} metadata of ConnectToSourceSqlServerTaskOutputLoginLevel + * + */ + mapper() { + return { + required: false, + serializedName: 'LoginLevelOutput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'ConnectToSourceSqlServerTaskOutput', + className: 'ConnectToSourceSqlServerTaskOutputLoginLevel', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + loginType: { + required: false, + readOnly: true, + serializedName: 'loginType', + type: { + name: 'String' + } + }, + defaultDatabase: { + required: false, + readOnly: true, + serializedName: 'defaultDatabase', + type: { + name: 'String' + } + }, + isEnabled: { + required: false, + readOnly: true, + serializedName: 'isEnabled', + type: { + name: 'Boolean' + } + }, + migrationEligibility: { + required: false, + readOnly: true, + serializedName: 'migrationEligibility', + type: { + name: 'Composite', + className: 'MigrationEligibilityInfo' + } + } + } + } + }; + } +} + +module.exports = ConnectToSourceSqlServerTaskOutputLoginLevel; diff --git a/lib/services/datamigrationManagement/lib/models/connectToSourceSqlServerTaskOutputTaskLevel.js b/lib/services/datamigrationManagement/lib/models/connectToSourceSqlServerTaskOutputTaskLevel.js new file mode 100644 index 0000000000..6801fff54a --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/connectToSourceSqlServerTaskOutputTaskLevel.js @@ -0,0 +1,173 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Task level output for the task that validates connection to SQL Server and + * also validates source server requirements + * + * @extends models['ConnectToSourceSqlServerTaskOutput'] + */ +class ConnectToSourceSqlServerTaskOutputTaskLevel extends models['ConnectToSourceSqlServerTaskOutput'] { + /** + * Create a ConnectToSourceSqlServerTaskOutputTaskLevel. + * @member {object} [databases] Source databases as a map from database name + * to database id + * @member {object} [logins] Source logins as a map from login name to login + * id. + * @member {object} [agentJobs] Source agent jobs as a map from agent job + * name to id. + * @member {object} [databaseTdeCertificateMapping] Mapping from database + * name to TDE certificate name, if applicable + * @member {string} [sourceServerVersion] Source server version + * @member {string} [sourceServerBrandVersion] Source server brand version + * @member {array} [validationErrors] Validation errors + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ConnectToSourceSqlServerTaskOutputTaskLevel + * + * @returns {object} metadata of ConnectToSourceSqlServerTaskOutputTaskLevel + * + */ + mapper() { + return { + required: false, + serializedName: 'TaskLevelOutput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'ConnectToSourceSqlServerTaskOutput', + className: 'ConnectToSourceSqlServerTaskOutputTaskLevel', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + databases: { + required: false, + readOnly: true, + serializedName: 'databases', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + logins: { + required: false, + readOnly: true, + serializedName: 'logins', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + agentJobs: { + required: false, + readOnly: true, + serializedName: 'agentJobs', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + databaseTdeCertificateMapping: { + required: false, + readOnly: true, + serializedName: 'databaseTdeCertificateMapping', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + sourceServerVersion: { + required: false, + readOnly: true, + serializedName: 'sourceServerVersion', + type: { + name: 'String' + } + }, + sourceServerBrandVersion: { + required: false, + readOnly: true, + serializedName: 'sourceServerBrandVersion', + type: { + name: 'String' + } + }, + validationErrors: { + required: false, + readOnly: true, + serializedName: 'validationErrors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ReportableExceptionElementType', + type: { + name: 'Composite', + className: 'ReportableException' + } + } + } + } + } + } + }; + } +} + +module.exports = ConnectToSourceSqlServerTaskOutputTaskLevel; diff --git a/lib/services/datamigrationManagement/lib/models/connectToSourceSqlServerTaskProperties.js b/lib/services/datamigrationManagement/lib/models/connectToSourceSqlServerTaskProperties.js new file mode 100644 index 0000000000..48be4ce7d6 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/connectToSourceSqlServerTaskProperties.js @@ -0,0 +1,164 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Properties for the task that validates connection to SQL Server and also + * validates source server requirements + * + * @extends models['ProjectTaskProperties'] + */ +class ConnectToSourceSqlServerTaskProperties extends models['ProjectTaskProperties'] { + /** + * Create a ConnectToSourceSqlServerTaskProperties. + * @member {object} [input] Task input + * @member {object} [input.sourceConnectionInfo] Connection information for + * Source SQL Server + * @member {string} [input.sourceConnectionInfo.dataSource] Data source in + * the format Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [input.sourceConnectionInfo.authentication] + * Authentication type to use for connection. Possible values include: + * 'None', 'WindowsAuthentication', 'SqlAuthentication', + * 'ActiveDirectoryIntegrated', 'ActiveDirectoryPassword' + * @member {boolean} [input.sourceConnectionInfo.encryptConnection] Whether + * to encrypt the connection + * @member {string} [input.sourceConnectionInfo.additionalSettings] + * Additional connection settings + * @member {boolean} [input.sourceConnectionInfo.trustServerCertificate] + * Whether to trust the server certificate + * @member {string} [input.sourceConnectionInfo.platform] Server platform + * type for connection. Possible values include: 'SqlOnPrem' + * @member {string} [input.checkPermissionsGroup] Permission group for + * validations. Possible values include: 'Default', + * 'MigrationFromSqlServerToAzureDB', 'MigrationFromSqlServerToAzureMI', + * 'MigrationFromMySQLToAzureDBForMySQL' + * @member {boolean} [input.collectLogins] Flag for whether to collect logins + * from source server. + * @member {boolean} [input.collectAgentJobs] Flag for whether to collect + * agent jobs from source server. + * @member {boolean} [input.collectTdeCertificateInfo] Flag for whether to + * collect TDE Certificate names from source server. + * @member {array} [output] Task output. This is ignored if submitted. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ConnectToSourceSqlServerTaskProperties + * + * @returns {object} metadata of ConnectToSourceSqlServerTaskProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'ConnectToSource.SqlServer', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'taskType', + clientName: 'taskType' + }, + uberParent: 'ProjectTaskProperties', + className: 'ConnectToSourceSqlServerTaskProperties', + modelProperties: { + errors: { + required: false, + readOnly: true, + serializedName: 'errors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ODataErrorElementType', + type: { + name: 'Composite', + className: 'ODataError' + } + } + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + commands: { + required: false, + readOnly: true, + serializedName: 'commands', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CommandPropertiesElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'commandType', + clientName: 'commandType' + }, + uberParent: 'CommandProperties', + className: 'CommandProperties' + } + } + } + }, + taskType: { + required: true, + serializedName: 'taskType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + input: { + required: false, + serializedName: 'input', + type: { + name: 'Composite', + className: 'ConnectToSourceSqlServerTaskInput' + } + }, + output: { + required: false, + readOnly: true, + serializedName: 'output', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ConnectToSourceSqlServerTaskOutputElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'ConnectToSourceSqlServerTaskOutput', + className: 'ConnectToSourceSqlServerTaskOutput' + } + } + } + } + } + } + }; + } +} + +module.exports = ConnectToSourceSqlServerTaskProperties; diff --git a/lib/services/datamigrationManagement/lib/models/connectToTargetAzureDbForMySqlTaskInput.js b/lib/services/datamigrationManagement/lib/models/connectToTargetAzureDbForMySqlTaskInput.js new file mode 100644 index 0000000000..aa8e7ba325 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/connectToTargetAzureDbForMySqlTaskInput.js @@ -0,0 +1,79 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Input for the task that validates connection to Azure Database for MySQL and + * target server requirements + * + */ +class ConnectToTargetAzureDbForMySqlTaskInput { + /** + * Create a ConnectToTargetAzureDbForMySqlTaskInput. + * @member {object} sourceConnectionInfo Connection information for source + * MySQL server + * @member {string} [sourceConnectionInfo.serverName] Name of the server + * @member {number} [sourceConnectionInfo.port] Port for Server + * @member {object} targetConnectionInfo Connection information for target + * Azure Database for MySQL server + * @member {string} [targetConnectionInfo.serverName] Name of the server + * @member {number} [targetConnectionInfo.port] Port for Server + */ + constructor() { + } + + /** + * Defines the metadata of ConnectToTargetAzureDbForMySqlTaskInput + * + * @returns {object} metadata of ConnectToTargetAzureDbForMySqlTaskInput + * + */ + mapper() { + return { + required: false, + serializedName: 'ConnectToTargetAzureDbForMySqlTaskInput', + type: { + name: 'Composite', + className: 'ConnectToTargetAzureDbForMySqlTaskInput', + modelProperties: { + sourceConnectionInfo: { + required: true, + serializedName: 'sourceConnectionInfo', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'ConnectionInfo', + className: 'MySqlConnectionInfo' + } + }, + targetConnectionInfo: { + required: true, + serializedName: 'targetConnectionInfo', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'ConnectionInfo', + className: 'MySqlConnectionInfo' + } + } + } + } + }; + } +} + +module.exports = ConnectToTargetAzureDbForMySqlTaskInput; diff --git a/lib/services/datamigrationManagement/lib/models/connectToTargetAzureDbForMySqlTaskOutput.js b/lib/services/datamigrationManagement/lib/models/connectToTargetAzureDbForMySqlTaskOutput.js new file mode 100644 index 0000000000..b3c93c4c4e --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/connectToTargetAzureDbForMySqlTaskOutput.js @@ -0,0 +1,106 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Output for the task that validates connection to Azure Database for MySQL + * and target server requirements + * + */ +class ConnectToTargetAzureDbForMySqlTaskOutput { + /** + * Create a ConnectToTargetAzureDbForMySqlTaskOutput. + * @member {string} [id] Result identifier + * @member {string} [serverVersion] Version of the target server + * @member {array} [databases] List of databases on target server + * @member {string} [targetServerBrandVersion] Target server brand version + * @member {array} [validationErrors] Validation errors associated with the + * task + */ + constructor() { + } + + /** + * Defines the metadata of ConnectToTargetAzureDbForMySqlTaskOutput + * + * @returns {object} metadata of ConnectToTargetAzureDbForMySqlTaskOutput + * + */ + mapper() { + return { + required: false, + serializedName: 'ConnectToTargetAzureDbForMySqlTaskOutput', + type: { + name: 'Composite', + className: 'ConnectToTargetAzureDbForMySqlTaskOutput', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + serverVersion: { + required: false, + readOnly: true, + serializedName: 'serverVersion', + type: { + name: 'String' + } + }, + databases: { + required: false, + readOnly: true, + serializedName: 'databases', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + targetServerBrandVersion: { + required: false, + readOnly: true, + serializedName: 'targetServerBrandVersion', + type: { + name: 'String' + } + }, + validationErrors: { + required: false, + readOnly: true, + serializedName: 'validationErrors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ReportableExceptionElementType', + type: { + name: 'Composite', + className: 'ReportableException' + } + } + } + } + } + } + }; + } +} + +module.exports = ConnectToTargetAzureDbForMySqlTaskOutput; diff --git a/lib/services/datamigrationManagement/lib/models/connectToTargetAzureDbForMySqlTaskProperties.js b/lib/services/datamigrationManagement/lib/models/connectToTargetAzureDbForMySqlTaskProperties.js new file mode 100644 index 0000000000..efe5df88d3 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/connectToTargetAzureDbForMySqlTaskProperties.js @@ -0,0 +1,143 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Properties for the task that validates connection to Azure Database for + * MySQL and target server requirements + * + * @extends models['ProjectTaskProperties'] + */ +class ConnectToTargetAzureDbForMySqlTaskProperties extends models['ProjectTaskProperties'] { + /** + * Create a ConnectToTargetAzureDbForMySqlTaskProperties. + * @member {object} [input] Task input + * @member {object} [input.sourceConnectionInfo] Connection information for + * source MySQL server + * @member {string} [input.sourceConnectionInfo.serverName] Name of the + * server + * @member {number} [input.sourceConnectionInfo.port] Port for Server + * @member {object} [input.targetConnectionInfo] Connection information for + * target Azure Database for MySQL server + * @member {string} [input.targetConnectionInfo.serverName] Name of the + * server + * @member {number} [input.targetConnectionInfo.port] Port for Server + * @member {array} [output] Task output. This is ignored if submitted. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ConnectToTargetAzureDbForMySqlTaskProperties + * + * @returns {object} metadata of ConnectToTargetAzureDbForMySqlTaskProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'ConnectToTarget.AzureDbForMySql', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'taskType', + clientName: 'taskType' + }, + uberParent: 'ProjectTaskProperties', + className: 'ConnectToTargetAzureDbForMySqlTaskProperties', + modelProperties: { + errors: { + required: false, + readOnly: true, + serializedName: 'errors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ODataErrorElementType', + type: { + name: 'Composite', + className: 'ODataError' + } + } + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + commands: { + required: false, + readOnly: true, + serializedName: 'commands', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CommandPropertiesElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'commandType', + clientName: 'commandType' + }, + uberParent: 'CommandProperties', + className: 'CommandProperties' + } + } + } + }, + taskType: { + required: true, + serializedName: 'taskType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + input: { + required: false, + serializedName: 'input', + type: { + name: 'Composite', + className: 'ConnectToTargetAzureDbForMySqlTaskInput' + } + }, + output: { + required: false, + readOnly: true, + serializedName: 'output', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ConnectToTargetAzureDbForMySqlTaskOutputElementType', + type: { + name: 'Composite', + className: 'ConnectToTargetAzureDbForMySqlTaskOutput' + } + } + } + } + } + } + }; + } +} + +module.exports = ConnectToTargetAzureDbForMySqlTaskProperties; diff --git a/lib/services/datamigrationManagement/lib/models/connectToTargetSqlDbTaskInput.js b/lib/services/datamigrationManagement/lib/models/connectToTargetSqlDbTaskInput.js new file mode 100644 index 0000000000..dd293d4729 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/connectToTargetSqlDbTaskInput.js @@ -0,0 +1,74 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Input for the task that validates connection to SQL DB and target server + * requirements + * + */ +class ConnectToTargetSqlDbTaskInput { + /** + * Create a ConnectToTargetSqlDbTaskInput. + * @member {object} targetConnectionInfo Connection information for target + * SQL DB + * @member {string} [targetConnectionInfo.dataSource] Data source in the + * format Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [targetConnectionInfo.authentication] Authentication type + * to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [targetConnectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [targetConnectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [targetConnectionInfo.trustServerCertificate] Whether to + * trust the server certificate + * @member {string} [targetConnectionInfo.platform] Server platform type for + * connection. Possible values include: 'SqlOnPrem' + */ + constructor() { + } + + /** + * Defines the metadata of ConnectToTargetSqlDbTaskInput + * + * @returns {object} metadata of ConnectToTargetSqlDbTaskInput + * + */ + mapper() { + return { + required: false, + serializedName: 'ConnectToTargetSqlDbTaskInput', + type: { + name: 'Composite', + className: 'ConnectToTargetSqlDbTaskInput', + modelProperties: { + targetConnectionInfo: { + required: true, + serializedName: 'targetConnectionInfo', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'ConnectionInfo', + className: 'SqlConnectionInfo' + } + } + } + } + }; + } +} + +module.exports = ConnectToTargetSqlDbTaskInput; diff --git a/lib/services/datamigrationManagement/lib/models/connectToTargetSqlDbTaskOutput.js b/lib/services/datamigrationManagement/lib/models/connectToTargetSqlDbTaskOutput.js new file mode 100644 index 0000000000..d26d173e0d --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/connectToTargetSqlDbTaskOutput.js @@ -0,0 +1,89 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Output for the task that validates connection to SQL DB and target server + * requirements + * + */ +class ConnectToTargetSqlDbTaskOutput { + /** + * Create a ConnectToTargetSqlDbTaskOutput. + * @member {string} [id] Result identifier + * @member {object} [databases] Source databases as a map from database name + * to database id + * @member {string} [targetServerVersion] Version of the target server + * @member {string} [targetServerBrandVersion] Target server brand version + */ + constructor() { + } + + /** + * Defines the metadata of ConnectToTargetSqlDbTaskOutput + * + * @returns {object} metadata of ConnectToTargetSqlDbTaskOutput + * + */ + mapper() { + return { + required: false, + serializedName: 'ConnectToTargetSqlDbTaskOutput', + type: { + name: 'Composite', + className: 'ConnectToTargetSqlDbTaskOutput', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + databases: { + required: false, + readOnly: true, + serializedName: 'databases', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + targetServerVersion: { + required: false, + readOnly: true, + serializedName: 'targetServerVersion', + type: { + name: 'String' + } + }, + targetServerBrandVersion: { + required: false, + readOnly: true, + serializedName: 'targetServerBrandVersion', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ConnectToTargetSqlDbTaskOutput; diff --git a/lib/services/datamigrationManagement/lib/models/connectToTargetSqlDbTaskProperties.js b/lib/services/datamigrationManagement/lib/models/connectToTargetSqlDbTaskProperties.js new file mode 100644 index 0000000000..60a2bbc1ec --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/connectToTargetSqlDbTaskProperties.js @@ -0,0 +1,149 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Properties for the task that validates connection to SQL DB and target + * server requirements + * + * @extends models['ProjectTaskProperties'] + */ +class ConnectToTargetSqlDbTaskProperties extends models['ProjectTaskProperties'] { + /** + * Create a ConnectToTargetSqlDbTaskProperties. + * @member {object} [input] Task input + * @member {object} [input.targetConnectionInfo] Connection information for + * target SQL DB + * @member {string} [input.targetConnectionInfo.dataSource] Data source in + * the format Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [input.targetConnectionInfo.authentication] + * Authentication type to use for connection. Possible values include: + * 'None', 'WindowsAuthentication', 'SqlAuthentication', + * 'ActiveDirectoryIntegrated', 'ActiveDirectoryPassword' + * @member {boolean} [input.targetConnectionInfo.encryptConnection] Whether + * to encrypt the connection + * @member {string} [input.targetConnectionInfo.additionalSettings] + * Additional connection settings + * @member {boolean} [input.targetConnectionInfo.trustServerCertificate] + * Whether to trust the server certificate + * @member {string} [input.targetConnectionInfo.platform] Server platform + * type for connection. Possible values include: 'SqlOnPrem' + * @member {array} [output] Task output. This is ignored if submitted. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ConnectToTargetSqlDbTaskProperties + * + * @returns {object} metadata of ConnectToTargetSqlDbTaskProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'ConnectToTarget.SqlDb', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'taskType', + clientName: 'taskType' + }, + uberParent: 'ProjectTaskProperties', + className: 'ConnectToTargetSqlDbTaskProperties', + modelProperties: { + errors: { + required: false, + readOnly: true, + serializedName: 'errors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ODataErrorElementType', + type: { + name: 'Composite', + className: 'ODataError' + } + } + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + commands: { + required: false, + readOnly: true, + serializedName: 'commands', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CommandPropertiesElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'commandType', + clientName: 'commandType' + }, + uberParent: 'CommandProperties', + className: 'CommandProperties' + } + } + } + }, + taskType: { + required: true, + serializedName: 'taskType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + input: { + required: false, + serializedName: 'input', + type: { + name: 'Composite', + className: 'ConnectToTargetSqlDbTaskInput' + } + }, + output: { + required: false, + readOnly: true, + serializedName: 'output', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ConnectToTargetSqlDbTaskOutputElementType', + type: { + name: 'Composite', + className: 'ConnectToTargetSqlDbTaskOutput' + } + } + } + } + } + } + }; + } +} + +module.exports = ConnectToTargetSqlDbTaskProperties; diff --git a/lib/services/datamigrationManagement/lib/models/connectToTargetSqlMITaskInput.js b/lib/services/datamigrationManagement/lib/models/connectToTargetSqlMITaskInput.js new file mode 100644 index 0000000000..f397053f7e --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/connectToTargetSqlMITaskInput.js @@ -0,0 +1,74 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Input for the task that validates connection to Azure SQL Database Managed + * Instance. + * + */ +class ConnectToTargetSqlMITaskInput { + /** + * Create a ConnectToTargetSqlMITaskInput. + * @member {object} targetConnectionInfo Connection information for target + * SQL Server + * @member {string} [targetConnectionInfo.dataSource] Data source in the + * format Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [targetConnectionInfo.authentication] Authentication type + * to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [targetConnectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [targetConnectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [targetConnectionInfo.trustServerCertificate] Whether to + * trust the server certificate + * @member {string} [targetConnectionInfo.platform] Server platform type for + * connection. Possible values include: 'SqlOnPrem' + */ + constructor() { + } + + /** + * Defines the metadata of ConnectToTargetSqlMITaskInput + * + * @returns {object} metadata of ConnectToTargetSqlMITaskInput + * + */ + mapper() { + return { + required: false, + serializedName: 'ConnectToTargetSqlMITaskInput', + type: { + name: 'Composite', + className: 'ConnectToTargetSqlMITaskInput', + modelProperties: { + targetConnectionInfo: { + required: true, + serializedName: 'targetConnectionInfo', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'ConnectionInfo', + className: 'SqlConnectionInfo' + } + } + } + } + }; + } +} + +module.exports = ConnectToTargetSqlMITaskInput; diff --git a/lib/services/datamigrationManagement/lib/models/connectToTargetSqlMITaskOutput.js b/lib/services/datamigrationManagement/lib/models/connectToTargetSqlMITaskOutput.js new file mode 100644 index 0000000000..7a93293fb5 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/connectToTargetSqlMITaskOutput.js @@ -0,0 +1,121 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Output for the task that validates connection to Azure SQL Database Managed + * Instance. + * + */ +class ConnectToTargetSqlMITaskOutput { + /** + * Create a ConnectToTargetSqlMITaskOutput. + * @member {string} [id] Result identifier + * @member {string} [targetServerVersion] Target server version + * @member {string} [targetServerBrandVersion] Target server brand version + * @member {array} [logins] List of logins on the target server. + * @member {array} [agentJobs] List of agent jobs on the target server. + * @member {array} [validationErrors] Validation errors + */ + constructor() { + } + + /** + * Defines the metadata of ConnectToTargetSqlMITaskOutput + * + * @returns {object} metadata of ConnectToTargetSqlMITaskOutput + * + */ + mapper() { + return { + required: false, + serializedName: 'ConnectToTargetSqlMITaskOutput', + type: { + name: 'Composite', + className: 'ConnectToTargetSqlMITaskOutput', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + targetServerVersion: { + required: false, + readOnly: true, + serializedName: 'targetServerVersion', + type: { + name: 'String' + } + }, + targetServerBrandVersion: { + required: false, + readOnly: true, + serializedName: 'targetServerBrandVersion', + type: { + name: 'String' + } + }, + logins: { + required: false, + readOnly: true, + serializedName: 'logins', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + agentJobs: { + required: false, + readOnly: true, + serializedName: 'agentJobs', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + validationErrors: { + required: false, + readOnly: true, + serializedName: 'validationErrors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ReportableExceptionElementType', + type: { + name: 'Composite', + className: 'ReportableException' + } + } + } + } + } + } + }; + } +} + +module.exports = ConnectToTargetSqlMITaskOutput; diff --git a/lib/services/datamigrationManagement/lib/models/connectToTargetSqlMITaskProperties.js b/lib/services/datamigrationManagement/lib/models/connectToTargetSqlMITaskProperties.js new file mode 100644 index 0000000000..3a3ce9b88f --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/connectToTargetSqlMITaskProperties.js @@ -0,0 +1,149 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Properties for the task that validates connection to Azure SQL Database + * Managed Instance + * + * @extends models['ProjectTaskProperties'] + */ +class ConnectToTargetSqlMITaskProperties extends models['ProjectTaskProperties'] { + /** + * Create a ConnectToTargetSqlMITaskProperties. + * @member {object} [input] Task input + * @member {object} [input.targetConnectionInfo] Connection information for + * target SQL Server + * @member {string} [input.targetConnectionInfo.dataSource] Data source in + * the format Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [input.targetConnectionInfo.authentication] + * Authentication type to use for connection. Possible values include: + * 'None', 'WindowsAuthentication', 'SqlAuthentication', + * 'ActiveDirectoryIntegrated', 'ActiveDirectoryPassword' + * @member {boolean} [input.targetConnectionInfo.encryptConnection] Whether + * to encrypt the connection + * @member {string} [input.targetConnectionInfo.additionalSettings] + * Additional connection settings + * @member {boolean} [input.targetConnectionInfo.trustServerCertificate] + * Whether to trust the server certificate + * @member {string} [input.targetConnectionInfo.platform] Server platform + * type for connection. Possible values include: 'SqlOnPrem' + * @member {array} [output] Task output. This is ignored if submitted. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ConnectToTargetSqlMITaskProperties + * + * @returns {object} metadata of ConnectToTargetSqlMITaskProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'ConnectToTarget.AzureSqlDbMI', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'taskType', + clientName: 'taskType' + }, + uberParent: 'ProjectTaskProperties', + className: 'ConnectToTargetSqlMITaskProperties', + modelProperties: { + errors: { + required: false, + readOnly: true, + serializedName: 'errors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ODataErrorElementType', + type: { + name: 'Composite', + className: 'ODataError' + } + } + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + commands: { + required: false, + readOnly: true, + serializedName: 'commands', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CommandPropertiesElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'commandType', + clientName: 'commandType' + }, + uberParent: 'CommandProperties', + className: 'CommandProperties' + } + } + } + }, + taskType: { + required: true, + serializedName: 'taskType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + input: { + required: false, + serializedName: 'input', + type: { + name: 'Composite', + className: 'ConnectToTargetSqlMITaskInput' + } + }, + output: { + required: false, + readOnly: true, + serializedName: 'output', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ConnectToTargetSqlMITaskOutputElementType', + type: { + name: 'Composite', + className: 'ConnectToTargetSqlMITaskOutput' + } + } + } + } + } + } + }; + } +} + +module.exports = ConnectToTargetSqlMITaskProperties; diff --git a/lib/services/datamigrationManagement/lib/models/connectToTargetSqlSqlDbSyncTaskInput.js b/lib/services/datamigrationManagement/lib/models/connectToTargetSqlSqlDbSyncTaskInput.js new file mode 100644 index 0000000000..75f5bdc58a --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/connectToTargetSqlSqlDbSyncTaskInput.js @@ -0,0 +1,103 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Input for the task that validates connection to Azure SQL DB and target + * server requirements + * + */ +class ConnectToTargetSqlSqlDbSyncTaskInput { + /** + * Create a ConnectToTargetSqlSqlDbSyncTaskInput. + * @member {object} sourceConnectionInfo Connection information for source + * SQL Server + * @member {string} [sourceConnectionInfo.dataSource] Data source in the + * format Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [sourceConnectionInfo.authentication] Authentication type + * to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [sourceConnectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [sourceConnectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [sourceConnectionInfo.trustServerCertificate] Whether to + * trust the server certificate + * @member {string} [sourceConnectionInfo.platform] Server platform type for + * connection. Possible values include: 'SqlOnPrem' + * @member {object} targetConnectionInfo Connection information for target + * SQL DB + * @member {string} [targetConnectionInfo.dataSource] Data source in the + * format Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [targetConnectionInfo.authentication] Authentication type + * to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [targetConnectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [targetConnectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [targetConnectionInfo.trustServerCertificate] Whether to + * trust the server certificate + * @member {string} [targetConnectionInfo.platform] Server platform type for + * connection. Possible values include: 'SqlOnPrem' + */ + constructor() { + } + + /** + * Defines the metadata of ConnectToTargetSqlSqlDbSyncTaskInput + * + * @returns {object} metadata of ConnectToTargetSqlSqlDbSyncTaskInput + * + */ + mapper() { + return { + required: false, + serializedName: 'ConnectToTargetSqlSqlDbSyncTaskInput', + type: { + name: 'Composite', + className: 'ConnectToTargetSqlSqlDbSyncTaskInput', + modelProperties: { + sourceConnectionInfo: { + required: true, + serializedName: 'sourceConnectionInfo', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'ConnectionInfo', + className: 'SqlConnectionInfo' + } + }, + targetConnectionInfo: { + required: true, + serializedName: 'targetConnectionInfo', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'ConnectionInfo', + className: 'SqlConnectionInfo' + } + } + } + } + }; + } +} + +module.exports = ConnectToTargetSqlSqlDbSyncTaskInput; diff --git a/lib/services/datamigrationManagement/lib/models/connectToTargetSqlSqlDbSyncTaskProperties.js b/lib/services/datamigrationManagement/lib/models/connectToTargetSqlSqlDbSyncTaskProperties.js new file mode 100644 index 0000000000..3f0e8c0da7 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/connectToTargetSqlSqlDbSyncTaskProperties.js @@ -0,0 +1,165 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Properties for the task that validates connection to SQL DB and target + * server requirements for online migration + * + * @extends models['ProjectTaskProperties'] + */ +class ConnectToTargetSqlSqlDbSyncTaskProperties extends models['ProjectTaskProperties'] { + /** + * Create a ConnectToTargetSqlSqlDbSyncTaskProperties. + * @member {object} [input] Task input + * @member {object} [input.sourceConnectionInfo] Connection information for + * source SQL Server + * @member {string} [input.sourceConnectionInfo.dataSource] Data source in + * the format Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [input.sourceConnectionInfo.authentication] + * Authentication type to use for connection. Possible values include: + * 'None', 'WindowsAuthentication', 'SqlAuthentication', + * 'ActiveDirectoryIntegrated', 'ActiveDirectoryPassword' + * @member {boolean} [input.sourceConnectionInfo.encryptConnection] Whether + * to encrypt the connection + * @member {string} [input.sourceConnectionInfo.additionalSettings] + * Additional connection settings + * @member {boolean} [input.sourceConnectionInfo.trustServerCertificate] + * Whether to trust the server certificate + * @member {string} [input.sourceConnectionInfo.platform] Server platform + * type for connection. Possible values include: 'SqlOnPrem' + * @member {object} [input.targetConnectionInfo] Connection information for + * target SQL DB + * @member {string} [input.targetConnectionInfo.dataSource] Data source in + * the format Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [input.targetConnectionInfo.authentication] + * Authentication type to use for connection. Possible values include: + * 'None', 'WindowsAuthentication', 'SqlAuthentication', + * 'ActiveDirectoryIntegrated', 'ActiveDirectoryPassword' + * @member {boolean} [input.targetConnectionInfo.encryptConnection] Whether + * to encrypt the connection + * @member {string} [input.targetConnectionInfo.additionalSettings] + * Additional connection settings + * @member {boolean} [input.targetConnectionInfo.trustServerCertificate] + * Whether to trust the server certificate + * @member {string} [input.targetConnectionInfo.platform] Server platform + * type for connection. Possible values include: 'SqlOnPrem' + * @member {array} [output] Task output. This is ignored if submitted. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ConnectToTargetSqlSqlDbSyncTaskProperties + * + * @returns {object} metadata of ConnectToTargetSqlSqlDbSyncTaskProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'ConnectToTarget.SqlDb.Sync', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'taskType', + clientName: 'taskType' + }, + uberParent: 'ProjectTaskProperties', + className: 'ConnectToTargetSqlSqlDbSyncTaskProperties', + modelProperties: { + errors: { + required: false, + readOnly: true, + serializedName: 'errors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ODataErrorElementType', + type: { + name: 'Composite', + className: 'ODataError' + } + } + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + commands: { + required: false, + readOnly: true, + serializedName: 'commands', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CommandPropertiesElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'commandType', + clientName: 'commandType' + }, + uberParent: 'CommandProperties', + className: 'CommandProperties' + } + } + } + }, + taskType: { + required: true, + serializedName: 'taskType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + input: { + required: false, + serializedName: 'input', + type: { + name: 'Composite', + className: 'ConnectToTargetSqlSqlDbSyncTaskInput' + } + }, + output: { + required: false, + readOnly: true, + serializedName: 'output', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ConnectToTargetSqlDbTaskOutputElementType', + type: { + name: 'Composite', + className: 'ConnectToTargetSqlDbTaskOutput' + } + } + } + } + } + } + }; + } +} + +module.exports = ConnectToTargetSqlSqlDbSyncTaskProperties; diff --git a/lib/services/datamigrationManagement/lib/models/connectionInfo.js b/lib/services/datamigrationManagement/lib/models/connectionInfo.js new file mode 100644 index 0000000000..b7e86e4df0 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/connectionInfo.js @@ -0,0 +1,74 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Defines the connection properties of a server + * + */ +class ConnectionInfo { + /** + * Create a ConnectionInfo. + * @member {string} [userName] User name + * @member {string} [password] Password credential. + * @member {string} type Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of ConnectionInfo + * + * @returns {object} metadata of ConnectionInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'Unknown', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'ConnectionInfo', + className: 'ConnectionInfo', + modelProperties: { + userName: { + required: false, + serializedName: 'userName', + type: { + name: 'String' + } + }, + password: { + required: false, + serializedName: 'password', + type: { + name: 'String' + } + }, + type: { + required: true, + serializedName: 'type', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ConnectionInfo; diff --git a/lib/services/datamigrationManagement/lib/models/dataIntegrityValidationResult.js b/lib/services/datamigrationManagement/lib/models/dataIntegrityValidationResult.js new file mode 100644 index 0000000000..6da18c9c53 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/dataIntegrityValidationResult.js @@ -0,0 +1,73 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Results for checksum based Data Integrity validation results + * + */ +class DataIntegrityValidationResult { + /** + * Create a DataIntegrityValidationResult. + * @member {object} [failedObjects] List of failed table names of source and + * target pair + * @member {object} [validationErrors] List of errors that happened while + * performing data integrity validation + * @member {string} [validationErrors.text] Error Text + * @member {string} [validationErrors.severity] Severity of the error. + * Possible values include: 'Message', 'Warning', 'Error' + */ + constructor() { + } + + /** + * Defines the metadata of DataIntegrityValidationResult + * + * @returns {object} metadata of DataIntegrityValidationResult + * + */ + mapper() { + return { + required: false, + serializedName: 'DataIntegrityValidationResult', + type: { + name: 'Composite', + className: 'DataIntegrityValidationResult', + modelProperties: { + failedObjects: { + required: false, + serializedName: 'failedObjects', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + validationErrors: { + required: false, + serializedName: 'validationErrors', + type: { + name: 'Composite', + className: 'ValidationError' + } + } + } + } + }; + } +} + +module.exports = DataIntegrityValidationResult; diff --git a/lib/services/datamigrationManagement/lib/models/dataItemMigrationSummaryResult.js b/lib/services/datamigrationManagement/lib/models/dataItemMigrationSummaryResult.js new file mode 100644 index 0000000000..4460762678 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/dataItemMigrationSummaryResult.js @@ -0,0 +1,130 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Basic summary of a data item migration + * + */ +class DataItemMigrationSummaryResult { + /** + * Create a DataItemMigrationSummaryResult. + * @member {string} [name] Name of the item + * @member {date} [startedOn] Migration start time + * @member {date} [endedOn] Migration end time + * @member {string} [state] Current state of migration. Possible values + * include: 'None', 'InProgress', 'Failed', 'Warning', 'Completed', + * 'Skipped', 'Stopped' + * @member {string} [statusMessage] Status message + * @member {number} [itemsCount] Number of items + * @member {number} [itemsCompletedCount] Number of successfully completed + * items + * @member {string} [errorPrefix] Wildcard string prefix to use for querying + * all errors of the item + * @member {string} [resultPrefix] Wildcard string prefix to use for querying + * all sub-tem results of the item + */ + constructor() { + } + + /** + * Defines the metadata of DataItemMigrationSummaryResult + * + * @returns {object} metadata of DataItemMigrationSummaryResult + * + */ + mapper() { + return { + required: false, + serializedName: 'DataItemMigrationSummaryResult', + type: { + name: 'Composite', + className: 'DataItemMigrationSummaryResult', + modelProperties: { + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + startedOn: { + required: false, + readOnly: true, + serializedName: 'startedOn', + type: { + name: 'DateTime' + } + }, + endedOn: { + required: false, + readOnly: true, + serializedName: 'endedOn', + type: { + name: 'DateTime' + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + statusMessage: { + required: false, + readOnly: true, + serializedName: 'statusMessage', + type: { + name: 'String' + } + }, + itemsCount: { + required: false, + readOnly: true, + serializedName: 'itemsCount', + type: { + name: 'Number' + } + }, + itemsCompletedCount: { + required: false, + readOnly: true, + serializedName: 'itemsCompletedCount', + type: { + name: 'Number' + } + }, + errorPrefix: { + required: false, + readOnly: true, + serializedName: 'errorPrefix', + type: { + name: 'String' + } + }, + resultPrefix: { + required: false, + readOnly: true, + serializedName: 'resultPrefix', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DataItemMigrationSummaryResult; diff --git a/lib/services/datamigrationManagement/lib/models/dataMigrationError.js b/lib/services/datamigrationManagement/lib/models/dataMigrationError.js new file mode 100644 index 0000000000..9e1865437d --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/dataMigrationError.js @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Migration Task errors + * + */ +class DataMigrationError { + /** + * Create a DataMigrationError. + * @member {string} [message] Error description + * @member {string} [type] Possible values include: 'Default', 'Warning', + * 'Error' + */ + constructor() { + } + + /** + * Defines the metadata of DataMigrationError + * + * @returns {object} metadata of DataMigrationError + * + */ + mapper() { + return { + required: false, + serializedName: 'DataMigrationError', + type: { + name: 'Composite', + className: 'DataMigrationError', + modelProperties: { + message: { + required: false, + readOnly: true, + serializedName: 'message', + type: { + name: 'String' + } + }, + type: { + required: false, + serializedName: 'type', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DataMigrationError; diff --git a/lib/services/datamigrationManagement/lib/models/dataMigrationProjectMetadata.js b/lib/services/datamigrationManagement/lib/models/dataMigrationProjectMetadata.js new file mode 100644 index 0000000000..e955137fba --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/dataMigrationProjectMetadata.js @@ -0,0 +1,126 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Common metadata for migration projects + * + */ +class DataMigrationProjectMetadata { + /** + * Create a DataMigrationProjectMetadata. + * @member {string} [sourceServerName] Source server name + * @member {string} [sourceServerPort] Source server port number + * @member {string} [sourceUsername] Source username + * @member {string} [targetServerName] Target server name + * @member {string} [targetUsername] Target username + * @member {string} [targetDbName] Target database name + * @member {boolean} [targetUsingWinAuth] Whether target connection is + * Windows authentication + * @member {array} [selectedMigrationTables] List of tables selected for + * migration + */ + constructor() { + } + + /** + * Defines the metadata of DataMigrationProjectMetadata + * + * @returns {object} metadata of DataMigrationProjectMetadata + * + */ + mapper() { + return { + required: false, + serializedName: 'DataMigrationProjectMetadata', + type: { + name: 'Composite', + className: 'DataMigrationProjectMetadata', + modelProperties: { + sourceServerName: { + required: false, + readOnly: true, + serializedName: 'sourceServerName', + type: { + name: 'String' + } + }, + sourceServerPort: { + required: false, + readOnly: true, + serializedName: 'sourceServerPort', + type: { + name: 'String' + } + }, + sourceUsername: { + required: false, + readOnly: true, + serializedName: 'sourceUsername', + type: { + name: 'String' + } + }, + targetServerName: { + required: false, + readOnly: true, + serializedName: 'targetServerName', + type: { + name: 'String' + } + }, + targetUsername: { + required: false, + readOnly: true, + serializedName: 'targetUsername', + type: { + name: 'String' + } + }, + targetDbName: { + required: false, + readOnly: true, + serializedName: 'targetDbName', + type: { + name: 'String' + } + }, + targetUsingWinAuth: { + required: false, + readOnly: true, + serializedName: 'targetUsingWinAuth', + type: { + name: 'Boolean' + } + }, + selectedMigrationTables: { + required: false, + readOnly: true, + serializedName: 'selectedMigrationTables', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'MigrationTableMetadataElementType', + type: { + name: 'Composite', + className: 'MigrationTableMetadata' + } + } + } + } + } + } + }; + } +} + +module.exports = DataMigrationProjectMetadata; diff --git a/lib/services/datamigrationManagement/lib/models/dataMigrationService.js b/lib/services/datamigrationManagement/lib/models/dataMigrationService.js new file mode 100644 index 0000000000..ba7746871a --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/dataMigrationService.js @@ -0,0 +1,161 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * A Database Migration Service resource + * + * @extends models['TrackedResource'] + */ +class DataMigrationService extends models['TrackedResource'] { + /** + * Create a DataMigrationService. + * @member {string} [etag] HTTP strong entity tag value. Ignored if submitted + * @member {string} [kind] The resource kind. Only 'vm' (the default) is + * supported. + * @member {string} [provisioningState] The resource's provisioning state. + * Possible values include: 'Accepted', 'Deleting', 'Deploying', 'Stopped', + * 'Stopping', 'Starting', 'FailedToStart', 'FailedToStop', 'Succeeded', + * 'Failed' + * @member {string} [publicKey] The public key of the service, used to + * encrypt secrets sent to the service + * @member {string} virtualSubnetId The ID of the + * Microsoft.Network/virtualNetworks/subnets resource to which the service + * should be joined + * @member {object} [sku] Service SKU + * @member {string} [sku.name] The unique name of the SKU, such as 'P3' + * @member {string} [sku.tier] The tier of the SKU, such as 'Basic', 'General + * Purpose', or 'Business Critical' + * @member {string} [sku.family] The SKU family, used when the service has + * multiple performance classes within a tier, such as 'A', 'D', etc. for + * virtual machines + * @member {string} [sku.size] The size of the SKU, used when the name alone + * does not denote a service size or when a SKU has multiple performance + * classes within a family, e.g. 'A1' for virtual machines + * @member {number} [sku.capacity] The capacity of the SKU, if it supports + * scaling + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DataMigrationService + * + * @returns {object} metadata of DataMigrationService + * + */ + mapper() { + return { + required: false, + serializedName: 'DataMigrationService', + type: { + name: 'Composite', + className: 'DataMigrationService', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + }, + kind: { + required: false, + serializedName: 'kind', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + publicKey: { + required: false, + serializedName: 'properties.publicKey', + type: { + name: 'String' + } + }, + virtualSubnetId: { + required: true, + serializedName: 'properties.virtualSubnetId', + type: { + name: 'String' + } + }, + sku: { + required: false, + serializedName: 'sku', + type: { + name: 'Composite', + className: 'ServiceSku' + } + } + } + } + }; + } +} + +module.exports = DataMigrationService; diff --git a/lib/services/datamigrationManagement/lib/models/dataMigrationServiceList.js b/lib/services/datamigrationManagement/lib/models/dataMigrationServiceList.js new file mode 100644 index 0000000000..7349629cd2 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/dataMigrationServiceList.js @@ -0,0 +1,67 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * OData page of service objects + */ +class DataMigrationServiceList extends Array { + /** + * Create a DataMigrationServiceList. + * @member {string} [nextLink] URL to load the next page of services + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DataMigrationServiceList + * + * @returns {object} metadata of DataMigrationServiceList + * + */ + mapper() { + return { + required: false, + serializedName: 'DataMigrationServiceList', + type: { + name: 'Composite', + className: 'DataMigrationServiceList', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DataMigrationServiceElementType', + type: { + name: 'Composite', + className: 'DataMigrationService' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DataMigrationServiceList; diff --git a/lib/services/datamigrationManagement/lib/models/dataMigrationServiceStatusResponse.js b/lib/services/datamigrationManagement/lib/models/dataMigrationServiceStatusResponse.js new file mode 100644 index 0000000000..63e961d93e --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/dataMigrationServiceStatusResponse.js @@ -0,0 +1,86 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Service health status + * + */ +class DataMigrationServiceStatusResponse { + /** + * Create a DataMigrationServiceStatusResponse. + * @member {string} [agentVersion] The DMS instance agent version + * @member {string} [status] The machine-readable status, such as + * 'Initializing', 'Offline', 'Online', 'Deploying', 'Deleting', 'Stopped', + * 'Stopping', 'Starting', 'FailedToStart', 'FailedToStop' or 'Failed' + * @member {string} [vmSize] The services virtual machine size, such as + * 'Standard_D2_v2' + * @member {array} [supportedTaskTypes] The list of supported task types + */ + constructor() { + } + + /** + * Defines the metadata of DataMigrationServiceStatusResponse + * + * @returns {object} metadata of DataMigrationServiceStatusResponse + * + */ + mapper() { + return { + required: false, + serializedName: 'DataMigrationServiceStatusResponse', + type: { + name: 'Composite', + className: 'DataMigrationServiceStatusResponse', + modelProperties: { + agentVersion: { + required: false, + serializedName: 'agentVersion', + type: { + name: 'String' + } + }, + status: { + required: false, + serializedName: 'status', + type: { + name: 'String' + } + }, + vmSize: { + required: false, + serializedName: 'vmSize', + type: { + name: 'String' + } + }, + supportedTaskTypes: { + required: false, + serializedName: 'supportedTaskTypes', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = DataMigrationServiceStatusResponse; diff --git a/lib/services/datamigrationManagement/lib/models/database.js b/lib/services/datamigrationManagement/lib/models/database.js new file mode 100644 index 0000000000..7d5b64ae95 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/database.js @@ -0,0 +1,187 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Information about a single database + * + */ +class Database { + /** + * Create a Database. + * @member {string} [id] Unique identifier for the database + * @member {string} [name] Name of the database + * @member {string} [compatibilityLevel] SQL Server compatibility level of + * database. Possible values include: 'CompatLevel80', 'CompatLevel90', + * 'CompatLevel100', 'CompatLevel110', 'CompatLevel120', 'CompatLevel130', + * 'CompatLevel140' + * @member {string} [collation] Collation name of the database + * @member {string} [serverName] Name of the server + * @member {string} [fqdn] Fully qualified name + * @member {string} [installId] Install id of the database + * @member {string} [serverVersion] Version of the server + * @member {string} [serverEdition] Edition of the server + * @member {string} [serverLevel] Product level of the server (RTM, SP, CTP). + * @member {string} [serverDefaultDataPath] Default path of the data files + * @member {string} [serverDefaultLogPath] Default path of the log files + * @member {string} [serverDefaultBackupPath] Default path of the backup + * folder + * @member {number} [serverCoreCount] Number of cores on the server + * @member {number} [serverVisibleOnlineCoreCount] Number of cores on the + * server that have VISIBLE ONLINE status + * @member {string} [databaseState] State of the database. Possible values + * include: 'Online', 'Restoring', 'Recovering', 'RecoveryPending', + * 'Suspect', 'Emergency', 'Offline', 'Copying', 'OfflineSecondary' + * @member {string} [serverId] The unique Server Id + */ + constructor() { + } + + /** + * Defines the metadata of Database + * + * @returns {object} metadata of Database + * + */ + mapper() { + return { + required: false, + serializedName: 'Database', + type: { + name: 'Composite', + className: 'Database', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + compatibilityLevel: { + required: false, + serializedName: 'compatibilityLevel', + type: { + name: 'String' + } + }, + collation: { + required: false, + serializedName: 'collation', + type: { + name: 'String' + } + }, + serverName: { + required: false, + serializedName: 'serverName', + type: { + name: 'String' + } + }, + fqdn: { + required: false, + serializedName: 'fqdn', + type: { + name: 'String' + } + }, + installId: { + required: false, + serializedName: 'installId', + type: { + name: 'String' + } + }, + serverVersion: { + required: false, + serializedName: 'serverVersion', + type: { + name: 'String' + } + }, + serverEdition: { + required: false, + serializedName: 'serverEdition', + type: { + name: 'String' + } + }, + serverLevel: { + required: false, + serializedName: 'serverLevel', + type: { + name: 'String' + } + }, + serverDefaultDataPath: { + required: false, + serializedName: 'serverDefaultDataPath', + type: { + name: 'String' + } + }, + serverDefaultLogPath: { + required: false, + serializedName: 'serverDefaultLogPath', + type: { + name: 'String' + } + }, + serverDefaultBackupPath: { + required: false, + serializedName: 'serverDefaultBackupPath', + type: { + name: 'String' + } + }, + serverCoreCount: { + required: false, + serializedName: 'serverCoreCount', + type: { + name: 'Number' + } + }, + serverVisibleOnlineCoreCount: { + required: false, + serializedName: 'serverVisibleOnlineCoreCount', + type: { + name: 'Number' + } + }, + databaseState: { + required: false, + serializedName: 'databaseState', + type: { + name: 'String' + } + }, + serverId: { + required: false, + serializedName: 'serverId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Database; diff --git a/lib/services/datamigrationManagement/lib/models/databaseBackupInfo.js b/lib/services/datamigrationManagement/lib/models/databaseBackupInfo.js new file mode 100644 index 0000000000..8f47d245d8 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/databaseBackupInfo.js @@ -0,0 +1,129 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Information about backup files when existing backup mode is used. + * + */ +class DatabaseBackupInfo { + /** + * Create a DatabaseBackupInfo. + * @member {string} [databaseName] Database name. + * @member {string} [backupType] Backup Type. Possible values include: + * 'Database', 'TransactionLog', 'File', 'DifferentialDatabase', + * 'DifferentialFile', 'Partial', 'DifferentialPartial' + * @member {array} [backupFiles] The list of backup files for the current + * database. + * @member {number} [position] Position of current database backup in the + * file. + * @member {boolean} [isDamaged] Database was damaged when backed up, but the + * backup operation was requested to continue despite errors. + * @member {boolean} [isCompressed] Whether the backup set is compressed + * @member {number} [familyCount] Number of files in the backup set. + * @member {date} [backupFinishDate] Date and time when the backup operation + * finished. + */ + constructor() { + } + + /** + * Defines the metadata of DatabaseBackupInfo + * + * @returns {object} metadata of DatabaseBackupInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'DatabaseBackupInfo', + type: { + name: 'Composite', + className: 'DatabaseBackupInfo', + modelProperties: { + databaseName: { + required: false, + readOnly: true, + serializedName: 'databaseName', + type: { + name: 'String' + } + }, + backupType: { + required: false, + readOnly: true, + serializedName: 'backupType', + type: { + name: 'String' + } + }, + backupFiles: { + required: false, + readOnly: true, + serializedName: 'backupFiles', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + position: { + required: false, + readOnly: true, + serializedName: 'position', + type: { + name: 'Number' + } + }, + isDamaged: { + required: false, + readOnly: true, + serializedName: 'isDamaged', + type: { + name: 'Boolean' + } + }, + isCompressed: { + required: false, + readOnly: true, + serializedName: 'isCompressed', + type: { + name: 'Boolean' + } + }, + familyCount: { + required: false, + readOnly: true, + serializedName: 'familyCount', + type: { + name: 'Number' + } + }, + backupFinishDate: { + required: false, + readOnly: true, + serializedName: 'backupFinishDate', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = DatabaseBackupInfo; diff --git a/lib/services/datamigrationManagement/lib/models/databaseFileInfo.js b/lib/services/datamigrationManagement/lib/models/databaseFileInfo.js new file mode 100644 index 0000000000..50fe63fb2d --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/databaseFileInfo.js @@ -0,0 +1,102 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Database file specific information + * + */ +class DatabaseFileInfo { + /** + * Create a DatabaseFileInfo. + * @member {string} [databaseName] Name of the database + * @member {string} [id] Unique identifier for database file + * @member {string} [logicalName] Logical name of the file + * @member {string} [physicalFullName] Operating-system full path of the file + * @member {string} [restoreFullName] Suggested full path of the file for + * restoring + * @member {string} [fileType] Database file type. Possible values include: + * 'Rows', 'Log', 'Filestream', 'NotSupported', 'Fulltext' + * @member {number} [sizeMB] Size of the file in megabytes + */ + constructor() { + } + + /** + * Defines the metadata of DatabaseFileInfo + * + * @returns {object} metadata of DatabaseFileInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'DatabaseFileInfo', + type: { + name: 'Composite', + className: 'DatabaseFileInfo', + modelProperties: { + databaseName: { + required: false, + serializedName: 'databaseName', + type: { + name: 'String' + } + }, + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + logicalName: { + required: false, + serializedName: 'logicalName', + type: { + name: 'String' + } + }, + physicalFullName: { + required: false, + serializedName: 'physicalFullName', + type: { + name: 'String' + } + }, + restoreFullName: { + required: false, + serializedName: 'restoreFullName', + type: { + name: 'String' + } + }, + fileType: { + required: false, + serializedName: 'fileType', + type: { + name: 'String' + } + }, + sizeMB: { + required: false, + serializedName: 'sizeMB', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = DatabaseFileInfo; diff --git a/lib/services/datamigrationManagement/lib/models/databaseFileInput.js b/lib/services/datamigrationManagement/lib/models/databaseFileInput.js new file mode 100644 index 0000000000..846d514880 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/databaseFileInput.js @@ -0,0 +1,86 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Database file specific information for input + * + */ +class DatabaseFileInput { + /** + * Create a DatabaseFileInput. + * @member {string} [id] Unique identifier for database file + * @member {string} [logicalName] Logical name of the file + * @member {string} [physicalFullName] Operating-system full path of the file + * @member {string} [restoreFullName] Suggested full path of the file for + * restoring + * @member {string} [fileType] Database file type. Possible values include: + * 'Rows', 'Log', 'Filestream', 'NotSupported', 'Fulltext' + */ + constructor() { + } + + /** + * Defines the metadata of DatabaseFileInput + * + * @returns {object} metadata of DatabaseFileInput + * + */ + mapper() { + return { + required: false, + serializedName: 'DatabaseFileInput', + type: { + name: 'Composite', + className: 'DatabaseFileInput', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + logicalName: { + required: false, + serializedName: 'logicalName', + type: { + name: 'String' + } + }, + physicalFullName: { + required: false, + serializedName: 'physicalFullName', + type: { + name: 'String' + } + }, + restoreFullName: { + required: false, + serializedName: 'restoreFullName', + type: { + name: 'String' + } + }, + fileType: { + required: false, + serializedName: 'fileType', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DatabaseFileInput; diff --git a/lib/services/datamigrationManagement/lib/models/databaseInfo.js b/lib/services/datamigrationManagement/lib/models/databaseInfo.js new file mode 100644 index 0000000000..e6443120d5 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/databaseInfo.js @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Project Database Details + * + */ +class DatabaseInfo { + /** + * Create a DatabaseInfo. + * @member {string} sourceDatabaseName Name of the database + */ + constructor() { + } + + /** + * Defines the metadata of DatabaseInfo + * + * @returns {object} metadata of DatabaseInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'DatabaseInfo', + type: { + name: 'Composite', + className: 'DatabaseInfo', + modelProperties: { + sourceDatabaseName: { + required: true, + serializedName: 'sourceDatabaseName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DatabaseInfo; diff --git a/lib/services/datamigrationManagement/lib/models/databaseObjectName.js b/lib/services/datamigrationManagement/lib/models/databaseObjectName.js new file mode 100644 index 0000000000..d49b9ce9cc --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/databaseObjectName.js @@ -0,0 +1,82 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * A representation of the name of an object in a database + * + */ +class DatabaseObjectName { + /** + * Create a DatabaseObjectName. + * @member {string} [databaseName] The unescaped name of the database + * containing the object + * @member {string} [objectName] The unescaped name of the object + * @member {string} [schemaName] The unescaped name of the schema containing + * the object + * @member {string} [objectType] Type of the object in the database. Possible + * values include: 'StoredProcedures', 'Table', 'User', 'View', 'Function' + */ + constructor() { + } + + /** + * Defines the metadata of DatabaseObjectName + * + * @returns {object} metadata of DatabaseObjectName + * + */ + mapper() { + return { + required: false, + serializedName: 'DatabaseObjectName', + type: { + name: 'Composite', + className: 'DatabaseObjectName', + modelProperties: { + databaseName: { + required: false, + readOnly: true, + serializedName: 'databaseName', + type: { + name: 'String' + } + }, + objectName: { + required: false, + readOnly: true, + serializedName: 'objectName', + type: { + name: 'String' + } + }, + schemaName: { + required: false, + readOnly: true, + serializedName: 'schemaName', + type: { + name: 'String' + } + }, + objectType: { + required: false, + serializedName: 'objectType', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DatabaseObjectName; diff --git a/lib/services/datamigrationManagement/lib/models/databaseSummaryResult.js b/lib/services/datamigrationManagement/lib/models/databaseSummaryResult.js new file mode 100644 index 0000000000..678548f665 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/databaseSummaryResult.js @@ -0,0 +1,129 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Summary of database results in the migration + * + * @extends models['DataItemMigrationSummaryResult'] + */ +class DatabaseSummaryResult extends models['DataItemMigrationSummaryResult'] { + /** + * Create a DatabaseSummaryResult. + * @member {number} [sizeMB] Size of the database in megabytes + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DatabaseSummaryResult + * + * @returns {object} metadata of DatabaseSummaryResult + * + */ + mapper() { + return { + required: false, + serializedName: 'DatabaseSummaryResult', + type: { + name: 'Composite', + className: 'DatabaseSummaryResult', + modelProperties: { + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + startedOn: { + required: false, + readOnly: true, + serializedName: 'startedOn', + type: { + name: 'DateTime' + } + }, + endedOn: { + required: false, + readOnly: true, + serializedName: 'endedOn', + type: { + name: 'DateTime' + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + statusMessage: { + required: false, + readOnly: true, + serializedName: 'statusMessage', + type: { + name: 'String' + } + }, + itemsCount: { + required: false, + readOnly: true, + serializedName: 'itemsCount', + type: { + name: 'Number' + } + }, + itemsCompletedCount: { + required: false, + readOnly: true, + serializedName: 'itemsCompletedCount', + type: { + name: 'Number' + } + }, + errorPrefix: { + required: false, + readOnly: true, + serializedName: 'errorPrefix', + type: { + name: 'String' + } + }, + resultPrefix: { + required: false, + readOnly: true, + serializedName: 'resultPrefix', + type: { + name: 'String' + } + }, + sizeMB: { + required: false, + readOnly: true, + serializedName: 'sizeMB', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = DatabaseSummaryResult; diff --git a/lib/services/datamigrationManagement/lib/models/databaseTable.js b/lib/services/datamigrationManagement/lib/models/databaseTable.js new file mode 100644 index 0000000000..e24ecfd1d6 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/databaseTable.js @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Table properties + * + */ +class DatabaseTable { + /** + * Create a DatabaseTable. + * @member {boolean} [hasRows] Indicates whether table is empty or not + * @member {string} [name] Schema-qualified name of the table + */ + constructor() { + } + + /** + * Defines the metadata of DatabaseTable + * + * @returns {object} metadata of DatabaseTable + * + */ + mapper() { + return { + required: false, + serializedName: 'DatabaseTable', + type: { + name: 'Composite', + className: 'DatabaseTable', + modelProperties: { + hasRows: { + required: false, + readOnly: true, + serializedName: 'hasRows', + type: { + name: 'Boolean' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DatabaseTable; diff --git a/lib/services/datamigrationManagement/lib/models/executionStatistics.js b/lib/services/datamigrationManagement/lib/models/executionStatistics.js new file mode 100644 index 0000000000..c882b60e3f --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/executionStatistics.js @@ -0,0 +1,111 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Description about the errors happen while performing migration validation + * + */ +class ExecutionStatistics { + /** + * Create a ExecutionStatistics. + * @member {number} [executionCount] No. of query executions + * @member {number} [cpuTimeMs] CPU Time in millisecond(s) for the query + * execution + * @member {number} [elapsedTimeMs] Time taken in millisecond(s) for + * executing the query + * @member {object} [waitStats] Dictionary of sql query execution wait types + * and the respective statistics + * @member {boolean} [hasErrors] Indicates whether the query resulted in an + * error + * @member {array} [sqlErrors] List of sql Errors + */ + constructor() { + } + + /** + * Defines the metadata of ExecutionStatistics + * + * @returns {object} metadata of ExecutionStatistics + * + */ + mapper() { + return { + required: false, + serializedName: 'ExecutionStatistics', + type: { + name: 'Composite', + className: 'ExecutionStatistics', + modelProperties: { + executionCount: { + required: false, + serializedName: 'executionCount', + type: { + name: 'Number' + } + }, + cpuTimeMs: { + required: false, + serializedName: 'cpuTimeMs', + type: { + name: 'Number' + } + }, + elapsedTimeMs: { + required: false, + serializedName: 'elapsedTimeMs', + type: { + name: 'Number' + } + }, + waitStats: { + required: false, + serializedName: 'waitStats', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'WaitStatisticsElementType', + type: { + name: 'Composite', + className: 'WaitStatistics' + } + } + } + }, + hasErrors: { + required: false, + serializedName: 'hasErrors', + type: { + name: 'Boolean' + } + }, + sqlErrors: { + required: false, + serializedName: 'sqlErrors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = ExecutionStatistics; diff --git a/lib/services/datamigrationManagement/lib/models/fileList.js b/lib/services/datamigrationManagement/lib/models/fileList.js new file mode 100644 index 0000000000..893df4bb37 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/fileList.js @@ -0,0 +1,67 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * OData page of files + */ +class FileList extends Array { + /** + * Create a FileList. + * @member {string} [nextLink] URL to load the next page of files + */ + constructor() { + super(); + } + + /** + * Defines the metadata of FileList + * + * @returns {object} metadata of FileList + * + */ + mapper() { + return { + required: false, + serializedName: 'FileList', + type: { + name: 'Composite', + className: 'FileList', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ProjectFileElementType', + type: { + name: 'Composite', + className: 'ProjectFile' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = FileList; diff --git a/lib/services/datamigrationManagement/lib/models/fileShare.js b/lib/services/datamigrationManagement/lib/models/fileShare.js new file mode 100644 index 0000000000..04714a9ef0 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/fileShare.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * File share information with Path, Username, and Password. + * + */ +class FileShare { + /** + * Create a FileShare. + * @member {string} [userName] User name credential to connect to the share + * location + * @member {string} [password] Password credential used to connect to the + * share location. + * @member {string} path The folder path for this share. + */ + constructor() { + } + + /** + * Defines the metadata of FileShare + * + * @returns {object} metadata of FileShare + * + */ + mapper() { + return { + required: false, + serializedName: 'FileShare', + type: { + name: 'Composite', + className: 'FileShare', + modelProperties: { + userName: { + required: false, + serializedName: 'userName', + type: { + name: 'String' + } + }, + password: { + required: false, + serializedName: 'password', + type: { + name: 'String' + } + }, + path: { + required: true, + serializedName: 'path', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = FileShare; diff --git a/lib/services/datamigrationManagement/lib/models/fileStorageInfo.js b/lib/services/datamigrationManagement/lib/models/fileStorageInfo.js new file mode 100644 index 0000000000..54484cf222 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/fileStorageInfo.js @@ -0,0 +1,67 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * File storage information. + * + */ +class FileStorageInfo { + /** + * Create a FileStorageInfo. + * @member {string} [uri] A URI that can be used to access the file content. + * @member {object} [headers] + */ + constructor() { + } + + /** + * Defines the metadata of FileStorageInfo + * + * @returns {object} metadata of FileStorageInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'Unknown', + type: { + name: 'Composite', + className: 'FileStorageInfo', + modelProperties: { + uri: { + required: false, + serializedName: 'uri', + type: { + name: 'String' + } + }, + headers: { + required: false, + serializedName: 'headers', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = FileStorageInfo; diff --git a/lib/services/datamigrationManagement/lib/models/getProjectDetailsNonSqlTaskInput.js b/lib/services/datamigrationManagement/lib/models/getProjectDetailsNonSqlTaskInput.js new file mode 100644 index 0000000000..58cf473939 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/getProjectDetailsNonSqlTaskInput.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Input for the task that reads configuration from project artifacts + * + */ +class GetProjectDetailsNonSqlTaskInput { + /** + * Create a GetProjectDetailsNonSqlTaskInput. + * @member {string} projectName Name of the migration project + * @member {string} projectLocation A URL that points to the location to + * access project artifacts + */ + constructor() { + } + + /** + * Defines the metadata of GetProjectDetailsNonSqlTaskInput + * + * @returns {object} metadata of GetProjectDetailsNonSqlTaskInput + * + */ + mapper() { + return { + required: false, + serializedName: 'GetProjectDetailsNonSqlTaskInput', + type: { + name: 'Composite', + className: 'GetProjectDetailsNonSqlTaskInput', + modelProperties: { + projectName: { + required: true, + serializedName: 'projectName', + type: { + name: 'String' + } + }, + projectLocation: { + required: true, + serializedName: 'projectLocation', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = GetProjectDetailsNonSqlTaskInput; diff --git a/lib/services/datamigrationManagement/lib/models/getTdeCertificatesSqlTaskInput.js b/lib/services/datamigrationManagement/lib/models/getTdeCertificatesSqlTaskInput.js new file mode 100644 index 0000000000..7493c8bc48 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/getTdeCertificatesSqlTaskInput.js @@ -0,0 +1,104 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Input for the task that gets TDE certificates in Base64 encoded format. + * + */ +class GetTdeCertificatesSqlTaskInput { + /** + * Create a GetTdeCertificatesSqlTaskInput. + * @member {object} connectionInfo Connection information for SQL Server + * @member {string} [connectionInfo.dataSource] Data source in the format + * Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [connectionInfo.authentication] Authentication type to + * use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [connectionInfo.encryptConnection] Whether to encrypt + * the connection + * @member {string} [connectionInfo.additionalSettings] Additional connection + * settings + * @member {boolean} [connectionInfo.trustServerCertificate] Whether to trust + * the server certificate + * @member {string} [connectionInfo.platform] Server platform type for + * connection. Possible values include: 'SqlOnPrem' + * @member {object} backupFileShare Backup file share information for file + * share to be used for temporarily storing files. + * @member {string} [backupFileShare.userName] User name credential to + * connect to the share location + * @member {string} [backupFileShare.password] Password credential used to + * connect to the share location. + * @member {string} [backupFileShare.path] The folder path for this share. + * @member {array} selectedCertificates List containing certificate names and + * corresponding password to use for encrypting the exported certificate. + */ + constructor() { + } + + /** + * Defines the metadata of GetTdeCertificatesSqlTaskInput + * + * @returns {object} metadata of GetTdeCertificatesSqlTaskInput + * + */ + mapper() { + return { + required: false, + serializedName: 'GetTdeCertificatesSqlTaskInput', + type: { + name: 'Composite', + className: 'GetTdeCertificatesSqlTaskInput', + modelProperties: { + connectionInfo: { + required: true, + serializedName: 'connectionInfo', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'ConnectionInfo', + className: 'SqlConnectionInfo' + } + }, + backupFileShare: { + required: true, + serializedName: 'backupFileShare', + type: { + name: 'Composite', + className: 'FileShare' + } + }, + selectedCertificates: { + required: true, + serializedName: 'selectedCertificates', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SelectedCertificateInputElementType', + type: { + name: 'Composite', + className: 'SelectedCertificateInput' + } + } + } + } + } + } + }; + } +} + +module.exports = GetTdeCertificatesSqlTaskInput; diff --git a/lib/services/datamigrationManagement/lib/models/getTdeCertificatesSqlTaskOutput.js b/lib/services/datamigrationManagement/lib/models/getTdeCertificatesSqlTaskOutput.js new file mode 100644 index 0000000000..4e53bfbbef --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/getTdeCertificatesSqlTaskOutput.js @@ -0,0 +1,85 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Output of the task that gets TDE certificates in Base64 encoded format. + * + */ +class GetTdeCertificatesSqlTaskOutput { + /** + * Create a GetTdeCertificatesSqlTaskOutput. + * @member {object} [base64EncodedCertificates] Mapping from certificate name + * to base 64 encoded format. + * @member {array} [validationErrors] Validation errors + */ + constructor() { + } + + /** + * Defines the metadata of GetTdeCertificatesSqlTaskOutput + * + * @returns {object} metadata of GetTdeCertificatesSqlTaskOutput + * + */ + mapper() { + return { + required: false, + serializedName: 'GetTdeCertificatesSqlTaskOutput', + type: { + name: 'Composite', + className: 'GetTdeCertificatesSqlTaskOutput', + modelProperties: { + base64EncodedCertificates: { + required: false, + readOnly: true, + serializedName: 'base64EncodedCertificates', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'ArrayElementType', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + }, + validationErrors: { + required: false, + readOnly: true, + serializedName: 'validationErrors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ReportableExceptionElementType', + type: { + name: 'Composite', + className: 'ReportableException' + } + } + } + } + } + } + }; + } +} + +module.exports = GetTdeCertificatesSqlTaskOutput; diff --git a/lib/services/datamigrationManagement/lib/models/getTdeCertificatesSqlTaskProperties.js b/lib/services/datamigrationManagement/lib/models/getTdeCertificatesSqlTaskProperties.js new file mode 100644 index 0000000000..fd1f5ea303 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/getTdeCertificatesSqlTaskProperties.js @@ -0,0 +1,159 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Properties for the task that gets TDE certificates in Base64 encoded format. + * + * @extends models['ProjectTaskProperties'] + */ +class GetTdeCertificatesSqlTaskProperties extends models['ProjectTaskProperties'] { + /** + * Create a GetTdeCertificatesSqlTaskProperties. + * @member {object} [input] Task input + * @member {object} [input.connectionInfo] Connection information for SQL + * Server + * @member {string} [input.connectionInfo.dataSource] Data source in the + * format Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [input.connectionInfo.authentication] Authentication type + * to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [input.connectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [input.connectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [input.connectionInfo.trustServerCertificate] Whether to + * trust the server certificate + * @member {string} [input.connectionInfo.platform] Server platform type for + * connection. Possible values include: 'SqlOnPrem' + * @member {object} [input.backupFileShare] Backup file share information for + * file share to be used for temporarily storing files. + * @member {string} [input.backupFileShare.userName] User name credential to + * connect to the share location + * @member {string} [input.backupFileShare.password] Password credential used + * to connect to the share location. + * @member {string} [input.backupFileShare.path] The folder path for this + * share. + * @member {array} [input.selectedCertificates] List containing certificate + * names and corresponding password to use for encrypting the exported + * certificate. + * @member {array} [output] Task output. This is ignored if submitted. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of GetTdeCertificatesSqlTaskProperties + * + * @returns {object} metadata of GetTdeCertificatesSqlTaskProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'GetTDECertificates.Sql', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'taskType', + clientName: 'taskType' + }, + uberParent: 'ProjectTaskProperties', + className: 'GetTdeCertificatesSqlTaskProperties', + modelProperties: { + errors: { + required: false, + readOnly: true, + serializedName: 'errors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ODataErrorElementType', + type: { + name: 'Composite', + className: 'ODataError' + } + } + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + commands: { + required: false, + readOnly: true, + serializedName: 'commands', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CommandPropertiesElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'commandType', + clientName: 'commandType' + }, + uberParent: 'CommandProperties', + className: 'CommandProperties' + } + } + } + }, + taskType: { + required: true, + serializedName: 'taskType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + input: { + required: false, + serializedName: 'input', + type: { + name: 'Composite', + className: 'GetTdeCertificatesSqlTaskInput' + } + }, + output: { + required: false, + readOnly: true, + serializedName: 'output', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'GetTdeCertificatesSqlTaskOutputElementType', + type: { + name: 'Composite', + className: 'GetTdeCertificatesSqlTaskOutput' + } + } + } + } + } + } + }; + } +} + +module.exports = GetTdeCertificatesSqlTaskProperties; diff --git a/lib/services/datamigrationManagement/lib/models/getUserTablesSqlSyncTaskInput.js b/lib/services/datamigrationManagement/lib/models/getUserTablesSqlSyncTaskInput.js new file mode 100644 index 0000000000..893fbb831c --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/getUserTablesSqlSyncTaskInput.js @@ -0,0 +1,133 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Input for the task that collects user tables for the given list of databases + * + */ +class GetUserTablesSqlSyncTaskInput { + /** + * Create a GetUserTablesSqlSyncTaskInput. + * @member {object} sourceConnectionInfo Connection information for SQL + * Server + * @member {string} [sourceConnectionInfo.dataSource] Data source in the + * format Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [sourceConnectionInfo.authentication] Authentication type + * to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [sourceConnectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [sourceConnectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [sourceConnectionInfo.trustServerCertificate] Whether to + * trust the server certificate + * @member {string} [sourceConnectionInfo.platform] Server platform type for + * connection. Possible values include: 'SqlOnPrem' + * @member {object} targetConnectionInfo Connection information for SQL DB + * @member {string} [targetConnectionInfo.dataSource] Data source in the + * format Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [targetConnectionInfo.authentication] Authentication type + * to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [targetConnectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [targetConnectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [targetConnectionInfo.trustServerCertificate] Whether to + * trust the server certificate + * @member {string} [targetConnectionInfo.platform] Server platform type for + * connection. Possible values include: 'SqlOnPrem' + * @member {array} selectedSourceDatabases List of source database names to + * collect tables for + * @member {array} selectedTargetDatabases List of target database names to + * collect tables for + */ + constructor() { + } + + /** + * Defines the metadata of GetUserTablesSqlSyncTaskInput + * + * @returns {object} metadata of GetUserTablesSqlSyncTaskInput + * + */ + mapper() { + return { + required: false, + serializedName: 'GetUserTablesSqlSyncTaskInput', + type: { + name: 'Composite', + className: 'GetUserTablesSqlSyncTaskInput', + modelProperties: { + sourceConnectionInfo: { + required: true, + serializedName: 'sourceConnectionInfo', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'ConnectionInfo', + className: 'SqlConnectionInfo' + } + }, + targetConnectionInfo: { + required: true, + serializedName: 'targetConnectionInfo', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'ConnectionInfo', + className: 'SqlConnectionInfo' + } + }, + selectedSourceDatabases: { + required: true, + serializedName: 'selectedSourceDatabases', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + selectedTargetDatabases: { + required: true, + serializedName: 'selectedTargetDatabases', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = GetUserTablesSqlSyncTaskInput; diff --git a/lib/services/datamigrationManagement/lib/models/getUserTablesSqlSyncTaskOutput.js b/lib/services/datamigrationManagement/lib/models/getUserTablesSqlSyncTaskOutput.js new file mode 100644 index 0000000000..cd2d1b74f0 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/getUserTablesSqlSyncTaskOutput.js @@ -0,0 +1,135 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Output of the task that collects user tables for the given list of databases + * + */ +class GetUserTablesSqlSyncTaskOutput { + /** + * Create a GetUserTablesSqlSyncTaskOutput. + * @member {object} [databasesToSourceTables] Mapping from database name to + * list of source tables + * @member {object} [databasesToTargetTables] Mapping from database name to + * list of target tables + * @member {object} [tableValidationErrors] Mapping from database name to + * list of validation errors + * @member {array} [validationErrors] Validation errors + */ + constructor() { + } + + /** + * Defines the metadata of GetUserTablesSqlSyncTaskOutput + * + * @returns {object} metadata of GetUserTablesSqlSyncTaskOutput + * + */ + mapper() { + return { + required: false, + serializedName: 'GetUserTablesSqlSyncTaskOutput', + type: { + name: 'Composite', + className: 'GetUserTablesSqlSyncTaskOutput', + modelProperties: { + databasesToSourceTables: { + required: false, + readOnly: true, + serializedName: 'databasesToSourceTables', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'ArrayElementType', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DatabaseTableElementType', + type: { + name: 'Composite', + className: 'DatabaseTable' + } + } + } + } + } + }, + databasesToTargetTables: { + required: false, + readOnly: true, + serializedName: 'databasesToTargetTables', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'ArrayElementType', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DatabaseTableElementType', + type: { + name: 'Composite', + className: 'DatabaseTable' + } + } + } + } + } + }, + tableValidationErrors: { + required: false, + readOnly: true, + serializedName: 'tableValidationErrors', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'ArrayElementType', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + }, + validationErrors: { + required: false, + readOnly: true, + serializedName: 'validationErrors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ReportableExceptionElementType', + type: { + name: 'Composite', + className: 'ReportableException' + } + } + } + } + } + } + }; + } +} + +module.exports = GetUserTablesSqlSyncTaskOutput; diff --git a/lib/services/datamigrationManagement/lib/models/getUserTablesSqlSyncTaskProperties.js b/lib/services/datamigrationManagement/lib/models/getUserTablesSqlSyncTaskProperties.js new file mode 100644 index 0000000000..536f77bf5d --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/getUserTablesSqlSyncTaskProperties.js @@ -0,0 +1,169 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Properties for the task that collects user tables for the given list of + * databases + * + * @extends models['ProjectTaskProperties'] + */ +class GetUserTablesSqlSyncTaskProperties extends models['ProjectTaskProperties'] { + /** + * Create a GetUserTablesSqlSyncTaskProperties. + * @member {object} [input] Task input + * @member {object} [input.sourceConnectionInfo] Connection information for + * SQL Server + * @member {string} [input.sourceConnectionInfo.dataSource] Data source in + * the format Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [input.sourceConnectionInfo.authentication] + * Authentication type to use for connection. Possible values include: + * 'None', 'WindowsAuthentication', 'SqlAuthentication', + * 'ActiveDirectoryIntegrated', 'ActiveDirectoryPassword' + * @member {boolean} [input.sourceConnectionInfo.encryptConnection] Whether + * to encrypt the connection + * @member {string} [input.sourceConnectionInfo.additionalSettings] + * Additional connection settings + * @member {boolean} [input.sourceConnectionInfo.trustServerCertificate] + * Whether to trust the server certificate + * @member {string} [input.sourceConnectionInfo.platform] Server platform + * type for connection. Possible values include: 'SqlOnPrem' + * @member {object} [input.targetConnectionInfo] Connection information for + * SQL DB + * @member {string} [input.targetConnectionInfo.dataSource] Data source in + * the format Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [input.targetConnectionInfo.authentication] + * Authentication type to use for connection. Possible values include: + * 'None', 'WindowsAuthentication', 'SqlAuthentication', + * 'ActiveDirectoryIntegrated', 'ActiveDirectoryPassword' + * @member {boolean} [input.targetConnectionInfo.encryptConnection] Whether + * to encrypt the connection + * @member {string} [input.targetConnectionInfo.additionalSettings] + * Additional connection settings + * @member {boolean} [input.targetConnectionInfo.trustServerCertificate] + * Whether to trust the server certificate + * @member {string} [input.targetConnectionInfo.platform] Server platform + * type for connection. Possible values include: 'SqlOnPrem' + * @member {array} [input.selectedSourceDatabases] List of source database + * names to collect tables for + * @member {array} [input.selectedTargetDatabases] List of target database + * names to collect tables for + * @member {array} [output] Task output. This is ignored if submitted. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of GetUserTablesSqlSyncTaskProperties + * + * @returns {object} metadata of GetUserTablesSqlSyncTaskProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'GetUserTables.AzureSqlDb.Sync', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'taskType', + clientName: 'taskType' + }, + uberParent: 'ProjectTaskProperties', + className: 'GetUserTablesSqlSyncTaskProperties', + modelProperties: { + errors: { + required: false, + readOnly: true, + serializedName: 'errors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ODataErrorElementType', + type: { + name: 'Composite', + className: 'ODataError' + } + } + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + commands: { + required: false, + readOnly: true, + serializedName: 'commands', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CommandPropertiesElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'commandType', + clientName: 'commandType' + }, + uberParent: 'CommandProperties', + className: 'CommandProperties' + } + } + } + }, + taskType: { + required: true, + serializedName: 'taskType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + input: { + required: false, + serializedName: 'input', + type: { + name: 'Composite', + className: 'GetUserTablesSqlSyncTaskInput' + } + }, + output: { + required: false, + readOnly: true, + serializedName: 'output', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'GetUserTablesSqlSyncTaskOutputElementType', + type: { + name: 'Composite', + className: 'GetUserTablesSqlSyncTaskOutput' + } + } + } + } + } + } + }; + } +} + +module.exports = GetUserTablesSqlSyncTaskProperties; diff --git a/lib/services/datamigrationManagement/lib/models/getUserTablesSqlTaskInput.js b/lib/services/datamigrationManagement/lib/models/getUserTablesSqlTaskInput.js new file mode 100644 index 0000000000..11ad5d6bd5 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/getUserTablesSqlTaskInput.js @@ -0,0 +1,88 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Input for the task that collects user tables for the given list of databases + * + */ +class GetUserTablesSqlTaskInput { + /** + * Create a GetUserTablesSqlTaskInput. + * @member {object} connectionInfo Connection information for SQL Server + * @member {string} [connectionInfo.dataSource] Data source in the format + * Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [connectionInfo.authentication] Authentication type to + * use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [connectionInfo.encryptConnection] Whether to encrypt + * the connection + * @member {string} [connectionInfo.additionalSettings] Additional connection + * settings + * @member {boolean} [connectionInfo.trustServerCertificate] Whether to trust + * the server certificate + * @member {string} [connectionInfo.platform] Server platform type for + * connection. Possible values include: 'SqlOnPrem' + * @member {array} selectedDatabases List of database names to collect tables + * for + */ + constructor() { + } + + /** + * Defines the metadata of GetUserTablesSqlTaskInput + * + * @returns {object} metadata of GetUserTablesSqlTaskInput + * + */ + mapper() { + return { + required: false, + serializedName: 'GetUserTablesSqlTaskInput', + type: { + name: 'Composite', + className: 'GetUserTablesSqlTaskInput', + modelProperties: { + connectionInfo: { + required: true, + serializedName: 'connectionInfo', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'ConnectionInfo', + className: 'SqlConnectionInfo' + } + }, + selectedDatabases: { + required: true, + serializedName: 'selectedDatabases', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = GetUserTablesSqlTaskInput; diff --git a/lib/services/datamigrationManagement/lib/models/getUserTablesSqlTaskOutput.js b/lib/services/datamigrationManagement/lib/models/getUserTablesSqlTaskOutput.js new file mode 100644 index 0000000000..c0f8895728 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/getUserTablesSqlTaskOutput.js @@ -0,0 +1,95 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Output of the task that collects user tables for the given list of databases + * + */ +class GetUserTablesSqlTaskOutput { + /** + * Create a GetUserTablesSqlTaskOutput. + * @member {string} [id] Result identifier + * @member {object} [databasesToTables] Mapping from database name to list of + * tables + * @member {array} [validationErrors] Validation errors + */ + constructor() { + } + + /** + * Defines the metadata of GetUserTablesSqlTaskOutput + * + * @returns {object} metadata of GetUserTablesSqlTaskOutput + * + */ + mapper() { + return { + required: false, + serializedName: 'GetUserTablesSqlTaskOutput', + type: { + name: 'Composite', + className: 'GetUserTablesSqlTaskOutput', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + databasesToTables: { + required: false, + readOnly: true, + serializedName: 'databasesToTables', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'ArrayElementType', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DatabaseTableElementType', + type: { + name: 'Composite', + className: 'DatabaseTable' + } + } + } + } + } + }, + validationErrors: { + required: false, + readOnly: true, + serializedName: 'validationErrors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ReportableExceptionElementType', + type: { + name: 'Composite', + className: 'ReportableException' + } + } + } + } + } + } + }; + } +} + +module.exports = GetUserTablesSqlTaskOutput; diff --git a/lib/services/datamigrationManagement/lib/models/getUserTablesSqlTaskProperties.js b/lib/services/datamigrationManagement/lib/models/getUserTablesSqlTaskProperties.js new file mode 100644 index 0000000000..28c5083db3 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/getUserTablesSqlTaskProperties.js @@ -0,0 +1,151 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Properties for the task that collects user tables for the given list of + * databases + * + * @extends models['ProjectTaskProperties'] + */ +class GetUserTablesSqlTaskProperties extends models['ProjectTaskProperties'] { + /** + * Create a GetUserTablesSqlTaskProperties. + * @member {object} [input] Task input + * @member {object} [input.connectionInfo] Connection information for SQL + * Server + * @member {string} [input.connectionInfo.dataSource] Data source in the + * format Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [input.connectionInfo.authentication] Authentication type + * to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [input.connectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [input.connectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [input.connectionInfo.trustServerCertificate] Whether to + * trust the server certificate + * @member {string} [input.connectionInfo.platform] Server platform type for + * connection. Possible values include: 'SqlOnPrem' + * @member {array} [input.selectedDatabases] List of database names to + * collect tables for + * @member {array} [output] Task output. This is ignored if submitted. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of GetUserTablesSqlTaskProperties + * + * @returns {object} metadata of GetUserTablesSqlTaskProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'GetUserTables.Sql', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'taskType', + clientName: 'taskType' + }, + uberParent: 'ProjectTaskProperties', + className: 'GetUserTablesSqlTaskProperties', + modelProperties: { + errors: { + required: false, + readOnly: true, + serializedName: 'errors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ODataErrorElementType', + type: { + name: 'Composite', + className: 'ODataError' + } + } + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + commands: { + required: false, + readOnly: true, + serializedName: 'commands', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CommandPropertiesElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'commandType', + clientName: 'commandType' + }, + uberParent: 'CommandProperties', + className: 'CommandProperties' + } + } + } + }, + taskType: { + required: true, + serializedName: 'taskType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + input: { + required: false, + serializedName: 'input', + type: { + name: 'Composite', + className: 'GetUserTablesSqlTaskInput' + } + }, + output: { + required: false, + readOnly: true, + serializedName: 'output', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'GetUserTablesSqlTaskOutputElementType', + type: { + name: 'Composite', + className: 'GetUserTablesSqlTaskOutput' + } + } + } + } + } + } + }; + } +} + +module.exports = GetUserTablesSqlTaskProperties; diff --git a/lib/services/datamigrationManagement/lib/models/index.d.ts b/lib/services/datamigrationManagement/lib/models/index.d.ts new file mode 100644 index 0000000000..85c9d3227f --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/index.d.ts @@ -0,0 +1,4955 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import { BaseResource } from 'ms-rest-azure'; +import { CloudError } from 'ms-rest-azure'; +import * as moment from 'moment'; + +export { BaseResource } from 'ms-rest-azure'; +export { CloudError } from 'ms-rest-azure'; + + +/** + * @class + * Initializes a new instance of the Resource class. + * @constructor + * ARM resource. + * + * @member {string} [id] Resource ID. + * @member {string} [name] Resource name. + * @member {string} [type] Resource type. + */ +export interface Resource extends BaseResource { + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + +/** + * @class + * Initializes a new instance of the TrackedResource class. + * @constructor + * ARM tracked top level resource. + * + * @member {object} [tags] Resource tags. + * @member {string} location Resource location. + */ +export interface TrackedResource extends Resource { + tags?: { [propertyName: string]: string }; + location: string; +} + +/** + * @class + * Initializes a new instance of the ProjectFileProperties class. + * @constructor + * Base class for file properties. + * + * @member {string} [extension] Optional File extension. If submitted it should + * not have a leading period and must match the extension from filePath. + * @member {string} [filePath] Relative path of this file resource. This + * property can be set when creating or updating the file resource. + * @member {date} [lastModified] Modification DateTime. + * @member {string} [mediaType] File content type. This propery can be modified + * to reflect the file content type. + * @member {number} [size] File size. + */ +export interface ProjectFileProperties { + extension?: string; + filePath?: string; + readonly lastModified?: Date; + mediaType?: string; + readonly size?: number; +} + +/** + * @class + * Initializes a new instance of the ProjectFile class. + * @constructor + * A file resource + * + * @member {string} [etag] HTTP strong entity tag value. This is ignored if + * submitted. + * @member {object} [properties] Custom file properties + * @member {string} [properties.extension] Optional File extension. If + * submitted it should not have a leading period and must match the extension + * from filePath. + * @member {string} [properties.filePath] Relative path of this file resource. + * This property can be set when creating or updating the file resource. + * @member {date} [properties.lastModified] Modification DateTime. + * @member {string} [properties.mediaType] File content type. This propery can + * be modified to reflect the file content type. + * @member {number} [properties.size] File size. + */ +export interface ProjectFile extends Resource { + etag?: string; + properties?: ProjectFileProperties; +} + +/** + * @class + * Initializes a new instance of the ODataError class. + * @constructor + * Error information in OData format. + * + * @member {string} [code] The machine-readable description of the error, such + * as 'InvalidRequest' or 'InternalServerError' + * @member {string} [message] The human-readable description of the error + * @member {array} [details] Inner errors that caused this error + */ +export interface ODataError { + code?: string; + message?: string; + details?: ODataError[]; +} + +/** + * @class + * Initializes a new instance of the ReportableException class. + * @constructor + * Exception object for all custom exceptions + * + * @member {string} [message] Error message + * @member {string} [actionableMessage] Actionable steps for this exception + * @member {string} [filePath] The path to the file where exception occurred + * @member {string} [lineNumber] The line number where exception occurred + * @member {number} [hResult] Coded numerical value that is assigned to a + * specific exception + * @member {string} [stackTrace] Stack trace + */ +export interface ReportableException { + message?: string; + actionableMessage?: string; + filePath?: string; + lineNumber?: string; + hResult?: number; + stackTrace?: string; +} + +/** + * @class + * Initializes a new instance of the MigrateSyncCompleteCommandOutput class. + * @constructor + * Output for command that completes sync migration for a database. + * + * @member {array} [errors] List of errors that happened during the command + * execution + */ +export interface MigrateSyncCompleteCommandOutput { + errors?: ReportableException[]; +} + +/** + * @class + * Initializes a new instance of the MigrateSyncCompleteCommandInput class. + * @constructor + * Input for command that completes sync migration for a database. + * + * @member {string} databaseName Name of database + * @member {date} [commitTimeStamp] Time stamp to complete + */ +export interface MigrateSyncCompleteCommandInput { + databaseName: string; + commitTimeStamp?: Date; +} + +/** + * @class + * Initializes a new instance of the CommandProperties class. + * @constructor + * Base class for all types of DMS command properties. If command is not + * supported by current client, this object is returned. + * + * @member {array} [errors] Array of errors. This is ignored if submitted. + * @member {string} [state] The state of the command. This is ignored if + * submitted. Possible values include: 'Unknown', 'Accepted', 'Running', + * 'Succeeded', 'Failed' + * @member {string} commandType Polymorphic Discriminator + */ +export interface CommandProperties { + readonly errors?: ODataError[]; + readonly state?: string; + commandType: string; +} + +/** + * @class + * Initializes a new instance of the MigrateSyncCompleteCommandProperties class. + * @constructor + * Properties for the command that completes sync migration for a database. + * + * @member {object} [input] Command input + * @member {string} [input.databaseName] Name of database + * @member {date} [input.commitTimeStamp] Time stamp to complete + * @member {object} [output] Command output. This is ignored if submitted. + * @member {array} [output.errors] List of errors that happened during the + * command execution + */ +export interface MigrateSyncCompleteCommandProperties extends CommandProperties { + input?: MigrateSyncCompleteCommandInput; + readonly output?: MigrateSyncCompleteCommandOutput; +} + +/** + * @class + * Initializes a new instance of the GetTdeCertificatesSqlTaskOutput class. + * @constructor + * Output of the task that gets TDE certificates in Base64 encoded format. + * + * @member {object} [base64EncodedCertificates] Mapping from certificate name + * to base 64 encoded format. + * @member {array} [validationErrors] Validation errors + */ +export interface GetTdeCertificatesSqlTaskOutput { + readonly base64EncodedCertificates?: { [propertyName: string]: string[] }; + readonly validationErrors?: ReportableException[]; +} + +/** + * @class + * Initializes a new instance of the SelectedCertificateInput class. + * @constructor + * Info for ertificate to be exported for TDE enabled databases. + * + * @member {string} certificateName Name of certificate to be exported. + * @member {string} password Password to use for encrypting the exported + * certificate. + */ +export interface SelectedCertificateInput { + certificateName: string; + password: string; +} + +/** + * @class + * Initializes a new instance of the FileShare class. + * @constructor + * File share information with Path, Username, and Password. + * + * @member {string} [userName] User name credential to connect to the share + * location + * @member {string} [password] Password credential used to connect to the share + * location. + * @member {string} path The folder path for this share. + */ +export interface FileShare { + userName?: string; + password?: string; + path: string; +} + +/** + * @class + * Initializes a new instance of the ConnectionInfo class. + * @constructor + * Defines the connection properties of a server + * + * @member {string} [userName] User name + * @member {string} [password] Password credential. + * @member {string} type Polymorphic Discriminator + */ +export interface ConnectionInfo { + userName?: string; + password?: string; + type: string; +} + +/** + * @class + * Initializes a new instance of the PostgreSqlConnectionInfo class. + * @constructor + * Information for connecting to PostgreSQL server + * + * @member {string} serverName Name of the server + * @member {string} [databaseName] Name of the database + * @member {number} port Port for Server + */ +export interface PostgreSqlConnectionInfo extends ConnectionInfo { + serverName: string; + databaseName?: string; + port: number; +} + +/** + * @class + * Initializes a new instance of the MySqlConnectionInfo class. + * @constructor + * Information for connecting to MySQL server + * + * @member {string} serverName Name of the server + * @member {number} port Port for Server + */ +export interface MySqlConnectionInfo extends ConnectionInfo { + serverName: string; + port: number; +} + +/** + * @class + * Initializes a new instance of the MongoDbConnectionInfo class. + * @constructor + * Describes a connection to a MongoDB data source + * + * @member {string} connectionString A MongoDB connection string or blob + * container URL. The user name and password can be specified here or in the + * userName and password properties + */ +export interface MongoDbConnectionInfo extends ConnectionInfo { + connectionString: string; +} + +/** + * @class + * Initializes a new instance of the SqlConnectionInfo class. + * @constructor + * Information for connecting to SQL database server + * + * @member {string} dataSource Data source in the format + * Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [authentication] Authentication type to use for connection. + * Possible values include: 'None', 'WindowsAuthentication', + * 'SqlAuthentication', 'ActiveDirectoryIntegrated', 'ActiveDirectoryPassword' + * @member {boolean} [encryptConnection] Whether to encrypt the connection. + * Default value: true . + * @member {string} [additionalSettings] Additional connection settings + * @member {boolean} [trustServerCertificate] Whether to trust the server + * certificate. Default value: false . + * @member {string} [platform] Server platform type for connection. Possible + * values include: 'SqlOnPrem' + */ +export interface SqlConnectionInfo extends ConnectionInfo { + dataSource: string; + authentication?: string; + encryptConnection?: boolean; + additionalSettings?: string; + trustServerCertificate?: boolean; + platform?: string; +} + +/** + * @class + * Initializes a new instance of the GetTdeCertificatesSqlTaskInput class. + * @constructor + * Input for the task that gets TDE certificates in Base64 encoded format. + * + * @member {object} connectionInfo Connection information for SQL Server + * @member {string} [connectionInfo.dataSource] Data source in the format + * Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [connectionInfo.authentication] Authentication type to use + * for connection. Possible values include: 'None', 'WindowsAuthentication', + * 'SqlAuthentication', 'ActiveDirectoryIntegrated', 'ActiveDirectoryPassword' + * @member {boolean} [connectionInfo.encryptConnection] Whether to encrypt the + * connection + * @member {string} [connectionInfo.additionalSettings] Additional connection + * settings + * @member {boolean} [connectionInfo.trustServerCertificate] Whether to trust + * the server certificate + * @member {string} [connectionInfo.platform] Server platform type for + * connection. Possible values include: 'SqlOnPrem' + * @member {object} backupFileShare Backup file share information for file + * share to be used for temporarily storing files. + * @member {string} [backupFileShare.userName] User name credential to connect + * to the share location + * @member {string} [backupFileShare.password] Password credential used to + * connect to the share location. + * @member {string} [backupFileShare.path] The folder path for this share. + * @member {array} selectedCertificates List containing certificate names and + * corresponding password to use for encrypting the exported certificate. + */ +export interface GetTdeCertificatesSqlTaskInput { + connectionInfo: SqlConnectionInfo; + backupFileShare: FileShare; + selectedCertificates: SelectedCertificateInput[]; +} + +/** + * @class + * Initializes a new instance of the ProjectTaskProperties class. + * @constructor + * Base class for all types of DMS task properties. If task is not supported by + * current client, this object is returned. + * + * @member {array} [errors] Array of errors. This is ignored if submitted. + * @member {string} [state] The state of the task. This is ignored if + * submitted. Possible values include: 'Unknown', 'Queued', 'Running', + * 'Canceled', 'Succeeded', 'Failed', 'FailedInputValidation', 'Faulted' + * @member {array} [commands] Array of command properties. + * @member {string} taskType Polymorphic Discriminator + */ +export interface ProjectTaskProperties { + readonly errors?: ODataError[]; + readonly state?: string; + readonly commands?: CommandProperties[]; + taskType: string; +} + +/** + * @class + * Initializes a new instance of the GetTdeCertificatesSqlTaskProperties class. + * @constructor + * Properties for the task that gets TDE certificates in Base64 encoded format. + * + * @member {object} [input] Task input + * @member {object} [input.connectionInfo] Connection information for SQL + * Server + * @member {string} [input.connectionInfo.dataSource] Data source in the format + * Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [input.connectionInfo.authentication] Authentication type + * to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [input.connectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [input.connectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [input.connectionInfo.trustServerCertificate] Whether to + * trust the server certificate + * @member {string} [input.connectionInfo.platform] Server platform type for + * connection. Possible values include: 'SqlOnPrem' + * @member {object} [input.backupFileShare] Backup file share information for + * file share to be used for temporarily storing files. + * @member {string} [input.backupFileShare.userName] User name credential to + * connect to the share location + * @member {string} [input.backupFileShare.password] Password credential used + * to connect to the share location. + * @member {string} [input.backupFileShare.path] The folder path for this + * share. + * @member {array} [input.selectedCertificates] List containing certificate + * names and corresponding password to use for encrypting the exported + * certificate. + * @member {array} [output] Task output. This is ignored if submitted. + */ +export interface GetTdeCertificatesSqlTaskProperties extends ProjectTaskProperties { + input?: GetTdeCertificatesSqlTaskInput; + readonly output?: GetTdeCertificatesSqlTaskOutput[]; +} + +/** + * @class + * Initializes a new instance of the MongoDbError class. + * @constructor + * Describes an error or warning that occurred during a MongoDB migration + * + * @member {string} [code] The non-localized, machine-readable code that + * describes the error or warning + * @member {number} [count] The number of times the error or warning has + * occurred + * @member {string} [message] The localized, human-readable message that + * describes the error or warning + * @member {string} [type] The type of error or warning. Possible values + * include: 'Error', 'ValidationError', 'Warning' + */ +export interface MongoDbError { + code?: string; + count?: number; + message?: string; + type?: string; +} + +/** + * @class + * Initializes a new instance of the MongoDbProgress class. + * @constructor + * Base class for MongoDB migration outputs + * + * @member {number} bytesCopied The number of document bytes copied during the + * Copying stage + * @member {number} documentsCopied The number of documents copied during the + * Copying stage + * @member {string} elapsedTime The elapsed time in the format + * [ddd.]hh:mm:ss[.fffffff] (i.e. TimeSpan format) + * @member {object} errors The errors and warnings that have occurred for the + * current object. The keys are the error codes. + * @member {number} eventsPending The number of oplog events awaiting replay + * @member {number} eventsReplayed The number of oplog events replayed so far + * @member {date} [lastEventTime] The timestamp of the last oplog event + * received, or null if no oplog event has been received yet + * @member {date} [lastReplayTime] The timestamp of the last oplog event + * replayed, or null if no oplog event has been replayed yet + * @member {string} [name] The name of the progress object. For a collection, + * this is the unqualified collection name. For a database, this is the + * database name. For the overall migration, this is null. + * @member {string} [qualifiedName] The qualified name of the progress object. + * For a collection, this is the database-qualified name. For a database, this + * is the database name. For the overall migration, this is null. + * @member {string} resultType The type of progress object. Possible values + * include: 'Migration', 'Database', 'Collection' + * @member {string} state Possible values include: 'NotStarted', + * 'ValidatingInput', 'Initializing', 'Restarting', 'Copying', 'InitialReplay', + * 'Replaying', 'Finalizing', 'Complete', 'Canceled', 'Failed' + * @member {number} totalBytes The total number of document bytes on the source + * at the beginning of the Copying stage, or -1 if the total size was unknown + * @member {number} totalDocuments The total number of documents on the source + * at the beginning of the Copying stage, or -1 if the total count was unknown + */ +export interface MongoDbProgress { + bytesCopied: number; + documentsCopied: number; + elapsedTime: string; + errors: { [propertyName: string]: MongoDbError }; + eventsPending: number; + eventsReplayed: number; + lastEventTime?: Date; + lastReplayTime?: Date; + name?: string; + qualifiedName?: string; + resultType: string; + state: string; + totalBytes: number; + totalDocuments: number; +} + +/** + * @class + * Initializes a new instance of the MongoDbCollectionProgress class. + * @constructor + * Describes the progress of a collection + * + */ +export interface MongoDbCollectionProgress extends MongoDbProgress { +} + +/** + * @class + * Initializes a new instance of the MongoDbDatabaseProgress class. + * @constructor + * Describes the progress of a database + * + * @member {object} [collections] The progress of the collections in the + * database. The keys are the unqualified names of the collections + */ +export interface MongoDbDatabaseProgress extends MongoDbProgress { + collections?: { [propertyName: string]: MongoDbCollectionProgress }; +} + +/** + * @class + * Initializes a new instance of the MongoDbMigrationProgress class. + * @constructor + * Describes the progress of the overall migration + * + * @member {object} [databases] The progress of the databases in the migration. + * The keys are the names of the databases + */ +export interface MongoDbMigrationProgress extends MongoDbProgress { + databases?: { [propertyName: string]: MongoDbDatabaseProgress }; +} + +/** + * @class + * Initializes a new instance of the MongoDbThrottlingSettings class. + * @constructor + * Specifies resource limits for the migration + * + * @member {number} [minFreeCpu] The percentage of CPU time that the migrator + * will try to avoid using, from 0 to 100 + * @member {number} [minFreeMemoryMb] The number of megabytes of RAM that the + * migrator will try to avoid using + * @member {number} [maxParallelism] The maximum number of work items (e.g. + * collection copies) that will be processed in parallel + */ +export interface MongoDbThrottlingSettings { + minFreeCpu?: number; + minFreeMemoryMb?: number; + maxParallelism?: number; +} + +/** + * @class + * Initializes a new instance of the MongoDbShardKeyField class. + * @constructor + * Describes a field reference within a MongoDB shard key + * + * @member {string} name The name of the field + * @member {string} order The field ordering. Possible values include: + * 'Forward', 'Reverse', 'Hashed' + */ +export interface MongoDbShardKeyField { + name: string; + order: string; +} + +/** + * @class + * Initializes a new instance of the MongoDbShardKeySetting class. + * @constructor + * Describes a MongoDB shard key + * + * @member {array} fields The fields within the shard key + * @member {boolean} isUnique Whether the shard key is unique + */ +export interface MongoDbShardKeySetting { + fields: MongoDbShardKeyField[]; + isUnique: boolean; +} + +/** + * @class + * Initializes a new instance of the MongoDbCollectionSettings class. + * @constructor + * Describes how an individual MongoDB collection should be migrated + * + * @member {boolean} [canDelete] Whether the migrator is allowed to drop the + * target collection in the course of performing a migration. The default is + * true. + * @member {object} [shardKey] + * @member {array} [shardKey.fields] The fields within the shard key + * @member {boolean} [shardKey.isUnique] Whether the shard key is unique + * @member {number} [targetRUs] The RUs that should be configured on a CosmosDB + * target, or null to use the default. This has no effect on non-CosmosDB + * targets. + */ +export interface MongoDbCollectionSettings { + canDelete?: boolean; + shardKey?: MongoDbShardKeySetting; + targetRUs?: number; +} + +/** + * @class + * Initializes a new instance of the MongoDbDatabaseSettings class. + * @constructor + * Describes how an individual MongoDB database should be migrated + * + * @member {object} collections The collections on the source database to + * migrate to the target. The keys are the unqualified names of the + * collections. + * @member {number} [targetRUs] The RUs that should be configured on a CosmosDB + * target, or null to use the default, or 0 if throughput should not be + * provisioned for the database. This has no effect on non-CosmosDB targets. + */ +export interface MongoDbDatabaseSettings { + collections: { [propertyName: string]: MongoDbCollectionSettings }; + targetRUs?: number; +} + +/** + * @class + * Initializes a new instance of the MongoDbMigrationSettings class. + * @constructor + * Describes how a MongoDB data migration should be performed + * + * @member {number} [boostRUs] The RU limit on a CosmosDB target that + * collections will be temporarily increased to (if lower) during the initial + * copy of a migration, from 10,000 to 1,000,000, or 0 to use the default boost + * (which is generally the maximum), or null to not boost the RUs. This setting + * has no effect on non-CosmosDB targets. + * @member {object} databases The databases on the source cluster to migrate to + * the target. The keys are the names of the databases. + * @member {string} [replication] Describes how changes will be replicated from + * the source to the target. The default is OneTime. Possible values include: + * 'Disabled', 'OneTime', 'Continuous' + * @member {object} source Settings used to connect to the source cluster + * @member {string} [source.connectionString] A MongoDB connection string or + * blob container URL. The user name and password can be specified here or in + * the userName and password properties + * @member {object} target Settings used to connect to the target cluster + * @member {string} [target.connectionString] A MongoDB connection string or + * blob container URL. The user name and password can be specified here or in + * the userName and password properties + * @member {object} [throttling] Settings used to limit the resource usage of + * the migration + * @member {number} [throttling.minFreeCpu] The percentage of CPU time that the + * migrator will try to avoid using, from 0 to 100 + * @member {number} [throttling.minFreeMemoryMb] The number of megabytes of RAM + * that the migrator will try to avoid using + * @member {number} [throttling.maxParallelism] The maximum number of work + * items (e.g. collection copies) that will be processed in parallel + */ +export interface MongoDbMigrationSettings { + boostRUs?: number; + databases: { [propertyName: string]: MongoDbDatabaseSettings }; + replication?: string; + source: MongoDbConnectionInfo; + target: MongoDbConnectionInfo; + throttling?: MongoDbThrottlingSettings; +} + +/** + * @class + * Initializes a new instance of the ValidateMongoDbTaskProperties class. + * @constructor + * Properties for the task that validates a migration between MongoDB data + * sources + * + * @member {object} [input] + * @member {number} [input.boostRUs] The RU limit on a CosmosDB target that + * collections will be temporarily increased to (if lower) during the initial + * copy of a migration, from 10,000 to 1,000,000, or 0 to use the default boost + * (which is generally the maximum), or null to not boost the RUs. This setting + * has no effect on non-CosmosDB targets. + * @member {object} [input.databases] The databases on the source cluster to + * migrate to the target. The keys are the names of the databases. + * @member {string} [input.replication] Describes how changes will be + * replicated from the source to the target. The default is OneTime. Possible + * values include: 'Disabled', 'OneTime', 'Continuous' + * @member {object} [input.source] Settings used to connect to the source + * cluster + * @member {string} [input.source.connectionString] A MongoDB connection string + * or blob container URL. The user name and password can be specified here or + * in the userName and password properties + * @member {object} [input.target] Settings used to connect to the target + * cluster + * @member {string} [input.target.connectionString] A MongoDB connection string + * or blob container URL. The user name and password can be specified here or + * in the userName and password properties + * @member {object} [input.throttling] Settings used to limit the resource + * usage of the migration + * @member {number} [input.throttling.minFreeCpu] The percentage of CPU time + * that the migrator will try to avoid using, from 0 to 100 + * @member {number} [input.throttling.minFreeMemoryMb] The number of megabytes + * of RAM that the migrator will try to avoid using + * @member {number} [input.throttling.maxParallelism] The maximum number of + * work items (e.g. collection copies) that will be processed in parallel + * @member {array} [output] An array containing a single + * MongoDbMigrationProgress object + */ +export interface ValidateMongoDbTaskProperties extends ProjectTaskProperties { + input?: MongoDbMigrationSettings; + readonly output?: MongoDbMigrationProgress[]; +} + +/** + * @class + * Initializes a new instance of the DatabaseBackupInfo class. + * @constructor + * Information about backup files when existing backup mode is used. + * + * @member {string} [databaseName] Database name. + * @member {string} [backupType] Backup Type. Possible values include: + * 'Database', 'TransactionLog', 'File', 'DifferentialDatabase', + * 'DifferentialFile', 'Partial', 'DifferentialPartial' + * @member {array} [backupFiles] The list of backup files for the current + * database. + * @member {number} [position] Position of current database backup in the file. + * @member {boolean} [isDamaged] Database was damaged when backed up, but the + * backup operation was requested to continue despite errors. + * @member {boolean} [isCompressed] Whether the backup set is compressed + * @member {number} [familyCount] Number of files in the backup set. + * @member {date} [backupFinishDate] Date and time when the backup operation + * finished. + */ +export interface DatabaseBackupInfo { + readonly databaseName?: string; + readonly backupType?: string; + readonly backupFiles?: string[]; + readonly position?: number; + readonly isDamaged?: boolean; + readonly isCompressed?: boolean; + readonly familyCount?: number; + readonly backupFinishDate?: Date; +} + +/** + * @class + * Initializes a new instance of the ValidateMigrationInputSqlServerSqlMITaskOutput class. + * @constructor + * Output for task that validates migration input for SQL to Azure SQL Managed + * Instance migrations + * + * @member {string} [id] Result identifier + * @member {string} [name] Name of database + * @member {array} [restoreDatabaseNameErrors] Errors associated with the + * RestoreDatabaseName + * @member {array} [backupFolderErrors] Errors associated with the BackupFolder + * path + * @member {array} [backupShareCredentialsErrors] Errors associated with backup + * share user name and password credentials + * @member {array} [backupStorageAccountErrors] Errors associated with the + * storage account provided. + * @member {array} [existingBackupErrors] Errors associated with existing + * backup files. + * @member {object} [databaseBackupInfo] Information about backup files when + * existing backup mode is used. + * @member {string} [databaseBackupInfo.databaseName] Database name. + * @member {string} [databaseBackupInfo.backupType] Backup Type. Possible + * values include: 'Database', 'TransactionLog', 'File', + * 'DifferentialDatabase', 'DifferentialFile', 'Partial', 'DifferentialPartial' + * @member {array} [databaseBackupInfo.backupFiles] The list of backup files + * for the current database. + * @member {number} [databaseBackupInfo.position] Position of current database + * backup in the file. + * @member {boolean} [databaseBackupInfo.isDamaged] Database was damaged when + * backed up, but the backup operation was requested to continue despite + * errors. + * @member {boolean} [databaseBackupInfo.isCompressed] Whether the backup set + * is compressed + * @member {number} [databaseBackupInfo.familyCount] Number of files in the + * backup set. + * @member {date} [databaseBackupInfo.backupFinishDate] Date and time when the + * backup operation finished. + */ +export interface ValidateMigrationInputSqlServerSqlMITaskOutput { + readonly id?: string; + readonly name?: string; + readonly restoreDatabaseNameErrors?: ReportableException[]; + readonly backupFolderErrors?: ReportableException[]; + readonly backupShareCredentialsErrors?: ReportableException[]; + readonly backupStorageAccountErrors?: ReportableException[]; + readonly existingBackupErrors?: ReportableException[]; + databaseBackupInfo?: DatabaseBackupInfo; +} + +/** + * @class + * Initializes a new instance of the BlobShare class. + * @constructor + * Blob container storage information. + * + * @member {string} sasUri SAS URI of Azure Storage Account Container. + */ +export interface BlobShare { + sasUri: string; +} + +/** + * @class + * Initializes a new instance of the MigrateSqlServerSqlMIDatabaseInput class. + * @constructor + * Database specific information for SQL to Azure SQL DB Managed Instance + * migration task inputs + * + * @member {string} name Name of the database + * @member {string} restoreDatabaseName Name of the database at destination + * @member {object} [backupFileShare] Backup file share information for backing + * up this database. + * @member {string} [backupFileShare.userName] User name credential to connect + * to the share location + * @member {string} [backupFileShare.password] Password credential used to + * connect to the share location. + * @member {string} [backupFileShare.path] The folder path for this share. + * @member {array} [backupFilePaths] The list of backup files to be used in + * case of existing backups. + */ +export interface MigrateSqlServerSqlMIDatabaseInput { + name: string; + restoreDatabaseName: string; + backupFileShare?: FileShare; + backupFilePaths?: string[]; +} + +/** + * @class + * Initializes a new instance of the ValidateMigrationInputSqlServerSqlMITaskInput class. + * @constructor + * Input for task that validates migration input for SQL to Azure SQL Managed + * Instance + * + * @member {object} sourceConnectionInfo Information for connecting to source + * @member {string} [sourceConnectionInfo.dataSource] Data source in the format + * Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [sourceConnectionInfo.authentication] Authentication type + * to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [sourceConnectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [sourceConnectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [sourceConnectionInfo.trustServerCertificate] Whether to + * trust the server certificate + * @member {string} [sourceConnectionInfo.platform] Server platform type for + * connection. Possible values include: 'SqlOnPrem' + * @member {object} targetConnectionInfo Information for connecting to target + * @member {string} [targetConnectionInfo.dataSource] Data source in the format + * Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [targetConnectionInfo.authentication] Authentication type + * to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [targetConnectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [targetConnectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [targetConnectionInfo.trustServerCertificate] Whether to + * trust the server certificate + * @member {string} [targetConnectionInfo.platform] Server platform type for + * connection. Possible values include: 'SqlOnPrem' + * @member {array} selectedDatabases Databases to migrate + * @member {array} [selectedLogins] Logins to migrate + * @member {object} [backupFileShare] Backup file share information for all + * selected databases. + * @member {string} [backupFileShare.userName] User name credential to connect + * to the share location + * @member {string} [backupFileShare.password] Password credential used to + * connect to the share location. + * @member {string} [backupFileShare.path] The folder path for this share. + * @member {object} backupBlobShare SAS URI of Azure Storage Account Container + * to be used for storing backup files. + * @member {string} [backupBlobShare.sasUri] SAS URI of Azure Storage Account + * Container. + * @member {string} [backupMode] Backup Mode to specify whether to use existing + * backup or create new backup. Possible values include: 'CreateBackup', + * 'ExistingBackup' + */ +export interface ValidateMigrationInputSqlServerSqlMITaskInput { + sourceConnectionInfo: SqlConnectionInfo; + targetConnectionInfo: SqlConnectionInfo; + selectedDatabases: MigrateSqlServerSqlMIDatabaseInput[]; + selectedLogins?: string[]; + backupFileShare?: FileShare; + backupBlobShare: BlobShare; + backupMode?: string; +} + +/** + * @class + * Initializes a new instance of the ValidateMigrationInputSqlServerSqlMITaskProperties class. + * @constructor + * Properties for task that validates migration input for SQL to Azure SQL + * Database Managed Instance + * + * @member {object} [input] Task input + * @member {object} [input.sourceConnectionInfo] Information for connecting to + * source + * @member {string} [input.sourceConnectionInfo.dataSource] Data source in the + * format Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [input.sourceConnectionInfo.authentication] Authentication + * type to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [input.sourceConnectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [input.sourceConnectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [input.sourceConnectionInfo.trustServerCertificate] + * Whether to trust the server certificate + * @member {string} [input.sourceConnectionInfo.platform] Server platform type + * for connection. Possible values include: 'SqlOnPrem' + * @member {object} [input.targetConnectionInfo] Information for connecting to + * target + * @member {string} [input.targetConnectionInfo.dataSource] Data source in the + * format Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [input.targetConnectionInfo.authentication] Authentication + * type to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [input.targetConnectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [input.targetConnectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [input.targetConnectionInfo.trustServerCertificate] + * Whether to trust the server certificate + * @member {string} [input.targetConnectionInfo.platform] Server platform type + * for connection. Possible values include: 'SqlOnPrem' + * @member {array} [input.selectedDatabases] Databases to migrate + * @member {array} [input.selectedLogins] Logins to migrate + * @member {object} [input.backupFileShare] Backup file share information for + * all selected databases. + * @member {string} [input.backupFileShare.userName] User name credential to + * connect to the share location + * @member {string} [input.backupFileShare.password] Password credential used + * to connect to the share location. + * @member {string} [input.backupFileShare.path] The folder path for this + * share. + * @member {object} [input.backupBlobShare] SAS URI of Azure Storage Account + * Container to be used for storing backup files. + * @member {string} [input.backupBlobShare.sasUri] SAS URI of Azure Storage + * Account Container. + * @member {string} [input.backupMode] Backup Mode to specify whether to use + * existing backup or create new backup. Possible values include: + * 'CreateBackup', 'ExistingBackup' + * @member {array} [output] Task output. This is ignored if submitted. + */ +export interface ValidateMigrationInputSqlServerSqlMITaskProperties extends ProjectTaskProperties { + input?: ValidateMigrationInputSqlServerSqlMITaskInput; + readonly output?: ValidateMigrationInputSqlServerSqlMITaskOutput[]; +} + +/** + * @class + * Initializes a new instance of the ValidateSyncMigrationInputSqlServerTaskOutput class. + * @constructor + * Output for task that validates migration input for SQL sync migrations + * + * @member {string} [id] Database identifier + * @member {string} [name] Name of database + * @member {array} [validationErrors] Errors associated with a selected + * database object + */ +export interface ValidateSyncMigrationInputSqlServerTaskOutput { + readonly id?: string; + readonly name?: string; + readonly validationErrors?: ReportableException[]; +} + +/** + * @class + * Initializes a new instance of the MigrateSqlServerSqlDbSyncDatabaseInput class. + * @constructor + * Database specific information for SQL to Azure SQL DB sync migration task + * inputs + * + * @member {string} [id] Unique identifier for database + * @member {string} [name] Name of database + * @member {string} [targetDatabaseName] Target database name + * @member {string} [schemaName] Schema name to be migrated + * @member {object} [tableMap] Mapping of source to target tables + * @member {object} [migrationSetting] Migration settings which tune the + * migration behavior + * @member {object} [sourceSetting] Source settings to tune source endpoint + * migration behavior + * @member {object} [targetSetting] Target settings to tune target endpoint + * migration behavior + */ +export interface MigrateSqlServerSqlDbSyncDatabaseInput { + id?: string; + name?: string; + targetDatabaseName?: string; + schemaName?: string; + tableMap?: { [propertyName: string]: string }; + migrationSetting?: { [propertyName: string]: string }; + sourceSetting?: { [propertyName: string]: string }; + targetSetting?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the ValidateSyncMigrationInputSqlServerTaskInput class. + * @constructor + * Input for task that validates migration input for SQL sync migrations + * + * @member {object} sourceConnectionInfo Information for connecting to source + * SQL server + * @member {string} [sourceConnectionInfo.dataSource] Data source in the format + * Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [sourceConnectionInfo.authentication] Authentication type + * to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [sourceConnectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [sourceConnectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [sourceConnectionInfo.trustServerCertificate] Whether to + * trust the server certificate + * @member {string} [sourceConnectionInfo.platform] Server platform type for + * connection. Possible values include: 'SqlOnPrem' + * @member {object} targetConnectionInfo Information for connecting to target + * @member {string} [targetConnectionInfo.dataSource] Data source in the format + * Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [targetConnectionInfo.authentication] Authentication type + * to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [targetConnectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [targetConnectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [targetConnectionInfo.trustServerCertificate] Whether to + * trust the server certificate + * @member {string} [targetConnectionInfo.platform] Server platform type for + * connection. Possible values include: 'SqlOnPrem' + * @member {array} selectedDatabases Databases to migrate + */ +export interface ValidateSyncMigrationInputSqlServerTaskInput { + sourceConnectionInfo: SqlConnectionInfo; + targetConnectionInfo: SqlConnectionInfo; + selectedDatabases: MigrateSqlServerSqlDbSyncDatabaseInput[]; +} + +/** + * @class + * Initializes a new instance of the ValidateMigrationInputSqlServerSqlDbSyncTaskProperties class. + * @constructor + * Properties for task that validates migration input for SQL to Azure SQL DB + * sync migrations + * + * @member {object} [input] Task input + * @member {object} [input.sourceConnectionInfo] Information for connecting to + * source SQL server + * @member {string} [input.sourceConnectionInfo.dataSource] Data source in the + * format Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [input.sourceConnectionInfo.authentication] Authentication + * type to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [input.sourceConnectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [input.sourceConnectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [input.sourceConnectionInfo.trustServerCertificate] + * Whether to trust the server certificate + * @member {string} [input.sourceConnectionInfo.platform] Server platform type + * for connection. Possible values include: 'SqlOnPrem' + * @member {object} [input.targetConnectionInfo] Information for connecting to + * target + * @member {string} [input.targetConnectionInfo.dataSource] Data source in the + * format Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [input.targetConnectionInfo.authentication] Authentication + * type to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [input.targetConnectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [input.targetConnectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [input.targetConnectionInfo.trustServerCertificate] + * Whether to trust the server certificate + * @member {string} [input.targetConnectionInfo.platform] Server platform type + * for connection. Possible values include: 'SqlOnPrem' + * @member {array} [input.selectedDatabases] Databases to migrate + * @member {array} [output] Task output. This is ignored if submitted. + */ +export interface ValidateMigrationInputSqlServerSqlDbSyncTaskProperties extends ProjectTaskProperties { + input?: ValidateSyncMigrationInputSqlServerTaskInput; + readonly output?: ValidateSyncMigrationInputSqlServerTaskOutput[]; +} + +/** + * @class + * Initializes a new instance of the SyncMigrationDatabaseErrorEvent class. + * @constructor + * Database migration errors for online migration + * + * @member {string} [timestampString] String value of timestamp. + * @member {string} [eventTypeString] Event type. + * @member {string} [eventText] Event text. + */ +export interface SyncMigrationDatabaseErrorEvent { + readonly timestampString?: string; + readonly eventTypeString?: string; + readonly eventText?: string; +} + +/** + * @class + * Initializes a new instance of the MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput class. + * @constructor + * Output for the task that migrates PostgreSQL databases to Azure Database for + * PostgreSQL for online migrations + * + * @member {string} [id] Result identifier + * @member {string} resultType Polymorphic Discriminator + */ +export interface MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput { + readonly id?: string; + resultType: string; +} + +/** + * @class + * Initializes a new instance of the MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError class. + * @constructor + * @member {string} [errorMessage] Error message + * @member {array} [events] List of error events. + */ +export interface MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError extends MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput { + errorMessage?: string; + events?: SyncMigrationDatabaseErrorEvent[]; +} + +/** + * @class + * Initializes a new instance of the MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError class. + * @constructor + * @member {object} [error] Migration error + * @member {string} [error.message] Error message + * @member {string} [error.actionableMessage] Actionable steps for this + * exception + * @member {string} [error.filePath] The path to the file where exception + * occurred + * @member {string} [error.lineNumber] The line number where exception occurred + * @member {number} [error.hResult] Coded numerical value that is assigned to a + * specific exception + * @member {string} [error.stackTrace] Stack trace + */ +export interface MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError extends MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput { + readonly error?: ReportableException; +} + +/** + * @class + * Initializes a new instance of the MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel class. + * @constructor + * @member {string} [tableName] Name of the table + * @member {string} [databaseName] Name of the database + * @member {number} [cdcInsertCounter] Number of applied inserts + * @member {number} [cdcUpdateCounter] Number of applied updates + * @member {number} [cdcDeleteCounter] Number of applied deletes + * @member {date} [fullLoadEstFinishTime] Estimate to finish full load + * @member {date} [fullLoadStartedOn] Full load start time + * @member {date} [fullLoadEndedOn] Full load end time + * @member {number} [fullLoadTotalRows] Number of rows applied in full load + * @member {string} [state] Current state of the table migration. Possible + * values include: 'BEFORE_LOAD', 'FULL_LOAD', 'COMPLETED', 'CANCELED', + * 'ERROR', 'FAILED' + * @member {number} [totalChangesApplied] Total number of applied changes + * @member {number} [dataErrorsCounter] Number of data errors occurred + * @member {date} [lastModifiedTime] Last modified time on target + */ +export interface MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel extends MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput { + readonly tableName?: string; + readonly databaseName?: string; + readonly cdcInsertCounter?: number; + readonly cdcUpdateCounter?: number; + readonly cdcDeleteCounter?: number; + readonly fullLoadEstFinishTime?: Date; + readonly fullLoadStartedOn?: Date; + readonly fullLoadEndedOn?: Date; + readonly fullLoadTotalRows?: number; + readonly state?: string; + readonly totalChangesApplied?: number; + readonly dataErrorsCounter?: number; + readonly lastModifiedTime?: Date; +} + +/** + * @class + * Initializes a new instance of the MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel class. + * @constructor + * @member {string} [databaseName] Name of the database + * @member {date} [startedOn] Migration start time + * @member {date} [endedOn] Migration end time + * @member {string} [migrationState] Migration state that this database is in. + * Possible values include: 'UNDEFINED', 'CONFIGURING', 'INITIALIAZING', + * 'STARTING', 'RUNNING', 'READY_TO_COMPLETE', 'COMPLETING', 'COMPLETE', + * 'CANCELLING', 'CANCELLED', 'FAILED' + * @member {number} [incomingChanges] Number of incoming changes + * @member {number} [appliedChanges] Number of applied changes + * @member {number} [cdcInsertCounter] Number of cdc inserts + * @member {number} [cdcDeleteCounter] Number of cdc deletes + * @member {number} [cdcUpdateCounter] Number of cdc updates + * @member {number} [fullLoadCompletedTables] Number of tables completed in + * full load + * @member {number} [fullLoadLoadingTables] Number of tables loading in full + * load + * @member {number} [fullLoadQueuedTables] Number of tables queued in full load + * @member {number} [fullLoadErroredTables] Number of tables errored in full + * load + * @member {boolean} [initializationCompleted] Indicates if initial load (full + * load) has been completed + * @member {number} [latency] CDC apply latency + */ +export interface MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel extends MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput { + readonly databaseName?: string; + readonly startedOn?: Date; + readonly endedOn?: Date; + readonly migrationState?: string; + readonly incomingChanges?: number; + readonly appliedChanges?: number; + readonly cdcInsertCounter?: number; + readonly cdcDeleteCounter?: number; + readonly cdcUpdateCounter?: number; + readonly fullLoadCompletedTables?: number; + readonly fullLoadLoadingTables?: number; + readonly fullLoadQueuedTables?: number; + readonly fullLoadErroredTables?: number; + readonly initializationCompleted?: boolean; + readonly latency?: number; +} + +/** + * @class + * Initializes a new instance of the MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel class. + * @constructor + * @member {date} [startedOn] Migration start time + * @member {date} [endedOn] Migration end time + * @member {string} [sourceServerVersion] Source server version + * @member {string} [sourceServer] Source server name + * @member {string} [targetServerVersion] Target server version + * @member {string} [targetServer] Target server name + */ +export interface MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel extends MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput { + readonly startedOn?: Date; + readonly endedOn?: Date; + readonly sourceServerVersion?: string; + readonly sourceServer?: string; + readonly targetServerVersion?: string; + readonly targetServer?: string; +} + +/** + * @class + * Initializes a new instance of the MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput class. + * @constructor + * Database specific information for PostgreSQL to Azure Database for + * PostgreSQL migration task inputs + * + * @member {string} [name] Name of the database + * @member {string} [targetDatabaseName] Name of target database. Note: Target + * database will be truncated before starting migration. + */ +export interface MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput { + name?: string; + targetDatabaseName?: string; +} + +/** + * @class + * Initializes a new instance of the MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput class. + * @constructor + * Input for the task that migrates PostgreSQL databases to Azure Database for + * PostgreSQL for online migrations + * + * @member {array} selectedDatabases Databases to migrate + * @member {object} targetConnectionInfo Connection information for target + * Azure Database for PostgreSQL + * @member {string} [targetConnectionInfo.serverName] Name of the server + * @member {string} [targetConnectionInfo.databaseName] Name of the database + * @member {number} [targetConnectionInfo.port] Port for Server + * @member {object} sourceConnectionInfo Connection information for source + * PostgreSQL + * @member {string} [sourceConnectionInfo.serverName] Name of the server + * @member {string} [sourceConnectionInfo.databaseName] Name of the database + * @member {number} [sourceConnectionInfo.port] Port for Server + */ +export interface MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput { + selectedDatabases: MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput[]; + targetConnectionInfo: PostgreSqlConnectionInfo; + sourceConnectionInfo: PostgreSqlConnectionInfo; +} + +/** + * @class + * Initializes a new instance of the MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties class. + * @constructor + * Properties for the task that migrates PostgreSQL databases to Azure Database + * for PostgreSQL for online migrations + * + * @member {object} [input] Task input + * @member {array} [input.selectedDatabases] Databases to migrate + * @member {object} [input.targetConnectionInfo] Connection information for + * target Azure Database for PostgreSQL + * @member {string} [input.targetConnectionInfo.serverName] Name of the server + * @member {string} [input.targetConnectionInfo.databaseName] Name of the + * database + * @member {number} [input.targetConnectionInfo.port] Port for Server + * @member {object} [input.sourceConnectionInfo] Connection information for + * source PostgreSQL + * @member {string} [input.sourceConnectionInfo.serverName] Name of the server + * @member {string} [input.sourceConnectionInfo.databaseName] Name of the + * database + * @member {number} [input.sourceConnectionInfo.port] Port for Server + * @member {array} [output] Task output. This is ignored if submitted. + */ +export interface MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties extends ProjectTaskProperties { + input?: MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput; + readonly output?: MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput[]; +} + +/** + * @class + * Initializes a new instance of the MigrateMySqlAzureDbForMySqlSyncTaskOutput class. + * @constructor + * Output for the task that migrates MySQL databases to Azure Database for + * MySQL for online migrations + * + * @member {string} [id] Result identifier + * @member {string} resultType Polymorphic Discriminator + */ +export interface MigrateMySqlAzureDbForMySqlSyncTaskOutput { + readonly id?: string; + resultType: string; +} + +/** + * @class + * Initializes a new instance of the MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError class. + * @constructor + * @member {string} [errorMessage] Error message + * @member {array} [events] List of error events. + */ +export interface MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError extends MigrateMySqlAzureDbForMySqlSyncTaskOutput { + errorMessage?: string; + events?: SyncMigrationDatabaseErrorEvent[]; +} + +/** + * @class + * Initializes a new instance of the MigrateMySqlAzureDbForMySqlSyncTaskOutputError class. + * @constructor + * @member {object} [error] Migration error + * @member {string} [error.message] Error message + * @member {string} [error.actionableMessage] Actionable steps for this + * exception + * @member {string} [error.filePath] The path to the file where exception + * occurred + * @member {string} [error.lineNumber] The line number where exception occurred + * @member {number} [error.hResult] Coded numerical value that is assigned to a + * specific exception + * @member {string} [error.stackTrace] Stack trace + */ +export interface MigrateMySqlAzureDbForMySqlSyncTaskOutputError extends MigrateMySqlAzureDbForMySqlSyncTaskOutput { + readonly error?: ReportableException; +} + +/** + * @class + * Initializes a new instance of the MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel class. + * @constructor + * @member {string} [tableName] Name of the table + * @member {string} [databaseName] Name of the database + * @member {string} [cdcInsertCounter] Number of applied inserts + * @member {string} [cdcUpdateCounter] Number of applied updates + * @member {string} [cdcDeleteCounter] Number of applied deletes + * @member {date} [fullLoadEstFinishTime] Estimate to finish full load + * @member {date} [fullLoadStartedOn] Full load start time + * @member {date} [fullLoadEndedOn] Full load end time + * @member {number} [fullLoadTotalRows] Number of rows applied in full load + * @member {string} [state] Current state of the table migration. Possible + * values include: 'BEFORE_LOAD', 'FULL_LOAD', 'COMPLETED', 'CANCELED', + * 'ERROR', 'FAILED' + * @member {number} [totalChangesApplied] Total number of applied changes + * @member {number} [dataErrorsCounter] Number of data errors occurred + * @member {date} [lastModifiedTime] Last modified time on target + */ +export interface MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel extends MigrateMySqlAzureDbForMySqlSyncTaskOutput { + readonly tableName?: string; + readonly databaseName?: string; + readonly cdcInsertCounter?: string; + readonly cdcUpdateCounter?: string; + readonly cdcDeleteCounter?: string; + readonly fullLoadEstFinishTime?: Date; + readonly fullLoadStartedOn?: Date; + readonly fullLoadEndedOn?: Date; + readonly fullLoadTotalRows?: number; + readonly state?: string; + readonly totalChangesApplied?: number; + readonly dataErrorsCounter?: number; + readonly lastModifiedTime?: Date; +} + +/** + * @class + * Initializes a new instance of the MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel class. + * @constructor + * @member {string} [databaseName] Name of the database + * @member {date} [startedOn] Migration start time + * @member {date} [endedOn] Migration end time + * @member {string} [migrationState] Migration state that this database is in. + * Possible values include: 'UNDEFINED', 'CONFIGURING', 'INITIALIAZING', + * 'STARTING', 'RUNNING', 'READY_TO_COMPLETE', 'COMPLETING', 'COMPLETE', + * 'CANCELLING', 'CANCELLED', 'FAILED' + * @member {number} [incomingChanges] Number of incoming changes + * @member {number} [appliedChanges] Number of applied changes + * @member {number} [cdcInsertCounter] Number of cdc inserts + * @member {number} [cdcDeleteCounter] Number of cdc deletes + * @member {number} [cdcUpdateCounter] Number of cdc updates + * @member {number} [fullLoadCompletedTables] Number of tables completed in + * full load + * @member {number} [fullLoadLoadingTables] Number of tables loading in full + * load + * @member {number} [fullLoadQueuedTables] Number of tables queued in full load + * @member {number} [fullLoadErroredTables] Number of tables errored in full + * load + * @member {boolean} [initializationCompleted] Indicates if initial load (full + * load) has been completed + * @member {number} [latency] CDC apply latency + */ +export interface MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel extends MigrateMySqlAzureDbForMySqlSyncTaskOutput { + readonly databaseName?: string; + readonly startedOn?: Date; + readonly endedOn?: Date; + readonly migrationState?: string; + readonly incomingChanges?: number; + readonly appliedChanges?: number; + readonly cdcInsertCounter?: number; + readonly cdcDeleteCounter?: number; + readonly cdcUpdateCounter?: number; + readonly fullLoadCompletedTables?: number; + readonly fullLoadLoadingTables?: number; + readonly fullLoadQueuedTables?: number; + readonly fullLoadErroredTables?: number; + readonly initializationCompleted?: boolean; + readonly latency?: number; +} + +/** + * @class + * Initializes a new instance of the MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel class. + * @constructor + * @member {date} [startedOn] Migration start time + * @member {date} [endedOn] Migration end time + * @member {string} [sourceServerVersion] Source server version + * @member {string} [sourceServer] Source server name + * @member {string} [targetServerVersion] Target server version + * @member {string} [targetServer] Target server name + */ +export interface MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel extends MigrateMySqlAzureDbForMySqlSyncTaskOutput { + readonly startedOn?: Date; + readonly endedOn?: Date; + readonly sourceServerVersion?: string; + readonly sourceServer?: string; + readonly targetServerVersion?: string; + readonly targetServer?: string; +} + +/** + * @class + * Initializes a new instance of the MigrateMySqlAzureDbForMySqlSyncDatabaseInput class. + * @constructor + * Database specific information for MySQL to Azure Database for MySQL + * migration task inputs + * + * @member {string} [name] Name of the database + * @member {string} [targetDatabaseName] Name of target database. Note: Target + * database will be truncated before starting migration. + */ +export interface MigrateMySqlAzureDbForMySqlSyncDatabaseInput { + name?: string; + targetDatabaseName?: string; +} + +/** + * @class + * Initializes a new instance of the MigrateMySqlAzureDbForMySqlSyncTaskInput class. + * @constructor + * Input for the task that migrates MySQL databases to Azure Database for MySQL + * for online migrations + * + * @member {object} sourceConnectionInfo Connection information for source + * MySQL + * @member {string} [sourceConnectionInfo.serverName] Name of the server + * @member {number} [sourceConnectionInfo.port] Port for Server + * @member {object} targetConnectionInfo Connection information for target + * Azure Database for MySQL + * @member {string} [targetConnectionInfo.serverName] Name of the server + * @member {number} [targetConnectionInfo.port] Port for Server + * @member {array} selectedDatabases Databases to migrate + */ +export interface MigrateMySqlAzureDbForMySqlSyncTaskInput { + sourceConnectionInfo: MySqlConnectionInfo; + targetConnectionInfo: MySqlConnectionInfo; + selectedDatabases: MigrateMySqlAzureDbForMySqlSyncDatabaseInput[]; +} + +/** + * @class + * Initializes a new instance of the MigrateMySqlAzureDbForMySqlSyncTaskProperties class. + * @constructor + * Properties for the task that migrates MySQL databases to Azure Database for + * MySQL for online migrations + * + * @member {object} [input] Task input + * @member {object} [input.sourceConnectionInfo] Connection information for + * source MySQL + * @member {string} [input.sourceConnectionInfo.serverName] Name of the server + * @member {number} [input.sourceConnectionInfo.port] Port for Server + * @member {object} [input.targetConnectionInfo] Connection information for + * target Azure Database for MySQL + * @member {string} [input.targetConnectionInfo.serverName] Name of the server + * @member {number} [input.targetConnectionInfo.port] Port for Server + * @member {array} [input.selectedDatabases] Databases to migrate + * @member {array} [output] Task output. This is ignored if submitted. + */ +export interface MigrateMySqlAzureDbForMySqlSyncTaskProperties extends ProjectTaskProperties { + input?: MigrateMySqlAzureDbForMySqlSyncTaskInput; + readonly output?: MigrateMySqlAzureDbForMySqlSyncTaskOutput[]; +} + +/** + * @class + * Initializes a new instance of the MigrateSqlServerSqlDbSyncTaskOutput class. + * @constructor + * Output for the task that migrates on-prem SQL Server databases to Azure SQL + * Database for online migrations + * + * @member {string} [id] Result identifier + * @member {string} resultType Polymorphic Discriminator + */ +export interface MigrateSqlServerSqlDbSyncTaskOutput { + readonly id?: string; + resultType: string; +} + +/** + * @class + * Initializes a new instance of the MigrateSqlServerSqlDbSyncTaskOutputDatabaseError class. + * @constructor + * @member {string} [errorMessage] Error message + * @member {array} [events] List of error events. + */ +export interface MigrateSqlServerSqlDbSyncTaskOutputDatabaseError extends MigrateSqlServerSqlDbSyncTaskOutput { + errorMessage?: string; + events?: SyncMigrationDatabaseErrorEvent[]; +} + +/** + * @class + * Initializes a new instance of the MigrateSqlServerSqlDbSyncTaskOutputError class. + * @constructor + * @member {object} [error] Migration error + * @member {string} [error.message] Error message + * @member {string} [error.actionableMessage] Actionable steps for this + * exception + * @member {string} [error.filePath] The path to the file where exception + * occurred + * @member {string} [error.lineNumber] The line number where exception occurred + * @member {number} [error.hResult] Coded numerical value that is assigned to a + * specific exception + * @member {string} [error.stackTrace] Stack trace + */ +export interface MigrateSqlServerSqlDbSyncTaskOutputError extends MigrateSqlServerSqlDbSyncTaskOutput { + readonly error?: ReportableException; +} + +/** + * @class + * Initializes a new instance of the MigrateSqlServerSqlDbSyncTaskOutputTableLevel class. + * @constructor + * @member {string} [tableName] Name of the table + * @member {string} [databaseName] Name of the database + * @member {number} [cdcInsertCounter] Number of applied inserts + * @member {number} [cdcUpdateCounter] Number of applied updates + * @member {number} [cdcDeleteCounter] Number of applied deletes + * @member {date} [fullLoadEstFinishTime] Estimate to finish full load + * @member {date} [fullLoadStartedOn] Full load start time + * @member {date} [fullLoadEndedOn] Full load end time + * @member {number} [fullLoadTotalRows] Number of rows applied in full load + * @member {string} [state] Current state of the table migration. Possible + * values include: 'BEFORE_LOAD', 'FULL_LOAD', 'COMPLETED', 'CANCELED', + * 'ERROR', 'FAILED' + * @member {number} [totalChangesApplied] Total number of applied changes + * @member {number} [dataErrorsCounter] Number of data errors occurred + * @member {date} [lastModifiedTime] Last modified time on target + */ +export interface MigrateSqlServerSqlDbSyncTaskOutputTableLevel extends MigrateSqlServerSqlDbSyncTaskOutput { + readonly tableName?: string; + readonly databaseName?: string; + readonly cdcInsertCounter?: number; + readonly cdcUpdateCounter?: number; + readonly cdcDeleteCounter?: number; + readonly fullLoadEstFinishTime?: Date; + readonly fullLoadStartedOn?: Date; + readonly fullLoadEndedOn?: Date; + readonly fullLoadTotalRows?: number; + readonly state?: string; + readonly totalChangesApplied?: number; + readonly dataErrorsCounter?: number; + readonly lastModifiedTime?: Date; +} + +/** + * @class + * Initializes a new instance of the MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel class. + * @constructor + * @member {string} [databaseName] Name of the database + * @member {date} [startedOn] Migration start time + * @member {date} [endedOn] Migration end time + * @member {string} [migrationState] Migration state that this database is in. + * Possible values include: 'UNDEFINED', 'CONFIGURING', 'INITIALIAZING', + * 'STARTING', 'RUNNING', 'READY_TO_COMPLETE', 'COMPLETING', 'COMPLETE', + * 'CANCELLING', 'CANCELLED', 'FAILED' + * @member {number} [incomingChanges] Number of incoming changes + * @member {number} [appliedChanges] Number of applied changes + * @member {number} [cdcInsertCounter] Number of cdc inserts + * @member {number} [cdcDeleteCounter] Number of cdc deletes + * @member {number} [cdcUpdateCounter] Number of cdc updates + * @member {number} [fullLoadCompletedTables] Number of tables completed in + * full load + * @member {number} [fullLoadLoadingTables] Number of tables loading in full + * load + * @member {number} [fullLoadQueuedTables] Number of tables queued in full load + * @member {number} [fullLoadErroredTables] Number of tables errored in full + * load + * @member {boolean} [initializationCompleted] Indicates if initial load (full + * load) has been completed + * @member {number} [latency] CDC apply latency + */ +export interface MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel extends MigrateSqlServerSqlDbSyncTaskOutput { + readonly databaseName?: string; + readonly startedOn?: Date; + readonly endedOn?: Date; + readonly migrationState?: string; + readonly incomingChanges?: number; + readonly appliedChanges?: number; + readonly cdcInsertCounter?: number; + readonly cdcDeleteCounter?: number; + readonly cdcUpdateCounter?: number; + readonly fullLoadCompletedTables?: number; + readonly fullLoadLoadingTables?: number; + readonly fullLoadQueuedTables?: number; + readonly fullLoadErroredTables?: number; + readonly initializationCompleted?: boolean; + readonly latency?: number; +} + +/** + * @class + * Initializes a new instance of the MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel class. + * @constructor + * @member {date} [startedOn] Migration start time + * @member {date} [endedOn] Migration end time + * @member {string} [sourceServerVersion] Source server version + * @member {string} [sourceServer] Source server name + * @member {string} [targetServerVersion] Target server version + * @member {string} [targetServer] Target server name + * @member {number} [databaseCount] Count of databases + */ +export interface MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel extends MigrateSqlServerSqlDbSyncTaskOutput { + readonly startedOn?: Date; + readonly endedOn?: Date; + readonly sourceServerVersion?: string; + readonly sourceServer?: string; + readonly targetServerVersion?: string; + readonly targetServer?: string; + readonly databaseCount?: number; +} + +/** + * @class + * Initializes a new instance of the SqlMigrationTaskInput class. + * @constructor + * Base class for migration task input + * + * @member {object} sourceConnectionInfo Information for connecting to source + * @member {string} [sourceConnectionInfo.dataSource] Data source in the format + * Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [sourceConnectionInfo.authentication] Authentication type + * to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [sourceConnectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [sourceConnectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [sourceConnectionInfo.trustServerCertificate] Whether to + * trust the server certificate + * @member {string} [sourceConnectionInfo.platform] Server platform type for + * connection. Possible values include: 'SqlOnPrem' + * @member {object} targetConnectionInfo Information for connecting to target + * @member {string} [targetConnectionInfo.dataSource] Data source in the format + * Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [targetConnectionInfo.authentication] Authentication type + * to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [targetConnectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [targetConnectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [targetConnectionInfo.trustServerCertificate] Whether to + * trust the server certificate + * @member {string} [targetConnectionInfo.platform] Server platform type for + * connection. Possible values include: 'SqlOnPrem' + */ +export interface SqlMigrationTaskInput { + sourceConnectionInfo: SqlConnectionInfo; + targetConnectionInfo: SqlConnectionInfo; +} + +/** + * @class + * Initializes a new instance of the MigrationValidationOptions class. + * @constructor + * Types of validations to run after the migration + * + * @member {boolean} [enableSchemaValidation] Allows to compare the schema + * information between source and target. + * @member {boolean} [enableDataIntegrityValidation] Allows to perform a + * checksum based data integrity validation between source and target for the + * selected database / tables . + * @member {boolean} [enableQueryAnalysisValidation] Allows to perform a quick + * and intelligent query analysis by retrieving queries from the source + * database and executes them in the target. The result will have execution + * statistics for executions in source and target databases for the extracted + * queries. + */ +export interface MigrationValidationOptions { + enableSchemaValidation?: boolean; + enableDataIntegrityValidation?: boolean; + enableQueryAnalysisValidation?: boolean; +} + +/** + * @class + * Initializes a new instance of the MigrateSqlServerSqlDbSyncTaskInput class. + * @constructor + * Input for the task that migrates on-prem SQL Server databases to Azure SQL + * Database for online migrations + * + * @member {array} selectedDatabases Databases to migrate + * @member {object} [validationOptions] Validation options + * @member {boolean} [validationOptions.enableSchemaValidation] Allows to + * compare the schema information between source and target. + * @member {boolean} [validationOptions.enableDataIntegrityValidation] Allows + * to perform a checksum based data integrity validation between source and + * target for the selected database / tables . + * @member {boolean} [validationOptions.enableQueryAnalysisValidation] Allows + * to perform a quick and intelligent query analysis by retrieving queries from + * the source database and executes them in the target. The result will have + * execution statistics for executions in source and target databases for the + * extracted queries. + */ +export interface MigrateSqlServerSqlDbSyncTaskInput extends SqlMigrationTaskInput { + selectedDatabases: MigrateSqlServerSqlDbSyncDatabaseInput[]; + validationOptions?: MigrationValidationOptions; +} + +/** + * @class + * Initializes a new instance of the MigrateSqlServerSqlDbSyncTaskProperties class. + * @constructor + * Properties for the task that migrates on-prem SQL Server databases to Azure + * SQL Database for online migrations + * + * @member {object} [input] Task input + * @member {array} [input.selectedDatabases] Databases to migrate + * @member {object} [input.validationOptions] Validation options + * @member {boolean} [input.validationOptions.enableSchemaValidation] Allows to + * compare the schema information between source and target. + * @member {boolean} [input.validationOptions.enableDataIntegrityValidation] + * Allows to perform a checksum based data integrity validation between source + * and target for the selected database / tables . + * @member {boolean} [input.validationOptions.enableQueryAnalysisValidation] + * Allows to perform a quick and intelligent query analysis by retrieving + * queries from the source database and executes them in the target. The result + * will have execution statistics for executions in source and target databases + * for the extracted queries. + * @member {array} [output] Task output. This is ignored if submitted. + */ +export interface MigrateSqlServerSqlDbSyncTaskProperties extends ProjectTaskProperties { + input?: MigrateSqlServerSqlDbSyncTaskInput; + readonly output?: MigrateSqlServerSqlDbSyncTaskOutput[]; +} + +/** + * @class + * Initializes a new instance of the ValidationError class. + * @constructor + * Description about the errors happen while performing migration validation + * + * @member {string} [text] Error Text + * @member {string} [severity] Severity of the error. Possible values include: + * 'Message', 'Warning', 'Error' + */ +export interface ValidationError { + text?: string; + severity?: string; +} + +/** + * @class + * Initializes a new instance of the WaitStatistics class. + * @constructor + * Wait statistics gathered during query batch execution + * + * @member {string} [waitType] Type of the Wait + * @member {number} [waitTimeMs] Total wait time in millisecond(s) . Default + * value: 0 . + * @member {number} [waitCount] Total no. of waits + */ +export interface WaitStatistics { + waitType?: string; + waitTimeMs?: number; + waitCount?: number; +} + +/** + * @class + * Initializes a new instance of the ExecutionStatistics class. + * @constructor + * Description about the errors happen while performing migration validation + * + * @member {number} [executionCount] No. of query executions + * @member {number} [cpuTimeMs] CPU Time in millisecond(s) for the query + * execution + * @member {number} [elapsedTimeMs] Time taken in millisecond(s) for executing + * the query + * @member {object} [waitStats] Dictionary of sql query execution wait types + * and the respective statistics + * @member {boolean} [hasErrors] Indicates whether the query resulted in an + * error + * @member {array} [sqlErrors] List of sql Errors + */ +export interface ExecutionStatistics { + executionCount?: number; + cpuTimeMs?: number; + elapsedTimeMs?: number; + waitStats?: { [propertyName: string]: WaitStatistics }; + hasErrors?: boolean; + sqlErrors?: string[]; +} + +/** + * @class + * Initializes a new instance of the QueryExecutionResult class. + * @constructor + * Describes query analysis results for execution in source and target + * + * @member {string} [queryText] Query text retrieved from the source server + * @member {number} [statementsInBatch] Total no. of statements in the batch + * @member {object} [sourceResult] Query analysis result from the source + * @member {number} [sourceResult.executionCount] No. of query executions + * @member {number} [sourceResult.cpuTimeMs] CPU Time in millisecond(s) for the + * query execution + * @member {number} [sourceResult.elapsedTimeMs] Time taken in millisecond(s) + * for executing the query + * @member {object} [sourceResult.waitStats] Dictionary of sql query execution + * wait types and the respective statistics + * @member {boolean} [sourceResult.hasErrors] Indicates whether the query + * resulted in an error + * @member {array} [sourceResult.sqlErrors] List of sql Errors + * @member {object} [targetResult] Query analysis result from the target + * @member {number} [targetResult.executionCount] No. of query executions + * @member {number} [targetResult.cpuTimeMs] CPU Time in millisecond(s) for the + * query execution + * @member {number} [targetResult.elapsedTimeMs] Time taken in millisecond(s) + * for executing the query + * @member {object} [targetResult.waitStats] Dictionary of sql query execution + * wait types and the respective statistics + * @member {boolean} [targetResult.hasErrors] Indicates whether the query + * resulted in an error + * @member {array} [targetResult.sqlErrors] List of sql Errors + */ +export interface QueryExecutionResult { + queryText?: string; + statementsInBatch?: number; + sourceResult?: ExecutionStatistics; + targetResult?: ExecutionStatistics; +} + +/** + * @class + * Initializes a new instance of the QueryAnalysisValidationResult class. + * @constructor + * Results for query analysis comparison between the source and target + * + * @member {object} [queryResults] List of queries executed and it's execution + * results in source and target + * @member {string} [queryResults.queryText] Query text retrieved from the + * source server + * @member {number} [queryResults.statementsInBatch] Total no. of statements in + * the batch + * @member {object} [queryResults.sourceResult] Query analysis result from the + * source + * @member {number} [queryResults.sourceResult.executionCount] No. of query + * executions + * @member {number} [queryResults.sourceResult.cpuTimeMs] CPU Time in + * millisecond(s) for the query execution + * @member {number} [queryResults.sourceResult.elapsedTimeMs] Time taken in + * millisecond(s) for executing the query + * @member {object} [queryResults.sourceResult.waitStats] Dictionary of sql + * query execution wait types and the respective statistics + * @member {boolean} [queryResults.sourceResult.hasErrors] Indicates whether + * the query resulted in an error + * @member {array} [queryResults.sourceResult.sqlErrors] List of sql Errors + * @member {object} [queryResults.targetResult] Query analysis result from the + * target + * @member {number} [queryResults.targetResult.executionCount] No. of query + * executions + * @member {number} [queryResults.targetResult.cpuTimeMs] CPU Time in + * millisecond(s) for the query execution + * @member {number} [queryResults.targetResult.elapsedTimeMs] Time taken in + * millisecond(s) for executing the query + * @member {object} [queryResults.targetResult.waitStats] Dictionary of sql + * query execution wait types and the respective statistics + * @member {boolean} [queryResults.targetResult.hasErrors] Indicates whether + * the query resulted in an error + * @member {array} [queryResults.targetResult.sqlErrors] List of sql Errors + * @member {object} [validationErrors] Errors that are part of the execution + * @member {string} [validationErrors.text] Error Text + * @member {string} [validationErrors.severity] Severity of the error. Possible + * values include: 'Message', 'Warning', 'Error' + */ +export interface QueryAnalysisValidationResult { + queryResults?: QueryExecutionResult; + validationErrors?: ValidationError; +} + +/** + * @class + * Initializes a new instance of the SchemaComparisonValidationResultType class. + * @constructor + * Description about the errors happen while performing migration validation + * + * @member {string} [objectName] Name of the object that has the difference + * @member {string} [objectType] Type of the object that has the difference. + * e.g (Table/View/StoredProcedure). Possible values include: + * 'StoredProcedures', 'Table', 'User', 'View', 'Function' + * @member {string} [updateAction] Update action type with respect to target. + * Possible values include: 'DeletedOnTarget', 'ChangedOnTarget', + * 'AddedOnTarget' + */ +export interface SchemaComparisonValidationResultType { + objectName?: string; + objectType?: string; + updateAction?: string; +} + +/** + * @class + * Initializes a new instance of the SchemaComparisonValidationResult class. + * @constructor + * Results for schema comparison between the source and target + * + * @member {object} [schemaDifferences] List of schema differences between the + * source and target databases + * @member {string} [schemaDifferences.objectName] Name of the object that has + * the difference + * @member {string} [schemaDifferences.objectType] Type of the object that has + * the difference. e.g (Table/View/StoredProcedure). Possible values include: + * 'StoredProcedures', 'Table', 'User', 'View', 'Function' + * @member {string} [schemaDifferences.updateAction] Update action type with + * respect to target. Possible values include: 'DeletedOnTarget', + * 'ChangedOnTarget', 'AddedOnTarget' + * @member {object} [validationErrors] List of errors that happened while + * performing schema compare validation + * @member {string} [validationErrors.text] Error Text + * @member {string} [validationErrors.severity] Severity of the error. Possible + * values include: 'Message', 'Warning', 'Error' + * @member {object} [sourceDatabaseObjectCount] Count of source database + * objects + * @member {object} [targetDatabaseObjectCount] Count of target database + * objects + */ +export interface SchemaComparisonValidationResult { + schemaDifferences?: SchemaComparisonValidationResultType; + validationErrors?: ValidationError; + sourceDatabaseObjectCount?: { [propertyName: string]: number }; + targetDatabaseObjectCount?: { [propertyName: string]: number }; +} + +/** + * @class + * Initializes a new instance of the DataIntegrityValidationResult class. + * @constructor + * Results for checksum based Data Integrity validation results + * + * @member {object} [failedObjects] List of failed table names of source and + * target pair + * @member {object} [validationErrors] List of errors that happened while + * performing data integrity validation + * @member {string} [validationErrors.text] Error Text + * @member {string} [validationErrors.severity] Severity of the error. Possible + * values include: 'Message', 'Warning', 'Error' + */ +export interface DataIntegrityValidationResult { + failedObjects?: { [propertyName: string]: string }; + validationErrors?: ValidationError; +} + +/** + * @class + * Initializes a new instance of the MigrationValidationDatabaseLevelResult class. + * @constructor + * Database level validation results + * + * @member {string} [id] Result identifier + * @member {string} [migrationId] Migration Identifier + * @member {string} [sourceDatabaseName] Name of the source database + * @member {string} [targetDatabaseName] Name of the target database + * @member {date} [startedOn] Validation start time + * @member {date} [endedOn] Validation end time + * @member {object} [dataIntegrityValidationResult] Provides data integrity + * validation result between the source and target tables that are migrated. + * @member {object} [dataIntegrityValidationResult.failedObjects] List of + * failed table names of source and target pair + * @member {object} [dataIntegrityValidationResult.validationErrors] List of + * errors that happened while performing data integrity validation + * @member {string} [dataIntegrityValidationResult.validationErrors.text] Error + * Text + * @member {string} [dataIntegrityValidationResult.validationErrors.severity] + * Severity of the error. Possible values include: 'Message', 'Warning', + * 'Error' + * @member {object} [schemaValidationResult] Provides schema comparison result + * between source and target database + * @member {object} [schemaValidationResult.schemaDifferences] List of schema + * differences between the source and target databases + * @member {string} [schemaValidationResult.schemaDifferences.objectName] Name + * of the object that has the difference + * @member {string} [schemaValidationResult.schemaDifferences.objectType] Type + * of the object that has the difference. e.g (Table/View/StoredProcedure). + * Possible values include: 'StoredProcedures', 'Table', 'User', 'View', + * 'Function' + * @member {string} [schemaValidationResult.schemaDifferences.updateAction] + * Update action type with respect to target. Possible values include: + * 'DeletedOnTarget', 'ChangedOnTarget', 'AddedOnTarget' + * @member {object} [schemaValidationResult.validationErrors] List of errors + * that happened while performing schema compare validation + * @member {string} [schemaValidationResult.validationErrors.text] Error Text + * @member {string} [schemaValidationResult.validationErrors.severity] Severity + * of the error. Possible values include: 'Message', 'Warning', 'Error' + * @member {object} [schemaValidationResult.sourceDatabaseObjectCount] Count of + * source database objects + * @member {object} [schemaValidationResult.targetDatabaseObjectCount] Count of + * target database objects + * @member {object} [queryAnalysisValidationResult] Results of some of the + * query execution result between source and target database + * @member {object} [queryAnalysisValidationResult.queryResults] List of + * queries executed and it's execution results in source and target + * @member {string} [queryAnalysisValidationResult.queryResults.queryText] + * Query text retrieved from the source server + * @member {number} + * [queryAnalysisValidationResult.queryResults.statementsInBatch] Total no. of + * statements in the batch + * @member {object} [queryAnalysisValidationResult.queryResults.sourceResult] + * Query analysis result from the source + * @member {number} + * [queryAnalysisValidationResult.queryResults.sourceResult.executionCount] No. + * of query executions + * @member {number} + * [queryAnalysisValidationResult.queryResults.sourceResult.cpuTimeMs] CPU Time + * in millisecond(s) for the query execution + * @member {number} + * [queryAnalysisValidationResult.queryResults.sourceResult.elapsedTimeMs] Time + * taken in millisecond(s) for executing the query + * @member {object} + * [queryAnalysisValidationResult.queryResults.sourceResult.waitStats] + * Dictionary of sql query execution wait types and the respective statistics + * @member {boolean} + * [queryAnalysisValidationResult.queryResults.sourceResult.hasErrors] + * Indicates whether the query resulted in an error + * @member {array} + * [queryAnalysisValidationResult.queryResults.sourceResult.sqlErrors] List of + * sql Errors + * @member {object} [queryAnalysisValidationResult.queryResults.targetResult] + * Query analysis result from the target + * @member {number} + * [queryAnalysisValidationResult.queryResults.targetResult.executionCount] No. + * of query executions + * @member {number} + * [queryAnalysisValidationResult.queryResults.targetResult.cpuTimeMs] CPU Time + * in millisecond(s) for the query execution + * @member {number} + * [queryAnalysisValidationResult.queryResults.targetResult.elapsedTimeMs] Time + * taken in millisecond(s) for executing the query + * @member {object} + * [queryAnalysisValidationResult.queryResults.targetResult.waitStats] + * Dictionary of sql query execution wait types and the respective statistics + * @member {boolean} + * [queryAnalysisValidationResult.queryResults.targetResult.hasErrors] + * Indicates whether the query resulted in an error + * @member {array} + * [queryAnalysisValidationResult.queryResults.targetResult.sqlErrors] List of + * sql Errors + * @member {object} [queryAnalysisValidationResult.validationErrors] Errors + * that are part of the execution + * @member {string} [queryAnalysisValidationResult.validationErrors.text] Error + * Text + * @member {string} [queryAnalysisValidationResult.validationErrors.severity] + * Severity of the error. Possible values include: 'Message', 'Warning', + * 'Error' + * @member {string} [status] Current status of validation at the database + * level. Possible values include: 'Default', 'NotStarted', 'Initialized', + * 'InProgress', 'Completed', 'CompletedWithIssues', 'Stopped', 'Failed' + */ +export interface MigrationValidationDatabaseLevelResult { + readonly id?: string; + readonly migrationId?: string; + readonly sourceDatabaseName?: string; + readonly targetDatabaseName?: string; + readonly startedOn?: Date; + readonly endedOn?: Date; + readonly dataIntegrityValidationResult?: DataIntegrityValidationResult; + readonly schemaValidationResult?: SchemaComparisonValidationResult; + readonly queryAnalysisValidationResult?: QueryAnalysisValidationResult; + readonly status?: string; +} + +/** + * @class + * Initializes a new instance of the MigrationValidationDatabaseSummaryResult class. + * @constructor + * Migration Validation Database level summary result + * + * @member {string} [id] Result identifier + * @member {string} [migrationId] Migration Identifier + * @member {string} [sourceDatabaseName] Name of the source database + * @member {string} [targetDatabaseName] Name of the target database + * @member {date} [startedOn] Validation start time + * @member {date} [endedOn] Validation end time + * @member {string} [status] Current status of validation at the database + * level. Possible values include: 'Default', 'NotStarted', 'Initialized', + * 'InProgress', 'Completed', 'CompletedWithIssues', 'Stopped', 'Failed' + */ +export interface MigrationValidationDatabaseSummaryResult { + readonly id?: string; + readonly migrationId?: string; + readonly sourceDatabaseName?: string; + readonly targetDatabaseName?: string; + readonly startedOn?: Date; + readonly endedOn?: Date; + readonly status?: string; +} + +/** + * @class + * Initializes a new instance of the MigrationValidationResult class. + * @constructor + * Migration Validation Result + * + * @member {string} [id] Migration validation result identifier + * @member {string} [migrationId] Migration Identifier + * @member {object} [summaryResults] Validation summary results for each + * database + * @member {string} [status] Current status of validation at the migration + * level. Status from the database validation result status will be aggregated + * here. Possible values include: 'Default', 'NotStarted', 'Initialized', + * 'InProgress', 'Completed', 'CompletedWithIssues', 'Stopped', 'Failed' + */ +export interface MigrationValidationResult { + readonly id?: string; + readonly migrationId?: string; + summaryResults?: { [propertyName: string]: MigrationValidationDatabaseSummaryResult }; + readonly status?: string; +} + +/** + * @class + * Initializes a new instance of the MigrateSqlServerSqlDbTaskOutput class. + * @constructor + * Output for the task that migrates on-prem SQL Server databases to Azure SQL + * Database + * + * @member {string} [id] Result identifier + * @member {string} resultType Polymorphic Discriminator + */ +export interface MigrateSqlServerSqlDbTaskOutput { + readonly id?: string; + resultType: string; +} + +/** + * @class + * Initializes a new instance of the MigrateSqlServerSqlDbTaskOutputError class. + * @constructor + * @member {object} [error] Migration error + * @member {string} [error.message] Error message + * @member {string} [error.actionableMessage] Actionable steps for this + * exception + * @member {string} [error.filePath] The path to the file where exception + * occurred + * @member {string} [error.lineNumber] The line number where exception occurred + * @member {number} [error.hResult] Coded numerical value that is assigned to a + * specific exception + * @member {string} [error.stackTrace] Stack trace + */ +export interface MigrateSqlServerSqlDbTaskOutputError extends MigrateSqlServerSqlDbTaskOutput { + readonly error?: ReportableException; +} + +/** + * @class + * Initializes a new instance of the MigrateSqlServerSqlDbTaskOutputTableLevel class. + * @constructor + * @member {string} [objectName] Name of the item + * @member {date} [startedOn] Migration start time + * @member {date} [endedOn] Migration end time + * @member {string} [state] Current state of migration. Possible values + * include: 'None', 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', + * 'Stopped' + * @member {string} [statusMessage] Status message + * @member {number} [itemsCount] Number of items + * @member {number} [itemsCompletedCount] Number of successfully completed + * items + * @member {string} [errorPrefix] Wildcard string prefix to use for querying + * all errors of the item + * @member {string} [resultPrefix] Wildcard string prefix to use for querying + * all sub-tem results of the item + */ +export interface MigrateSqlServerSqlDbTaskOutputTableLevel extends MigrateSqlServerSqlDbTaskOutput { + readonly objectName?: string; + readonly startedOn?: Date; + readonly endedOn?: Date; + readonly state?: string; + readonly statusMessage?: string; + readonly itemsCount?: number; + readonly itemsCompletedCount?: number; + readonly errorPrefix?: string; + readonly resultPrefix?: string; +} + +/** + * @class + * Initializes a new instance of the DataItemMigrationSummaryResult class. + * @constructor + * Basic summary of a data item migration + * + * @member {string} [name] Name of the item + * @member {date} [startedOn] Migration start time + * @member {date} [endedOn] Migration end time + * @member {string} [state] Current state of migration. Possible values + * include: 'None', 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', + * 'Stopped' + * @member {string} [statusMessage] Status message + * @member {number} [itemsCount] Number of items + * @member {number} [itemsCompletedCount] Number of successfully completed + * items + * @member {string} [errorPrefix] Wildcard string prefix to use for querying + * all errors of the item + * @member {string} [resultPrefix] Wildcard string prefix to use for querying + * all sub-tem results of the item + */ +export interface DataItemMigrationSummaryResult { + readonly name?: string; + readonly startedOn?: Date; + readonly endedOn?: Date; + readonly state?: string; + readonly statusMessage?: string; + readonly itemsCount?: number; + readonly itemsCompletedCount?: number; + readonly errorPrefix?: string; + readonly resultPrefix?: string; +} + +/** + * @class + * Initializes a new instance of the MigrateSqlServerSqlDbTaskOutputDatabaseLevel class. + * @constructor + * @member {string} [databaseName] Name of the item + * @member {date} [startedOn] Migration start time + * @member {date} [endedOn] Migration end time + * @member {string} [state] Current state of migration. Possible values + * include: 'None', 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', + * 'Stopped' + * @member {string} [stage] Migration stage that this database is in. Possible + * values include: 'None', 'Initialize', 'Backup', 'FileCopy', 'Restore', + * 'Completed' + * @member {string} [statusMessage] Status message + * @member {string} [message] Migration progress message + * @member {number} [numberOfObjects] Number of objects + * @member {number} [numberOfObjectsCompleted] Number of successfully completed + * objects + * @member {number} [errorCount] Number of database/object errors. + * @member {string} [errorPrefix] Wildcard string prefix to use for querying + * all errors of the item + * @member {string} [resultPrefix] Wildcard string prefix to use for querying + * all sub-tem results of the item + * @member {array} [exceptionsAndWarnings] Migration exceptions and warnings. + * @member {object} [objectSummary] Summary of object results in the migration + */ +export interface MigrateSqlServerSqlDbTaskOutputDatabaseLevel extends MigrateSqlServerSqlDbTaskOutput { + readonly databaseName?: string; + readonly startedOn?: Date; + readonly endedOn?: Date; + readonly state?: string; + readonly stage?: string; + readonly statusMessage?: string; + readonly message?: string; + readonly numberOfObjects?: number; + readonly numberOfObjectsCompleted?: number; + readonly errorCount?: number; + readonly errorPrefix?: string; + readonly resultPrefix?: string; + readonly exceptionsAndWarnings?: ReportableException[]; + readonly objectSummary?: { [propertyName: string]: DataItemMigrationSummaryResult }; +} + +/** + * @class + * Initializes a new instance of the MigrationReportResult class. + * @constructor + * Migration validation report result, contains the url for downloading the + * generated report. + * + * @member {string} [id] Migration validation result identifier + * @member {string} [reportUrl] The url of the report. + */ +export interface MigrationReportResult { + id?: string; + reportUrl?: string; +} + +/** + * @class + * Initializes a new instance of the DatabaseSummaryResult class. + * @constructor + * Summary of database results in the migration + * + * @member {number} [sizeMB] Size of the database in megabytes + */ +export interface DatabaseSummaryResult extends DataItemMigrationSummaryResult { + readonly sizeMB?: number; +} + +/** + * @class + * Initializes a new instance of the MigrateSqlServerSqlDbTaskOutputMigrationLevel class. + * @constructor + * @member {date} [startedOn] Migration start time + * @member {date} [endedOn] Migration end time + * @member {number} [durationInSeconds] Duration of task execution in seconds. + * @member {string} [status] Current status of migration. Possible values + * include: 'Default', 'Connecting', 'SourceAndTargetSelected', 'SelectLogins', + * 'Configured', 'Running', 'Error', 'Stopped', 'Completed', + * 'CompletedWithWarnings' + * @member {string} [statusMessage] Migration status message + * @member {string} [message] Migration progress message + * @member {object} [databases] Selected databases as a map from database name + * to database id + * @member {object} [databaseSummary] Summary of database results in the + * migration + * @member {object} [migrationValidationResult] Migration Validation Results + * @member {string} [migrationValidationResult.id] Migration validation result + * identifier + * @member {string} [migrationValidationResult.migrationId] Migration + * Identifier + * @member {object} [migrationValidationResult.summaryResults] Validation + * summary results for each database + * @member {string} [migrationValidationResult.status] Current status of + * validation at the migration level. Status from the database validation + * result status will be aggregated here. Possible values include: 'Default', + * 'NotStarted', 'Initialized', 'InProgress', 'Completed', + * 'CompletedWithIssues', 'Stopped', 'Failed' + * @member {object} [migrationReportResult] Migration Report Result, provides + * unique url for downloading your migration report. + * @member {string} [migrationReportResult.id] Migration validation result + * identifier + * @member {string} [migrationReportResult.reportUrl] The url of the report. + * @member {string} [sourceServerVersion] Source server version + * @member {string} [sourceServerBrandVersion] Source server brand version + * @member {string} [targetServerVersion] Target server version + * @member {string} [targetServerBrandVersion] Target server brand version + * @member {array} [exceptionsAndWarnings] Migration exceptions and warnings. + */ +export interface MigrateSqlServerSqlDbTaskOutputMigrationLevel extends MigrateSqlServerSqlDbTaskOutput { + readonly startedOn?: Date; + readonly endedOn?: Date; + readonly durationInSeconds?: number; + readonly status?: string; + readonly statusMessage?: string; + readonly message?: string; + readonly databases?: { [propertyName: string]: string }; + readonly databaseSummary?: { [propertyName: string]: DatabaseSummaryResult }; + migrationValidationResult?: MigrationValidationResult; + migrationReportResult?: MigrationReportResult; + readonly sourceServerVersion?: string; + readonly sourceServerBrandVersion?: string; + readonly targetServerVersion?: string; + readonly targetServerBrandVersion?: string; + readonly exceptionsAndWarnings?: ReportableException[]; +} + +/** + * @class + * Initializes a new instance of the MigrateSqlServerSqlDbDatabaseInput class. + * @constructor + * Database specific information for SQL to Azure SQL DB migration task inputs + * + * @member {string} [name] Name of the database + * @member {string} [targetDatabaseName] Name of target database. Note: Target + * database will be truncated before starting migration. + * @member {boolean} [makeSourceDbReadOnly] Whether to set database read only + * before migration + * @member {object} [tableMap] Mapping of source to target tables + */ +export interface MigrateSqlServerSqlDbDatabaseInput { + name?: string; + targetDatabaseName?: string; + makeSourceDbReadOnly?: boolean; + tableMap?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the MigrateSqlServerSqlDbTaskInput class. + * @constructor + * Input for the task that migrates on-prem SQL Server databases to Azure SQL + * Database + * + * @member {array} selectedDatabases Databases to migrate + * @member {object} [validationOptions] Options for enabling various post + * migration validations. Available options, + * 1.) Data Integrity Check: Performs a checksum based comparison on source and + * target tables after the migration to ensure the correctness of the data. + * 2.) Schema Validation: Performs a thorough schema comparison between the + * source and target tables and provides a list of differences between the + * source and target database, 3.) Query Analysis: Executes a set of queries + * picked up automatically either from the Query Plan Cache or Query Store and + * execute them and compares the execution time between the source and target + * database. + * @member {boolean} [validationOptions.enableSchemaValidation] Allows to + * compare the schema information between source and target. + * @member {boolean} [validationOptions.enableDataIntegrityValidation] Allows + * to perform a checksum based data integrity validation between source and + * target for the selected database / tables . + * @member {boolean} [validationOptions.enableQueryAnalysisValidation] Allows + * to perform a quick and intelligent query analysis by retrieving queries from + * the source database and executes them in the target. The result will have + * execution statistics for executions in source and target databases for the + * extracted queries. + */ +export interface MigrateSqlServerSqlDbTaskInput extends SqlMigrationTaskInput { + selectedDatabases: MigrateSqlServerSqlDbDatabaseInput[]; + validationOptions?: MigrationValidationOptions; +} + +/** + * @class + * Initializes a new instance of the MigrateSqlServerSqlDbTaskProperties class. + * @constructor + * Properties for the task that migrates on-prem SQL Server databases to Azure + * SQL Database + * + * @member {object} [input] Task input + * @member {array} [input.selectedDatabases] Databases to migrate + * @member {object} [input.validationOptions] Options for enabling various post + * migration validations. Available options, + * 1.) Data Integrity Check: Performs a checksum based comparison on source and + * target tables after the migration to ensure the correctness of the data. + * 2.) Schema Validation: Performs a thorough schema comparison between the + * source and target tables and provides a list of differences between the + * source and target database, 3.) Query Analysis: Executes a set of queries + * picked up automatically either from the Query Plan Cache or Query Store and + * execute them and compares the execution time between the source and target + * database. + * @member {boolean} [input.validationOptions.enableSchemaValidation] Allows to + * compare the schema information between source and target. + * @member {boolean} [input.validationOptions.enableDataIntegrityValidation] + * Allows to perform a checksum based data integrity validation between source + * and target for the selected database / tables . + * @member {boolean} [input.validationOptions.enableQueryAnalysisValidation] + * Allows to perform a quick and intelligent query analysis by retrieving + * queries from the source database and executes them in the target. The result + * will have execution statistics for executions in source and target databases + * for the extracted queries. + * @member {array} [output] Task output. This is ignored if submitted. + */ +export interface MigrateSqlServerSqlDbTaskProperties extends ProjectTaskProperties { + input?: MigrateSqlServerSqlDbTaskInput; + readonly output?: MigrateSqlServerSqlDbTaskOutput[]; +} + +/** + * @class + * Initializes a new instance of the MigrateSqlServerSqlMITaskOutput class. + * @constructor + * Output for task that migrates SQL Server databases to Azure SQL Database + * Managed Instance. + * + * @member {string} [id] Result identifier + * @member {string} resultType Polymorphic Discriminator + */ +export interface MigrateSqlServerSqlMITaskOutput { + readonly id?: string; + resultType: string; +} + +/** + * @class + * Initializes a new instance of the MigrateSqlServerSqlMITaskOutputError class. + * @constructor + * @member {object} [error] Migration error + * @member {string} [error.message] Error message + * @member {string} [error.actionableMessage] Actionable steps for this + * exception + * @member {string} [error.filePath] The path to the file where exception + * occurred + * @member {string} [error.lineNumber] The line number where exception occurred + * @member {number} [error.hResult] Coded numerical value that is assigned to a + * specific exception + * @member {string} [error.stackTrace] Stack trace + */ +export interface MigrateSqlServerSqlMITaskOutputError extends MigrateSqlServerSqlMITaskOutput { + readonly error?: ReportableException; +} + +/** + * @class + * Initializes a new instance of the MigrateSqlServerSqlMITaskOutputLoginLevel class. + * @constructor + * @member {string} [loginName] Login name. + * @member {string} [state] Current state of login. Possible values include: + * 'None', 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', 'Stopped' + * @member {string} [stage] Current stage of login. Possible values include: + * 'None', 'Initialize', 'LoginMigration', 'EstablishUserMapping', + * 'AssignRoleMembership', 'AssignRoleOwnership', 'EstablishServerPermissions', + * 'EstablishObjectPermissions', 'Completed' + * @member {date} [startedOn] Login migration start time + * @member {date} [endedOn] Login migration end time + * @member {string} [message] Login migration progress message + * @member {array} [exceptionsAndWarnings] Login migration errors and warnings + * per login + */ +export interface MigrateSqlServerSqlMITaskOutputLoginLevel extends MigrateSqlServerSqlMITaskOutput { + readonly loginName?: string; + readonly state?: string; + readonly stage?: string; + readonly startedOn?: Date; + readonly endedOn?: Date; + readonly message?: string; + readonly exceptionsAndWarnings?: ReportableException[]; +} + +/** + * @class + * Initializes a new instance of the MigrateSqlServerSqlMITaskOutputAgentJobLevel class. + * @constructor + * @member {string} [name] Agent Job name. + * @member {boolean} [isEnabled] The state of the original Agent Job. + * @member {string} [state] Current state of migration. Possible values + * include: 'None', 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', + * 'Stopped' + * @member {date} [startedOn] Migration start time + * @member {date} [endedOn] Migration end time + * @member {string} [message] Migration progress message + * @member {array} [exceptionsAndWarnings] Migration errors and warnings per + * job + */ +export interface MigrateSqlServerSqlMITaskOutputAgentJobLevel extends MigrateSqlServerSqlMITaskOutput { + readonly name?: string; + readonly isEnabled?: boolean; + readonly state?: string; + readonly startedOn?: Date; + readonly endedOn?: Date; + readonly message?: string; + readonly exceptionsAndWarnings?: ReportableException[]; +} + +/** + * @class + * Initializes a new instance of the MigrateSqlServerSqlMITaskOutputDatabaseLevel class. + * @constructor + * @member {string} [databaseName] Name of the database + * @member {number} [sizeMB] Size of the database in megabytes + * @member {string} [state] Current state of migration. Possible values + * include: 'None', 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', + * 'Stopped' + * @member {string} [stage] Current stage of migration. Possible values + * include: 'None', 'Initialize', 'Backup', 'FileCopy', 'Restore', 'Completed' + * @member {date} [startedOn] Migration start time + * @member {date} [endedOn] Migration end time + * @member {string} [message] Migration progress message + * @member {array} [exceptionsAndWarnings] Migration exceptions and warnings + */ +export interface MigrateSqlServerSqlMITaskOutputDatabaseLevel extends MigrateSqlServerSqlMITaskOutput { + readonly databaseName?: string; + readonly sizeMB?: number; + readonly state?: string; + readonly stage?: string; + readonly startedOn?: Date; + readonly endedOn?: Date; + readonly message?: string; + readonly exceptionsAndWarnings?: ReportableException[]; +} + +/** + * @class + * Initializes a new instance of the StartMigrationScenarioServerRoleResult class. + * @constructor + * Server role migration result + * + * @member {string} [name] Name of server role. + * @member {string} [state] Current state of migration. Possible values + * include: 'None', 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', + * 'Stopped' + * @member {array} [exceptionsAndWarnings] Migration exceptions and warnings. + */ +export interface StartMigrationScenarioServerRoleResult { + readonly name?: string; + readonly state?: string; + readonly exceptionsAndWarnings?: ReportableException[]; +} + +/** + * @class + * Initializes a new instance of the MigrateSqlServerSqlMITaskOutputMigrationLevel class. + * @constructor + * @member {date} [startedOn] Migration start time + * @member {date} [endedOn] Migration end time + * @member {string} [status] Current status of migration. Possible values + * include: 'Default', 'Connecting', 'SourceAndTargetSelected', 'SelectLogins', + * 'Configured', 'Running', 'Error', 'Stopped', 'Completed', + * 'CompletedWithWarnings' + * @member {string} [state] Current state of migration. Possible values + * include: 'None', 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', + * 'Stopped' + * @member {object} [agentJobs] Selected agent jobs as a map from name to id + * @member {object} [logins] Selected logins as a map from name to id + * @member {string} [message] Migration progress message + * @member {object} [serverRoleResults] Map of server role migration results. + * @member {object} [orphanedUsers] Map of users to database name of orphaned + * users. + * @member {object} [databases] Selected databases as a map from database name + * to database id + * @member {string} [sourceServerVersion] Source server version + * @member {string} [sourceServerBrandVersion] Source server brand version + * @member {string} [targetServerVersion] Target server version + * @member {string} [targetServerBrandVersion] Target server brand version + * @member {array} [exceptionsAndWarnings] Migration exceptions and warnings. + */ +export interface MigrateSqlServerSqlMITaskOutputMigrationLevel extends MigrateSqlServerSqlMITaskOutput { + readonly startedOn?: Date; + readonly endedOn?: Date; + readonly status?: string; + readonly state?: string; + readonly agentJobs?: { [propertyName: string]: string }; + readonly logins?: { [propertyName: string]: string }; + readonly message?: string; + readonly serverRoleResults?: { [propertyName: string]: StartMigrationScenarioServerRoleResult }; + readonly orphanedUsers?: { [propertyName: string]: string }; + readonly databases?: { [propertyName: string]: string }; + readonly sourceServerVersion?: string; + readonly sourceServerBrandVersion?: string; + readonly targetServerVersion?: string; + readonly targetServerBrandVersion?: string; + readonly exceptionsAndWarnings?: ReportableException[]; +} + +/** + * @class + * Initializes a new instance of the MigrateSqlServerSqlMITaskInput class. + * @constructor + * Input for task that migrates SQL Server databases to Azure SQL Database + * Managed Instance. + * + * @member {array} selectedDatabases Databases to migrate + * @member {array} [selectedLogins] Logins to migrate. + * @member {array} [selectedAgentJobs] Agent Jobs to migrate. + * @member {object} [backupFileShare] Backup file share information for all + * selected databases. + * @member {string} [backupFileShare.userName] User name credential to connect + * to the share location + * @member {string} [backupFileShare.password] Password credential used to + * connect to the share location. + * @member {string} [backupFileShare.path] The folder path for this share. + * @member {object} backupBlobShare SAS URI of Azure Storage Account Container + * to be used for storing backup files. + * @member {string} [backupBlobShare.sasUri] SAS URI of Azure Storage Account + * Container. + * @member {string} [backupMode] Backup Mode to specify whether to use existing + * backup or create new backup. If using existing backups, backup file paths + * are required to be provided in selectedDatabases. Possible values include: + * 'CreateBackup', 'ExistingBackup' + */ +export interface MigrateSqlServerSqlMITaskInput extends SqlMigrationTaskInput { + selectedDatabases: MigrateSqlServerSqlMIDatabaseInput[]; + selectedLogins?: string[]; + selectedAgentJobs?: string[]; + backupFileShare?: FileShare; + backupBlobShare: BlobShare; + backupMode?: string; +} + +/** + * @class + * Initializes a new instance of the MigrateSqlServerSqlMITaskProperties class. + * @constructor + * Properties for task that migrates SQL Server databases to Azure SQL Database + * Managed Instance + * + * @member {object} [input] Task input + * @member {array} [input.selectedDatabases] Databases to migrate + * @member {array} [input.selectedLogins] Logins to migrate. + * @member {array} [input.selectedAgentJobs] Agent Jobs to migrate. + * @member {object} [input.backupFileShare] Backup file share information for + * all selected databases. + * @member {string} [input.backupFileShare.userName] User name credential to + * connect to the share location + * @member {string} [input.backupFileShare.password] Password credential used + * to connect to the share location. + * @member {string} [input.backupFileShare.path] The folder path for this + * share. + * @member {object} [input.backupBlobShare] SAS URI of Azure Storage Account + * Container to be used for storing backup files. + * @member {string} [input.backupBlobShare.sasUri] SAS URI of Azure Storage + * Account Container. + * @member {string} [input.backupMode] Backup Mode to specify whether to use + * existing backup or create new backup. If using existing backups, backup file + * paths are required to be provided in selectedDatabases. Possible values + * include: 'CreateBackup', 'ExistingBackup' + * @member {array} [output] Task output. This is ignored if submitted. + */ +export interface MigrateSqlServerSqlMITaskProperties extends ProjectTaskProperties { + input?: MigrateSqlServerSqlMITaskInput; + readonly output?: MigrateSqlServerSqlMITaskOutput[]; +} + +/** + * @class + * Initializes a new instance of the MigrateMongoDbTaskProperties class. + * @constructor + * Properties for the task that migrates data between MongoDB data sources + * + * @member {object} [input] + * @member {number} [input.boostRUs] The RU limit on a CosmosDB target that + * collections will be temporarily increased to (if lower) during the initial + * copy of a migration, from 10,000 to 1,000,000, or 0 to use the default boost + * (which is generally the maximum), or null to not boost the RUs. This setting + * has no effect on non-CosmosDB targets. + * @member {object} [input.databases] The databases on the source cluster to + * migrate to the target. The keys are the names of the databases. + * @member {string} [input.replication] Describes how changes will be + * replicated from the source to the target. The default is OneTime. Possible + * values include: 'Disabled', 'OneTime', 'Continuous' + * @member {object} [input.source] Settings used to connect to the source + * cluster + * @member {string} [input.source.connectionString] A MongoDB connection string + * or blob container URL. The user name and password can be specified here or + * in the userName and password properties + * @member {object} [input.target] Settings used to connect to the target + * cluster + * @member {string} [input.target.connectionString] A MongoDB connection string + * or blob container URL. The user name and password can be specified here or + * in the userName and password properties + * @member {object} [input.throttling] Settings used to limit the resource + * usage of the migration + * @member {number} [input.throttling.minFreeCpu] The percentage of CPU time + * that the migrator will try to avoid using, from 0 to 100 + * @member {number} [input.throttling.minFreeMemoryMb] The number of megabytes + * of RAM that the migrator will try to avoid using + * @member {number} [input.throttling.maxParallelism] The maximum number of + * work items (e.g. collection copies) that will be processed in parallel + * @member {array} [output] + */ +export interface MigrateMongoDbTaskProperties extends ProjectTaskProperties { + input?: MongoDbMigrationSettings; + readonly output?: MongoDbProgress[]; +} + +/** + * @class + * Initializes a new instance of the ConnectToTargetAzureDbForMySqlTaskOutput class. + * @constructor + * Output for the task that validates connection to Azure Database for MySQL + * and target server requirements + * + * @member {string} [id] Result identifier + * @member {string} [serverVersion] Version of the target server + * @member {array} [databases] List of databases on target server + * @member {string} [targetServerBrandVersion] Target server brand version + * @member {array} [validationErrors] Validation errors associated with the + * task + */ +export interface ConnectToTargetAzureDbForMySqlTaskOutput { + readonly id?: string; + readonly serverVersion?: string; + readonly databases?: string[]; + readonly targetServerBrandVersion?: string; + readonly validationErrors?: ReportableException[]; +} + +/** + * @class + * Initializes a new instance of the ConnectToTargetAzureDbForMySqlTaskInput class. + * @constructor + * Input for the task that validates connection to Azure Database for MySQL and + * target server requirements + * + * @member {object} sourceConnectionInfo Connection information for source + * MySQL server + * @member {string} [sourceConnectionInfo.serverName] Name of the server + * @member {number} [sourceConnectionInfo.port] Port for Server + * @member {object} targetConnectionInfo Connection information for target + * Azure Database for MySQL server + * @member {string} [targetConnectionInfo.serverName] Name of the server + * @member {number} [targetConnectionInfo.port] Port for Server + */ +export interface ConnectToTargetAzureDbForMySqlTaskInput { + sourceConnectionInfo: MySqlConnectionInfo; + targetConnectionInfo: MySqlConnectionInfo; +} + +/** + * @class + * Initializes a new instance of the ConnectToTargetAzureDbForMySqlTaskProperties class. + * @constructor + * Properties for the task that validates connection to Azure Database for + * MySQL and target server requirements + * + * @member {object} [input] Task input + * @member {object} [input.sourceConnectionInfo] Connection information for + * source MySQL server + * @member {string} [input.sourceConnectionInfo.serverName] Name of the server + * @member {number} [input.sourceConnectionInfo.port] Port for Server + * @member {object} [input.targetConnectionInfo] Connection information for + * target Azure Database for MySQL server + * @member {string} [input.targetConnectionInfo.serverName] Name of the server + * @member {number} [input.targetConnectionInfo.port] Port for Server + * @member {array} [output] Task output. This is ignored if submitted. + */ +export interface ConnectToTargetAzureDbForMySqlTaskProperties extends ProjectTaskProperties { + input?: ConnectToTargetAzureDbForMySqlTaskInput; + readonly output?: ConnectToTargetAzureDbForMySqlTaskOutput[]; +} + +/** + * @class + * Initializes a new instance of the ConnectToTargetSqlMITaskOutput class. + * @constructor + * Output for the task that validates connection to Azure SQL Database Managed + * Instance. + * + * @member {string} [id] Result identifier + * @member {string} [targetServerVersion] Target server version + * @member {string} [targetServerBrandVersion] Target server brand version + * @member {array} [logins] List of logins on the target server. + * @member {array} [agentJobs] List of agent jobs on the target server. + * @member {array} [validationErrors] Validation errors + */ +export interface ConnectToTargetSqlMITaskOutput { + readonly id?: string; + readonly targetServerVersion?: string; + readonly targetServerBrandVersion?: string; + readonly logins?: string[]; + readonly agentJobs?: string[]; + readonly validationErrors?: ReportableException[]; +} + +/** + * @class + * Initializes a new instance of the ConnectToTargetSqlMITaskInput class. + * @constructor + * Input for the task that validates connection to Azure SQL Database Managed + * Instance. + * + * @member {object} targetConnectionInfo Connection information for target SQL + * Server + * @member {string} [targetConnectionInfo.dataSource] Data source in the format + * Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [targetConnectionInfo.authentication] Authentication type + * to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [targetConnectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [targetConnectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [targetConnectionInfo.trustServerCertificate] Whether to + * trust the server certificate + * @member {string} [targetConnectionInfo.platform] Server platform type for + * connection. Possible values include: 'SqlOnPrem' + */ +export interface ConnectToTargetSqlMITaskInput { + targetConnectionInfo: SqlConnectionInfo; +} + +/** + * @class + * Initializes a new instance of the ConnectToTargetSqlMITaskProperties class. + * @constructor + * Properties for the task that validates connection to Azure SQL Database + * Managed Instance + * + * @member {object} [input] Task input + * @member {object} [input.targetConnectionInfo] Connection information for + * target SQL Server + * @member {string} [input.targetConnectionInfo.dataSource] Data source in the + * format Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [input.targetConnectionInfo.authentication] Authentication + * type to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [input.targetConnectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [input.targetConnectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [input.targetConnectionInfo.trustServerCertificate] + * Whether to trust the server certificate + * @member {string} [input.targetConnectionInfo.platform] Server platform type + * for connection. Possible values include: 'SqlOnPrem' + * @member {array} [output] Task output. This is ignored if submitted. + */ +export interface ConnectToTargetSqlMITaskProperties extends ProjectTaskProperties { + input?: ConnectToTargetSqlMITaskInput; + readonly output?: ConnectToTargetSqlMITaskOutput[]; +} + +/** + * @class + * Initializes a new instance of the DatabaseTable class. + * @constructor + * Table properties + * + * @member {boolean} [hasRows] Indicates whether table is empty or not + * @member {string} [name] Schema-qualified name of the table + */ +export interface DatabaseTable { + readonly hasRows?: boolean; + readonly name?: string; +} + +/** + * @class + * Initializes a new instance of the GetUserTablesSqlSyncTaskOutput class. + * @constructor + * Output of the task that collects user tables for the given list of databases + * + * @member {object} [databasesToSourceTables] Mapping from database name to + * list of source tables + * @member {object} [databasesToTargetTables] Mapping from database name to + * list of target tables + * @member {object} [tableValidationErrors] Mapping from database name to list + * of validation errors + * @member {array} [validationErrors] Validation errors + */ +export interface GetUserTablesSqlSyncTaskOutput { + readonly databasesToSourceTables?: { [propertyName: string]: DatabaseTable[] }; + readonly databasesToTargetTables?: { [propertyName: string]: DatabaseTable[] }; + readonly tableValidationErrors?: { [propertyName: string]: string[] }; + readonly validationErrors?: ReportableException[]; +} + +/** + * @class + * Initializes a new instance of the GetUserTablesSqlSyncTaskInput class. + * @constructor + * Input for the task that collects user tables for the given list of databases + * + * @member {object} sourceConnectionInfo Connection information for SQL Server + * @member {string} [sourceConnectionInfo.dataSource] Data source in the format + * Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [sourceConnectionInfo.authentication] Authentication type + * to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [sourceConnectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [sourceConnectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [sourceConnectionInfo.trustServerCertificate] Whether to + * trust the server certificate + * @member {string} [sourceConnectionInfo.platform] Server platform type for + * connection. Possible values include: 'SqlOnPrem' + * @member {object} targetConnectionInfo Connection information for SQL DB + * @member {string} [targetConnectionInfo.dataSource] Data source in the format + * Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [targetConnectionInfo.authentication] Authentication type + * to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [targetConnectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [targetConnectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [targetConnectionInfo.trustServerCertificate] Whether to + * trust the server certificate + * @member {string} [targetConnectionInfo.platform] Server platform type for + * connection. Possible values include: 'SqlOnPrem' + * @member {array} selectedSourceDatabases List of source database names to + * collect tables for + * @member {array} selectedTargetDatabases List of target database names to + * collect tables for + */ +export interface GetUserTablesSqlSyncTaskInput { + sourceConnectionInfo: SqlConnectionInfo; + targetConnectionInfo: SqlConnectionInfo; + selectedSourceDatabases: string[]; + selectedTargetDatabases: string[]; +} + +/** + * @class + * Initializes a new instance of the GetUserTablesSqlSyncTaskProperties class. + * @constructor + * Properties for the task that collects user tables for the given list of + * databases + * + * @member {object} [input] Task input + * @member {object} [input.sourceConnectionInfo] Connection information for SQL + * Server + * @member {string} [input.sourceConnectionInfo.dataSource] Data source in the + * format Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [input.sourceConnectionInfo.authentication] Authentication + * type to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [input.sourceConnectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [input.sourceConnectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [input.sourceConnectionInfo.trustServerCertificate] + * Whether to trust the server certificate + * @member {string} [input.sourceConnectionInfo.platform] Server platform type + * for connection. Possible values include: 'SqlOnPrem' + * @member {object} [input.targetConnectionInfo] Connection information for SQL + * DB + * @member {string} [input.targetConnectionInfo.dataSource] Data source in the + * format Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [input.targetConnectionInfo.authentication] Authentication + * type to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [input.targetConnectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [input.targetConnectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [input.targetConnectionInfo.trustServerCertificate] + * Whether to trust the server certificate + * @member {string} [input.targetConnectionInfo.platform] Server platform type + * for connection. Possible values include: 'SqlOnPrem' + * @member {array} [input.selectedSourceDatabases] List of source database + * names to collect tables for + * @member {array} [input.selectedTargetDatabases] List of target database + * names to collect tables for + * @member {array} [output] Task output. This is ignored if submitted. + */ +export interface GetUserTablesSqlSyncTaskProperties extends ProjectTaskProperties { + input?: GetUserTablesSqlSyncTaskInput; + readonly output?: GetUserTablesSqlSyncTaskOutput[]; +} + +/** + * @class + * Initializes a new instance of the GetUserTablesSqlTaskOutput class. + * @constructor + * Output of the task that collects user tables for the given list of databases + * + * @member {string} [id] Result identifier + * @member {object} [databasesToTables] Mapping from database name to list of + * tables + * @member {array} [validationErrors] Validation errors + */ +export interface GetUserTablesSqlTaskOutput { + readonly id?: string; + readonly databasesToTables?: { [propertyName: string]: DatabaseTable[] }; + readonly validationErrors?: ReportableException[]; +} + +/** + * @class + * Initializes a new instance of the GetUserTablesSqlTaskInput class. + * @constructor + * Input for the task that collects user tables for the given list of databases + * + * @member {object} connectionInfo Connection information for SQL Server + * @member {string} [connectionInfo.dataSource] Data source in the format + * Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [connectionInfo.authentication] Authentication type to use + * for connection. Possible values include: 'None', 'WindowsAuthentication', + * 'SqlAuthentication', 'ActiveDirectoryIntegrated', 'ActiveDirectoryPassword' + * @member {boolean} [connectionInfo.encryptConnection] Whether to encrypt the + * connection + * @member {string} [connectionInfo.additionalSettings] Additional connection + * settings + * @member {boolean} [connectionInfo.trustServerCertificate] Whether to trust + * the server certificate + * @member {string} [connectionInfo.platform] Server platform type for + * connection. Possible values include: 'SqlOnPrem' + * @member {array} selectedDatabases List of database names to collect tables + * for + */ +export interface GetUserTablesSqlTaskInput { + connectionInfo: SqlConnectionInfo; + selectedDatabases: string[]; +} + +/** + * @class + * Initializes a new instance of the GetUserTablesSqlTaskProperties class. + * @constructor + * Properties for the task that collects user tables for the given list of + * databases + * + * @member {object} [input] Task input + * @member {object} [input.connectionInfo] Connection information for SQL + * Server + * @member {string} [input.connectionInfo.dataSource] Data source in the format + * Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [input.connectionInfo.authentication] Authentication type + * to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [input.connectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [input.connectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [input.connectionInfo.trustServerCertificate] Whether to + * trust the server certificate + * @member {string} [input.connectionInfo.platform] Server platform type for + * connection. Possible values include: 'SqlOnPrem' + * @member {array} [input.selectedDatabases] List of database names to collect + * tables for + * @member {array} [output] Task output. This is ignored if submitted. + */ +export interface GetUserTablesSqlTaskProperties extends ProjectTaskProperties { + input?: GetUserTablesSqlTaskInput; + readonly output?: GetUserTablesSqlTaskOutput[]; +} + +/** + * @class + * Initializes a new instance of the ConnectToTargetSqlDbTaskOutput class. + * @constructor + * Output for the task that validates connection to SQL DB and target server + * requirements + * + * @member {string} [id] Result identifier + * @member {object} [databases] Source databases as a map from database name to + * database id + * @member {string} [targetServerVersion] Version of the target server + * @member {string} [targetServerBrandVersion] Target server brand version + */ +export interface ConnectToTargetSqlDbTaskOutput { + readonly id?: string; + readonly databases?: { [propertyName: string]: string }; + readonly targetServerVersion?: string; + readonly targetServerBrandVersion?: string; +} + +/** + * @class + * Initializes a new instance of the ConnectToTargetSqlSqlDbSyncTaskInput class. + * @constructor + * Input for the task that validates connection to Azure SQL DB and target + * server requirements + * + * @member {object} sourceConnectionInfo Connection information for source SQL + * Server + * @member {string} [sourceConnectionInfo.dataSource] Data source in the format + * Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [sourceConnectionInfo.authentication] Authentication type + * to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [sourceConnectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [sourceConnectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [sourceConnectionInfo.trustServerCertificate] Whether to + * trust the server certificate + * @member {string} [sourceConnectionInfo.platform] Server platform type for + * connection. Possible values include: 'SqlOnPrem' + * @member {object} targetConnectionInfo Connection information for target SQL + * DB + * @member {string} [targetConnectionInfo.dataSource] Data source in the format + * Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [targetConnectionInfo.authentication] Authentication type + * to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [targetConnectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [targetConnectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [targetConnectionInfo.trustServerCertificate] Whether to + * trust the server certificate + * @member {string} [targetConnectionInfo.platform] Server platform type for + * connection. Possible values include: 'SqlOnPrem' + */ +export interface ConnectToTargetSqlSqlDbSyncTaskInput { + sourceConnectionInfo: SqlConnectionInfo; + targetConnectionInfo: SqlConnectionInfo; +} + +/** + * @class + * Initializes a new instance of the ConnectToTargetSqlSqlDbSyncTaskProperties class. + * @constructor + * Properties for the task that validates connection to SQL DB and target + * server requirements for online migration + * + * @member {object} [input] Task input + * @member {object} [input.sourceConnectionInfo] Connection information for + * source SQL Server + * @member {string} [input.sourceConnectionInfo.dataSource] Data source in the + * format Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [input.sourceConnectionInfo.authentication] Authentication + * type to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [input.sourceConnectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [input.sourceConnectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [input.sourceConnectionInfo.trustServerCertificate] + * Whether to trust the server certificate + * @member {string} [input.sourceConnectionInfo.platform] Server platform type + * for connection. Possible values include: 'SqlOnPrem' + * @member {object} [input.targetConnectionInfo] Connection information for + * target SQL DB + * @member {string} [input.targetConnectionInfo.dataSource] Data source in the + * format Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [input.targetConnectionInfo.authentication] Authentication + * type to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [input.targetConnectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [input.targetConnectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [input.targetConnectionInfo.trustServerCertificate] + * Whether to trust the server certificate + * @member {string} [input.targetConnectionInfo.platform] Server platform type + * for connection. Possible values include: 'SqlOnPrem' + * @member {array} [output] Task output. This is ignored if submitted. + */ +export interface ConnectToTargetSqlSqlDbSyncTaskProperties extends ProjectTaskProperties { + input?: ConnectToTargetSqlSqlDbSyncTaskInput; + readonly output?: ConnectToTargetSqlDbTaskOutput[]; +} + +/** + * @class + * Initializes a new instance of the ConnectToTargetSqlDbTaskInput class. + * @constructor + * Input for the task that validates connection to SQL DB and target server + * requirements + * + * @member {object} targetConnectionInfo Connection information for target SQL + * DB + * @member {string} [targetConnectionInfo.dataSource] Data source in the format + * Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [targetConnectionInfo.authentication] Authentication type + * to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [targetConnectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [targetConnectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [targetConnectionInfo.trustServerCertificate] Whether to + * trust the server certificate + * @member {string} [targetConnectionInfo.platform] Server platform type for + * connection. Possible values include: 'SqlOnPrem' + */ +export interface ConnectToTargetSqlDbTaskInput { + targetConnectionInfo: SqlConnectionInfo; +} + +/** + * @class + * Initializes a new instance of the ConnectToTargetSqlDbTaskProperties class. + * @constructor + * Properties for the task that validates connection to SQL DB and target + * server requirements + * + * @member {object} [input] Task input + * @member {object} [input.targetConnectionInfo] Connection information for + * target SQL DB + * @member {string} [input.targetConnectionInfo.dataSource] Data source in the + * format Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [input.targetConnectionInfo.authentication] Authentication + * type to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [input.targetConnectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [input.targetConnectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [input.targetConnectionInfo.trustServerCertificate] + * Whether to trust the server certificate + * @member {string} [input.targetConnectionInfo.platform] Server platform type + * for connection. Possible values include: 'SqlOnPrem' + * @member {array} [output] Task output. This is ignored if submitted. + */ +export interface ConnectToTargetSqlDbTaskProperties extends ProjectTaskProperties { + input?: ConnectToTargetSqlDbTaskInput; + readonly output?: ConnectToTargetSqlDbTaskOutput[]; +} + +/** + * @class + * Initializes a new instance of the MigrationEligibilityInfo class. + * @constructor + * Information about migration eligibility of a server object + * + * @member {boolean} [isEligibileForMigration] Whether object is eligible for + * migration or not. + * @member {array} [validationMessages] Information about eligibility failure + * for the server object. + */ +export interface MigrationEligibilityInfo { + readonly isEligibileForMigration?: boolean; + readonly validationMessages?: string[]; +} + +/** + * @class + * Initializes a new instance of the ConnectToSourceSqlServerTaskOutput class. + * @constructor + * Output for the task that validates connection to SQL Server and also + * validates source server requirements + * + * @member {string} [id] Result identifier + * @member {string} resultType Polymorphic Discriminator + */ +export interface ConnectToSourceSqlServerTaskOutput { + readonly id?: string; + resultType: string; +} + +/** + * @class + * Initializes a new instance of the ConnectToSourceSqlServerTaskOutputAgentJobLevel class. + * @constructor + * Agent Job level output for the task that validates connection to SQL Server + * and also validates source server requirements + * + * @member {string} [name] Agent Job name + * @member {string} [jobCategory] The type of Agent Job. + * @member {boolean} [isEnabled] The state of the original Agent Job. + * @member {string} [jobOwner] The owner of the Agent Job + * @member {date} [lastExecutedOn] UTC Date and time when the Agent Job was + * last executed. + * @member {array} [validationErrors] Validation errors + * @member {object} [migrationEligibility] Information about eligiblity of + * agent job for migration. + * @member {boolean} [migrationEligibility.isEligibileForMigration] Whether + * object is eligible for migration or not. + * @member {array} [migrationEligibility.validationMessages] Information about + * eligibility failure for the server object. + */ +export interface ConnectToSourceSqlServerTaskOutputAgentJobLevel extends ConnectToSourceSqlServerTaskOutput { + readonly name?: string; + readonly jobCategory?: string; + readonly isEnabled?: boolean; + readonly jobOwner?: string; + readonly lastExecutedOn?: Date; + readonly validationErrors?: ReportableException[]; + readonly migrationEligibility?: MigrationEligibilityInfo; +} + +/** + * @class + * Initializes a new instance of the ConnectToSourceSqlServerTaskOutputLoginLevel class. + * @constructor + * Login level output for the task that validates connection to SQL Server and + * also validates source server requirements + * + * @member {string} [name] Login name. + * @member {string} [loginType] The type of login. Possible values include: + * 'WindowsUser', 'WindowsGroup', 'SqlLogin', 'Certificate', 'AsymmetricKey', + * 'ExternalUser', 'ExternalGroup' + * @member {string} [defaultDatabase] The default database for the login. + * @member {boolean} [isEnabled] The state of the login. + * @member {object} [migrationEligibility] Information about eligiblity of + * login for migration. + * @member {boolean} [migrationEligibility.isEligibileForMigration] Whether + * object is eligible for migration or not. + * @member {array} [migrationEligibility.validationMessages] Information about + * eligibility failure for the server object. + */ +export interface ConnectToSourceSqlServerTaskOutputLoginLevel extends ConnectToSourceSqlServerTaskOutput { + readonly name?: string; + readonly loginType?: string; + readonly defaultDatabase?: string; + readonly isEnabled?: boolean; + readonly migrationEligibility?: MigrationEligibilityInfo; +} + +/** + * @class + * Initializes a new instance of the DatabaseFileInfo class. + * @constructor + * Database file specific information + * + * @member {string} [databaseName] Name of the database + * @member {string} [id] Unique identifier for database file + * @member {string} [logicalName] Logical name of the file + * @member {string} [physicalFullName] Operating-system full path of the file + * @member {string} [restoreFullName] Suggested full path of the file for + * restoring + * @member {string} [fileType] Database file type. Possible values include: + * 'Rows', 'Log', 'Filestream', 'NotSupported', 'Fulltext' + * @member {number} [sizeMB] Size of the file in megabytes + */ +export interface DatabaseFileInfo { + databaseName?: string; + id?: string; + logicalName?: string; + physicalFullName?: string; + restoreFullName?: string; + fileType?: string; + sizeMB?: number; +} + +/** + * @class + * Initializes a new instance of the ConnectToSourceSqlServerTaskOutputDatabaseLevel class. + * @constructor + * Database level output for the task that validates connection to SQL Server + * and also validates source server requirements + * + * @member {string} [name] Database name + * @member {number} [sizeMB] Size of the file in megabytes + * @member {array} [databaseFiles] The list of database files + * @member {string} [compatibilityLevel] SQL Server compatibility level of + * database. Possible values include: 'CompatLevel80', 'CompatLevel90', + * 'CompatLevel100', 'CompatLevel110', 'CompatLevel120', 'CompatLevel130', + * 'CompatLevel140' + * @member {string} [databaseState] State of the database. Possible values + * include: 'Online', 'Restoring', 'Recovering', 'RecoveryPending', 'Suspect', + * 'Emergency', 'Offline', 'Copying', 'OfflineSecondary' + */ +export interface ConnectToSourceSqlServerTaskOutputDatabaseLevel extends ConnectToSourceSqlServerTaskOutput { + readonly name?: string; + readonly sizeMB?: number; + readonly databaseFiles?: DatabaseFileInfo[]; + readonly compatibilityLevel?: string; + readonly databaseState?: string; +} + +/** + * @class + * Initializes a new instance of the ConnectToSourceSqlServerTaskOutputTaskLevel class. + * @constructor + * Task level output for the task that validates connection to SQL Server and + * also validates source server requirements + * + * @member {object} [databases] Source databases as a map from database name to + * database id + * @member {object} [logins] Source logins as a map from login name to login + * id. + * @member {object} [agentJobs] Source agent jobs as a map from agent job name + * to id. + * @member {object} [databaseTdeCertificateMapping] Mapping from database name + * to TDE certificate name, if applicable + * @member {string} [sourceServerVersion] Source server version + * @member {string} [sourceServerBrandVersion] Source server brand version + * @member {array} [validationErrors] Validation errors + */ +export interface ConnectToSourceSqlServerTaskOutputTaskLevel extends ConnectToSourceSqlServerTaskOutput { + readonly databases?: { [propertyName: string]: string }; + readonly logins?: { [propertyName: string]: string }; + readonly agentJobs?: { [propertyName: string]: string }; + readonly databaseTdeCertificateMapping?: { [propertyName: string]: string }; + readonly sourceServerVersion?: string; + readonly sourceServerBrandVersion?: string; + readonly validationErrors?: ReportableException[]; +} + +/** + * @class + * Initializes a new instance of the ConnectToSourceSqlServerTaskInput class. + * @constructor + * Input for the task that validates connection to SQL Server and also + * validates source server requirements + * + * @member {object} sourceConnectionInfo Connection information for Source SQL + * Server + * @member {string} [sourceConnectionInfo.dataSource] Data source in the format + * Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [sourceConnectionInfo.authentication] Authentication type + * to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [sourceConnectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [sourceConnectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [sourceConnectionInfo.trustServerCertificate] Whether to + * trust the server certificate + * @member {string} [sourceConnectionInfo.platform] Server platform type for + * connection. Possible values include: 'SqlOnPrem' + * @member {string} [checkPermissionsGroup] Permission group for validations. + * Possible values include: 'Default', 'MigrationFromSqlServerToAzureDB', + * 'MigrationFromSqlServerToAzureMI', 'MigrationFromMySQLToAzureDBForMySQL' + * @member {boolean} [collectLogins] Flag for whether to collect logins from + * source server. Default value: false . + * @member {boolean} [collectAgentJobs] Flag for whether to collect agent jobs + * from source server. Default value: false . + * @member {boolean} [collectTdeCertificateInfo] Flag for whether to collect + * TDE Certificate names from source server. Default value: false . + */ +export interface ConnectToSourceSqlServerTaskInput { + sourceConnectionInfo: SqlConnectionInfo; + checkPermissionsGroup?: string; + collectLogins?: boolean; + collectAgentJobs?: boolean; + collectTdeCertificateInfo?: boolean; +} + +/** + * @class + * Initializes a new instance of the ConnectToSourceSqlServerSyncTaskProperties class. + * @constructor + * Properties for the task that validates connection to SQL Server and source + * server requirements for online migration + * + * @member {object} [input] Task input + * @member {object} [input.sourceConnectionInfo] Connection information for + * Source SQL Server + * @member {string} [input.sourceConnectionInfo.dataSource] Data source in the + * format Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [input.sourceConnectionInfo.authentication] Authentication + * type to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [input.sourceConnectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [input.sourceConnectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [input.sourceConnectionInfo.trustServerCertificate] + * Whether to trust the server certificate + * @member {string} [input.sourceConnectionInfo.platform] Server platform type + * for connection. Possible values include: 'SqlOnPrem' + * @member {string} [input.checkPermissionsGroup] Permission group for + * validations. Possible values include: 'Default', + * 'MigrationFromSqlServerToAzureDB', 'MigrationFromSqlServerToAzureMI', + * 'MigrationFromMySQLToAzureDBForMySQL' + * @member {boolean} [input.collectLogins] Flag for whether to collect logins + * from source server. + * @member {boolean} [input.collectAgentJobs] Flag for whether to collect agent + * jobs from source server. + * @member {boolean} [input.collectTdeCertificateInfo] Flag for whether to + * collect TDE Certificate names from source server. + * @member {array} [output] Task output. This is ignored if submitted. + */ +export interface ConnectToSourceSqlServerSyncTaskProperties extends ProjectTaskProperties { + input?: ConnectToSourceSqlServerTaskInput; + readonly output?: ConnectToSourceSqlServerTaskOutput[]; +} + +/** + * @class + * Initializes a new instance of the ConnectToSourceSqlServerTaskProperties class. + * @constructor + * Properties for the task that validates connection to SQL Server and also + * validates source server requirements + * + * @member {object} [input] Task input + * @member {object} [input.sourceConnectionInfo] Connection information for + * Source SQL Server + * @member {string} [input.sourceConnectionInfo.dataSource] Data source in the + * format Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [input.sourceConnectionInfo.authentication] Authentication + * type to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [input.sourceConnectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [input.sourceConnectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [input.sourceConnectionInfo.trustServerCertificate] + * Whether to trust the server certificate + * @member {string} [input.sourceConnectionInfo.platform] Server platform type + * for connection. Possible values include: 'SqlOnPrem' + * @member {string} [input.checkPermissionsGroup] Permission group for + * validations. Possible values include: 'Default', + * 'MigrationFromSqlServerToAzureDB', 'MigrationFromSqlServerToAzureMI', + * 'MigrationFromMySQLToAzureDBForMySQL' + * @member {boolean} [input.collectLogins] Flag for whether to collect logins + * from source server. + * @member {boolean} [input.collectAgentJobs] Flag for whether to collect agent + * jobs from source server. + * @member {boolean} [input.collectTdeCertificateInfo] Flag for whether to + * collect TDE Certificate names from source server. + * @member {array} [output] Task output. This is ignored if submitted. + */ +export interface ConnectToSourceSqlServerTaskProperties extends ProjectTaskProperties { + input?: ConnectToSourceSqlServerTaskInput; + readonly output?: ConnectToSourceSqlServerTaskOutput[]; +} + +/** + * @class + * Initializes a new instance of the MongoDbShardKeyInfo class. + * @constructor + * Describes a MongoDB shard key + * + * @member {array} fields The fields within the shard key + * @member {boolean} isUnique Whether the shard key is unique + */ +export interface MongoDbShardKeyInfo { + fields: MongoDbShardKeyField[]; + isUnique: boolean; +} + +/** + * @class + * Initializes a new instance of the MongoDbObjectInfo class. + * @constructor + * Describes a database or collection within a MongoDB data source + * + * @member {number} averageDocumentSize The average document size, or -1 if the + * average size is unknown + * @member {number} dataSize The estimated total data size, in bytes, or -1 if + * the size is unknown. + * @member {number} documentCount The estimated total number of documents, or + * -1 if the document count is unknown + * @member {string} name The unqualified name of the database or collection + * @member {string} qualifiedName The qualified name of the database or + * collection. For a collection, this is the database-qualified name. + */ +export interface MongoDbObjectInfo { + averageDocumentSize: number; + dataSize: number; + documentCount: number; + name: string; + qualifiedName: string; +} + +/** + * @class + * Initializes a new instance of the MongoDbCollectionInfo class. + * @constructor + * Describes a supported collection within a MongoDB database + * + * @member {string} databaseName The name of the database containing the + * collection + * @member {boolean} isCapped Whether the collection is a capped collection + * (i.e. whether it has a fixed size and acts like a circular buffer) + * @member {boolean} isSystemCollection Whether the collection is system + * collection + * @member {boolean} isView Whether the collection is a view of another + * collection + * @member {object} [shardKey] The shard key on the collection, or null if the + * collection is not sharded + * @member {array} [shardKey.fields] The fields within the shard key + * @member {boolean} [shardKey.isUnique] Whether the shard key is unique + * @member {boolean} supportsSharding Whether the database has sharding + * enabled. Note that the migration task will enable sharding on the target if + * necessary. + * @member {string} [viewOf] The name of the collection that this is a view of, + * if IsView is true + */ +export interface MongoDbCollectionInfo extends MongoDbObjectInfo { + databaseName: string; + isCapped: boolean; + isSystemCollection: boolean; + isView: boolean; + shardKey?: MongoDbShardKeyInfo; + supportsSharding: boolean; + viewOf?: string; +} + +/** + * @class + * Initializes a new instance of the MongoDbDatabaseInfo class. + * @constructor + * Describes a database within a MongoDB data source + * + * @member {array} collections A list of supported collections in a MongoDB + * database + * @member {boolean} supportsSharding Whether the database has sharding + * enabled. Note that the migration task will enable sharding on the target if + * necessary. + */ +export interface MongoDbDatabaseInfo extends MongoDbObjectInfo { + collections: MongoDbCollectionInfo[]; + supportsSharding: boolean; +} + +/** + * @class + * Initializes a new instance of the MongoDbClusterInfo class. + * @constructor + * Describes a MongoDB data source + * + * @member {array} databases A list of non-system databases in the cluster + * @member {boolean} supportsSharding Whether the cluster supports sharded + * collections + * @member {string} type The type of data source. Possible values include: + * 'BlobContainer', 'CosmosDb', 'MongoDb' + * @member {string} version The version of the data source in the form x.y.z + * (e.g. 3.6.7). Not used if Type is BlobContainer. + */ +export interface MongoDbClusterInfo { + databases: MongoDbDatabaseInfo[]; + supportsSharding: boolean; + type: string; + version: string; +} + +/** + * @class + * Initializes a new instance of the ConnectToMongoDbTaskProperties class. + * @constructor + * Properties for the task that validates the connection to and provides + * information about a MongoDB server + * + * @member {object} [input] + * @member {string} [input.connectionString] A MongoDB connection string or + * blob container URL. The user name and password can be specified here or in + * the userName and password properties + * @member {array} [output] An array containing a single MongoDbClusterInfo + * object + */ +export interface ConnectToMongoDbTaskProperties extends ProjectTaskProperties { + input?: MongoDbConnectionInfo; + readonly output?: MongoDbClusterInfo[]; +} + +/** + * @class + * Initializes a new instance of the ProjectTask class. + * @constructor + * A task resource + * + * @member {string} [etag] HTTP strong entity tag value. This is ignored if + * submitted. + * @member {object} [properties] Custom task properties + * @member {array} [properties.errors] Array of errors. This is ignored if + * submitted. + * @member {string} [properties.state] The state of the task. This is ignored + * if submitted. Possible values include: 'Unknown', 'Queued', 'Running', + * 'Canceled', 'Succeeded', 'Failed', 'FailedInputValidation', 'Faulted' + * @member {array} [properties.commands] Array of command properties. + * @member {string} [properties.taskType] Polymorphic Discriminator + */ +export interface ProjectTask extends Resource { + etag?: string; + properties?: ProjectTaskProperties; +} + +/** + * @class + * Initializes a new instance of the ServiceSku class. + * @constructor + * An Azure SKU instance + * + * @member {string} [name] The unique name of the SKU, such as 'P3' + * @member {string} [tier] The tier of the SKU, such as 'Basic', 'General + * Purpose', or 'Business Critical' + * @member {string} [family] The SKU family, used when the service has multiple + * performance classes within a tier, such as 'A', 'D', etc. for virtual + * machines + * @member {string} [size] The size of the SKU, used when the name alone does + * not denote a service size or when a SKU has multiple performance classes + * within a family, e.g. 'A1' for virtual machines + * @member {number} [capacity] The capacity of the SKU, if it supports scaling + */ +export interface ServiceSku { + name?: string; + tier?: string; + family?: string; + size?: string; + capacity?: number; +} + +/** + * @class + * Initializes a new instance of the DataMigrationService class. + * @constructor + * A Database Migration Service resource + * + * @member {string} [etag] HTTP strong entity tag value. Ignored if submitted + * @member {string} [kind] The resource kind. Only 'vm' (the default) is + * supported. + * @member {string} [provisioningState] The resource's provisioning state. + * Possible values include: 'Accepted', 'Deleting', 'Deploying', 'Stopped', + * 'Stopping', 'Starting', 'FailedToStart', 'FailedToStop', 'Succeeded', + * 'Failed' + * @member {string} [publicKey] The public key of the service, used to encrypt + * secrets sent to the service + * @member {string} virtualSubnetId The ID of the + * Microsoft.Network/virtualNetworks/subnets resource to which the service + * should be joined + * @member {object} [sku] Service SKU + * @member {string} [sku.name] The unique name of the SKU, such as 'P3' + * @member {string} [sku.tier] The tier of the SKU, such as 'Basic', 'General + * Purpose', or 'Business Critical' + * @member {string} [sku.family] The SKU family, used when the service has + * multiple performance classes within a tier, such as 'A', 'D', etc. for + * virtual machines + * @member {string} [sku.size] The size of the SKU, used when the name alone + * does not denote a service size or when a SKU has multiple performance + * classes within a family, e.g. 'A1' for virtual machines + * @member {number} [sku.capacity] The capacity of the SKU, if it supports + * scaling + */ +export interface DataMigrationService extends TrackedResource { + etag?: string; + kind?: string; + readonly provisioningState?: string; + publicKey?: string; + virtualSubnetId: string; + sku?: ServiceSku; +} + +/** + * @class + * Initializes a new instance of the NameAvailabilityRequest class. + * @constructor + * A resource type and proposed name + * + * @member {string} [name] The proposed resource name + * @member {string} [type] The resource type chain (e.g. + * virtualMachines/extensions) + */ +export interface NameAvailabilityRequest { + name?: string; + type?: string; +} + +/** + * @class + * Initializes a new instance of the DatabaseInfo class. + * @constructor + * Project Database Details + * + * @member {string} sourceDatabaseName Name of the database + */ +export interface DatabaseInfo { + sourceDatabaseName: string; +} + +/** + * @class + * Initializes a new instance of the Project class. + * @constructor + * A project resource + * + * @member {string} sourcePlatform Source platform for the project. Possible + * values include: 'SQL', 'MySQL', 'PostgreSql', 'MongoDb', 'Unknown' + * @member {string} targetPlatform Target platform for the project. Possible + * values include: 'SQLDB', 'SQLMI', 'AzureDbForMySql', 'AzureDbForPostgreSql', + * 'MongoDb', 'Unknown' + * @member {date} [creationTime] UTC Date and time when project was created + * @member {object} [sourceConnectionInfo] Information for connecting to source + * @member {string} [sourceConnectionInfo.userName] User name + * @member {string} [sourceConnectionInfo.password] Password credential. + * @member {string} [sourceConnectionInfo.type] Polymorphic Discriminator + * @member {object} [targetConnectionInfo] Information for connecting to target + * @member {string} [targetConnectionInfo.userName] User name + * @member {string} [targetConnectionInfo.password] Password credential. + * @member {string} [targetConnectionInfo.type] Polymorphic Discriminator + * @member {array} [databasesInfo] List of DatabaseInfo + * @member {string} [provisioningState] The project's provisioning state. + * Possible values include: 'Deleting', 'Succeeded' + */ +export interface Project extends TrackedResource { + sourcePlatform: string; + targetPlatform: string; + readonly creationTime?: Date; + sourceConnectionInfo?: ConnectionInfo; + targetConnectionInfo?: ConnectionInfo; + databasesInfo?: DatabaseInfo[]; + readonly provisioningState?: string; +} + +/** + * @class + * Initializes a new instance of the ApiError class. + * @constructor + * Error information. + * + * @member {object} [error] Error information in OData format + * @member {string} [error.code] The machine-readable description of the error, + * such as 'InvalidRequest' or 'InternalServerError' + * @member {string} [error.message] The human-readable description of the error + * @member {array} [error.details] Inner errors that caused this error + */ +export interface ApiError { + error?: ODataError; +} + +/** + * @class + * Initializes a new instance of the FileStorageInfo class. + * @constructor + * File storage information. + * + * @member {string} [uri] A URI that can be used to access the file content. + * @member {object} [headers] + */ +export interface FileStorageInfo { + uri?: string; + headers?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the ServiceOperationDisplay class. + * @constructor + * Localized display text + * + * @member {string} [provider] The localized resource provider name + * @member {string} [resource] The localized resource type name + * @member {string} [operation] The localized operation name + * @member {string} [description] The localized operation description + */ +export interface ServiceOperationDisplay { + provider?: string; + resource?: string; + operation?: string; + description?: string; +} + +/** + * @class + * Initializes a new instance of the ServiceOperation class. + * @constructor + * Description of an action supported by the Database Migration Service + * + * @member {string} [name] The fully qualified action name, e.g. + * Microsoft.DataMigration/services/read + * @member {object} [display] Localized display text + * @member {string} [display.provider] The localized resource provider name + * @member {string} [display.resource] The localized resource type name + * @member {string} [display.operation] The localized operation name + * @member {string} [display.description] The localized operation description + */ +export interface ServiceOperation { + name?: string; + display?: ServiceOperationDisplay; +} + +/** + * @class + * Initializes a new instance of the QuotaName class. + * @constructor + * The name of the quota + * + * @member {string} [localizedValue] The localized name of the quota + * @member {string} [value] The unlocalized name (or ID) of the quota + */ +export interface QuotaName { + localizedValue?: string; + value?: string; +} + +/** + * @class + * Initializes a new instance of the Quota class. + * @constructor + * Describes a quota for or usage details about a resource + * + * @member {number} [currentValue] The current value of the quota. If null or + * missing, the current value cannot be determined in the context of the + * request. + * @member {string} [id] The resource ID of the quota object + * @member {number} [limit] The maximum value of the quota. If null or missing, + * the quota has no maximum, in which case it merely tracks usage. + * @member {object} [name] The name of the quota + * @member {string} [name.localizedValue] The localized name of the quota + * @member {string} [name.value] The unlocalized name (or ID) of the quota + * @member {string} [unit] The unit for the quota, such as Count, Bytes, + * BytesPerSecond, etc. + */ +export interface Quota { + currentValue?: number; + id?: string; + limit?: number; + name?: QuotaName; + unit?: string; +} + +/** + * @class + * Initializes a new instance of the NameAvailabilityResponse class. + * @constructor + * Indicates whether a proposed resource name is available + * + * @member {boolean} [nameAvailable] If true, the name is valid and available. + * If false, 'reason' describes why not. + * @member {string} [reason] The reason why the name is not available, if + * nameAvailable is false. Possible values include: 'AlreadyExists', 'Invalid' + * @member {string} [message] The localized reason why the name is not + * available, if nameAvailable is false + */ +export interface NameAvailabilityResponse { + nameAvailable?: boolean; + reason?: string; + message?: string; +} + +/** + * @class + * Initializes a new instance of the AvailableServiceSkuSku class. + * @constructor + * SKU name, tier, etc. + * + * @member {string} [name] The name of the SKU + * @member {string} [family] SKU family + * @member {string} [size] SKU size + * @member {string} [tier] The tier of the SKU, such as "Basic", "General + * Purpose", or "Business Critical" + */ +export interface AvailableServiceSkuSku { + name?: string; + family?: string; + size?: string; + tier?: string; +} + +/** + * @class + * Initializes a new instance of the AvailableServiceSkuCapacity class. + * @constructor + * A description of the scaling capacities of the SKU + * + * @member {number} [minimum] The minimum capacity, usually 0 or 1. + * @member {number} [maximum] The maximum capacity + * @member {number} [default] The default capacity + * @member {string} [scaleType] The scalability approach. Possible values + * include: 'none', 'manual', 'automatic' + */ +export interface AvailableServiceSkuCapacity { + minimum?: number; + maximum?: number; + default?: number; + scaleType?: string; +} + +/** + * @class + * Initializes a new instance of the AvailableServiceSku class. + * @constructor + * Describes the available service SKU. + * + * @member {string} [resourceType] The resource type, including the provider + * namespace + * @member {object} [sku] SKU name, tier, etc. + * @member {string} [sku.name] The name of the SKU + * @member {string} [sku.family] SKU family + * @member {string} [sku.size] SKU size + * @member {string} [sku.tier] The tier of the SKU, such as "Basic", "General + * Purpose", or "Business Critical" + * @member {object} [capacity] A description of the scaling capacities of the + * SKU + * @member {number} [capacity.minimum] The minimum capacity, usually 0 or 1. + * @member {number} [capacity.maximum] The maximum capacity + * @member {number} [capacity.default] The default capacity + * @member {string} [capacity.scaleType] The scalability approach. Possible + * values include: 'none', 'manual', 'automatic' + */ +export interface AvailableServiceSku { + resourceType?: string; + sku?: AvailableServiceSkuSku; + capacity?: AvailableServiceSkuCapacity; +} + +/** + * @class + * Initializes a new instance of the DataMigrationServiceStatusResponse class. + * @constructor + * Service health status + * + * @member {string} [agentVersion] The DMS instance agent version + * @member {string} [status] The machine-readable status, such as + * 'Initializing', 'Offline', 'Online', 'Deploying', 'Deleting', 'Stopped', + * 'Stopping', 'Starting', 'FailedToStart', 'FailedToStop' or 'Failed' + * @member {string} [vmSize] The services virtual machine size, such as + * 'Standard_D2_v2' + * @member {array} [supportedTaskTypes] The list of supported task types + */ +export interface DataMigrationServiceStatusResponse { + agentVersion?: string; + status?: string; + vmSize?: string; + supportedTaskTypes?: string[]; +} + +/** + * @class + * Initializes a new instance of the ResourceSkuRestrictions class. + * @constructor + * Describes scaling information of a SKU. + * + * @member {string} [type] The type of restrictions. Possible values include: + * 'location' + * @member {array} [values] The value of restrictions. If the restriction type + * is set to location. This would be different locations where the SKU is + * restricted. + * @member {string} [reasonCode] The reason code for restriction. Possible + * values include: 'QuotaId', 'NotAvailableForSubscription' + */ +export interface ResourceSkuRestrictions { + readonly type?: string; + readonly values?: string[]; + readonly reasonCode?: string; +} + +/** + * @class + * Initializes a new instance of the ResourceSkuCapabilities class. + * @constructor + * Describes The SKU capabilites object. + * + * @member {string} [name] An invariant to describe the feature. + * @member {string} [value] An invariant if the feature is measured by + * quantity. + */ +export interface ResourceSkuCapabilities { + readonly name?: string; + readonly value?: string; +} + +/** + * @class + * Initializes a new instance of the ResourceSkuCosts class. + * @constructor + * Describes metadata for retrieving price info. + * + * @member {string} [meterID] Used for querying price from commerce. + * @member {number} [quantity] The multiplier is needed to extend the base + * metered cost. + * @member {string} [extendedUnit] An invariant to show the extended unit. + */ +export interface ResourceSkuCosts { + readonly meterID?: string; + readonly quantity?: number; + readonly extendedUnit?: string; +} + +/** + * @class + * Initializes a new instance of the ResourceSkuCapacity class. + * @constructor + * Describes scaling information of a SKU. + * + * @member {number} [minimum] The minimum capacity. + * @member {number} [maximum] The maximum capacity. + * @member {number} [default] The default capacity. + * @member {string} [scaleType] The scale type applicable to the SKU. Possible + * values include: 'Automatic', 'Manual', 'None' + */ +export interface ResourceSkuCapacity { + readonly minimum?: number; + readonly maximum?: number; + readonly default?: number; + readonly scaleType?: string; +} + +/** + * @class + * Initializes a new instance of the ResourceSku class. + * @constructor + * Describes an available DMS SKU. + * + * @member {string} [resourceType] The type of resource the SKU applies to. + * @member {string} [name] The name of SKU. + * @member {string} [tier] Specifies the tier of DMS in a scale set. + * @member {string} [size] The Size of the SKU. + * @member {string} [family] The Family of this particular SKU. + * @member {string} [kind] The Kind of resources that are supported in this + * SKU. + * @member {object} [capacity] Not used. + * @member {number} [capacity.minimum] The minimum capacity. + * @member {number} [capacity.maximum] The maximum capacity. + * @member {number} [capacity.default] The default capacity. + * @member {string} [capacity.scaleType] The scale type applicable to the SKU. + * Possible values include: 'Automatic', 'Manual', 'None' + * @member {array} [locations] The set of locations that the SKU is available. + * @member {array} [apiVersions] The api versions that support this SKU. + * @member {array} [costs] Metadata for retrieving price info. + * @member {array} [capabilities] A name value pair to describe the capability. + * @member {array} [restrictions] The restrictions because of which SKU cannot + * be used. This is empty if there are no restrictions. + */ +export interface ResourceSku { + readonly resourceType?: string; + readonly name?: string; + readonly tier?: string; + readonly size?: string; + readonly family?: string; + readonly kind?: string; + readonly capacity?: ResourceSkuCapacity; + readonly locations?: string[]; + readonly apiVersions?: string[]; + readonly costs?: ResourceSkuCosts[]; + readonly capabilities?: ResourceSkuCapabilities[]; + readonly restrictions?: ResourceSkuRestrictions[]; +} + +/** + * @class + * Initializes a new instance of the ConnectToSourceMySqlTaskInput class. + * @constructor + * Input for the task that validates MySQL database connection + * + * @member {object} sourceConnectionInfo Information for connecting to MySQL + * source + * @member {string} [sourceConnectionInfo.serverName] Name of the server + * @member {number} [sourceConnectionInfo.port] Port for Server + * @member {string} [targetPlatform] Target Platform for the migration. + * Possible values include: 'AzureDbForMySQL' + * @member {string} [checkPermissionsGroup] Permission group for validations. + * Possible values include: 'Default', 'MigrationFromSqlServerToAzureDB', + * 'MigrationFromSqlServerToAzureMI', 'MigrationFromMySQLToAzureDBForMySQL' + */ +export interface ConnectToSourceMySqlTaskInput { + sourceConnectionInfo: MySqlConnectionInfo; + targetPlatform?: string; + checkPermissionsGroup?: string; +} + +/** + * @class + * Initializes a new instance of the ServerProperties class. + * @constructor + * Server properties for Oracle, MySQL type source + * + * @member {string} [serverPlatform] Name of the server platform + * @member {string} [serverName] Name of the server + * @member {string} [serverVersion] Version of the database server + * @member {string} [serverEdition] Edition of the database server + * @member {string} [serverOperatingSystemVersion] Version of the operating + * system + * @member {number} [serverDatabaseCount] Number of databases in the server + */ +export interface ServerProperties { + readonly serverPlatform?: string; + readonly serverName?: string; + readonly serverVersion?: string; + readonly serverEdition?: string; + readonly serverOperatingSystemVersion?: string; + readonly serverDatabaseCount?: number; +} + +/** + * @class + * Initializes a new instance of the ConnectToSourceNonSqlTaskOutput class. + * @constructor + * Output for connect to Oracle, MySQL type source + * + * @member {string} [id] Result identifier + * @member {string} [sourceServerBrandVersion] Server brand version + * @member {object} [serverProperties] Server properties + * @member {string} [serverProperties.serverPlatform] Name of the server + * platform + * @member {string} [serverProperties.serverName] Name of the server + * @member {string} [serverProperties.serverVersion] Version of the database + * server + * @member {string} [serverProperties.serverEdition] Edition of the database + * server + * @member {string} [serverProperties.serverOperatingSystemVersion] Version of + * the operating system + * @member {number} [serverProperties.serverDatabaseCount] Number of databases + * in the server + * @member {array} [databases] List of databases on the server + * @member {array} [validationErrors] Validation errors associated with the + * task + */ +export interface ConnectToSourceNonSqlTaskOutput { + readonly id?: string; + readonly sourceServerBrandVersion?: string; + readonly serverProperties?: ServerProperties; + readonly databases?: string[]; + readonly validationErrors?: ReportableException[]; +} + +/** + * @class + * Initializes a new instance of the ConnectToSourceMySqlTaskProperties class. + * @constructor + * Properties for the task that validates MySQL database connection + * + * @member {object} [input] Task input + * @member {object} [input.sourceConnectionInfo] Information for connecting to + * MySQL source + * @member {string} [input.sourceConnectionInfo.serverName] Name of the server + * @member {number} [input.sourceConnectionInfo.port] Port for Server + * @member {string} [input.targetPlatform] Target Platform for the migration. + * Possible values include: 'AzureDbForMySQL' + * @member {string} [input.checkPermissionsGroup] Permission group for + * validations. Possible values include: 'Default', + * 'MigrationFromSqlServerToAzureDB', 'MigrationFromSqlServerToAzureMI', + * 'MigrationFromMySQLToAzureDBForMySQL' + * @member {array} [output] Task output. This is ignored if submitted. + */ +export interface ConnectToSourceMySqlTaskProperties extends ProjectTaskProperties { + input?: ConnectToSourceMySqlTaskInput; + readonly output?: ConnectToSourceNonSqlTaskOutput[]; +} + +/** + * @class + * Initializes a new instance of the SchemaMigrationSetting class. + * @constructor + * Settings for migrating schema from source to target + * + * @member {string} [schemaOption] Option on how to migrate the schema. + * Possible values include: 'None', 'ExtractFromSource', 'UseStorageFile' + * @member {string} [fileId] Resource Identifier of a file resource containing + * the uploaded schema file + */ +export interface SchemaMigrationSetting { + schemaOption?: string; + fileId?: string; +} + +/** + * @class + * Initializes a new instance of the MigrateSchemaSqlServerSqlDbDatabaseInput class. + * @constructor + * Database input for migrate schema Sql Server to Azure SQL Server scenario + * + * @member {string} [name] Name of source database + * @member {string} [targetDatabaseName] Name of target database + * @member {object} [schemaSetting] Database schema migration settings + * @member {string} [schemaSetting.schemaOption] Option on how to migrate the + * schema. Possible values include: 'None', 'ExtractFromSource', + * 'UseStorageFile' + * @member {string} [schemaSetting.fileId] Resource Identifier of a file + * resource containing the uploaded schema file + */ +export interface MigrateSchemaSqlServerSqlDbDatabaseInput { + name?: string; + targetDatabaseName?: string; + schemaSetting?: SchemaMigrationSetting; +} + +/** + * @class + * Initializes a new instance of the MigrateSchemaSqlServerSqlDbTaskInput class. + * @constructor + * Input for task that migrates Schema for SQL Server databases to Azure SQL + * databases + * + * @member {array} selectedDatabases Databases to migrate + */ +export interface MigrateSchemaSqlServerSqlDbTaskInput extends SqlMigrationTaskInput { + selectedDatabases: MigrateSchemaSqlServerSqlDbDatabaseInput[]; +} + +/** + * @class + * Initializes a new instance of the MigrateSchemaSqlServerSqlDbTaskOutput class. + * @constructor + * Output for the task that migrates Schema for SQL Server databases to Azure + * SQL databases + * + * @member {string} [id] Result identifier + * @member {string} resultType Polymorphic Discriminator + */ +export interface MigrateSchemaSqlServerSqlDbTaskOutput { + readonly id?: string; + resultType: string; +} + +/** + * @class + * Initializes a new instance of the MigrateSchemaSqlServerSqlDbTaskProperties class. + * @constructor + * Properties for task that migrates Schema for SQL Server databases to Azure + * SQL databases + * + * @member {object} [input] Task input + * @member {array} [input.selectedDatabases] Databases to migrate + * @member {array} [output] Task output. This is ignored if submitted. + */ +export interface MigrateSchemaSqlServerSqlDbTaskProperties extends ProjectTaskProperties { + input?: MigrateSchemaSqlServerSqlDbTaskInput; + readonly output?: MigrateSchemaSqlServerSqlDbTaskOutput[]; +} + +/** + * @class + * Initializes a new instance of the MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel class. + * @constructor + * @member {string} [state] Overall state of the schema migration. Possible + * values include: 'None', 'InProgress', 'Failed', 'Warning', 'Completed', + * 'Skipped', 'Stopped' + * @member {date} [startedOn] Migration start time + * @member {date} [endedOn] Migration end time + * @member {string} [sourceServerVersion] Source server version + * @member {string} [sourceServerBrandVersion] Source server brand version + * @member {string} [targetServerVersion] Target server version + * @member {string} [targetServerBrandVersion] Target server brand version + */ +export interface MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel extends MigrateSchemaSqlServerSqlDbTaskOutput { + readonly state?: string; + readonly startedOn?: Date; + readonly endedOn?: Date; + readonly sourceServerVersion?: string; + readonly sourceServerBrandVersion?: string; + readonly targetServerVersion?: string; + readonly targetServerBrandVersion?: string; +} + +/** + * @class + * Initializes a new instance of the MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel class. + * @constructor + * @member {string} [databaseName] The name of the database + * @member {string} [state] State of the schema migration for this database. + * Possible values include: 'None', 'InProgress', 'Failed', 'Warning', + * 'Completed', 'Skipped', 'Stopped' + * @member {string} [stage] Schema migration stage for this database. Possible + * values include: 'NotStarted', 'ValidatingInputs', 'CollectingObjects', + * 'DownloadingScript', 'GeneratingScript', 'UploadingScript', + * 'DeployingSchema', 'Completed', 'CompletedWithWarnings', 'Failed' + * @member {date} [startedOn] Migration start time + * @member {date} [endedOn] Migration end time + * @member {string} [databaseErrorResultPrefix] Prefix string to use for + * querying errors for this database + * @member {string} [schemaErrorResultPrefix] Prefix string to use for querying + * schema errors for this database + * @member {number} [numberOfSuccessfulOperations] Number of successful + * operations for this database + * @member {number} [numberOfFailedOperations] Number of failed operations for + * this database + * @member {string} [fileId] Identifier for the file resource containing the + * schema of this database + */ +export interface MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel extends MigrateSchemaSqlServerSqlDbTaskOutput { + readonly databaseName?: string; + readonly state?: string; + readonly stage?: string; + readonly startedOn?: Date; + readonly endedOn?: Date; + readonly databaseErrorResultPrefix?: string; + readonly schemaErrorResultPrefix?: string; + readonly numberOfSuccessfulOperations?: number; + readonly numberOfFailedOperations?: number; + readonly fileId?: string; +} + +/** + * @class + * Initializes a new instance of the MigrateSchemaSqlServerSqlDbTaskOutputError class. + * @constructor + * @member {string} [commandText] Schema command which failed + * @member {string} [errorText] Reason of failure + */ +export interface MigrateSchemaSqlServerSqlDbTaskOutputError extends MigrateSchemaSqlServerSqlDbTaskOutput { + readonly commandText?: string; + readonly errorText?: string; +} + +/** + * @class + * Initializes a new instance of the MigrateSchemaSqlTaskOutputError class. + * @constructor + * @member {object} [error] Migration error + * @member {string} [error.message] Error message + * @member {string} [error.actionableMessage] Actionable steps for this + * exception + * @member {string} [error.filePath] The path to the file where exception + * occurred + * @member {string} [error.lineNumber] The line number where exception occurred + * @member {number} [error.hResult] Coded numerical value that is assigned to a + * specific exception + * @member {string} [error.stackTrace] Stack trace + */ +export interface MigrateSchemaSqlTaskOutputError extends MigrateSchemaSqlServerSqlDbTaskOutput { + readonly error?: ReportableException; +} + +/** + * @class + * Initializes a new instance of the MongoDbCommandInput class. + * @constructor + * Describes the input to the 'cancel' and 'restart' MongoDB migration commands + * + * @member {string} [objectName] The qualified name of a database or collection + * to act upon, or null to act upon the entire migration + */ +export interface MongoDbCommandInput { + objectName?: string; +} + +/** + * @class + * Initializes a new instance of the MongoDbCancelCommand class. + * @constructor + * Properties for the command that cancels a migration in whole or in part + * + * @member {object} [input] Command input + * @member {string} [input.objectName] The qualified name of a database or + * collection to act upon, or null to act upon the entire migration + */ +export interface MongoDbCancelCommand extends CommandProperties { + input?: MongoDbCommandInput; +} + +/** + * @class + * Initializes a new instance of the MongoDbFinishCommandInput class. + * @constructor + * Describes the input to the 'finish' MongoDB migration command + * + * @member {boolean} immediate If true, replication for the affected objects + * will be stopped immediately. If false, the migrator will finish replaying + * queued events before finishing the replication. + */ +export interface MongoDbFinishCommandInput extends MongoDbCommandInput { + immediate: boolean; +} + +/** + * @class + * Initializes a new instance of the MongoDbFinishCommand class. + * @constructor + * Properties for the command that finishes a migration in whole or in part + * + * @member {object} [input] Command input + * @member {boolean} [input.immediate] If true, replication for the affected + * objects will be stopped immediately. If false, the migrator will finish + * replaying queued events before finishing the replication. + */ +export interface MongoDbFinishCommand extends CommandProperties { + input?: MongoDbFinishCommandInput; +} + +/** + * @class + * Initializes a new instance of the MongoDbRestartCommand class. + * @constructor + * Properties for the command that restarts a migration in whole or in part + * + * @member {object} [input] Command input + * @member {string} [input.objectName] The qualified name of a database or + * collection to act upon, or null to act upon the entire migration + */ +export interface MongoDbRestartCommand extends CommandProperties { + input?: MongoDbCommandInput; +} + +/** + * @class + * Initializes a new instance of the Database class. + * @constructor + * Information about a single database + * + * @member {string} [id] Unique identifier for the database + * @member {string} [name] Name of the database + * @member {string} [compatibilityLevel] SQL Server compatibility level of + * database. Possible values include: 'CompatLevel80', 'CompatLevel90', + * 'CompatLevel100', 'CompatLevel110', 'CompatLevel120', 'CompatLevel130', + * 'CompatLevel140' + * @member {string} [collation] Collation name of the database + * @member {string} [serverName] Name of the server + * @member {string} [fqdn] Fully qualified name + * @member {string} [installId] Install id of the database + * @member {string} [serverVersion] Version of the server + * @member {string} [serverEdition] Edition of the server + * @member {string} [serverLevel] Product level of the server (RTM, SP, CTP). + * @member {string} [serverDefaultDataPath] Default path of the data files + * @member {string} [serverDefaultLogPath] Default path of the log files + * @member {string} [serverDefaultBackupPath] Default path of the backup folder + * @member {number} [serverCoreCount] Number of cores on the server + * @member {number} [serverVisibleOnlineCoreCount] Number of cores on the + * server that have VISIBLE ONLINE status + * @member {string} [databaseState] State of the database. Possible values + * include: 'Online', 'Restoring', 'Recovering', 'RecoveryPending', 'Suspect', + * 'Emergency', 'Offline', 'Copying', 'OfflineSecondary' + * @member {string} [serverId] The unique Server Id + */ +export interface Database { + id?: string; + name?: string; + compatibilityLevel?: string; + collation?: string; + serverName?: string; + fqdn?: string; + installId?: string; + serverVersion?: string; + serverEdition?: string; + serverLevel?: string; + serverDefaultDataPath?: string; + serverDefaultLogPath?: string; + serverDefaultBackupPath?: string; + serverCoreCount?: number; + serverVisibleOnlineCoreCount?: number; + databaseState?: string; + serverId?: string; +} + +/** + * @class + * Initializes a new instance of the DatabaseObjectName class. + * @constructor + * A representation of the name of an object in a database + * + * @member {string} [databaseName] The unescaped name of the database + * containing the object + * @member {string} [objectName] The unescaped name of the object + * @member {string} [schemaName] The unescaped name of the schema containing + * the object + * @member {string} [objectType] Type of the object in the database. Possible + * values include: 'StoredProcedures', 'Table', 'User', 'View', 'Function' + */ +export interface DatabaseObjectName { + readonly databaseName?: string; + readonly objectName?: string; + readonly schemaName?: string; + objectType?: string; +} + +/** + * @class + * Initializes a new instance of the MigrationTableMetadata class. + * @constructor + * Metadata for tables selected in migration project + * + * @member {string} [sourceTableName] Source table name + * @member {string} [targetTableName] Target table name + */ +export interface MigrationTableMetadata { + readonly sourceTableName?: string; + readonly targetTableName?: string; +} + +/** + * @class + * Initializes a new instance of the DataMigrationProjectMetadata class. + * @constructor + * Common metadata for migration projects + * + * @member {string} [sourceServerName] Source server name + * @member {string} [sourceServerPort] Source server port number + * @member {string} [sourceUsername] Source username + * @member {string} [targetServerName] Target server name + * @member {string} [targetUsername] Target username + * @member {string} [targetDbName] Target database name + * @member {boolean} [targetUsingWinAuth] Whether target connection is Windows + * authentication + * @member {array} [selectedMigrationTables] List of tables selected for + * migration + */ +export interface DataMigrationProjectMetadata { + readonly sourceServerName?: string; + readonly sourceServerPort?: string; + readonly sourceUsername?: string; + readonly targetServerName?: string; + readonly targetUsername?: string; + readonly targetDbName?: string; + readonly targetUsingWinAuth?: boolean; + readonly selectedMigrationTables?: MigrationTableMetadata[]; +} + +/** + * @class + * Initializes a new instance of the GetProjectDetailsNonSqlTaskInput class. + * @constructor + * Input for the task that reads configuration from project artifacts + * + * @member {string} projectName Name of the migration project + * @member {string} projectLocation A URL that points to the location to access + * project artifacts + */ +export interface GetProjectDetailsNonSqlTaskInput { + projectName: string; + projectLocation: string; +} + +/** + * @class + * Initializes a new instance of the NonSqlDataMigrationTable class. + * @constructor + * Defines metadata for table to be migrated + * + * @member {string} [sourceName] Source table name + */ +export interface NonSqlDataMigrationTable { + sourceName?: string; +} + +/** + * @class + * Initializes a new instance of the NonSqlMigrationTaskInput class. + * @constructor + * Base class for non sql migration task input + * + * @member {object} targetConnectionInfo Information for connecting to target + * @member {string} [targetConnectionInfo.dataSource] Data source in the format + * Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [targetConnectionInfo.authentication] Authentication type + * to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [targetConnectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [targetConnectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [targetConnectionInfo.trustServerCertificate] Whether to + * trust the server certificate + * @member {string} [targetConnectionInfo.platform] Server platform type for + * connection. Possible values include: 'SqlOnPrem' + * @member {string} targetDatabaseName Target database name + * @member {string} projectName Name of the migration project + * @member {string} projectLocation A URL that points to the drop location to + * access project artifacts + * @member {array} selectedTables Metadata of the tables selected for migration + */ +export interface NonSqlMigrationTaskInput { + targetConnectionInfo: SqlConnectionInfo; + targetDatabaseName: string; + projectName: string; + projectLocation: string; + selectedTables: NonSqlDataMigrationTable[]; +} + +/** + * @class + * Initializes a new instance of the DataMigrationError class. + * @constructor + * Migration Task errors + * + * @member {string} [message] Error description + * @member {string} [type] Possible values include: 'Default', 'Warning', + * 'Error' + */ +export interface DataMigrationError { + readonly message?: string; + type?: string; +} + +/** + * @class + * Initializes a new instance of the NonSqlDataMigrationTableResult class. + * @constructor + * Object used to report the data migration results of a table + * + * @member {string} [resultCode] Result code of the data migration. Possible + * values include: 'Initial', 'Completed', 'ObjectNotExistsInSource', + * 'ObjectNotExistsInTarget', 'TargetObjectIsInaccessible', 'FatalError' + * @member {string} [sourceName] Name of the source table + * @member {string} [targetName] Name of the target table + * @member {number} [sourceRowCount] Number of rows in the source table + * @member {number} [targetRowCount] Number of rows in the target table + * @member {number} [elapsedTimeInMiliseconds] Time taken to migrate the data + * @member {array} [errors] List of errors, if any, during migration + */ +export interface NonSqlDataMigrationTableResult { + readonly resultCode?: string; + readonly sourceName?: string; + readonly targetName?: string; + readonly sourceRowCount?: number; + readonly targetRowCount?: number; + readonly elapsedTimeInMiliseconds?: number; + readonly errors?: DataMigrationError[]; +} + +/** + * @class + * Initializes a new instance of the NonSqlMigrationTaskOutput class. + * @constructor + * Base class for non sql migration task output + * + * @member {string} [id] Result identifier + * @member {date} [startedOn] Migration start time + * @member {date} [endedOn] Migration end time + * @member {string} [status] Current state of migration. Possible values + * include: 'Default', 'Connecting', 'SourceAndTargetSelected', 'SelectLogins', + * 'Configured', 'Running', 'Error', 'Stopped', 'Completed', + * 'CompletedWithWarnings' + * @member {object} [dataMigrationTableResults] Results of the migration. The + * key contains the table name and the value the table result object + * @member {string} [progressMessage] Message about the progress of the + * migration + * @member {string} [sourceServerName] Name of source server + * @member {string} [targetServerName] Name of target server + */ +export interface NonSqlMigrationTaskOutput { + readonly id?: string; + readonly startedOn?: Date; + readonly endedOn?: Date; + readonly status?: string; + readonly dataMigrationTableResults?: { [propertyName: string]: NonSqlDataMigrationTableResult }; + readonly progressMessage?: string; + readonly sourceServerName?: string; + readonly targetServerName?: string; +} + +/** + * @class + * Initializes a new instance of the DatabaseFileInput class. + * @constructor + * Database file specific information for input + * + * @member {string} [id] Unique identifier for database file + * @member {string} [logicalName] Logical name of the file + * @member {string} [physicalFullName] Operating-system full path of the file + * @member {string} [restoreFullName] Suggested full path of the file for + * restoring + * @member {string} [fileType] Database file type. Possible values include: + * 'Rows', 'Log', 'Filestream', 'NotSupported', 'Fulltext' + */ +export interface DatabaseFileInput { + id?: string; + logicalName?: string; + physicalFullName?: string; + restoreFullName?: string; + fileType?: string; +} + +/** + * @class + * Initializes a new instance of the MigrateSqlServerSqlServerDatabaseInput class. + * @constructor + * Database specific information for SQL to SQL migration task inputs + * + * @member {string} [name] Name of the database + * @member {string} [restoreDatabaseName] Name of the database at destination + * @member {string} [backupAndRestoreFolder] The backup and restore folder + * @member {array} [databaseFiles] The list of database files + */ +export interface MigrateSqlServerSqlServerDatabaseInput { + name?: string; + restoreDatabaseName?: string; + backupAndRestoreFolder?: string; + databaseFiles?: DatabaseFileInput[]; +} + + +/** + * @class + * Initializes a new instance of the ResourceSkusResult class. + * @constructor + * The DMS List SKUs operation response. + * + * @member {string} [nextLink] The uri to fetch the next page of DMS SKUs. Call + * ListNext() with this to fetch the next page of DMS SKUs. + */ +export interface ResourceSkusResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the ServiceSkuList class. + * @constructor + * OData page of available SKUs + * + * @member {string} [nextLink] URL to load the next page of service SKUs + */ +export interface ServiceSkuList extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the DataMigrationServiceList class. + * @constructor + * OData page of service objects + * + * @member {string} [nextLink] URL to load the next page of services + */ +export interface DataMigrationServiceList extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the TaskList class. + * @constructor + * OData page of tasks + * + * @member {string} [nextLink] URL to load the next page of tasks + */ +export interface TaskList extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the ProjectList class. + * @constructor + * OData page of project resources + * + * @member {string} [nextLink] URL to load the next page of projects + */ +export interface ProjectList extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the QuotaList class. + * @constructor + * OData page of quota objects + * + * @member {string} [nextLink] URL to load the next page of quotas, or null or + * missing if this is the last page + */ +export interface QuotaList extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the ServiceOperationList class. + * @constructor + * OData page of action (operation) objects + * + * @member {string} [nextLink] URL to load the next page of actions + */ +export interface ServiceOperationList extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the FileList class. + * @constructor + * OData page of files + * + * @member {string} [nextLink] URL to load the next page of files + */ +export interface FileList extends Array { + nextLink?: string; +} diff --git a/lib/services/datamigrationManagement/lib/models/index.js b/lib/services/datamigrationManagement/lib/models/index.js new file mode 100644 index 0000000000..919b607d33 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/index.js @@ -0,0 +1,291 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +/* jshint latedef:false */ +/* jshint forin:false */ +/* jshint noempty:false */ + +'use strict'; + +var msRestAzure = require('ms-rest-azure'); + +exports.BaseResource = msRestAzure.BaseResource; +exports.CloudError = msRestAzure.CloudError; +exports.Resource = require('./resource'); +exports.TrackedResource = require('./trackedResource'); +exports.ProjectFileProperties = require('./projectFileProperties'); +exports.ProjectFile = require('./projectFile'); +exports.ODataError = require('./oDataError'); +exports.ReportableException = require('./reportableException'); +exports.MigrateSyncCompleteCommandOutput = require('./migrateSyncCompleteCommandOutput'); +exports.MigrateSyncCompleteCommandInput = require('./migrateSyncCompleteCommandInput'); +exports.CommandProperties = require('./commandProperties'); +exports.MigrateSyncCompleteCommandProperties = require('./migrateSyncCompleteCommandProperties'); +exports.GetTdeCertificatesSqlTaskOutput = require('./getTdeCertificatesSqlTaskOutput'); +exports.SelectedCertificateInput = require('./selectedCertificateInput'); +exports.FileShare = require('./fileShare'); +exports.ConnectionInfo = require('./connectionInfo'); +exports.PostgreSqlConnectionInfo = require('./postgreSqlConnectionInfo'); +exports.MySqlConnectionInfo = require('./mySqlConnectionInfo'); +exports.MongoDbConnectionInfo = require('./mongoDbConnectionInfo'); +exports.SqlConnectionInfo = require('./sqlConnectionInfo'); +exports.GetTdeCertificatesSqlTaskInput = require('./getTdeCertificatesSqlTaskInput'); +exports.ProjectTaskProperties = require('./projectTaskProperties'); +exports.GetTdeCertificatesSqlTaskProperties = require('./getTdeCertificatesSqlTaskProperties'); +exports.MongoDbError = require('./mongoDbError'); +exports.MongoDbProgress = require('./mongoDbProgress'); +exports.MongoDbCollectionProgress = require('./mongoDbCollectionProgress'); +exports.MongoDbDatabaseProgress = require('./mongoDbDatabaseProgress'); +exports.MongoDbMigrationProgress = require('./mongoDbMigrationProgress'); +exports.MongoDbThrottlingSettings = require('./mongoDbThrottlingSettings'); +exports.MongoDbShardKeyField = require('./mongoDbShardKeyField'); +exports.MongoDbShardKeySetting = require('./mongoDbShardKeySetting'); +exports.MongoDbCollectionSettings = require('./mongoDbCollectionSettings'); +exports.MongoDbDatabaseSettings = require('./mongoDbDatabaseSettings'); +exports.MongoDbMigrationSettings = require('./mongoDbMigrationSettings'); +exports.ValidateMongoDbTaskProperties = require('./validateMongoDbTaskProperties'); +exports.DatabaseBackupInfo = require('./databaseBackupInfo'); +exports.ValidateMigrationInputSqlServerSqlMITaskOutput = require('./validateMigrationInputSqlServerSqlMITaskOutput'); +exports.BlobShare = require('./blobShare'); +exports.MigrateSqlServerSqlMIDatabaseInput = require('./migrateSqlServerSqlMIDatabaseInput'); +exports.ValidateMigrationInputSqlServerSqlMITaskInput = require('./validateMigrationInputSqlServerSqlMITaskInput'); +exports.ValidateMigrationInputSqlServerSqlMITaskProperties = require('./validateMigrationInputSqlServerSqlMITaskProperties'); +exports.ValidateSyncMigrationInputSqlServerTaskOutput = require('./validateSyncMigrationInputSqlServerTaskOutput'); +exports.MigrateSqlServerSqlDbSyncDatabaseInput = require('./migrateSqlServerSqlDbSyncDatabaseInput'); +exports.ValidateSyncMigrationInputSqlServerTaskInput = require('./validateSyncMigrationInputSqlServerTaskInput'); +exports.ValidateMigrationInputSqlServerSqlDbSyncTaskProperties = require('./validateMigrationInputSqlServerSqlDbSyncTaskProperties'); +exports.SyncMigrationDatabaseErrorEvent = require('./syncMigrationDatabaseErrorEvent'); +exports.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = require('./migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput'); +exports.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError = require('./migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError'); +exports.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError = require('./migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError'); +exports.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel = require('./migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel'); +exports.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel = require('./migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel'); +exports.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel = require('./migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel'); +exports.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput = require('./migratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput'); +exports.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput = require('./migratePostgreSqlAzureDbForPostgreSqlSyncTaskInput'); +exports.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties = require('./migratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties'); +exports.MigrateMySqlAzureDbForMySqlSyncTaskOutput = require('./migrateMySqlAzureDbForMySqlSyncTaskOutput'); +exports.MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError = require('./migrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError'); +exports.MigrateMySqlAzureDbForMySqlSyncTaskOutputError = require('./migrateMySqlAzureDbForMySqlSyncTaskOutputError'); +exports.MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel = require('./migrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel'); +exports.MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel = require('./migrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel'); +exports.MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel = require('./migrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel'); +exports.MigrateMySqlAzureDbForMySqlSyncDatabaseInput = require('./migrateMySqlAzureDbForMySqlSyncDatabaseInput'); +exports.MigrateMySqlAzureDbForMySqlSyncTaskInput = require('./migrateMySqlAzureDbForMySqlSyncTaskInput'); +exports.MigrateMySqlAzureDbForMySqlSyncTaskProperties = require('./migrateMySqlAzureDbForMySqlSyncTaskProperties'); +exports.MigrateSqlServerSqlDbSyncTaskOutput = require('./migrateSqlServerSqlDbSyncTaskOutput'); +exports.MigrateSqlServerSqlDbSyncTaskOutputDatabaseError = require('./migrateSqlServerSqlDbSyncTaskOutputDatabaseError'); +exports.MigrateSqlServerSqlDbSyncTaskOutputError = require('./migrateSqlServerSqlDbSyncTaskOutputError'); +exports.MigrateSqlServerSqlDbSyncTaskOutputTableLevel = require('./migrateSqlServerSqlDbSyncTaskOutputTableLevel'); +exports.MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel = require('./migrateSqlServerSqlDbSyncTaskOutputDatabaseLevel'); +exports.MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel = require('./migrateSqlServerSqlDbSyncTaskOutputMigrationLevel'); +exports.SqlMigrationTaskInput = require('./sqlMigrationTaskInput'); +exports.MigrationValidationOptions = require('./migrationValidationOptions'); +exports.MigrateSqlServerSqlDbSyncTaskInput = require('./migrateSqlServerSqlDbSyncTaskInput'); +exports.MigrateSqlServerSqlDbSyncTaskProperties = require('./migrateSqlServerSqlDbSyncTaskProperties'); +exports.ValidationError = require('./validationError'); +exports.WaitStatistics = require('./waitStatistics'); +exports.ExecutionStatistics = require('./executionStatistics'); +exports.QueryExecutionResult = require('./queryExecutionResult'); +exports.QueryAnalysisValidationResult = require('./queryAnalysisValidationResult'); +exports.SchemaComparisonValidationResultType = require('./schemaComparisonValidationResultType'); +exports.SchemaComparisonValidationResult = require('./schemaComparisonValidationResult'); +exports.DataIntegrityValidationResult = require('./dataIntegrityValidationResult'); +exports.MigrationValidationDatabaseLevelResult = require('./migrationValidationDatabaseLevelResult'); +exports.MigrationValidationDatabaseSummaryResult = require('./migrationValidationDatabaseSummaryResult'); +exports.MigrationValidationResult = require('./migrationValidationResult'); +exports.MigrateSqlServerSqlDbTaskOutput = require('./migrateSqlServerSqlDbTaskOutput'); +exports.MigrateSqlServerSqlDbTaskOutputError = require('./migrateSqlServerSqlDbTaskOutputError'); +exports.MigrateSqlServerSqlDbTaskOutputTableLevel = require('./migrateSqlServerSqlDbTaskOutputTableLevel'); +exports.DataItemMigrationSummaryResult = require('./dataItemMigrationSummaryResult'); +exports.MigrateSqlServerSqlDbTaskOutputDatabaseLevel = require('./migrateSqlServerSqlDbTaskOutputDatabaseLevel'); +exports.MigrationReportResult = require('./migrationReportResult'); +exports.DatabaseSummaryResult = require('./databaseSummaryResult'); +exports.MigrateSqlServerSqlDbTaskOutputMigrationLevel = require('./migrateSqlServerSqlDbTaskOutputMigrationLevel'); +exports.MigrateSqlServerSqlDbDatabaseInput = require('./migrateSqlServerSqlDbDatabaseInput'); +exports.MigrateSqlServerSqlDbTaskInput = require('./migrateSqlServerSqlDbTaskInput'); +exports.MigrateSqlServerSqlDbTaskProperties = require('./migrateSqlServerSqlDbTaskProperties'); +exports.MigrateSqlServerSqlMITaskOutput = require('./migrateSqlServerSqlMITaskOutput'); +exports.MigrateSqlServerSqlMITaskOutputError = require('./migrateSqlServerSqlMITaskOutputError'); +exports.MigrateSqlServerSqlMITaskOutputLoginLevel = require('./migrateSqlServerSqlMITaskOutputLoginLevel'); +exports.MigrateSqlServerSqlMITaskOutputAgentJobLevel = require('./migrateSqlServerSqlMITaskOutputAgentJobLevel'); +exports.MigrateSqlServerSqlMITaskOutputDatabaseLevel = require('./migrateSqlServerSqlMITaskOutputDatabaseLevel'); +exports.StartMigrationScenarioServerRoleResult = require('./startMigrationScenarioServerRoleResult'); +exports.MigrateSqlServerSqlMITaskOutputMigrationLevel = require('./migrateSqlServerSqlMITaskOutputMigrationLevel'); +exports.MigrateSqlServerSqlMITaskInput = require('./migrateSqlServerSqlMITaskInput'); +exports.MigrateSqlServerSqlMITaskProperties = require('./migrateSqlServerSqlMITaskProperties'); +exports.MigrateMongoDbTaskProperties = require('./migrateMongoDbTaskProperties'); +exports.ConnectToTargetAzureDbForMySqlTaskOutput = require('./connectToTargetAzureDbForMySqlTaskOutput'); +exports.ConnectToTargetAzureDbForMySqlTaskInput = require('./connectToTargetAzureDbForMySqlTaskInput'); +exports.ConnectToTargetAzureDbForMySqlTaskProperties = require('./connectToTargetAzureDbForMySqlTaskProperties'); +exports.ConnectToTargetSqlMITaskOutput = require('./connectToTargetSqlMITaskOutput'); +exports.ConnectToTargetSqlMITaskInput = require('./connectToTargetSqlMITaskInput'); +exports.ConnectToTargetSqlMITaskProperties = require('./connectToTargetSqlMITaskProperties'); +exports.DatabaseTable = require('./databaseTable'); +exports.GetUserTablesSqlSyncTaskOutput = require('./getUserTablesSqlSyncTaskOutput'); +exports.GetUserTablesSqlSyncTaskInput = require('./getUserTablesSqlSyncTaskInput'); +exports.GetUserTablesSqlSyncTaskProperties = require('./getUserTablesSqlSyncTaskProperties'); +exports.GetUserTablesSqlTaskOutput = require('./getUserTablesSqlTaskOutput'); +exports.GetUserTablesSqlTaskInput = require('./getUserTablesSqlTaskInput'); +exports.GetUserTablesSqlTaskProperties = require('./getUserTablesSqlTaskProperties'); +exports.ConnectToTargetSqlDbTaskOutput = require('./connectToTargetSqlDbTaskOutput'); +exports.ConnectToTargetSqlSqlDbSyncTaskInput = require('./connectToTargetSqlSqlDbSyncTaskInput'); +exports.ConnectToTargetSqlSqlDbSyncTaskProperties = require('./connectToTargetSqlSqlDbSyncTaskProperties'); +exports.ConnectToTargetSqlDbTaskInput = require('./connectToTargetSqlDbTaskInput'); +exports.ConnectToTargetSqlDbTaskProperties = require('./connectToTargetSqlDbTaskProperties'); +exports.MigrationEligibilityInfo = require('./migrationEligibilityInfo'); +exports.ConnectToSourceSqlServerTaskOutput = require('./connectToSourceSqlServerTaskOutput'); +exports.ConnectToSourceSqlServerTaskOutputAgentJobLevel = require('./connectToSourceSqlServerTaskOutputAgentJobLevel'); +exports.ConnectToSourceSqlServerTaskOutputLoginLevel = require('./connectToSourceSqlServerTaskOutputLoginLevel'); +exports.DatabaseFileInfo = require('./databaseFileInfo'); +exports.ConnectToSourceSqlServerTaskOutputDatabaseLevel = require('./connectToSourceSqlServerTaskOutputDatabaseLevel'); +exports.ConnectToSourceSqlServerTaskOutputTaskLevel = require('./connectToSourceSqlServerTaskOutputTaskLevel'); +exports.ConnectToSourceSqlServerTaskInput = require('./connectToSourceSqlServerTaskInput'); +exports.ConnectToSourceSqlServerSyncTaskProperties = require('./connectToSourceSqlServerSyncTaskProperties'); +exports.ConnectToSourceSqlServerTaskProperties = require('./connectToSourceSqlServerTaskProperties'); +exports.MongoDbShardKeyInfo = require('./mongoDbShardKeyInfo'); +exports.MongoDbObjectInfo = require('./mongoDbObjectInfo'); +exports.MongoDbCollectionInfo = require('./mongoDbCollectionInfo'); +exports.MongoDbDatabaseInfo = require('./mongoDbDatabaseInfo'); +exports.MongoDbClusterInfo = require('./mongoDbClusterInfo'); +exports.ConnectToMongoDbTaskProperties = require('./connectToMongoDbTaskProperties'); +exports.ProjectTask = require('./projectTask'); +exports.ServiceSku = require('./serviceSku'); +exports.DataMigrationService = require('./dataMigrationService'); +exports.NameAvailabilityRequest = require('./nameAvailabilityRequest'); +exports.DatabaseInfo = require('./databaseInfo'); +exports.Project = require('./project'); +exports.ApiError = require('./apiError'); +exports.FileStorageInfo = require('./fileStorageInfo'); +exports.ServiceOperationDisplay = require('./serviceOperationDisplay'); +exports.ServiceOperation = require('./serviceOperation'); +exports.QuotaName = require('./quotaName'); +exports.Quota = require('./quota'); +exports.NameAvailabilityResponse = require('./nameAvailabilityResponse'); +exports.AvailableServiceSkuSku = require('./availableServiceSkuSku'); +exports.AvailableServiceSkuCapacity = require('./availableServiceSkuCapacity'); +exports.AvailableServiceSku = require('./availableServiceSku'); +exports.DataMigrationServiceStatusResponse = require('./dataMigrationServiceStatusResponse'); +exports.ResourceSkuRestrictions = require('./resourceSkuRestrictions'); +exports.ResourceSkuCapabilities = require('./resourceSkuCapabilities'); +exports.ResourceSkuCosts = require('./resourceSkuCosts'); +exports.ResourceSkuCapacity = require('./resourceSkuCapacity'); +exports.ResourceSku = require('./resourceSku'); +exports.ConnectToSourceMySqlTaskInput = require('./connectToSourceMySqlTaskInput'); +exports.ServerProperties = require('./serverProperties'); +exports.ConnectToSourceNonSqlTaskOutput = require('./connectToSourceNonSqlTaskOutput'); +exports.ConnectToSourceMySqlTaskProperties = require('./connectToSourceMySqlTaskProperties'); +exports.SchemaMigrationSetting = require('./schemaMigrationSetting'); +exports.MigrateSchemaSqlServerSqlDbDatabaseInput = require('./migrateSchemaSqlServerSqlDbDatabaseInput'); +exports.MigrateSchemaSqlServerSqlDbTaskInput = require('./migrateSchemaSqlServerSqlDbTaskInput'); +exports.MigrateSchemaSqlServerSqlDbTaskOutput = require('./migrateSchemaSqlServerSqlDbTaskOutput'); +exports.MigrateSchemaSqlServerSqlDbTaskProperties = require('./migrateSchemaSqlServerSqlDbTaskProperties'); +exports.MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel = require('./migrateSchemaSqlServerSqlDbTaskOutputMigrationLevel'); +exports.MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel = require('./migrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel'); +exports.MigrateSchemaSqlServerSqlDbTaskOutputError = require('./migrateSchemaSqlServerSqlDbTaskOutputError'); +exports.MigrateSchemaSqlTaskOutputError = require('./migrateSchemaSqlTaskOutputError'); +exports.MongoDbCommandInput = require('./mongoDbCommandInput'); +exports.MongoDbCancelCommand = require('./mongoDbCancelCommand'); +exports.MongoDbFinishCommandInput = require('./mongoDbFinishCommandInput'); +exports.MongoDbFinishCommand = require('./mongoDbFinishCommand'); +exports.MongoDbRestartCommand = require('./mongoDbRestartCommand'); +exports.Database = require('./database'); +exports.DatabaseObjectName = require('./databaseObjectName'); +exports.MigrationTableMetadata = require('./migrationTableMetadata'); +exports.DataMigrationProjectMetadata = require('./dataMigrationProjectMetadata'); +exports.GetProjectDetailsNonSqlTaskInput = require('./getProjectDetailsNonSqlTaskInput'); +exports.NonSqlDataMigrationTable = require('./nonSqlDataMigrationTable'); +exports.NonSqlMigrationTaskInput = require('./nonSqlMigrationTaskInput'); +exports.DataMigrationError = require('./dataMigrationError'); +exports.NonSqlDataMigrationTableResult = require('./nonSqlDataMigrationTableResult'); +exports.NonSqlMigrationTaskOutput = require('./nonSqlMigrationTaskOutput'); +exports.DatabaseFileInput = require('./databaseFileInput'); +exports.MigrateSqlServerSqlServerDatabaseInput = require('./migrateSqlServerSqlServerDatabaseInput'); +exports.ResourceSkusResult = require('./resourceSkusResult'); +exports.ServiceSkuList = require('./serviceSkuList'); +exports.DataMigrationServiceList = require('./dataMigrationServiceList'); +exports.TaskList = require('./taskList'); +exports.ProjectList = require('./projectList'); +exports.QuotaList = require('./quotaList'); +exports.ServiceOperationList = require('./serviceOperationList'); +exports.FileList = require('./fileList'); +exports.discriminators = { + 'CommandProperties.Migrate.Sync.Complete.Database' : exports.MigrateSyncCompleteCommandProperties, + 'Unknown' : exports.CommandProperties, + 'ConnectionInfo.PostgreSqlConnectionInfo' : exports.PostgreSqlConnectionInfo, + 'ConnectionInfo.MySqlConnectionInfo' : exports.MySqlConnectionInfo, + 'ConnectionInfo.MongoDbConnectionInfo' : exports.MongoDbConnectionInfo, + 'Unknown' : exports.ConnectionInfo, + 'ConnectionInfo.SqlConnectionInfo' : exports.SqlConnectionInfo, + 'ProjectTaskProperties.GetTDECertificates.Sql' : exports.GetTdeCertificatesSqlTaskProperties, + 'ProjectTaskProperties.Validate.MongoDb' : exports.ValidateMongoDbTaskProperties, + 'ProjectTaskProperties.ValidateMigrationInput.SqlServer.AzureSqlDbMI' : exports.ValidateMigrationInputSqlServerSqlMITaskProperties, + 'ProjectTaskProperties.ValidateMigrationInput.SqlServer.SqlDb.Sync' : exports.ValidateMigrationInputSqlServerSqlDbSyncTaskProperties, + 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput.DatabaseLevelErrorOutput' : exports.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError, + 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput.ErrorOutput' : exports.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError, + 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput.TableLevelOutput' : exports.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel, + 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput.DatabaseLevelOutput' : exports.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel, + 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput.MigrationLevelOutput' : exports.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel, + 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput' : exports.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, + 'ProjectTaskProperties.Migrate.PostgreSql.AzureDbForPostgreSql.Sync' : exports.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties, + 'MigrateMySqlAzureDbForMySqlSyncTaskOutput.DatabaseLevelErrorOutput' : exports.MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError, + 'MigrateMySqlAzureDbForMySqlSyncTaskOutput.ErrorOutput' : exports.MigrateMySqlAzureDbForMySqlSyncTaskOutputError, + 'MigrateMySqlAzureDbForMySqlSyncTaskOutput.TableLevelOutput' : exports.MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel, + 'MigrateMySqlAzureDbForMySqlSyncTaskOutput.DatabaseLevelOutput' : exports.MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel, + 'MigrateMySqlAzureDbForMySqlSyncTaskOutput.MigrationLevelOutput' : exports.MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel, + 'MigrateMySqlAzureDbForMySqlSyncTaskOutput' : exports.MigrateMySqlAzureDbForMySqlSyncTaskOutput, + 'ProjectTaskProperties.Migrate.MySql.AzureDbForMySql.Sync' : exports.MigrateMySqlAzureDbForMySqlSyncTaskProperties, + 'MigrateSqlServerSqlDbSyncTaskOutput.DatabaseLevelErrorOutput' : exports.MigrateSqlServerSqlDbSyncTaskOutputDatabaseError, + 'MigrateSqlServerSqlDbSyncTaskOutput.ErrorOutput' : exports.MigrateSqlServerSqlDbSyncTaskOutputError, + 'MigrateSqlServerSqlDbSyncTaskOutput.TableLevelOutput' : exports.MigrateSqlServerSqlDbSyncTaskOutputTableLevel, + 'MigrateSqlServerSqlDbSyncTaskOutput.DatabaseLevelOutput' : exports.MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel, + 'MigrateSqlServerSqlDbSyncTaskOutput.MigrationLevelOutput' : exports.MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel, + 'MigrateSqlServerSqlDbSyncTaskOutput' : exports.MigrateSqlServerSqlDbSyncTaskOutput, + 'ProjectTaskProperties.Migrate.SqlServer.AzureSqlDb.Sync' : exports.MigrateSqlServerSqlDbSyncTaskProperties, + 'MigrateSqlServerSqlDbTaskOutput.ErrorOutput' : exports.MigrateSqlServerSqlDbTaskOutputError, + 'MigrateSqlServerSqlDbTaskOutput.TableLevelOutput' : exports.MigrateSqlServerSqlDbTaskOutputTableLevel, + 'MigrateSqlServerSqlDbTaskOutput.DatabaseLevelOutput' : exports.MigrateSqlServerSqlDbTaskOutputDatabaseLevel, + 'MigrateSqlServerSqlDbTaskOutput.MigrationLevelOutput' : exports.MigrateSqlServerSqlDbTaskOutputMigrationLevel, + 'MigrateSqlServerSqlDbTaskOutput' : exports.MigrateSqlServerSqlDbTaskOutput, + 'ProjectTaskProperties.Migrate.SqlServer.SqlDb' : exports.MigrateSqlServerSqlDbTaskProperties, + 'MigrateSqlServerSqlMITaskOutput.ErrorOutput' : exports.MigrateSqlServerSqlMITaskOutputError, + 'MigrateSqlServerSqlMITaskOutput.LoginLevelOutput' : exports.MigrateSqlServerSqlMITaskOutputLoginLevel, + 'MigrateSqlServerSqlMITaskOutput.AgentJobLevelOutput' : exports.MigrateSqlServerSqlMITaskOutputAgentJobLevel, + 'MigrateSqlServerSqlMITaskOutput.DatabaseLevelOutput' : exports.MigrateSqlServerSqlMITaskOutputDatabaseLevel, + 'MigrateSqlServerSqlMITaskOutput.MigrationLevelOutput' : exports.MigrateSqlServerSqlMITaskOutputMigrationLevel, + 'MigrateSqlServerSqlMITaskOutput' : exports.MigrateSqlServerSqlMITaskOutput, + 'ProjectTaskProperties.Migrate.SqlServer.AzureSqlDbMI' : exports.MigrateSqlServerSqlMITaskProperties, + 'ProjectTaskProperties.Migrate.MongoDb' : exports.MigrateMongoDbTaskProperties, + 'ProjectTaskProperties.ConnectToTarget.AzureDbForMySql' : exports.ConnectToTargetAzureDbForMySqlTaskProperties, + 'ProjectTaskProperties.ConnectToTarget.AzureSqlDbMI' : exports.ConnectToTargetSqlMITaskProperties, + 'ProjectTaskProperties.GetUserTables.AzureSqlDb.Sync' : exports.GetUserTablesSqlSyncTaskProperties, + 'ProjectTaskProperties.GetUserTables.Sql' : exports.GetUserTablesSqlTaskProperties, + 'ProjectTaskProperties.ConnectToTarget.SqlDb.Sync' : exports.ConnectToTargetSqlSqlDbSyncTaskProperties, + 'ProjectTaskProperties.ConnectToTarget.SqlDb' : exports.ConnectToTargetSqlDbTaskProperties, + 'ConnectToSourceSqlServerTaskOutput.AgentJobLevelOutput' : exports.ConnectToSourceSqlServerTaskOutputAgentJobLevel, + 'ConnectToSourceSqlServerTaskOutput.LoginLevelOutput' : exports.ConnectToSourceSqlServerTaskOutputLoginLevel, + 'ConnectToSourceSqlServerTaskOutput.DatabaseLevelOutput' : exports.ConnectToSourceSqlServerTaskOutputDatabaseLevel, + 'ConnectToSourceSqlServerTaskOutput.TaskLevelOutput' : exports.ConnectToSourceSqlServerTaskOutputTaskLevel, + 'ConnectToSourceSqlServerTaskOutput' : exports.ConnectToSourceSqlServerTaskOutput, + 'ProjectTaskProperties.ConnectToSource.SqlServer.Sync' : exports.ConnectToSourceSqlServerSyncTaskProperties, + 'ProjectTaskProperties.ConnectToSource.SqlServer' : exports.ConnectToSourceSqlServerTaskProperties, + 'ProjectTaskProperties.Connect.MongoDb' : exports.ConnectToMongoDbTaskProperties, + 'Unknown' : exports.ProjectTaskProperties, + 'ProjectTaskProperties.ConnectToSource.MySql' : exports.ConnectToSourceMySqlTaskProperties, + 'MigrateSchemaSqlServerSqlDbTaskOutput' : exports.MigrateSchemaSqlServerSqlDbTaskOutput, + 'ProjectTaskProperties.MigrateSchemaSqlServerSqlDb' : exports.MigrateSchemaSqlServerSqlDbTaskProperties, + 'MigrateSchemaSqlServerSqlDbTaskOutput.MigrationLevelOutput' : exports.MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel, + 'MigrateSchemaSqlServerSqlDbTaskOutput.DatabaseLevelOutput' : exports.MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel, + 'MigrateSchemaSqlServerSqlDbTaskOutput.SchemaErrorOutput' : exports.MigrateSchemaSqlServerSqlDbTaskOutputError, + 'MigrateSchemaSqlServerSqlDbTaskOutput.ErrorOutput' : exports.MigrateSchemaSqlTaskOutputError, + 'CommandProperties.cancel' : exports.MongoDbCancelCommand, + 'CommandProperties.finish' : exports.MongoDbFinishCommand, + 'CommandProperties.restart' : exports.MongoDbRestartCommand +}; diff --git a/lib/services/datamigrationManagement/lib/models/migrateMongoDbTaskProperties.js b/lib/services/datamigrationManagement/lib/models/migrateMongoDbTaskProperties.js new file mode 100644 index 0000000000..31e3550469 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateMongoDbTaskProperties.js @@ -0,0 +1,160 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Properties for the task that migrates data between MongoDB data sources + * + * @extends models['ProjectTaskProperties'] + */ +class MigrateMongoDbTaskProperties extends models['ProjectTaskProperties'] { + /** + * Create a MigrateMongoDbTaskProperties. + * @member {object} [input] + * @member {number} [input.boostRUs] The RU limit on a CosmosDB target that + * collections will be temporarily increased to (if lower) during the initial + * copy of a migration, from 10,000 to 1,000,000, or 0 to use the default + * boost (which is generally the maximum), or null to not boost the RUs. This + * setting has no effect on non-CosmosDB targets. + * @member {object} [input.databases] The databases on the source cluster to + * migrate to the target. The keys are the names of the databases. + * @member {string} [input.replication] Describes how changes will be + * replicated from the source to the target. The default is OneTime. Possible + * values include: 'Disabled', 'OneTime', 'Continuous' + * @member {object} [input.source] Settings used to connect to the source + * cluster + * @member {string} [input.source.connectionString] A MongoDB connection + * string or blob container URL. The user name and password can be specified + * here or in the userName and password properties + * @member {object} [input.target] Settings used to connect to the target + * cluster + * @member {string} [input.target.connectionString] A MongoDB connection + * string or blob container URL. The user name and password can be specified + * here or in the userName and password properties + * @member {object} [input.throttling] Settings used to limit the resource + * usage of the migration + * @member {number} [input.throttling.minFreeCpu] The percentage of CPU time + * that the migrator will try to avoid using, from 0 to 100 + * @member {number} [input.throttling.minFreeMemoryMb] The number of + * megabytes of RAM that the migrator will try to avoid using + * @member {number} [input.throttling.maxParallelism] The maximum number of + * work items (e.g. collection copies) that will be processed in parallel + * @member {array} [output] + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrateMongoDbTaskProperties + * + * @returns {object} metadata of MigrateMongoDbTaskProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'Migrate.MongoDb', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'taskType', + clientName: 'taskType' + }, + uberParent: 'ProjectTaskProperties', + className: 'MigrateMongoDbTaskProperties', + modelProperties: { + errors: { + required: false, + readOnly: true, + serializedName: 'errors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ODataErrorElementType', + type: { + name: 'Composite', + className: 'ODataError' + } + } + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + commands: { + required: false, + readOnly: true, + serializedName: 'commands', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CommandPropertiesElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'commandType', + clientName: 'commandType' + }, + uberParent: 'CommandProperties', + className: 'CommandProperties' + } + } + } + }, + taskType: { + required: true, + serializedName: 'taskType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + input: { + required: false, + serializedName: 'input', + type: { + name: 'Composite', + className: 'MongoDbMigrationSettings' + } + }, + output: { + required: false, + readOnly: true, + serializedName: 'output', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'MongoDbProgressElementType', + type: { + name: 'Composite', + className: 'MongoDbProgress' + } + } + } + } + } + } + }; + } +} + +module.exports = MigrateMongoDbTaskProperties; diff --git a/lib/services/datamigrationManagement/lib/models/migrateMySqlAzureDbForMySqlSyncDatabaseInput.js b/lib/services/datamigrationManagement/lib/models/migrateMySqlAzureDbForMySqlSyncDatabaseInput.js new file mode 100644 index 0000000000..978a0791d9 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateMySqlAzureDbForMySqlSyncDatabaseInput.js @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Database specific information for MySQL to Azure Database for MySQL + * migration task inputs + * + */ +class MigrateMySqlAzureDbForMySqlSyncDatabaseInput { + /** + * Create a MigrateMySqlAzureDbForMySqlSyncDatabaseInput. + * @member {string} [name] Name of the database + * @member {string} [targetDatabaseName] Name of target database. Note: + * Target database will be truncated before starting migration. + */ + constructor() { + } + + /** + * Defines the metadata of MigrateMySqlAzureDbForMySqlSyncDatabaseInput + * + * @returns {object} metadata of MigrateMySqlAzureDbForMySqlSyncDatabaseInput + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrateMySqlAzureDbForMySqlSyncDatabaseInput', + type: { + name: 'Composite', + className: 'MigrateMySqlAzureDbForMySqlSyncDatabaseInput', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + targetDatabaseName: { + required: false, + serializedName: 'targetDatabaseName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MigrateMySqlAzureDbForMySqlSyncDatabaseInput; diff --git a/lib/services/datamigrationManagement/lib/models/migrateMySqlAzureDbForMySqlSyncTaskInput.js b/lib/services/datamigrationManagement/lib/models/migrateMySqlAzureDbForMySqlSyncTaskInput.js new file mode 100644 index 0000000000..30d9aa42b9 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateMySqlAzureDbForMySqlSyncTaskInput.js @@ -0,0 +1,95 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Input for the task that migrates MySQL databases to Azure Database for MySQL + * for online migrations + * + */ +class MigrateMySqlAzureDbForMySqlSyncTaskInput { + /** + * Create a MigrateMySqlAzureDbForMySqlSyncTaskInput. + * @member {object} sourceConnectionInfo Connection information for source + * MySQL + * @member {string} [sourceConnectionInfo.serverName] Name of the server + * @member {number} [sourceConnectionInfo.port] Port for Server + * @member {object} targetConnectionInfo Connection information for target + * Azure Database for MySQL + * @member {string} [targetConnectionInfo.serverName] Name of the server + * @member {number} [targetConnectionInfo.port] Port for Server + * @member {array} selectedDatabases Databases to migrate + */ + constructor() { + } + + /** + * Defines the metadata of MigrateMySqlAzureDbForMySqlSyncTaskInput + * + * @returns {object} metadata of MigrateMySqlAzureDbForMySqlSyncTaskInput + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrateMySqlAzureDbForMySqlSyncTaskInput', + type: { + name: 'Composite', + className: 'MigrateMySqlAzureDbForMySqlSyncTaskInput', + modelProperties: { + sourceConnectionInfo: { + required: true, + serializedName: 'sourceConnectionInfo', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'ConnectionInfo', + className: 'MySqlConnectionInfo' + } + }, + targetConnectionInfo: { + required: true, + serializedName: 'targetConnectionInfo', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'ConnectionInfo', + className: 'MySqlConnectionInfo' + } + }, + selectedDatabases: { + required: true, + serializedName: 'selectedDatabases', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'MigrateMySqlAzureDbForMySqlSyncDatabaseInputElementType', + type: { + name: 'Composite', + className: 'MigrateMySqlAzureDbForMySqlSyncDatabaseInput' + } + } + } + } + } + } + }; + } +} + +module.exports = MigrateMySqlAzureDbForMySqlSyncTaskInput; diff --git a/lib/services/datamigrationManagement/lib/models/migrateMySqlAzureDbForMySqlSyncTaskOutput.js b/lib/services/datamigrationManagement/lib/models/migrateMySqlAzureDbForMySqlSyncTaskOutput.js new file mode 100644 index 0000000000..7059a5923e --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateMySqlAzureDbForMySqlSyncTaskOutput.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Output for the task that migrates MySQL databases to Azure Database for + * MySQL for online migrations + * + */ +class MigrateMySqlAzureDbForMySqlSyncTaskOutput { + /** + * Create a MigrateMySqlAzureDbForMySqlSyncTaskOutput. + * @member {string} [id] Result identifier + * @member {string} resultType Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of MigrateMySqlAzureDbForMySqlSyncTaskOutput + * + * @returns {object} metadata of MigrateMySqlAzureDbForMySqlSyncTaskOutput + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrateMySqlAzureDbForMySqlSyncTaskOutput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'MigrateMySqlAzureDbForMySqlSyncTaskOutput', + className: 'MigrateMySqlAzureDbForMySqlSyncTaskOutput', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MigrateMySqlAzureDbForMySqlSyncTaskOutput; diff --git a/lib/services/datamigrationManagement/lib/models/migrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError.js b/lib/services/datamigrationManagement/lib/models/migrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError.js new file mode 100644 index 0000000000..f1f74eded8 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError.js @@ -0,0 +1,92 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing a MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError. + * @extends models['MigrateMySqlAzureDbForMySqlSyncTaskOutput'] + */ +class MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError extends models['MigrateMySqlAzureDbForMySqlSyncTaskOutput'] { + /** + * Create a MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError. + * @member {string} [errorMessage] Error message + * @member {array} [events] List of error events. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + * + * @returns {object} metadata of MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + * + */ + mapper() { + return { + required: false, + serializedName: 'DatabaseLevelErrorOutput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'MigrateMySqlAzureDbForMySqlSyncTaskOutput', + className: 'MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + errorMessage: { + required: false, + serializedName: 'errorMessage', + type: { + name: 'String' + } + }, + events: { + required: false, + serializedName: 'events', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SyncMigrationDatabaseErrorEventElementType', + type: { + name: 'Composite', + className: 'SyncMigrationDatabaseErrorEvent' + } + } + } + } + } + } + }; + } +} + +module.exports = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError; diff --git a/lib/services/datamigrationManagement/lib/models/migrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel.js b/lib/services/datamigrationManagement/lib/models/migrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel.js new file mode 100644 index 0000000000..ee2d014abf --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel.js @@ -0,0 +1,211 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing a MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel. + * @extends models['MigrateMySqlAzureDbForMySqlSyncTaskOutput'] + */ +class MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel extends models['MigrateMySqlAzureDbForMySqlSyncTaskOutput'] { + /** + * Create a MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel. + * @member {string} [databaseName] Name of the database + * @member {date} [startedOn] Migration start time + * @member {date} [endedOn] Migration end time + * @member {string} [migrationState] Migration state that this database is + * in. Possible values include: 'UNDEFINED', 'CONFIGURING', 'INITIALIAZING', + * 'STARTING', 'RUNNING', 'READY_TO_COMPLETE', 'COMPLETING', 'COMPLETE', + * 'CANCELLING', 'CANCELLED', 'FAILED' + * @member {number} [incomingChanges] Number of incoming changes + * @member {number} [appliedChanges] Number of applied changes + * @member {number} [cdcInsertCounter] Number of cdc inserts + * @member {number} [cdcDeleteCounter] Number of cdc deletes + * @member {number} [cdcUpdateCounter] Number of cdc updates + * @member {number} [fullLoadCompletedTables] Number of tables completed in + * full load + * @member {number} [fullLoadLoadingTables] Number of tables loading in full + * load + * @member {number} [fullLoadQueuedTables] Number of tables queued in full + * load + * @member {number} [fullLoadErroredTables] Number of tables errored in full + * load + * @member {boolean} [initializationCompleted] Indicates if initial load + * (full load) has been completed + * @member {number} [latency] CDC apply latency + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + * + * @returns {object} metadata of MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + * + */ + mapper() { + return { + required: false, + serializedName: 'DatabaseLevelOutput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'MigrateMySqlAzureDbForMySqlSyncTaskOutput', + className: 'MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + databaseName: { + required: false, + readOnly: true, + serializedName: 'databaseName', + type: { + name: 'String' + } + }, + startedOn: { + required: false, + readOnly: true, + serializedName: 'startedOn', + type: { + name: 'DateTime' + } + }, + endedOn: { + required: false, + readOnly: true, + serializedName: 'endedOn', + type: { + name: 'DateTime' + } + }, + migrationState: { + required: false, + readOnly: true, + serializedName: 'migrationState', + type: { + name: 'String' + } + }, + incomingChanges: { + required: false, + readOnly: true, + serializedName: 'incomingChanges', + type: { + name: 'Number' + } + }, + appliedChanges: { + required: false, + readOnly: true, + serializedName: 'appliedChanges', + type: { + name: 'Number' + } + }, + cdcInsertCounter: { + required: false, + readOnly: true, + serializedName: 'cdcInsertCounter', + type: { + name: 'Number' + } + }, + cdcDeleteCounter: { + required: false, + readOnly: true, + serializedName: 'cdcDeleteCounter', + type: { + name: 'Number' + } + }, + cdcUpdateCounter: { + required: false, + readOnly: true, + serializedName: 'cdcUpdateCounter', + type: { + name: 'Number' + } + }, + fullLoadCompletedTables: { + required: false, + readOnly: true, + serializedName: 'fullLoadCompletedTables', + type: { + name: 'Number' + } + }, + fullLoadLoadingTables: { + required: false, + readOnly: true, + serializedName: 'fullLoadLoadingTables', + type: { + name: 'Number' + } + }, + fullLoadQueuedTables: { + required: false, + readOnly: true, + serializedName: 'fullLoadQueuedTables', + type: { + name: 'Number' + } + }, + fullLoadErroredTables: { + required: false, + readOnly: true, + serializedName: 'fullLoadErroredTables', + type: { + name: 'Number' + } + }, + initializationCompleted: { + required: false, + readOnly: true, + serializedName: 'initializationCompleted', + type: { + name: 'Boolean' + } + }, + latency: { + required: false, + readOnly: true, + serializedName: 'latency', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel; diff --git a/lib/services/datamigrationManagement/lib/models/migrateMySqlAzureDbForMySqlSyncTaskOutputError.js b/lib/services/datamigrationManagement/lib/models/migrateMySqlAzureDbForMySqlSyncTaskOutputError.js new file mode 100644 index 0000000000..86aed10007 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateMySqlAzureDbForMySqlSyncTaskOutputError.js @@ -0,0 +1,88 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing a MigrateMySqlAzureDbForMySqlSyncTaskOutputError. + * @extends models['MigrateMySqlAzureDbForMySqlSyncTaskOutput'] + */ +class MigrateMySqlAzureDbForMySqlSyncTaskOutputError extends models['MigrateMySqlAzureDbForMySqlSyncTaskOutput'] { + /** + * Create a MigrateMySqlAzureDbForMySqlSyncTaskOutputError. + * @member {object} [error] Migration error + * @member {string} [error.message] Error message + * @member {string} [error.actionableMessage] Actionable steps for this + * exception + * @member {string} [error.filePath] The path to the file where exception + * occurred + * @member {string} [error.lineNumber] The line number where exception + * occurred + * @member {number} [error.hResult] Coded numerical value that is assigned to + * a specific exception + * @member {string} [error.stackTrace] Stack trace + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrateMySqlAzureDbForMySqlSyncTaskOutputError + * + * @returns {object} metadata of MigrateMySqlAzureDbForMySqlSyncTaskOutputError + * + */ + mapper() { + return { + required: false, + serializedName: 'ErrorOutput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'MigrateMySqlAzureDbForMySqlSyncTaskOutput', + className: 'MigrateMySqlAzureDbForMySqlSyncTaskOutputError', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + error: { + required: false, + readOnly: true, + serializedName: 'error', + type: { + name: 'Composite', + className: 'ReportableException' + } + } + } + } + }; + } +} + +module.exports = MigrateMySqlAzureDbForMySqlSyncTaskOutputError; diff --git a/lib/services/datamigrationManagement/lib/models/migrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel.js b/lib/services/datamigrationManagement/lib/models/migrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel.js new file mode 100644 index 0000000000..48ec435ff6 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel.js @@ -0,0 +1,122 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing a MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel. + * @extends models['MigrateMySqlAzureDbForMySqlSyncTaskOutput'] + */ +class MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel extends models['MigrateMySqlAzureDbForMySqlSyncTaskOutput'] { + /** + * Create a MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel. + * @member {date} [startedOn] Migration start time + * @member {date} [endedOn] Migration end time + * @member {string} [sourceServerVersion] Source server version + * @member {string} [sourceServer] Source server name + * @member {string} [targetServerVersion] Target server version + * @member {string} [targetServer] Target server name + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + * + * @returns {object} metadata of MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrationLevelOutput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'MigrateMySqlAzureDbForMySqlSyncTaskOutput', + className: 'MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + startedOn: { + required: false, + readOnly: true, + serializedName: 'startedOn', + type: { + name: 'DateTime' + } + }, + endedOn: { + required: false, + readOnly: true, + serializedName: 'endedOn', + type: { + name: 'DateTime' + } + }, + sourceServerVersion: { + required: false, + readOnly: true, + serializedName: 'sourceServerVersion', + type: { + name: 'String' + } + }, + sourceServer: { + required: false, + readOnly: true, + serializedName: 'sourceServer', + type: { + name: 'String' + } + }, + targetServerVersion: { + required: false, + readOnly: true, + serializedName: 'targetServerVersion', + type: { + name: 'String' + } + }, + targetServer: { + required: false, + readOnly: true, + serializedName: 'targetServer', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel; diff --git a/lib/services/datamigrationManagement/lib/models/migrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel.js b/lib/services/datamigrationManagement/lib/models/migrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel.js new file mode 100644 index 0000000000..bf6e8ee100 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel.js @@ -0,0 +1,187 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing a MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel. + * @extends models['MigrateMySqlAzureDbForMySqlSyncTaskOutput'] + */ +class MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel extends models['MigrateMySqlAzureDbForMySqlSyncTaskOutput'] { + /** + * Create a MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel. + * @member {string} [tableName] Name of the table + * @member {string} [databaseName] Name of the database + * @member {string} [cdcInsertCounter] Number of applied inserts + * @member {string} [cdcUpdateCounter] Number of applied updates + * @member {string} [cdcDeleteCounter] Number of applied deletes + * @member {date} [fullLoadEstFinishTime] Estimate to finish full load + * @member {date} [fullLoadStartedOn] Full load start time + * @member {date} [fullLoadEndedOn] Full load end time + * @member {number} [fullLoadTotalRows] Number of rows applied in full load + * @member {string} [state] Current state of the table migration. Possible + * values include: 'BEFORE_LOAD', 'FULL_LOAD', 'COMPLETED', 'CANCELED', + * 'ERROR', 'FAILED' + * @member {number} [totalChangesApplied] Total number of applied changes + * @member {number} [dataErrorsCounter] Number of data errors occurred + * @member {date} [lastModifiedTime] Last modified time on target + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + * + * @returns {object} metadata of MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + * + */ + mapper() { + return { + required: false, + serializedName: 'TableLevelOutput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'MigrateMySqlAzureDbForMySqlSyncTaskOutput', + className: 'MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + tableName: { + required: false, + readOnly: true, + serializedName: 'tableName', + type: { + name: 'String' + } + }, + databaseName: { + required: false, + readOnly: true, + serializedName: 'databaseName', + type: { + name: 'String' + } + }, + cdcInsertCounter: { + required: false, + readOnly: true, + serializedName: 'cdcInsertCounter', + type: { + name: 'String' + } + }, + cdcUpdateCounter: { + required: false, + readOnly: true, + serializedName: 'cdcUpdateCounter', + type: { + name: 'String' + } + }, + cdcDeleteCounter: { + required: false, + readOnly: true, + serializedName: 'cdcDeleteCounter', + type: { + name: 'String' + } + }, + fullLoadEstFinishTime: { + required: false, + readOnly: true, + serializedName: 'fullLoadEstFinishTime', + type: { + name: 'DateTime' + } + }, + fullLoadStartedOn: { + required: false, + readOnly: true, + serializedName: 'fullLoadStartedOn', + type: { + name: 'DateTime' + } + }, + fullLoadEndedOn: { + required: false, + readOnly: true, + serializedName: 'fullLoadEndedOn', + type: { + name: 'DateTime' + } + }, + fullLoadTotalRows: { + required: false, + readOnly: true, + serializedName: 'fullLoadTotalRows', + type: { + name: 'Number' + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + totalChangesApplied: { + required: false, + readOnly: true, + serializedName: 'totalChangesApplied', + type: { + name: 'Number' + } + }, + dataErrorsCounter: { + required: false, + readOnly: true, + serializedName: 'dataErrorsCounter', + type: { + name: 'Number' + } + }, + lastModifiedTime: { + required: false, + readOnly: true, + serializedName: 'lastModifiedTime', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel; diff --git a/lib/services/datamigrationManagement/lib/models/migrateMySqlAzureDbForMySqlSyncTaskProperties.js b/lib/services/datamigrationManagement/lib/models/migrateMySqlAzureDbForMySqlSyncTaskProperties.js new file mode 100644 index 0000000000..cbe8a49d9f --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateMySqlAzureDbForMySqlSyncTaskProperties.js @@ -0,0 +1,149 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Properties for the task that migrates MySQL databases to Azure Database for + * MySQL for online migrations + * + * @extends models['ProjectTaskProperties'] + */ +class MigrateMySqlAzureDbForMySqlSyncTaskProperties extends models['ProjectTaskProperties'] { + /** + * Create a MigrateMySqlAzureDbForMySqlSyncTaskProperties. + * @member {object} [input] Task input + * @member {object} [input.sourceConnectionInfo] Connection information for + * source MySQL + * @member {string} [input.sourceConnectionInfo.serverName] Name of the + * server + * @member {number} [input.sourceConnectionInfo.port] Port for Server + * @member {object} [input.targetConnectionInfo] Connection information for + * target Azure Database for MySQL + * @member {string} [input.targetConnectionInfo.serverName] Name of the + * server + * @member {number} [input.targetConnectionInfo.port] Port for Server + * @member {array} [input.selectedDatabases] Databases to migrate + * @member {array} [output] Task output. This is ignored if submitted. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrateMySqlAzureDbForMySqlSyncTaskProperties + * + * @returns {object} metadata of MigrateMySqlAzureDbForMySqlSyncTaskProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'Migrate.MySql.AzureDbForMySql.Sync', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'taskType', + clientName: 'taskType' + }, + uberParent: 'ProjectTaskProperties', + className: 'MigrateMySqlAzureDbForMySqlSyncTaskProperties', + modelProperties: { + errors: { + required: false, + readOnly: true, + serializedName: 'errors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ODataErrorElementType', + type: { + name: 'Composite', + className: 'ODataError' + } + } + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + commands: { + required: false, + readOnly: true, + serializedName: 'commands', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CommandPropertiesElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'commandType', + clientName: 'commandType' + }, + uberParent: 'CommandProperties', + className: 'CommandProperties' + } + } + } + }, + taskType: { + required: true, + serializedName: 'taskType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + input: { + required: false, + serializedName: 'input', + type: { + name: 'Composite', + className: 'MigrateMySqlAzureDbForMySqlSyncTaskInput' + } + }, + output: { + required: false, + readOnly: true, + serializedName: 'output', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'MigrateMySqlAzureDbForMySqlSyncTaskOutputElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'MigrateMySqlAzureDbForMySqlSyncTaskOutput', + className: 'MigrateMySqlAzureDbForMySqlSyncTaskOutput' + } + } + } + } + } + } + }; + } +} + +module.exports = MigrateMySqlAzureDbForMySqlSyncTaskProperties; diff --git a/lib/services/datamigrationManagement/lib/models/migratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput.js b/lib/services/datamigrationManagement/lib/models/migratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput.js new file mode 100644 index 0000000000..4fd0e347b7 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput.js @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Database specific information for PostgreSQL to Azure Database for + * PostgreSQL migration task inputs + * + */ +class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput { + /** + * Create a MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput. + * @member {string} [name] Name of the database + * @member {string} [targetDatabaseName] Name of target database. Note: + * Target database will be truncated before starting migration. + */ + constructor() { + } + + /** + * Defines the metadata of MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput + * + * @returns {object} metadata of MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput + * + */ + mapper() { + return { + required: false, + serializedName: 'MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput', + type: { + name: 'Composite', + className: 'MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + targetDatabaseName: { + required: false, + serializedName: 'targetDatabaseName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput; diff --git a/lib/services/datamigrationManagement/lib/models/migratePostgreSqlAzureDbForPostgreSqlSyncTaskInput.js b/lib/services/datamigrationManagement/lib/models/migratePostgreSqlAzureDbForPostgreSqlSyncTaskInput.js new file mode 100644 index 0000000000..8e1d2c8f9d --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migratePostgreSqlAzureDbForPostgreSqlSyncTaskInput.js @@ -0,0 +1,97 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Input for the task that migrates PostgreSQL databases to Azure Database for + * PostgreSQL for online migrations + * + */ +class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput { + /** + * Create a MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput. + * @member {array} selectedDatabases Databases to migrate + * @member {object} targetConnectionInfo Connection information for target + * Azure Database for PostgreSQL + * @member {string} [targetConnectionInfo.serverName] Name of the server + * @member {string} [targetConnectionInfo.databaseName] Name of the database + * @member {number} [targetConnectionInfo.port] Port for Server + * @member {object} sourceConnectionInfo Connection information for source + * PostgreSQL + * @member {string} [sourceConnectionInfo.serverName] Name of the server + * @member {string} [sourceConnectionInfo.databaseName] Name of the database + * @member {number} [sourceConnectionInfo.port] Port for Server + */ + constructor() { + } + + /** + * Defines the metadata of MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput + * + * @returns {object} metadata of MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput + * + */ + mapper() { + return { + required: false, + serializedName: 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput', + type: { + name: 'Composite', + className: 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput', + modelProperties: { + selectedDatabases: { + required: true, + serializedName: 'selectedDatabases', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputElementType', + type: { + name: 'Composite', + className: 'MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput' + } + } + } + }, + targetConnectionInfo: { + required: true, + serializedName: 'targetConnectionInfo', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'ConnectionInfo', + className: 'PostgreSqlConnectionInfo' + } + }, + sourceConnectionInfo: { + required: true, + serializedName: 'sourceConnectionInfo', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'ConnectionInfo', + className: 'PostgreSqlConnectionInfo' + } + } + } + } + }; + } +} + +module.exports = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput; diff --git a/lib/services/datamigrationManagement/lib/models/migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput.js b/lib/services/datamigrationManagement/lib/models/migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput.js new file mode 100644 index 0000000000..0cc2f4d57b --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Output for the task that migrates PostgreSQL databases to Azure Database for + * PostgreSQL for online migrations + * + */ +class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput { + /** + * Create a MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput. + * @member {string} [id] Result identifier + * @member {string} resultType Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + * + * @returns {object} metadata of MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + * + */ + mapper() { + return { + required: false, + serializedName: 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput', + className: 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput; diff --git a/lib/services/datamigrationManagement/lib/models/migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError.js b/lib/services/datamigrationManagement/lib/models/migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError.js new file mode 100644 index 0000000000..198a98e71a --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError.js @@ -0,0 +1,92 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing a MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError. + * @extends models['MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput'] + */ +class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError extends models['MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput'] { + /** + * Create a MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError. + * @member {string} [errorMessage] Error message + * @member {array} [events] List of error events. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + * + * @returns {object} metadata of MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + * + */ + mapper() { + return { + required: false, + serializedName: 'DatabaseLevelErrorOutput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput', + className: 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + errorMessage: { + required: false, + serializedName: 'errorMessage', + type: { + name: 'String' + } + }, + events: { + required: false, + serializedName: 'events', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SyncMigrationDatabaseErrorEventElementType', + type: { + name: 'Composite', + className: 'SyncMigrationDatabaseErrorEvent' + } + } + } + } + } + } + }; + } +} + +module.exports = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError; diff --git a/lib/services/datamigrationManagement/lib/models/migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel.js b/lib/services/datamigrationManagement/lib/models/migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel.js new file mode 100644 index 0000000000..e4c28075d5 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel.js @@ -0,0 +1,211 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing a MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel. + * @extends models['MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput'] + */ +class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel extends models['MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput'] { + /** + * Create a MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel. + * @member {string} [databaseName] Name of the database + * @member {date} [startedOn] Migration start time + * @member {date} [endedOn] Migration end time + * @member {string} [migrationState] Migration state that this database is + * in. Possible values include: 'UNDEFINED', 'CONFIGURING', 'INITIALIAZING', + * 'STARTING', 'RUNNING', 'READY_TO_COMPLETE', 'COMPLETING', 'COMPLETE', + * 'CANCELLING', 'CANCELLED', 'FAILED' + * @member {number} [incomingChanges] Number of incoming changes + * @member {number} [appliedChanges] Number of applied changes + * @member {number} [cdcInsertCounter] Number of cdc inserts + * @member {number} [cdcDeleteCounter] Number of cdc deletes + * @member {number} [cdcUpdateCounter] Number of cdc updates + * @member {number} [fullLoadCompletedTables] Number of tables completed in + * full load + * @member {number} [fullLoadLoadingTables] Number of tables loading in full + * load + * @member {number} [fullLoadQueuedTables] Number of tables queued in full + * load + * @member {number} [fullLoadErroredTables] Number of tables errored in full + * load + * @member {boolean} [initializationCompleted] Indicates if initial load + * (full load) has been completed + * @member {number} [latency] CDC apply latency + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + * + * @returns {object} metadata of MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + * + */ + mapper() { + return { + required: false, + serializedName: 'DatabaseLevelOutput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput', + className: 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + databaseName: { + required: false, + readOnly: true, + serializedName: 'databaseName', + type: { + name: 'String' + } + }, + startedOn: { + required: false, + readOnly: true, + serializedName: 'startedOn', + type: { + name: 'DateTime' + } + }, + endedOn: { + required: false, + readOnly: true, + serializedName: 'endedOn', + type: { + name: 'DateTime' + } + }, + migrationState: { + required: false, + readOnly: true, + serializedName: 'migrationState', + type: { + name: 'String' + } + }, + incomingChanges: { + required: false, + readOnly: true, + serializedName: 'incomingChanges', + type: { + name: 'Number' + } + }, + appliedChanges: { + required: false, + readOnly: true, + serializedName: 'appliedChanges', + type: { + name: 'Number' + } + }, + cdcInsertCounter: { + required: false, + readOnly: true, + serializedName: 'cdcInsertCounter', + type: { + name: 'Number' + } + }, + cdcDeleteCounter: { + required: false, + readOnly: true, + serializedName: 'cdcDeleteCounter', + type: { + name: 'Number' + } + }, + cdcUpdateCounter: { + required: false, + readOnly: true, + serializedName: 'cdcUpdateCounter', + type: { + name: 'Number' + } + }, + fullLoadCompletedTables: { + required: false, + readOnly: true, + serializedName: 'fullLoadCompletedTables', + type: { + name: 'Number' + } + }, + fullLoadLoadingTables: { + required: false, + readOnly: true, + serializedName: 'fullLoadLoadingTables', + type: { + name: 'Number' + } + }, + fullLoadQueuedTables: { + required: false, + readOnly: true, + serializedName: 'fullLoadQueuedTables', + type: { + name: 'Number' + } + }, + fullLoadErroredTables: { + required: false, + readOnly: true, + serializedName: 'fullLoadErroredTables', + type: { + name: 'Number' + } + }, + initializationCompleted: { + required: false, + readOnly: true, + serializedName: 'initializationCompleted', + type: { + name: 'Boolean' + } + }, + latency: { + required: false, + readOnly: true, + serializedName: 'latency', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel; diff --git a/lib/services/datamigrationManagement/lib/models/migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError.js b/lib/services/datamigrationManagement/lib/models/migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError.js new file mode 100644 index 0000000000..564cadac3d --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError.js @@ -0,0 +1,88 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing a MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError. + * @extends models['MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput'] + */ +class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError extends models['MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput'] { + /** + * Create a MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError. + * @member {object} [error] Migration error + * @member {string} [error.message] Error message + * @member {string} [error.actionableMessage] Actionable steps for this + * exception + * @member {string} [error.filePath] The path to the file where exception + * occurred + * @member {string} [error.lineNumber] The line number where exception + * occurred + * @member {number} [error.hResult] Coded numerical value that is assigned to + * a specific exception + * @member {string} [error.stackTrace] Stack trace + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + * + * @returns {object} metadata of MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + * + */ + mapper() { + return { + required: false, + serializedName: 'ErrorOutput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput', + className: 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + error: { + required: false, + readOnly: true, + serializedName: 'error', + type: { + name: 'Composite', + className: 'ReportableException' + } + } + } + } + }; + } +} + +module.exports = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError; diff --git a/lib/services/datamigrationManagement/lib/models/migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.js b/lib/services/datamigrationManagement/lib/models/migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.js new file mode 100644 index 0000000000..3aae29a5f2 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.js @@ -0,0 +1,122 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing a MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel. + * @extends models['MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput'] + */ +class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel extends models['MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput'] { + /** + * Create a MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel. + * @member {date} [startedOn] Migration start time + * @member {date} [endedOn] Migration end time + * @member {string} [sourceServerVersion] Source server version + * @member {string} [sourceServer] Source server name + * @member {string} [targetServerVersion] Target server version + * @member {string} [targetServer] Target server name + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + * + * @returns {object} metadata of MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrationLevelOutput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput', + className: 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + startedOn: { + required: false, + readOnly: true, + serializedName: 'startedOn', + type: { + name: 'DateTime' + } + }, + endedOn: { + required: false, + readOnly: true, + serializedName: 'endedOn', + type: { + name: 'DateTime' + } + }, + sourceServerVersion: { + required: false, + readOnly: true, + serializedName: 'sourceServerVersion', + type: { + name: 'String' + } + }, + sourceServer: { + required: false, + readOnly: true, + serializedName: 'sourceServer', + type: { + name: 'String' + } + }, + targetServerVersion: { + required: false, + readOnly: true, + serializedName: 'targetServerVersion', + type: { + name: 'String' + } + }, + targetServer: { + required: false, + readOnly: true, + serializedName: 'targetServer', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel; diff --git a/lib/services/datamigrationManagement/lib/models/migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel.js b/lib/services/datamigrationManagement/lib/models/migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel.js new file mode 100644 index 0000000000..65e09b66f2 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel.js @@ -0,0 +1,187 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing a MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel. + * @extends models['MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput'] + */ +class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel extends models['MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput'] { + /** + * Create a MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel. + * @member {string} [tableName] Name of the table + * @member {string} [databaseName] Name of the database + * @member {number} [cdcInsertCounter] Number of applied inserts + * @member {number} [cdcUpdateCounter] Number of applied updates + * @member {number} [cdcDeleteCounter] Number of applied deletes + * @member {date} [fullLoadEstFinishTime] Estimate to finish full load + * @member {date} [fullLoadStartedOn] Full load start time + * @member {date} [fullLoadEndedOn] Full load end time + * @member {number} [fullLoadTotalRows] Number of rows applied in full load + * @member {string} [state] Current state of the table migration. Possible + * values include: 'BEFORE_LOAD', 'FULL_LOAD', 'COMPLETED', 'CANCELED', + * 'ERROR', 'FAILED' + * @member {number} [totalChangesApplied] Total number of applied changes + * @member {number} [dataErrorsCounter] Number of data errors occurred + * @member {date} [lastModifiedTime] Last modified time on target + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + * + * @returns {object} metadata of MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + * + */ + mapper() { + return { + required: false, + serializedName: 'TableLevelOutput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput', + className: 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + tableName: { + required: false, + readOnly: true, + serializedName: 'tableName', + type: { + name: 'String' + } + }, + databaseName: { + required: false, + readOnly: true, + serializedName: 'databaseName', + type: { + name: 'String' + } + }, + cdcInsertCounter: { + required: false, + readOnly: true, + serializedName: 'cdcInsertCounter', + type: { + name: 'Number' + } + }, + cdcUpdateCounter: { + required: false, + readOnly: true, + serializedName: 'cdcUpdateCounter', + type: { + name: 'Number' + } + }, + cdcDeleteCounter: { + required: false, + readOnly: true, + serializedName: 'cdcDeleteCounter', + type: { + name: 'Number' + } + }, + fullLoadEstFinishTime: { + required: false, + readOnly: true, + serializedName: 'fullLoadEstFinishTime', + type: { + name: 'DateTime' + } + }, + fullLoadStartedOn: { + required: false, + readOnly: true, + serializedName: 'fullLoadStartedOn', + type: { + name: 'DateTime' + } + }, + fullLoadEndedOn: { + required: false, + readOnly: true, + serializedName: 'fullLoadEndedOn', + type: { + name: 'DateTime' + } + }, + fullLoadTotalRows: { + required: false, + readOnly: true, + serializedName: 'fullLoadTotalRows', + type: { + name: 'Number' + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + totalChangesApplied: { + required: false, + readOnly: true, + serializedName: 'totalChangesApplied', + type: { + name: 'Number' + } + }, + dataErrorsCounter: { + required: false, + readOnly: true, + serializedName: 'dataErrorsCounter', + type: { + name: 'Number' + } + }, + lastModifiedTime: { + required: false, + readOnly: true, + serializedName: 'lastModifiedTime', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel; diff --git a/lib/services/datamigrationManagement/lib/models/migratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.js b/lib/services/datamigrationManagement/lib/models/migratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.js new file mode 100644 index 0000000000..3722c50eb0 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.js @@ -0,0 +1,153 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Properties for the task that migrates PostgreSQL databases to Azure Database + * for PostgreSQL for online migrations + * + * @extends models['ProjectTaskProperties'] + */ +class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties extends models['ProjectTaskProperties'] { + /** + * Create a MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties. + * @member {object} [input] Task input + * @member {array} [input.selectedDatabases] Databases to migrate + * @member {object} [input.targetConnectionInfo] Connection information for + * target Azure Database for PostgreSQL + * @member {string} [input.targetConnectionInfo.serverName] Name of the + * server + * @member {string} [input.targetConnectionInfo.databaseName] Name of the + * database + * @member {number} [input.targetConnectionInfo.port] Port for Server + * @member {object} [input.sourceConnectionInfo] Connection information for + * source PostgreSQL + * @member {string} [input.sourceConnectionInfo.serverName] Name of the + * server + * @member {string} [input.sourceConnectionInfo.databaseName] Name of the + * database + * @member {number} [input.sourceConnectionInfo.port] Port for Server + * @member {array} [output] Task output. This is ignored if submitted. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties + * + * @returns {object} metadata of MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'Migrate.PostgreSql.AzureDbForPostgreSql.Sync', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'taskType', + clientName: 'taskType' + }, + uberParent: 'ProjectTaskProperties', + className: 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties', + modelProperties: { + errors: { + required: false, + readOnly: true, + serializedName: 'errors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ODataErrorElementType', + type: { + name: 'Composite', + className: 'ODataError' + } + } + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + commands: { + required: false, + readOnly: true, + serializedName: 'commands', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CommandPropertiesElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'commandType', + clientName: 'commandType' + }, + uberParent: 'CommandProperties', + className: 'CommandProperties' + } + } + } + }, + taskType: { + required: true, + serializedName: 'taskType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + input: { + required: false, + serializedName: 'input', + type: { + name: 'Composite', + className: 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput' + } + }, + output: { + required: false, + readOnly: true, + serializedName: 'output', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput', + className: 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput' + } + } + } + } + } + } + }; + } +} + +module.exports = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties; diff --git a/lib/services/datamigrationManagement/lib/models/migrateSchemaSqlServerSqlDbDatabaseInput.js b/lib/services/datamigrationManagement/lib/models/migrateSchemaSqlServerSqlDbDatabaseInput.js new file mode 100644 index 0000000000..f1528e0269 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateSchemaSqlServerSqlDbDatabaseInput.js @@ -0,0 +1,74 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Database input for migrate schema Sql Server to Azure SQL Server scenario + * + */ +class MigrateSchemaSqlServerSqlDbDatabaseInput { + /** + * Create a MigrateSchemaSqlServerSqlDbDatabaseInput. + * @member {string} [name] Name of source database + * @member {string} [targetDatabaseName] Name of target database + * @member {object} [schemaSetting] Database schema migration settings + * @member {string} [schemaSetting.schemaOption] Option on how to migrate the + * schema. Possible values include: 'None', 'ExtractFromSource', + * 'UseStorageFile' + * @member {string} [schemaSetting.fileId] Resource Identifier of a file + * resource containing the uploaded schema file + */ + constructor() { + } + + /** + * Defines the metadata of MigrateSchemaSqlServerSqlDbDatabaseInput + * + * @returns {object} metadata of MigrateSchemaSqlServerSqlDbDatabaseInput + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrateSchemaSqlServerSqlDbDatabaseInput', + type: { + name: 'Composite', + className: 'MigrateSchemaSqlServerSqlDbDatabaseInput', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + targetDatabaseName: { + required: false, + serializedName: 'targetDatabaseName', + type: { + name: 'String' + } + }, + schemaSetting: { + required: false, + serializedName: 'schemaSetting', + type: { + name: 'Composite', + className: 'SchemaMigrationSetting' + } + } + } + } + }; + } +} + +module.exports = MigrateSchemaSqlServerSqlDbDatabaseInput; diff --git a/lib/services/datamigrationManagement/lib/models/migrateSchemaSqlServerSqlDbTaskInput.js b/lib/services/datamigrationManagement/lib/models/migrateSchemaSqlServerSqlDbTaskInput.js new file mode 100644 index 0000000000..7abafa01da --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateSchemaSqlServerSqlDbTaskInput.js @@ -0,0 +1,91 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Input for task that migrates Schema for SQL Server databases to Azure SQL + * databases + * + * @extends models['SqlMigrationTaskInput'] + */ +class MigrateSchemaSqlServerSqlDbTaskInput extends models['SqlMigrationTaskInput'] { + /** + * Create a MigrateSchemaSqlServerSqlDbTaskInput. + * @member {array} selectedDatabases Databases to migrate + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrateSchemaSqlServerSqlDbTaskInput + * + * @returns {object} metadata of MigrateSchemaSqlServerSqlDbTaskInput + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrateSchemaSqlServerSqlDbTaskInput', + type: { + name: 'Composite', + className: 'MigrateSchemaSqlServerSqlDbTaskInput', + modelProperties: { + sourceConnectionInfo: { + required: true, + serializedName: 'sourceConnectionInfo', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'ConnectionInfo', + className: 'SqlConnectionInfo' + } + }, + targetConnectionInfo: { + required: true, + serializedName: 'targetConnectionInfo', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'ConnectionInfo', + className: 'SqlConnectionInfo' + } + }, + selectedDatabases: { + required: true, + serializedName: 'selectedDatabases', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'MigrateSchemaSqlServerSqlDbDatabaseInputElementType', + type: { + name: 'Composite', + className: 'MigrateSchemaSqlServerSqlDbDatabaseInput' + } + } + } + } + } + } + }; + } +} + +module.exports = MigrateSchemaSqlServerSqlDbTaskInput; diff --git a/lib/services/datamigrationManagement/lib/models/migrateSchemaSqlServerSqlDbTaskOutput.js b/lib/services/datamigrationManagement/lib/models/migrateSchemaSqlServerSqlDbTaskOutput.js new file mode 100644 index 0000000000..47b781889b --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateSchemaSqlServerSqlDbTaskOutput.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Output for the task that migrates Schema for SQL Server databases to Azure + * SQL databases + * + */ +class MigrateSchemaSqlServerSqlDbTaskOutput { + /** + * Create a MigrateSchemaSqlServerSqlDbTaskOutput. + * @member {string} [id] Result identifier + * @member {string} resultType Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of MigrateSchemaSqlServerSqlDbTaskOutput + * + * @returns {object} metadata of MigrateSchemaSqlServerSqlDbTaskOutput + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrateSchemaSqlServerSqlDbTaskOutput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'MigrateSchemaSqlServerSqlDbTaskOutput', + className: 'MigrateSchemaSqlServerSqlDbTaskOutput', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MigrateSchemaSqlServerSqlDbTaskOutput; diff --git a/lib/services/datamigrationManagement/lib/models/migrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.js b/lib/services/datamigrationManagement/lib/models/migrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.js new file mode 100644 index 0000000000..70e99c42d1 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.js @@ -0,0 +1,169 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing a MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel. + * @extends models['MigrateSchemaSqlServerSqlDbTaskOutput'] + */ +class MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel extends models['MigrateSchemaSqlServerSqlDbTaskOutput'] { + /** + * Create a MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel. + * @member {string} [databaseName] The name of the database + * @member {string} [state] State of the schema migration for this database. + * Possible values include: 'None', 'InProgress', 'Failed', 'Warning', + * 'Completed', 'Skipped', 'Stopped' + * @member {string} [stage] Schema migration stage for this database. + * Possible values include: 'NotStarted', 'ValidatingInputs', + * 'CollectingObjects', 'DownloadingScript', 'GeneratingScript', + * 'UploadingScript', 'DeployingSchema', 'Completed', + * 'CompletedWithWarnings', 'Failed' + * @member {date} [startedOn] Migration start time + * @member {date} [endedOn] Migration end time + * @member {string} [databaseErrorResultPrefix] Prefix string to use for + * querying errors for this database + * @member {string} [schemaErrorResultPrefix] Prefix string to use for + * querying schema errors for this database + * @member {number} [numberOfSuccessfulOperations] Number of successful + * operations for this database + * @member {number} [numberOfFailedOperations] Number of failed operations + * for this database + * @member {string} [fileId] Identifier for the file resource containing the + * schema of this database + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel + * + * @returns {object} metadata of MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel + * + */ + mapper() { + return { + required: false, + serializedName: 'DatabaseLevelOutput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'MigrateSchemaSqlServerSqlDbTaskOutput', + className: 'MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + databaseName: { + required: false, + readOnly: true, + serializedName: 'databaseName', + type: { + name: 'String' + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + stage: { + required: false, + readOnly: true, + serializedName: 'stage', + type: { + name: 'String' + } + }, + startedOn: { + required: false, + readOnly: true, + serializedName: 'startedOn', + type: { + name: 'DateTime' + } + }, + endedOn: { + required: false, + readOnly: true, + serializedName: 'endedOn', + type: { + name: 'DateTime' + } + }, + databaseErrorResultPrefix: { + required: false, + readOnly: true, + serializedName: 'databaseErrorResultPrefix', + type: { + name: 'String' + } + }, + schemaErrorResultPrefix: { + required: false, + readOnly: true, + serializedName: 'schemaErrorResultPrefix', + type: { + name: 'String' + } + }, + numberOfSuccessfulOperations: { + required: false, + readOnly: true, + serializedName: 'numberOfSuccessfulOperations', + type: { + name: 'Number' + } + }, + numberOfFailedOperations: { + required: false, + readOnly: true, + serializedName: 'numberOfFailedOperations', + type: { + name: 'Number' + } + }, + fileId: { + required: false, + readOnly: true, + serializedName: 'fileId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel; diff --git a/lib/services/datamigrationManagement/lib/models/migrateSchemaSqlServerSqlDbTaskOutputError.js b/lib/services/datamigrationManagement/lib/models/migrateSchemaSqlServerSqlDbTaskOutputError.js new file mode 100644 index 0000000000..c8a864e991 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateSchemaSqlServerSqlDbTaskOutputError.js @@ -0,0 +1,86 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing a MigrateSchemaSqlServerSqlDbTaskOutputError. + * @extends models['MigrateSchemaSqlServerSqlDbTaskOutput'] + */ +class MigrateSchemaSqlServerSqlDbTaskOutputError extends models['MigrateSchemaSqlServerSqlDbTaskOutput'] { + /** + * Create a MigrateSchemaSqlServerSqlDbTaskOutputError. + * @member {string} [commandText] Schema command which failed + * @member {string} [errorText] Reason of failure + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrateSchemaSqlServerSqlDbTaskOutputError + * + * @returns {object} metadata of MigrateSchemaSqlServerSqlDbTaskOutputError + * + */ + mapper() { + return { + required: false, + serializedName: 'SchemaErrorOutput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'MigrateSchemaSqlServerSqlDbTaskOutput', + className: 'MigrateSchemaSqlServerSqlDbTaskOutputError', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + commandText: { + required: false, + readOnly: true, + serializedName: 'commandText', + type: { + name: 'String' + } + }, + errorText: { + required: false, + readOnly: true, + serializedName: 'errorText', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MigrateSchemaSqlServerSqlDbTaskOutputError; diff --git a/lib/services/datamigrationManagement/lib/models/migrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.js b/lib/services/datamigrationManagement/lib/models/migrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.js new file mode 100644 index 0000000000..71a28868c5 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.js @@ -0,0 +1,133 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing a MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel. + * @extends models['MigrateSchemaSqlServerSqlDbTaskOutput'] + */ +class MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel extends models['MigrateSchemaSqlServerSqlDbTaskOutput'] { + /** + * Create a MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel. + * @member {string} [state] Overall state of the schema migration. Possible + * values include: 'None', 'InProgress', 'Failed', 'Warning', 'Completed', + * 'Skipped', 'Stopped' + * @member {date} [startedOn] Migration start time + * @member {date} [endedOn] Migration end time + * @member {string} [sourceServerVersion] Source server version + * @member {string} [sourceServerBrandVersion] Source server brand version + * @member {string} [targetServerVersion] Target server version + * @member {string} [targetServerBrandVersion] Target server brand version + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel + * + * @returns {object} metadata of MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrationLevelOutput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'MigrateSchemaSqlServerSqlDbTaskOutput', + className: 'MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + startedOn: { + required: false, + readOnly: true, + serializedName: 'startedOn', + type: { + name: 'DateTime' + } + }, + endedOn: { + required: false, + readOnly: true, + serializedName: 'endedOn', + type: { + name: 'DateTime' + } + }, + sourceServerVersion: { + required: false, + readOnly: true, + serializedName: 'sourceServerVersion', + type: { + name: 'String' + } + }, + sourceServerBrandVersion: { + required: false, + readOnly: true, + serializedName: 'sourceServerBrandVersion', + type: { + name: 'String' + } + }, + targetServerVersion: { + required: false, + readOnly: true, + serializedName: 'targetServerVersion', + type: { + name: 'String' + } + }, + targetServerBrandVersion: { + required: false, + readOnly: true, + serializedName: 'targetServerBrandVersion', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel; diff --git a/lib/services/datamigrationManagement/lib/models/migrateSchemaSqlServerSqlDbTaskProperties.js b/lib/services/datamigrationManagement/lib/models/migrateSchemaSqlServerSqlDbTaskProperties.js new file mode 100644 index 0000000000..deaede0f37 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateSchemaSqlServerSqlDbTaskProperties.js @@ -0,0 +1,139 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Properties for task that migrates Schema for SQL Server databases to Azure + * SQL databases + * + * @extends models['ProjectTaskProperties'] + */ +class MigrateSchemaSqlServerSqlDbTaskProperties extends models['ProjectTaskProperties'] { + /** + * Create a MigrateSchemaSqlServerSqlDbTaskProperties. + * @member {object} [input] Task input + * @member {array} [input.selectedDatabases] Databases to migrate + * @member {array} [output] Task output. This is ignored if submitted. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrateSchemaSqlServerSqlDbTaskProperties + * + * @returns {object} metadata of MigrateSchemaSqlServerSqlDbTaskProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrateSchemaSqlServerSqlDb', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'taskType', + clientName: 'taskType' + }, + uberParent: 'ProjectTaskProperties', + className: 'MigrateSchemaSqlServerSqlDbTaskProperties', + modelProperties: { + errors: { + required: false, + readOnly: true, + serializedName: 'errors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ODataErrorElementType', + type: { + name: 'Composite', + className: 'ODataError' + } + } + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + commands: { + required: false, + readOnly: true, + serializedName: 'commands', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CommandPropertiesElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'commandType', + clientName: 'commandType' + }, + uberParent: 'CommandProperties', + className: 'CommandProperties' + } + } + } + }, + taskType: { + required: true, + serializedName: 'taskType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + input: { + required: false, + serializedName: 'input', + type: { + name: 'Composite', + className: 'MigrateSchemaSqlServerSqlDbTaskInput' + } + }, + output: { + required: false, + readOnly: true, + serializedName: 'output', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'MigrateSchemaSqlServerSqlDbTaskOutputElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'MigrateSchemaSqlServerSqlDbTaskOutput', + className: 'MigrateSchemaSqlServerSqlDbTaskOutput' + } + } + } + } + } + } + }; + } +} + +module.exports = MigrateSchemaSqlServerSqlDbTaskProperties; diff --git a/lib/services/datamigrationManagement/lib/models/migrateSchemaSqlTaskOutputError.js b/lib/services/datamigrationManagement/lib/models/migrateSchemaSqlTaskOutputError.js new file mode 100644 index 0000000000..b02ab49486 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateSchemaSqlTaskOutputError.js @@ -0,0 +1,88 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing a MigrateSchemaSqlTaskOutputError. + * @extends models['MigrateSchemaSqlServerSqlDbTaskOutput'] + */ +class MigrateSchemaSqlTaskOutputError extends models['MigrateSchemaSqlServerSqlDbTaskOutput'] { + /** + * Create a MigrateSchemaSqlTaskOutputError. + * @member {object} [error] Migration error + * @member {string} [error.message] Error message + * @member {string} [error.actionableMessage] Actionable steps for this + * exception + * @member {string} [error.filePath] The path to the file where exception + * occurred + * @member {string} [error.lineNumber] The line number where exception + * occurred + * @member {number} [error.hResult] Coded numerical value that is assigned to + * a specific exception + * @member {string} [error.stackTrace] Stack trace + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrateSchemaSqlTaskOutputError + * + * @returns {object} metadata of MigrateSchemaSqlTaskOutputError + * + */ + mapper() { + return { + required: false, + serializedName: 'ErrorOutput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'MigrateSchemaSqlServerSqlDbTaskOutput', + className: 'MigrateSchemaSqlTaskOutputError', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + error: { + required: false, + readOnly: true, + serializedName: 'error', + type: { + name: 'Composite', + className: 'ReportableException' + } + } + } + } + }; + } +} + +module.exports = MigrateSchemaSqlTaskOutputError; diff --git a/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbDatabaseInput.js b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbDatabaseInput.js new file mode 100644 index 0000000000..6f41bf074b --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbDatabaseInput.js @@ -0,0 +1,85 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Database specific information for SQL to Azure SQL DB migration task inputs + * + */ +class MigrateSqlServerSqlDbDatabaseInput { + /** + * Create a MigrateSqlServerSqlDbDatabaseInput. + * @member {string} [name] Name of the database + * @member {string} [targetDatabaseName] Name of target database. Note: + * Target database will be truncated before starting migration. + * @member {boolean} [makeSourceDbReadOnly] Whether to set database read only + * before migration + * @member {object} [tableMap] Mapping of source to target tables + */ + constructor() { + } + + /** + * Defines the metadata of MigrateSqlServerSqlDbDatabaseInput + * + * @returns {object} metadata of MigrateSqlServerSqlDbDatabaseInput + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrateSqlServerSqlDbDatabaseInput', + type: { + name: 'Composite', + className: 'MigrateSqlServerSqlDbDatabaseInput', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + targetDatabaseName: { + required: false, + serializedName: 'targetDatabaseName', + type: { + name: 'String' + } + }, + makeSourceDbReadOnly: { + required: false, + serializedName: 'makeSourceDbReadOnly', + type: { + name: 'Boolean' + } + }, + tableMap: { + required: false, + serializedName: 'tableMap', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = MigrateSqlServerSqlDbDatabaseInput; diff --git a/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbSyncDatabaseInput.js b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbSyncDatabaseInput.js new file mode 100644 index 0000000000..a68b3296e9 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbSyncDatabaseInput.js @@ -0,0 +1,140 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Database specific information for SQL to Azure SQL DB sync migration task + * inputs + * + */ +class MigrateSqlServerSqlDbSyncDatabaseInput { + /** + * Create a MigrateSqlServerSqlDbSyncDatabaseInput. + * @member {string} [id] Unique identifier for database + * @member {string} [name] Name of database + * @member {string} [targetDatabaseName] Target database name + * @member {string} [schemaName] Schema name to be migrated + * @member {object} [tableMap] Mapping of source to target tables + * @member {object} [migrationSetting] Migration settings which tune the + * migration behavior + * @member {object} [sourceSetting] Source settings to tune source endpoint + * migration behavior + * @member {object} [targetSetting] Target settings to tune target endpoint + * migration behavior + */ + constructor() { + } + + /** + * Defines the metadata of MigrateSqlServerSqlDbSyncDatabaseInput + * + * @returns {object} metadata of MigrateSqlServerSqlDbSyncDatabaseInput + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrateSqlServerSqlDbSyncDatabaseInput', + type: { + name: 'Composite', + className: 'MigrateSqlServerSqlDbSyncDatabaseInput', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + targetDatabaseName: { + required: false, + serializedName: 'targetDatabaseName', + type: { + name: 'String' + } + }, + schemaName: { + required: false, + serializedName: 'schemaName', + type: { + name: 'String' + } + }, + tableMap: { + required: false, + serializedName: 'tableMap', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + migrationSetting: { + required: false, + serializedName: 'migrationSetting', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + sourceSetting: { + required: false, + serializedName: 'sourceSetting', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + targetSetting: { + required: false, + serializedName: 'targetSetting', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = MigrateSqlServerSqlDbSyncDatabaseInput; diff --git a/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbSyncTaskInput.js b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbSyncTaskInput.js new file mode 100644 index 0000000000..cb4d5fdbec --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbSyncTaskInput.js @@ -0,0 +1,110 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Input for the task that migrates on-prem SQL Server databases to Azure SQL + * Database for online migrations + * + * @extends models['SqlMigrationTaskInput'] + */ +class MigrateSqlServerSqlDbSyncTaskInput extends models['SqlMigrationTaskInput'] { + /** + * Create a MigrateSqlServerSqlDbSyncTaskInput. + * @member {array} selectedDatabases Databases to migrate + * @member {object} [validationOptions] Validation options + * @member {boolean} [validationOptions.enableSchemaValidation] Allows to + * compare the schema information between source and target. + * @member {boolean} [validationOptions.enableDataIntegrityValidation] Allows + * to perform a checksum based data integrity validation between source and + * target for the selected database / tables . + * @member {boolean} [validationOptions.enableQueryAnalysisValidation] Allows + * to perform a quick and intelligent query analysis by retrieving queries + * from the source database and executes them in the target. The result will + * have execution statistics for executions in source and target databases + * for the extracted queries. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrateSqlServerSqlDbSyncTaskInput + * + * @returns {object} metadata of MigrateSqlServerSqlDbSyncTaskInput + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrateSqlServerSqlDbSyncTaskInput', + type: { + name: 'Composite', + className: 'MigrateSqlServerSqlDbSyncTaskInput', + modelProperties: { + sourceConnectionInfo: { + required: true, + serializedName: 'sourceConnectionInfo', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'ConnectionInfo', + className: 'SqlConnectionInfo' + } + }, + targetConnectionInfo: { + required: true, + serializedName: 'targetConnectionInfo', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'ConnectionInfo', + className: 'SqlConnectionInfo' + } + }, + selectedDatabases: { + required: true, + serializedName: 'selectedDatabases', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'MigrateSqlServerSqlDbSyncDatabaseInputElementType', + type: { + name: 'Composite', + className: 'MigrateSqlServerSqlDbSyncDatabaseInput' + } + } + } + }, + validationOptions: { + required: false, + serializedName: 'validationOptions', + type: { + name: 'Composite', + className: 'MigrationValidationOptions' + } + } + } + } + }; + } +} + +module.exports = MigrateSqlServerSqlDbSyncTaskInput; diff --git a/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbSyncTaskOutput.js b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbSyncTaskOutput.js new file mode 100644 index 0000000000..844da9f666 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbSyncTaskOutput.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Output for the task that migrates on-prem SQL Server databases to Azure SQL + * Database for online migrations + * + */ +class MigrateSqlServerSqlDbSyncTaskOutput { + /** + * Create a MigrateSqlServerSqlDbSyncTaskOutput. + * @member {string} [id] Result identifier + * @member {string} resultType Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of MigrateSqlServerSqlDbSyncTaskOutput + * + * @returns {object} metadata of MigrateSqlServerSqlDbSyncTaskOutput + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrateSqlServerSqlDbSyncTaskOutput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'MigrateSqlServerSqlDbSyncTaskOutput', + className: 'MigrateSqlServerSqlDbSyncTaskOutput', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MigrateSqlServerSqlDbSyncTaskOutput; diff --git a/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbSyncTaskOutputDatabaseError.js b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbSyncTaskOutputDatabaseError.js new file mode 100644 index 0000000000..dc56554880 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbSyncTaskOutputDatabaseError.js @@ -0,0 +1,92 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing a MigrateSqlServerSqlDbSyncTaskOutputDatabaseError. + * @extends models['MigrateSqlServerSqlDbSyncTaskOutput'] + */ +class MigrateSqlServerSqlDbSyncTaskOutputDatabaseError extends models['MigrateSqlServerSqlDbSyncTaskOutput'] { + /** + * Create a MigrateSqlServerSqlDbSyncTaskOutputDatabaseError. + * @member {string} [errorMessage] Error message + * @member {array} [events] List of error events. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrateSqlServerSqlDbSyncTaskOutputDatabaseError + * + * @returns {object} metadata of MigrateSqlServerSqlDbSyncTaskOutputDatabaseError + * + */ + mapper() { + return { + required: false, + serializedName: 'DatabaseLevelErrorOutput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'MigrateSqlServerSqlDbSyncTaskOutput', + className: 'MigrateSqlServerSqlDbSyncTaskOutputDatabaseError', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + errorMessage: { + required: false, + serializedName: 'errorMessage', + type: { + name: 'String' + } + }, + events: { + required: false, + serializedName: 'events', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SyncMigrationDatabaseErrorEventElementType', + type: { + name: 'Composite', + className: 'SyncMigrationDatabaseErrorEvent' + } + } + } + } + } + } + }; + } +} + +module.exports = MigrateSqlServerSqlDbSyncTaskOutputDatabaseError; diff --git a/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbSyncTaskOutputDatabaseLevel.js b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbSyncTaskOutputDatabaseLevel.js new file mode 100644 index 0000000000..28e6b9cc99 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbSyncTaskOutputDatabaseLevel.js @@ -0,0 +1,211 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing a MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel. + * @extends models['MigrateSqlServerSqlDbSyncTaskOutput'] + */ +class MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel extends models['MigrateSqlServerSqlDbSyncTaskOutput'] { + /** + * Create a MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel. + * @member {string} [databaseName] Name of the database + * @member {date} [startedOn] Migration start time + * @member {date} [endedOn] Migration end time + * @member {string} [migrationState] Migration state that this database is + * in. Possible values include: 'UNDEFINED', 'CONFIGURING', 'INITIALIAZING', + * 'STARTING', 'RUNNING', 'READY_TO_COMPLETE', 'COMPLETING', 'COMPLETE', + * 'CANCELLING', 'CANCELLED', 'FAILED' + * @member {number} [incomingChanges] Number of incoming changes + * @member {number} [appliedChanges] Number of applied changes + * @member {number} [cdcInsertCounter] Number of cdc inserts + * @member {number} [cdcDeleteCounter] Number of cdc deletes + * @member {number} [cdcUpdateCounter] Number of cdc updates + * @member {number} [fullLoadCompletedTables] Number of tables completed in + * full load + * @member {number} [fullLoadLoadingTables] Number of tables loading in full + * load + * @member {number} [fullLoadQueuedTables] Number of tables queued in full + * load + * @member {number} [fullLoadErroredTables] Number of tables errored in full + * load + * @member {boolean} [initializationCompleted] Indicates if initial load + * (full load) has been completed + * @member {number} [latency] CDC apply latency + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel + * + * @returns {object} metadata of MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel + * + */ + mapper() { + return { + required: false, + serializedName: 'DatabaseLevelOutput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'MigrateSqlServerSqlDbSyncTaskOutput', + className: 'MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + databaseName: { + required: false, + readOnly: true, + serializedName: 'databaseName', + type: { + name: 'String' + } + }, + startedOn: { + required: false, + readOnly: true, + serializedName: 'startedOn', + type: { + name: 'DateTime' + } + }, + endedOn: { + required: false, + readOnly: true, + serializedName: 'endedOn', + type: { + name: 'DateTime' + } + }, + migrationState: { + required: false, + readOnly: true, + serializedName: 'migrationState', + type: { + name: 'String' + } + }, + incomingChanges: { + required: false, + readOnly: true, + serializedName: 'incomingChanges', + type: { + name: 'Number' + } + }, + appliedChanges: { + required: false, + readOnly: true, + serializedName: 'appliedChanges', + type: { + name: 'Number' + } + }, + cdcInsertCounter: { + required: false, + readOnly: true, + serializedName: 'cdcInsertCounter', + type: { + name: 'Number' + } + }, + cdcDeleteCounter: { + required: false, + readOnly: true, + serializedName: 'cdcDeleteCounter', + type: { + name: 'Number' + } + }, + cdcUpdateCounter: { + required: false, + readOnly: true, + serializedName: 'cdcUpdateCounter', + type: { + name: 'Number' + } + }, + fullLoadCompletedTables: { + required: false, + readOnly: true, + serializedName: 'fullLoadCompletedTables', + type: { + name: 'Number' + } + }, + fullLoadLoadingTables: { + required: false, + readOnly: true, + serializedName: 'fullLoadLoadingTables', + type: { + name: 'Number' + } + }, + fullLoadQueuedTables: { + required: false, + readOnly: true, + serializedName: 'fullLoadQueuedTables', + type: { + name: 'Number' + } + }, + fullLoadErroredTables: { + required: false, + readOnly: true, + serializedName: 'fullLoadErroredTables', + type: { + name: 'Number' + } + }, + initializationCompleted: { + required: false, + readOnly: true, + serializedName: 'initializationCompleted', + type: { + name: 'Boolean' + } + }, + latency: { + required: false, + readOnly: true, + serializedName: 'latency', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel; diff --git a/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbSyncTaskOutputError.js b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbSyncTaskOutputError.js new file mode 100644 index 0000000000..4f2dce4a70 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbSyncTaskOutputError.js @@ -0,0 +1,88 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing a MigrateSqlServerSqlDbSyncTaskOutputError. + * @extends models['MigrateSqlServerSqlDbSyncTaskOutput'] + */ +class MigrateSqlServerSqlDbSyncTaskOutputError extends models['MigrateSqlServerSqlDbSyncTaskOutput'] { + /** + * Create a MigrateSqlServerSqlDbSyncTaskOutputError. + * @member {object} [error] Migration error + * @member {string} [error.message] Error message + * @member {string} [error.actionableMessage] Actionable steps for this + * exception + * @member {string} [error.filePath] The path to the file where exception + * occurred + * @member {string} [error.lineNumber] The line number where exception + * occurred + * @member {number} [error.hResult] Coded numerical value that is assigned to + * a specific exception + * @member {string} [error.stackTrace] Stack trace + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrateSqlServerSqlDbSyncTaskOutputError + * + * @returns {object} metadata of MigrateSqlServerSqlDbSyncTaskOutputError + * + */ + mapper() { + return { + required: false, + serializedName: 'ErrorOutput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'MigrateSqlServerSqlDbSyncTaskOutput', + className: 'MigrateSqlServerSqlDbSyncTaskOutputError', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + error: { + required: false, + readOnly: true, + serializedName: 'error', + type: { + name: 'Composite', + className: 'ReportableException' + } + } + } + } + }; + } +} + +module.exports = MigrateSqlServerSqlDbSyncTaskOutputError; diff --git a/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbSyncTaskOutputMigrationLevel.js b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbSyncTaskOutputMigrationLevel.js new file mode 100644 index 0000000000..ecc3840ae6 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbSyncTaskOutputMigrationLevel.js @@ -0,0 +1,131 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing a MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel. + * @extends models['MigrateSqlServerSqlDbSyncTaskOutput'] + */ +class MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel extends models['MigrateSqlServerSqlDbSyncTaskOutput'] { + /** + * Create a MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel. + * @member {date} [startedOn] Migration start time + * @member {date} [endedOn] Migration end time + * @member {string} [sourceServerVersion] Source server version + * @member {string} [sourceServer] Source server name + * @member {string} [targetServerVersion] Target server version + * @member {string} [targetServer] Target server name + * @member {number} [databaseCount] Count of databases + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel + * + * @returns {object} metadata of MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrationLevelOutput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'MigrateSqlServerSqlDbSyncTaskOutput', + className: 'MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + startedOn: { + required: false, + readOnly: true, + serializedName: 'startedOn', + type: { + name: 'DateTime' + } + }, + endedOn: { + required: false, + readOnly: true, + serializedName: 'endedOn', + type: { + name: 'DateTime' + } + }, + sourceServerVersion: { + required: false, + readOnly: true, + serializedName: 'sourceServerVersion', + type: { + name: 'String' + } + }, + sourceServer: { + required: false, + readOnly: true, + serializedName: 'sourceServer', + type: { + name: 'String' + } + }, + targetServerVersion: { + required: false, + readOnly: true, + serializedName: 'targetServerVersion', + type: { + name: 'String' + } + }, + targetServer: { + required: false, + readOnly: true, + serializedName: 'targetServer', + type: { + name: 'String' + } + }, + databaseCount: { + required: false, + readOnly: true, + serializedName: 'databaseCount', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel; diff --git a/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbSyncTaskOutputTableLevel.js b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbSyncTaskOutputTableLevel.js new file mode 100644 index 0000000000..f8f584b9b9 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbSyncTaskOutputTableLevel.js @@ -0,0 +1,187 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing a MigrateSqlServerSqlDbSyncTaskOutputTableLevel. + * @extends models['MigrateSqlServerSqlDbSyncTaskOutput'] + */ +class MigrateSqlServerSqlDbSyncTaskOutputTableLevel extends models['MigrateSqlServerSqlDbSyncTaskOutput'] { + /** + * Create a MigrateSqlServerSqlDbSyncTaskOutputTableLevel. + * @member {string} [tableName] Name of the table + * @member {string} [databaseName] Name of the database + * @member {number} [cdcInsertCounter] Number of applied inserts + * @member {number} [cdcUpdateCounter] Number of applied updates + * @member {number} [cdcDeleteCounter] Number of applied deletes + * @member {date} [fullLoadEstFinishTime] Estimate to finish full load + * @member {date} [fullLoadStartedOn] Full load start time + * @member {date} [fullLoadEndedOn] Full load end time + * @member {number} [fullLoadTotalRows] Number of rows applied in full load + * @member {string} [state] Current state of the table migration. Possible + * values include: 'BEFORE_LOAD', 'FULL_LOAD', 'COMPLETED', 'CANCELED', + * 'ERROR', 'FAILED' + * @member {number} [totalChangesApplied] Total number of applied changes + * @member {number} [dataErrorsCounter] Number of data errors occurred + * @member {date} [lastModifiedTime] Last modified time on target + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrateSqlServerSqlDbSyncTaskOutputTableLevel + * + * @returns {object} metadata of MigrateSqlServerSqlDbSyncTaskOutputTableLevel + * + */ + mapper() { + return { + required: false, + serializedName: 'TableLevelOutput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'MigrateSqlServerSqlDbSyncTaskOutput', + className: 'MigrateSqlServerSqlDbSyncTaskOutputTableLevel', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + tableName: { + required: false, + readOnly: true, + serializedName: 'tableName', + type: { + name: 'String' + } + }, + databaseName: { + required: false, + readOnly: true, + serializedName: 'databaseName', + type: { + name: 'String' + } + }, + cdcInsertCounter: { + required: false, + readOnly: true, + serializedName: 'cdcInsertCounter', + type: { + name: 'Number' + } + }, + cdcUpdateCounter: { + required: false, + readOnly: true, + serializedName: 'cdcUpdateCounter', + type: { + name: 'Number' + } + }, + cdcDeleteCounter: { + required: false, + readOnly: true, + serializedName: 'cdcDeleteCounter', + type: { + name: 'Number' + } + }, + fullLoadEstFinishTime: { + required: false, + readOnly: true, + serializedName: 'fullLoadEstFinishTime', + type: { + name: 'DateTime' + } + }, + fullLoadStartedOn: { + required: false, + readOnly: true, + serializedName: 'fullLoadStartedOn', + type: { + name: 'DateTime' + } + }, + fullLoadEndedOn: { + required: false, + readOnly: true, + serializedName: 'fullLoadEndedOn', + type: { + name: 'DateTime' + } + }, + fullLoadTotalRows: { + required: false, + readOnly: true, + serializedName: 'fullLoadTotalRows', + type: { + name: 'Number' + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + totalChangesApplied: { + required: false, + readOnly: true, + serializedName: 'totalChangesApplied', + type: { + name: 'Number' + } + }, + dataErrorsCounter: { + required: false, + readOnly: true, + serializedName: 'dataErrorsCounter', + type: { + name: 'Number' + } + }, + lastModifiedTime: { + required: false, + readOnly: true, + serializedName: 'lastModifiedTime', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = MigrateSqlServerSqlDbSyncTaskOutputTableLevel; diff --git a/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbSyncTaskProperties.js b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbSyncTaskProperties.js new file mode 100644 index 0000000000..2d1dda7752 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbSyncTaskProperties.js @@ -0,0 +1,150 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Properties for the task that migrates on-prem SQL Server databases to Azure + * SQL Database for online migrations + * + * @extends models['ProjectTaskProperties'] + */ +class MigrateSqlServerSqlDbSyncTaskProperties extends models['ProjectTaskProperties'] { + /** + * Create a MigrateSqlServerSqlDbSyncTaskProperties. + * @member {object} [input] Task input + * @member {array} [input.selectedDatabases] Databases to migrate + * @member {object} [input.validationOptions] Validation options + * @member {boolean} [input.validationOptions.enableSchemaValidation] Allows + * to compare the schema information between source and target. + * @member {boolean} [input.validationOptions.enableDataIntegrityValidation] + * Allows to perform a checksum based data integrity validation between + * source and target for the selected database / tables . + * @member {boolean} [input.validationOptions.enableQueryAnalysisValidation] + * Allows to perform a quick and intelligent query analysis by retrieving + * queries from the source database and executes them in the target. The + * result will have execution statistics for executions in source and target + * databases for the extracted queries. + * @member {array} [output] Task output. This is ignored if submitted. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrateSqlServerSqlDbSyncTaskProperties + * + * @returns {object} metadata of MigrateSqlServerSqlDbSyncTaskProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'Migrate.SqlServer.AzureSqlDb.Sync', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'taskType', + clientName: 'taskType' + }, + uberParent: 'ProjectTaskProperties', + className: 'MigrateSqlServerSqlDbSyncTaskProperties', + modelProperties: { + errors: { + required: false, + readOnly: true, + serializedName: 'errors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ODataErrorElementType', + type: { + name: 'Composite', + className: 'ODataError' + } + } + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + commands: { + required: false, + readOnly: true, + serializedName: 'commands', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CommandPropertiesElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'commandType', + clientName: 'commandType' + }, + uberParent: 'CommandProperties', + className: 'CommandProperties' + } + } + } + }, + taskType: { + required: true, + serializedName: 'taskType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + input: { + required: false, + serializedName: 'input', + type: { + name: 'Composite', + className: 'MigrateSqlServerSqlDbSyncTaskInput' + } + }, + output: { + required: false, + readOnly: true, + serializedName: 'output', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'MigrateSqlServerSqlDbSyncTaskOutputElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'MigrateSqlServerSqlDbSyncTaskOutput', + className: 'MigrateSqlServerSqlDbSyncTaskOutput' + } + } + } + } + } + } + }; + } +} + +module.exports = MigrateSqlServerSqlDbSyncTaskProperties; diff --git a/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbTaskInput.js b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbTaskInput.js new file mode 100644 index 0000000000..8e6170586e --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbTaskInput.js @@ -0,0 +1,120 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Input for the task that migrates on-prem SQL Server databases to Azure SQL + * Database + * + * @extends models['SqlMigrationTaskInput'] + */ +class MigrateSqlServerSqlDbTaskInput extends models['SqlMigrationTaskInput'] { + /** + * Create a MigrateSqlServerSqlDbTaskInput. + * @member {array} selectedDatabases Databases to migrate + * @member {object} [validationOptions] Options for enabling various post + * migration validations. Available options, + * 1.) Data Integrity Check: Performs a checksum based comparison on source + * and target tables after the migration to ensure the correctness of the + * data. + * 2.) Schema Validation: Performs a thorough schema comparison between the + * source and target tables and provides a list of differences between the + * source and target database, 3.) Query Analysis: Executes a set of queries + * picked up automatically either from the Query Plan Cache or Query Store + * and execute them and compares the execution time between the source and + * target database. + * @member {boolean} [validationOptions.enableSchemaValidation] Allows to + * compare the schema information between source and target. + * @member {boolean} [validationOptions.enableDataIntegrityValidation] Allows + * to perform a checksum based data integrity validation between source and + * target for the selected database / tables . + * @member {boolean} [validationOptions.enableQueryAnalysisValidation] Allows + * to perform a quick and intelligent query analysis by retrieving queries + * from the source database and executes them in the target. The result will + * have execution statistics for executions in source and target databases + * for the extracted queries. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrateSqlServerSqlDbTaskInput + * + * @returns {object} metadata of MigrateSqlServerSqlDbTaskInput + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrateSqlServerSqlDbTaskInput', + type: { + name: 'Composite', + className: 'MigrateSqlServerSqlDbTaskInput', + modelProperties: { + sourceConnectionInfo: { + required: true, + serializedName: 'sourceConnectionInfo', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'ConnectionInfo', + className: 'SqlConnectionInfo' + } + }, + targetConnectionInfo: { + required: true, + serializedName: 'targetConnectionInfo', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'ConnectionInfo', + className: 'SqlConnectionInfo' + } + }, + selectedDatabases: { + required: true, + serializedName: 'selectedDatabases', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'MigrateSqlServerSqlDbDatabaseInputElementType', + type: { + name: 'Composite', + className: 'MigrateSqlServerSqlDbDatabaseInput' + } + } + } + }, + validationOptions: { + required: false, + serializedName: 'validationOptions', + type: { + name: 'Composite', + className: 'MigrationValidationOptions' + } + } + } + } + }; + } +} + +module.exports = MigrateSqlServerSqlDbTaskInput; diff --git a/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbTaskOutput.js b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbTaskOutput.js new file mode 100644 index 0000000000..39e1a7079a --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbTaskOutput.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Output for the task that migrates on-prem SQL Server databases to Azure SQL + * Database + * + */ +class MigrateSqlServerSqlDbTaskOutput { + /** + * Create a MigrateSqlServerSqlDbTaskOutput. + * @member {string} [id] Result identifier + * @member {string} resultType Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of MigrateSqlServerSqlDbTaskOutput + * + * @returns {object} metadata of MigrateSqlServerSqlDbTaskOutput + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrateSqlServerSqlDbTaskOutput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'MigrateSqlServerSqlDbTaskOutput', + className: 'MigrateSqlServerSqlDbTaskOutput', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MigrateSqlServerSqlDbTaskOutput; diff --git a/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbTaskOutputDatabaseLevel.js b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbTaskOutputDatabaseLevel.js new file mode 100644 index 0000000000..5b7498b638 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbTaskOutputDatabaseLevel.js @@ -0,0 +1,218 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing a MigrateSqlServerSqlDbTaskOutputDatabaseLevel. + * @extends models['MigrateSqlServerSqlDbTaskOutput'] + */ +class MigrateSqlServerSqlDbTaskOutputDatabaseLevel extends models['MigrateSqlServerSqlDbTaskOutput'] { + /** + * Create a MigrateSqlServerSqlDbTaskOutputDatabaseLevel. + * @member {string} [databaseName] Name of the item + * @member {date} [startedOn] Migration start time + * @member {date} [endedOn] Migration end time + * @member {string} [state] Current state of migration. Possible values + * include: 'None', 'InProgress', 'Failed', 'Warning', 'Completed', + * 'Skipped', 'Stopped' + * @member {string} [stage] Migration stage that this database is in. + * Possible values include: 'None', 'Initialize', 'Backup', 'FileCopy', + * 'Restore', 'Completed' + * @member {string} [statusMessage] Status message + * @member {string} [message] Migration progress message + * @member {number} [numberOfObjects] Number of objects + * @member {number} [numberOfObjectsCompleted] Number of successfully + * completed objects + * @member {number} [errorCount] Number of database/object errors. + * @member {string} [errorPrefix] Wildcard string prefix to use for querying + * all errors of the item + * @member {string} [resultPrefix] Wildcard string prefix to use for querying + * all sub-tem results of the item + * @member {array} [exceptionsAndWarnings] Migration exceptions and warnings. + * @member {object} [objectSummary] Summary of object results in the + * migration + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrateSqlServerSqlDbTaskOutputDatabaseLevel + * + * @returns {object} metadata of MigrateSqlServerSqlDbTaskOutputDatabaseLevel + * + */ + mapper() { + return { + required: false, + serializedName: 'DatabaseLevelOutput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'MigrateSqlServerSqlDbTaskOutput', + className: 'MigrateSqlServerSqlDbTaskOutputDatabaseLevel', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + databaseName: { + required: false, + readOnly: true, + serializedName: 'databaseName', + type: { + name: 'String' + } + }, + startedOn: { + required: false, + readOnly: true, + serializedName: 'startedOn', + type: { + name: 'DateTime' + } + }, + endedOn: { + required: false, + readOnly: true, + serializedName: 'endedOn', + type: { + name: 'DateTime' + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + stage: { + required: false, + readOnly: true, + serializedName: 'stage', + type: { + name: 'String' + } + }, + statusMessage: { + required: false, + readOnly: true, + serializedName: 'statusMessage', + type: { + name: 'String' + } + }, + message: { + required: false, + readOnly: true, + serializedName: 'message', + type: { + name: 'String' + } + }, + numberOfObjects: { + required: false, + readOnly: true, + serializedName: 'numberOfObjects', + type: { + name: 'Number' + } + }, + numberOfObjectsCompleted: { + required: false, + readOnly: true, + serializedName: 'numberOfObjectsCompleted', + type: { + name: 'Number' + } + }, + errorCount: { + required: false, + readOnly: true, + serializedName: 'errorCount', + type: { + name: 'Number' + } + }, + errorPrefix: { + required: false, + readOnly: true, + serializedName: 'errorPrefix', + type: { + name: 'String' + } + }, + resultPrefix: { + required: false, + readOnly: true, + serializedName: 'resultPrefix', + type: { + name: 'String' + } + }, + exceptionsAndWarnings: { + required: false, + readOnly: true, + serializedName: 'exceptionsAndWarnings', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ReportableExceptionElementType', + type: { + name: 'Composite', + className: 'ReportableException' + } + } + } + }, + objectSummary: { + required: false, + readOnly: true, + serializedName: 'objectSummary', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'DataItemMigrationSummaryResultElementType', + type: { + name: 'Composite', + className: 'DataItemMigrationSummaryResult' + } + } + } + } + } + } + }; + } +} + +module.exports = MigrateSqlServerSqlDbTaskOutputDatabaseLevel; diff --git a/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbTaskOutputError.js b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbTaskOutputError.js new file mode 100644 index 0000000000..406a2239c3 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbTaskOutputError.js @@ -0,0 +1,88 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing a MigrateSqlServerSqlDbTaskOutputError. + * @extends models['MigrateSqlServerSqlDbTaskOutput'] + */ +class MigrateSqlServerSqlDbTaskOutputError extends models['MigrateSqlServerSqlDbTaskOutput'] { + /** + * Create a MigrateSqlServerSqlDbTaskOutputError. + * @member {object} [error] Migration error + * @member {string} [error.message] Error message + * @member {string} [error.actionableMessage] Actionable steps for this + * exception + * @member {string} [error.filePath] The path to the file where exception + * occurred + * @member {string} [error.lineNumber] The line number where exception + * occurred + * @member {number} [error.hResult] Coded numerical value that is assigned to + * a specific exception + * @member {string} [error.stackTrace] Stack trace + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrateSqlServerSqlDbTaskOutputError + * + * @returns {object} metadata of MigrateSqlServerSqlDbTaskOutputError + * + */ + mapper() { + return { + required: false, + serializedName: 'ErrorOutput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'MigrateSqlServerSqlDbTaskOutput', + className: 'MigrateSqlServerSqlDbTaskOutputError', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + error: { + required: false, + readOnly: true, + serializedName: 'error', + type: { + name: 'Composite', + className: 'ReportableException' + } + } + } + } + }; + } +} + +module.exports = MigrateSqlServerSqlDbTaskOutputError; diff --git a/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbTaskOutputMigrationLevel.js b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbTaskOutputMigrationLevel.js new file mode 100644 index 0000000000..60b528ce33 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbTaskOutputMigrationLevel.js @@ -0,0 +1,247 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing a MigrateSqlServerSqlDbTaskOutputMigrationLevel. + * @extends models['MigrateSqlServerSqlDbTaskOutput'] + */ +class MigrateSqlServerSqlDbTaskOutputMigrationLevel extends models['MigrateSqlServerSqlDbTaskOutput'] { + /** + * Create a MigrateSqlServerSqlDbTaskOutputMigrationLevel. + * @member {date} [startedOn] Migration start time + * @member {date} [endedOn] Migration end time + * @member {number} [durationInSeconds] Duration of task execution in + * seconds. + * @member {string} [status] Current status of migration. Possible values + * include: 'Default', 'Connecting', 'SourceAndTargetSelected', + * 'SelectLogins', 'Configured', 'Running', 'Error', 'Stopped', 'Completed', + * 'CompletedWithWarnings' + * @member {string} [statusMessage] Migration status message + * @member {string} [message] Migration progress message + * @member {object} [databases] Selected databases as a map from database + * name to database id + * @member {object} [databaseSummary] Summary of database results in the + * migration + * @member {object} [migrationValidationResult] Migration Validation Results + * @member {string} [migrationValidationResult.id] Migration validation + * result identifier + * @member {string} [migrationValidationResult.migrationId] Migration + * Identifier + * @member {object} [migrationValidationResult.summaryResults] Validation + * summary results for each database + * @member {string} [migrationValidationResult.status] Current status of + * validation at the migration level. Status from the database validation + * result status will be aggregated here. Possible values include: 'Default', + * 'NotStarted', 'Initialized', 'InProgress', 'Completed', + * 'CompletedWithIssues', 'Stopped', 'Failed' + * @member {object} [migrationReportResult] Migration Report Result, provides + * unique url for downloading your migration report. + * @member {string} [migrationReportResult.id] Migration validation result + * identifier + * @member {string} [migrationReportResult.reportUrl] The url of the report. + * @member {string} [sourceServerVersion] Source server version + * @member {string} [sourceServerBrandVersion] Source server brand version + * @member {string} [targetServerVersion] Target server version + * @member {string} [targetServerBrandVersion] Target server brand version + * @member {array} [exceptionsAndWarnings] Migration exceptions and warnings. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrateSqlServerSqlDbTaskOutputMigrationLevel + * + * @returns {object} metadata of MigrateSqlServerSqlDbTaskOutputMigrationLevel + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrationLevelOutput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'MigrateSqlServerSqlDbTaskOutput', + className: 'MigrateSqlServerSqlDbTaskOutputMigrationLevel', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + startedOn: { + required: false, + readOnly: true, + serializedName: 'startedOn', + type: { + name: 'DateTime' + } + }, + endedOn: { + required: false, + readOnly: true, + serializedName: 'endedOn', + type: { + name: 'DateTime' + } + }, + durationInSeconds: { + required: false, + readOnly: true, + serializedName: 'durationInSeconds', + type: { + name: 'Number' + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'status', + type: { + name: 'String' + } + }, + statusMessage: { + required: false, + readOnly: true, + serializedName: 'statusMessage', + type: { + name: 'String' + } + }, + message: { + required: false, + readOnly: true, + serializedName: 'message', + type: { + name: 'String' + } + }, + databases: { + required: false, + readOnly: true, + serializedName: 'databases', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + databaseSummary: { + required: false, + readOnly: true, + serializedName: 'databaseSummary', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'DatabaseSummaryResultElementType', + type: { + name: 'Composite', + className: 'DatabaseSummaryResult' + } + } + } + }, + migrationValidationResult: { + required: false, + serializedName: 'migrationValidationResult', + type: { + name: 'Composite', + className: 'MigrationValidationResult' + } + }, + migrationReportResult: { + required: false, + serializedName: 'migrationReportResult', + type: { + name: 'Composite', + className: 'MigrationReportResult' + } + }, + sourceServerVersion: { + required: false, + readOnly: true, + serializedName: 'sourceServerVersion', + type: { + name: 'String' + } + }, + sourceServerBrandVersion: { + required: false, + readOnly: true, + serializedName: 'sourceServerBrandVersion', + type: { + name: 'String' + } + }, + targetServerVersion: { + required: false, + readOnly: true, + serializedName: 'targetServerVersion', + type: { + name: 'String' + } + }, + targetServerBrandVersion: { + required: false, + readOnly: true, + serializedName: 'targetServerBrandVersion', + type: { + name: 'String' + } + }, + exceptionsAndWarnings: { + required: false, + readOnly: true, + serializedName: 'exceptionsAndWarnings', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ReportableExceptionElementType', + type: { + name: 'Composite', + className: 'ReportableException' + } + } + } + } + } + } + }; + } +} + +module.exports = MigrateSqlServerSqlDbTaskOutputMigrationLevel; diff --git a/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbTaskOutputTableLevel.js b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbTaskOutputTableLevel.js new file mode 100644 index 0000000000..3f7f0e9361 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbTaskOutputTableLevel.js @@ -0,0 +1,154 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing a MigrateSqlServerSqlDbTaskOutputTableLevel. + * @extends models['MigrateSqlServerSqlDbTaskOutput'] + */ +class MigrateSqlServerSqlDbTaskOutputTableLevel extends models['MigrateSqlServerSqlDbTaskOutput'] { + /** + * Create a MigrateSqlServerSqlDbTaskOutputTableLevel. + * @member {string} [objectName] Name of the item + * @member {date} [startedOn] Migration start time + * @member {date} [endedOn] Migration end time + * @member {string} [state] Current state of migration. Possible values + * include: 'None', 'InProgress', 'Failed', 'Warning', 'Completed', + * 'Skipped', 'Stopped' + * @member {string} [statusMessage] Status message + * @member {number} [itemsCount] Number of items + * @member {number} [itemsCompletedCount] Number of successfully completed + * items + * @member {string} [errorPrefix] Wildcard string prefix to use for querying + * all errors of the item + * @member {string} [resultPrefix] Wildcard string prefix to use for querying + * all sub-tem results of the item + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrateSqlServerSqlDbTaskOutputTableLevel + * + * @returns {object} metadata of MigrateSqlServerSqlDbTaskOutputTableLevel + * + */ + mapper() { + return { + required: false, + serializedName: 'TableLevelOutput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'MigrateSqlServerSqlDbTaskOutput', + className: 'MigrateSqlServerSqlDbTaskOutputTableLevel', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + objectName: { + required: false, + readOnly: true, + serializedName: 'objectName', + type: { + name: 'String' + } + }, + startedOn: { + required: false, + readOnly: true, + serializedName: 'startedOn', + type: { + name: 'DateTime' + } + }, + endedOn: { + required: false, + readOnly: true, + serializedName: 'endedOn', + type: { + name: 'DateTime' + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + statusMessage: { + required: false, + readOnly: true, + serializedName: 'statusMessage', + type: { + name: 'String' + } + }, + itemsCount: { + required: false, + readOnly: true, + serializedName: 'itemsCount', + type: { + name: 'Number' + } + }, + itemsCompletedCount: { + required: false, + readOnly: true, + serializedName: 'itemsCompletedCount', + type: { + name: 'Number' + } + }, + errorPrefix: { + required: false, + readOnly: true, + serializedName: 'errorPrefix', + type: { + name: 'String' + } + }, + resultPrefix: { + required: false, + readOnly: true, + serializedName: 'resultPrefix', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MigrateSqlServerSqlDbTaskOutputTableLevel; diff --git a/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbTaskProperties.js b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbTaskProperties.js new file mode 100644 index 0000000000..f3c082619d --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlDbTaskProperties.js @@ -0,0 +1,160 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Properties for the task that migrates on-prem SQL Server databases to Azure + * SQL Database + * + * @extends models['ProjectTaskProperties'] + */ +class MigrateSqlServerSqlDbTaskProperties extends models['ProjectTaskProperties'] { + /** + * Create a MigrateSqlServerSqlDbTaskProperties. + * @member {object} [input] Task input + * @member {array} [input.selectedDatabases] Databases to migrate + * @member {object} [input.validationOptions] Options for enabling various + * post migration validations. Available options, + * 1.) Data Integrity Check: Performs a checksum based comparison on source + * and target tables after the migration to ensure the correctness of the + * data. + * 2.) Schema Validation: Performs a thorough schema comparison between the + * source and target tables and provides a list of differences between the + * source and target database, 3.) Query Analysis: Executes a set of queries + * picked up automatically either from the Query Plan Cache or Query Store + * and execute them and compares the execution time between the source and + * target database. + * @member {boolean} [input.validationOptions.enableSchemaValidation] Allows + * to compare the schema information between source and target. + * @member {boolean} [input.validationOptions.enableDataIntegrityValidation] + * Allows to perform a checksum based data integrity validation between + * source and target for the selected database / tables . + * @member {boolean} [input.validationOptions.enableQueryAnalysisValidation] + * Allows to perform a quick and intelligent query analysis by retrieving + * queries from the source database and executes them in the target. The + * result will have execution statistics for executions in source and target + * databases for the extracted queries. + * @member {array} [output] Task output. This is ignored if submitted. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrateSqlServerSqlDbTaskProperties + * + * @returns {object} metadata of MigrateSqlServerSqlDbTaskProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'Migrate.SqlServer.SqlDb', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'taskType', + clientName: 'taskType' + }, + uberParent: 'ProjectTaskProperties', + className: 'MigrateSqlServerSqlDbTaskProperties', + modelProperties: { + errors: { + required: false, + readOnly: true, + serializedName: 'errors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ODataErrorElementType', + type: { + name: 'Composite', + className: 'ODataError' + } + } + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + commands: { + required: false, + readOnly: true, + serializedName: 'commands', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CommandPropertiesElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'commandType', + clientName: 'commandType' + }, + uberParent: 'CommandProperties', + className: 'CommandProperties' + } + } + } + }, + taskType: { + required: true, + serializedName: 'taskType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + input: { + required: false, + serializedName: 'input', + type: { + name: 'Composite', + className: 'MigrateSqlServerSqlDbTaskInput' + } + }, + output: { + required: false, + readOnly: true, + serializedName: 'output', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'MigrateSqlServerSqlDbTaskOutputElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'MigrateSqlServerSqlDbTaskOutput', + className: 'MigrateSqlServerSqlDbTaskOutput' + } + } + } + } + } + } + }; + } +} + +module.exports = MigrateSqlServerSqlDbTaskProperties; diff --git a/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlMIDatabaseInput.js b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlMIDatabaseInput.js new file mode 100644 index 0000000000..56883df8fe --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlMIDatabaseInput.js @@ -0,0 +1,92 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Database specific information for SQL to Azure SQL DB Managed Instance + * migration task inputs + * + */ +class MigrateSqlServerSqlMIDatabaseInput { + /** + * Create a MigrateSqlServerSqlMIDatabaseInput. + * @member {string} name Name of the database + * @member {string} restoreDatabaseName Name of the database at destination + * @member {object} [backupFileShare] Backup file share information for + * backing up this database. + * @member {string} [backupFileShare.userName] User name credential to + * connect to the share location + * @member {string} [backupFileShare.password] Password credential used to + * connect to the share location. + * @member {string} [backupFileShare.path] The folder path for this share. + * @member {array} [backupFilePaths] The list of backup files to be used in + * case of existing backups. + */ + constructor() { + } + + /** + * Defines the metadata of MigrateSqlServerSqlMIDatabaseInput + * + * @returns {object} metadata of MigrateSqlServerSqlMIDatabaseInput + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrateSqlServerSqlMIDatabaseInput', + type: { + name: 'Composite', + className: 'MigrateSqlServerSqlMIDatabaseInput', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + restoreDatabaseName: { + required: true, + serializedName: 'restoreDatabaseName', + type: { + name: 'String' + } + }, + backupFileShare: { + required: false, + serializedName: 'backupFileShare', + type: { + name: 'Composite', + className: 'FileShare' + } + }, + backupFilePaths: { + required: false, + serializedName: 'backupFilePaths', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = MigrateSqlServerSqlMIDatabaseInput; diff --git a/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlMITaskInput.js b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlMITaskInput.js new file mode 100644 index 0000000000..40f6b30dd0 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlMITaskInput.js @@ -0,0 +1,159 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Input for task that migrates SQL Server databases to Azure SQL Database + * Managed Instance. + * + * @extends models['SqlMigrationTaskInput'] + */ +class MigrateSqlServerSqlMITaskInput extends models['SqlMigrationTaskInput'] { + /** + * Create a MigrateSqlServerSqlMITaskInput. + * @member {array} selectedDatabases Databases to migrate + * @member {array} [selectedLogins] Logins to migrate. + * @member {array} [selectedAgentJobs] Agent Jobs to migrate. + * @member {object} [backupFileShare] Backup file share information for all + * selected databases. + * @member {string} [backupFileShare.userName] User name credential to + * connect to the share location + * @member {string} [backupFileShare.password] Password credential used to + * connect to the share location. + * @member {string} [backupFileShare.path] The folder path for this share. + * @member {object} backupBlobShare SAS URI of Azure Storage Account + * Container to be used for storing backup files. + * @member {string} [backupBlobShare.sasUri] SAS URI of Azure Storage Account + * Container. + * @member {string} [backupMode] Backup Mode to specify whether to use + * existing backup or create new backup. If using existing backups, backup + * file paths are required to be provided in selectedDatabases. Possible + * values include: 'CreateBackup', 'ExistingBackup' + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrateSqlServerSqlMITaskInput + * + * @returns {object} metadata of MigrateSqlServerSqlMITaskInput + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrateSqlServerSqlMITaskInput', + type: { + name: 'Composite', + className: 'MigrateSqlServerSqlMITaskInput', + modelProperties: { + sourceConnectionInfo: { + required: true, + serializedName: 'sourceConnectionInfo', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'ConnectionInfo', + className: 'SqlConnectionInfo' + } + }, + targetConnectionInfo: { + required: true, + serializedName: 'targetConnectionInfo', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'ConnectionInfo', + className: 'SqlConnectionInfo' + } + }, + selectedDatabases: { + required: true, + serializedName: 'selectedDatabases', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'MigrateSqlServerSqlMIDatabaseInputElementType', + type: { + name: 'Composite', + className: 'MigrateSqlServerSqlMIDatabaseInput' + } + } + } + }, + selectedLogins: { + required: false, + serializedName: 'selectedLogins', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + selectedAgentJobs: { + required: false, + serializedName: 'selectedAgentJobs', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + backupFileShare: { + required: false, + serializedName: 'backupFileShare', + type: { + name: 'Composite', + className: 'FileShare' + } + }, + backupBlobShare: { + required: true, + serializedName: 'backupBlobShare', + type: { + name: 'Composite', + className: 'BlobShare' + } + }, + backupMode: { + required: false, + serializedName: 'backupMode', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MigrateSqlServerSqlMITaskInput; diff --git a/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlMITaskOutput.js b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlMITaskOutput.js new file mode 100644 index 0000000000..4edaf961d0 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlMITaskOutput.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Output for task that migrates SQL Server databases to Azure SQL Database + * Managed Instance. + * + */ +class MigrateSqlServerSqlMITaskOutput { + /** + * Create a MigrateSqlServerSqlMITaskOutput. + * @member {string} [id] Result identifier + * @member {string} resultType Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of MigrateSqlServerSqlMITaskOutput + * + * @returns {object} metadata of MigrateSqlServerSqlMITaskOutput + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrateSqlServerSqlMITaskOutput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'MigrateSqlServerSqlMITaskOutput', + className: 'MigrateSqlServerSqlMITaskOutput', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MigrateSqlServerSqlMITaskOutput; diff --git a/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlMITaskOutputAgentJobLevel.js b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlMITaskOutputAgentJobLevel.js new file mode 100644 index 0000000000..a46bd171b9 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlMITaskOutputAgentJobLevel.js @@ -0,0 +1,142 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing a MigrateSqlServerSqlMITaskOutputAgentJobLevel. + * @extends models['MigrateSqlServerSqlMITaskOutput'] + */ +class MigrateSqlServerSqlMITaskOutputAgentJobLevel extends models['MigrateSqlServerSqlMITaskOutput'] { + /** + * Create a MigrateSqlServerSqlMITaskOutputAgentJobLevel. + * @member {string} [name] Agent Job name. + * @member {boolean} [isEnabled] The state of the original Agent Job. + * @member {string} [state] Current state of migration. Possible values + * include: 'None', 'InProgress', 'Failed', 'Warning', 'Completed', + * 'Skipped', 'Stopped' + * @member {date} [startedOn] Migration start time + * @member {date} [endedOn] Migration end time + * @member {string} [message] Migration progress message + * @member {array} [exceptionsAndWarnings] Migration errors and warnings per + * job + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrateSqlServerSqlMITaskOutputAgentJobLevel + * + * @returns {object} metadata of MigrateSqlServerSqlMITaskOutputAgentJobLevel + * + */ + mapper() { + return { + required: false, + serializedName: 'AgentJobLevelOutput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'MigrateSqlServerSqlMITaskOutput', + className: 'MigrateSqlServerSqlMITaskOutputAgentJobLevel', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + isEnabled: { + required: false, + readOnly: true, + serializedName: 'isEnabled', + type: { + name: 'Boolean' + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + startedOn: { + required: false, + readOnly: true, + serializedName: 'startedOn', + type: { + name: 'DateTime' + } + }, + endedOn: { + required: false, + readOnly: true, + serializedName: 'endedOn', + type: { + name: 'DateTime' + } + }, + message: { + required: false, + readOnly: true, + serializedName: 'message', + type: { + name: 'String' + } + }, + exceptionsAndWarnings: { + required: false, + readOnly: true, + serializedName: 'exceptionsAndWarnings', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ReportableExceptionElementType', + type: { + name: 'Composite', + className: 'ReportableException' + } + } + } + } + } + } + }; + } +} + +module.exports = MigrateSqlServerSqlMITaskOutputAgentJobLevel; diff --git a/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlMITaskOutputDatabaseLevel.js b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlMITaskOutputDatabaseLevel.js new file mode 100644 index 0000000000..000635ab76 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlMITaskOutputDatabaseLevel.js @@ -0,0 +1,152 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing a MigrateSqlServerSqlMITaskOutputDatabaseLevel. + * @extends models['MigrateSqlServerSqlMITaskOutput'] + */ +class MigrateSqlServerSqlMITaskOutputDatabaseLevel extends models['MigrateSqlServerSqlMITaskOutput'] { + /** + * Create a MigrateSqlServerSqlMITaskOutputDatabaseLevel. + * @member {string} [databaseName] Name of the database + * @member {number} [sizeMB] Size of the database in megabytes + * @member {string} [state] Current state of migration. Possible values + * include: 'None', 'InProgress', 'Failed', 'Warning', 'Completed', + * 'Skipped', 'Stopped' + * @member {string} [stage] Current stage of migration. Possible values + * include: 'None', 'Initialize', 'Backup', 'FileCopy', 'Restore', + * 'Completed' + * @member {date} [startedOn] Migration start time + * @member {date} [endedOn] Migration end time + * @member {string} [message] Migration progress message + * @member {array} [exceptionsAndWarnings] Migration exceptions and warnings + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrateSqlServerSqlMITaskOutputDatabaseLevel + * + * @returns {object} metadata of MigrateSqlServerSqlMITaskOutputDatabaseLevel + * + */ + mapper() { + return { + required: false, + serializedName: 'DatabaseLevelOutput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'MigrateSqlServerSqlMITaskOutput', + className: 'MigrateSqlServerSqlMITaskOutputDatabaseLevel', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + databaseName: { + required: false, + readOnly: true, + serializedName: 'databaseName', + type: { + name: 'String' + } + }, + sizeMB: { + required: false, + readOnly: true, + serializedName: 'sizeMB', + type: { + name: 'Number' + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + stage: { + required: false, + readOnly: true, + serializedName: 'stage', + type: { + name: 'String' + } + }, + startedOn: { + required: false, + readOnly: true, + serializedName: 'startedOn', + type: { + name: 'DateTime' + } + }, + endedOn: { + required: false, + readOnly: true, + serializedName: 'endedOn', + type: { + name: 'DateTime' + } + }, + message: { + required: false, + readOnly: true, + serializedName: 'message', + type: { + name: 'String' + } + }, + exceptionsAndWarnings: { + required: false, + readOnly: true, + serializedName: 'exceptionsAndWarnings', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ReportableExceptionElementType', + type: { + name: 'Composite', + className: 'ReportableException' + } + } + } + } + } + } + }; + } +} + +module.exports = MigrateSqlServerSqlMITaskOutputDatabaseLevel; diff --git a/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlMITaskOutputError.js b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlMITaskOutputError.js new file mode 100644 index 0000000000..72aae70f46 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlMITaskOutputError.js @@ -0,0 +1,88 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing a MigrateSqlServerSqlMITaskOutputError. + * @extends models['MigrateSqlServerSqlMITaskOutput'] + */ +class MigrateSqlServerSqlMITaskOutputError extends models['MigrateSqlServerSqlMITaskOutput'] { + /** + * Create a MigrateSqlServerSqlMITaskOutputError. + * @member {object} [error] Migration error + * @member {string} [error.message] Error message + * @member {string} [error.actionableMessage] Actionable steps for this + * exception + * @member {string} [error.filePath] The path to the file where exception + * occurred + * @member {string} [error.lineNumber] The line number where exception + * occurred + * @member {number} [error.hResult] Coded numerical value that is assigned to + * a specific exception + * @member {string} [error.stackTrace] Stack trace + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrateSqlServerSqlMITaskOutputError + * + * @returns {object} metadata of MigrateSqlServerSqlMITaskOutputError + * + */ + mapper() { + return { + required: false, + serializedName: 'ErrorOutput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'MigrateSqlServerSqlMITaskOutput', + className: 'MigrateSqlServerSqlMITaskOutputError', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + error: { + required: false, + readOnly: true, + serializedName: 'error', + type: { + name: 'Composite', + className: 'ReportableException' + } + } + } + } + }; + } +} + +module.exports = MigrateSqlServerSqlMITaskOutputError; diff --git a/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlMITaskOutputLoginLevel.js b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlMITaskOutputLoginLevel.js new file mode 100644 index 0000000000..2afab7340c --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlMITaskOutputLoginLevel.js @@ -0,0 +1,145 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing a MigrateSqlServerSqlMITaskOutputLoginLevel. + * @extends models['MigrateSqlServerSqlMITaskOutput'] + */ +class MigrateSqlServerSqlMITaskOutputLoginLevel extends models['MigrateSqlServerSqlMITaskOutput'] { + /** + * Create a MigrateSqlServerSqlMITaskOutputLoginLevel. + * @member {string} [loginName] Login name. + * @member {string} [state] Current state of login. Possible values include: + * 'None', 'InProgress', 'Failed', 'Warning', 'Completed', 'Skipped', + * 'Stopped' + * @member {string} [stage] Current stage of login. Possible values include: + * 'None', 'Initialize', 'LoginMigration', 'EstablishUserMapping', + * 'AssignRoleMembership', 'AssignRoleOwnership', + * 'EstablishServerPermissions', 'EstablishObjectPermissions', 'Completed' + * @member {date} [startedOn] Login migration start time + * @member {date} [endedOn] Login migration end time + * @member {string} [message] Login migration progress message + * @member {array} [exceptionsAndWarnings] Login migration errors and + * warnings per login + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrateSqlServerSqlMITaskOutputLoginLevel + * + * @returns {object} metadata of MigrateSqlServerSqlMITaskOutputLoginLevel + * + */ + mapper() { + return { + required: false, + serializedName: 'LoginLevelOutput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'MigrateSqlServerSqlMITaskOutput', + className: 'MigrateSqlServerSqlMITaskOutputLoginLevel', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + loginName: { + required: false, + readOnly: true, + serializedName: 'loginName', + type: { + name: 'String' + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + stage: { + required: false, + readOnly: true, + serializedName: 'stage', + type: { + name: 'String' + } + }, + startedOn: { + required: false, + readOnly: true, + serializedName: 'startedOn', + type: { + name: 'DateTime' + } + }, + endedOn: { + required: false, + readOnly: true, + serializedName: 'endedOn', + type: { + name: 'DateTime' + } + }, + message: { + required: false, + readOnly: true, + serializedName: 'message', + type: { + name: 'String' + } + }, + exceptionsAndWarnings: { + required: false, + readOnly: true, + serializedName: 'exceptionsAndWarnings', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ReportableExceptionElementType', + type: { + name: 'Composite', + className: 'ReportableException' + } + } + } + } + } + } + }; + } +} + +module.exports = MigrateSqlServerSqlMITaskOutputLoginLevel; diff --git a/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlMITaskOutputMigrationLevel.js b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlMITaskOutputMigrationLevel.js new file mode 100644 index 0000000000..552734e945 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlMITaskOutputMigrationLevel.js @@ -0,0 +1,254 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing a MigrateSqlServerSqlMITaskOutputMigrationLevel. + * @extends models['MigrateSqlServerSqlMITaskOutput'] + */ +class MigrateSqlServerSqlMITaskOutputMigrationLevel extends models['MigrateSqlServerSqlMITaskOutput'] { + /** + * Create a MigrateSqlServerSqlMITaskOutputMigrationLevel. + * @member {date} [startedOn] Migration start time + * @member {date} [endedOn] Migration end time + * @member {string} [status] Current status of migration. Possible values + * include: 'Default', 'Connecting', 'SourceAndTargetSelected', + * 'SelectLogins', 'Configured', 'Running', 'Error', 'Stopped', 'Completed', + * 'CompletedWithWarnings' + * @member {string} [state] Current state of migration. Possible values + * include: 'None', 'InProgress', 'Failed', 'Warning', 'Completed', + * 'Skipped', 'Stopped' + * @member {object} [agentJobs] Selected agent jobs as a map from name to id + * @member {object} [logins] Selected logins as a map from name to id + * @member {string} [message] Migration progress message + * @member {object} [serverRoleResults] Map of server role migration results. + * @member {object} [orphanedUsers] Map of users to database name of orphaned + * users. + * @member {object} [databases] Selected databases as a map from database + * name to database id + * @member {string} [sourceServerVersion] Source server version + * @member {string} [sourceServerBrandVersion] Source server brand version + * @member {string} [targetServerVersion] Target server version + * @member {string} [targetServerBrandVersion] Target server brand version + * @member {array} [exceptionsAndWarnings] Migration exceptions and warnings. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrateSqlServerSqlMITaskOutputMigrationLevel + * + * @returns {object} metadata of MigrateSqlServerSqlMITaskOutputMigrationLevel + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrationLevelOutput', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'MigrateSqlServerSqlMITaskOutput', + className: 'MigrateSqlServerSqlMITaskOutputMigrationLevel', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + startedOn: { + required: false, + readOnly: true, + serializedName: 'startedOn', + type: { + name: 'DateTime' + } + }, + endedOn: { + required: false, + readOnly: true, + serializedName: 'endedOn', + type: { + name: 'DateTime' + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'status', + type: { + name: 'String' + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + agentJobs: { + required: false, + readOnly: true, + serializedName: 'agentJobs', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + logins: { + required: false, + readOnly: true, + serializedName: 'logins', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + message: { + required: false, + readOnly: true, + serializedName: 'message', + type: { + name: 'String' + } + }, + serverRoleResults: { + required: false, + readOnly: true, + serializedName: 'serverRoleResults', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StartMigrationScenarioServerRoleResultElementType', + type: { + name: 'Composite', + className: 'StartMigrationScenarioServerRoleResult' + } + } + } + }, + orphanedUsers: { + required: false, + readOnly: true, + serializedName: 'orphanedUsers', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + databases: { + required: false, + readOnly: true, + serializedName: 'databases', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + sourceServerVersion: { + required: false, + readOnly: true, + serializedName: 'sourceServerVersion', + type: { + name: 'String' + } + }, + sourceServerBrandVersion: { + required: false, + readOnly: true, + serializedName: 'sourceServerBrandVersion', + type: { + name: 'String' + } + }, + targetServerVersion: { + required: false, + readOnly: true, + serializedName: 'targetServerVersion', + type: { + name: 'String' + } + }, + targetServerBrandVersion: { + required: false, + readOnly: true, + serializedName: 'targetServerBrandVersion', + type: { + name: 'String' + } + }, + exceptionsAndWarnings: { + required: false, + readOnly: true, + serializedName: 'exceptionsAndWarnings', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ReportableExceptionElementType', + type: { + name: 'Composite', + className: 'ReportableException' + } + } + } + } + } + } + }; + } +} + +module.exports = MigrateSqlServerSqlMITaskOutputMigrationLevel; diff --git a/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlMITaskProperties.js b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlMITaskProperties.js new file mode 100644 index 0000000000..20ba8d742f --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlMITaskProperties.js @@ -0,0 +1,157 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Properties for task that migrates SQL Server databases to Azure SQL Database + * Managed Instance + * + * @extends models['ProjectTaskProperties'] + */ +class MigrateSqlServerSqlMITaskProperties extends models['ProjectTaskProperties'] { + /** + * Create a MigrateSqlServerSqlMITaskProperties. + * @member {object} [input] Task input + * @member {array} [input.selectedDatabases] Databases to migrate + * @member {array} [input.selectedLogins] Logins to migrate. + * @member {array} [input.selectedAgentJobs] Agent Jobs to migrate. + * @member {object} [input.backupFileShare] Backup file share information for + * all selected databases. + * @member {string} [input.backupFileShare.userName] User name credential to + * connect to the share location + * @member {string} [input.backupFileShare.password] Password credential used + * to connect to the share location. + * @member {string} [input.backupFileShare.path] The folder path for this + * share. + * @member {object} [input.backupBlobShare] SAS URI of Azure Storage Account + * Container to be used for storing backup files. + * @member {string} [input.backupBlobShare.sasUri] SAS URI of Azure Storage + * Account Container. + * @member {string} [input.backupMode] Backup Mode to specify whether to use + * existing backup or create new backup. If using existing backups, backup + * file paths are required to be provided in selectedDatabases. Possible + * values include: 'CreateBackup', 'ExistingBackup' + * @member {array} [output] Task output. This is ignored if submitted. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrateSqlServerSqlMITaskProperties + * + * @returns {object} metadata of MigrateSqlServerSqlMITaskProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'Migrate.SqlServer.AzureSqlDbMI', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'taskType', + clientName: 'taskType' + }, + uberParent: 'ProjectTaskProperties', + className: 'MigrateSqlServerSqlMITaskProperties', + modelProperties: { + errors: { + required: false, + readOnly: true, + serializedName: 'errors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ODataErrorElementType', + type: { + name: 'Composite', + className: 'ODataError' + } + } + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + commands: { + required: false, + readOnly: true, + serializedName: 'commands', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CommandPropertiesElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'commandType', + clientName: 'commandType' + }, + uberParent: 'CommandProperties', + className: 'CommandProperties' + } + } + } + }, + taskType: { + required: true, + serializedName: 'taskType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + input: { + required: false, + serializedName: 'input', + type: { + name: 'Composite', + className: 'MigrateSqlServerSqlMITaskInput' + } + }, + output: { + required: false, + readOnly: true, + serializedName: 'output', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'MigrateSqlServerSqlMITaskOutputElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'resultType', + clientName: 'resultType' + }, + uberParent: 'MigrateSqlServerSqlMITaskOutput', + className: 'MigrateSqlServerSqlMITaskOutput' + } + } + } + } + } + } + }; + } +} + +module.exports = MigrateSqlServerSqlMITaskProperties; diff --git a/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlServerDatabaseInput.js b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlServerDatabaseInput.js new file mode 100644 index 0000000000..53588c0cab --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateSqlServerSqlServerDatabaseInput.js @@ -0,0 +1,84 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Database specific information for SQL to SQL migration task inputs + * + */ +class MigrateSqlServerSqlServerDatabaseInput { + /** + * Create a MigrateSqlServerSqlServerDatabaseInput. + * @member {string} [name] Name of the database + * @member {string} [restoreDatabaseName] Name of the database at destination + * @member {string} [backupAndRestoreFolder] The backup and restore folder + * @member {array} [databaseFiles] The list of database files + */ + constructor() { + } + + /** + * Defines the metadata of MigrateSqlServerSqlServerDatabaseInput + * + * @returns {object} metadata of MigrateSqlServerSqlServerDatabaseInput + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrateSqlServerSqlServerDatabaseInput', + type: { + name: 'Composite', + className: 'MigrateSqlServerSqlServerDatabaseInput', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + restoreDatabaseName: { + required: false, + serializedName: 'restoreDatabaseName', + type: { + name: 'String' + } + }, + backupAndRestoreFolder: { + required: false, + serializedName: 'backupAndRestoreFolder', + type: { + name: 'String' + } + }, + databaseFiles: { + required: false, + serializedName: 'databaseFiles', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DatabaseFileInputElementType', + type: { + name: 'Composite', + className: 'DatabaseFileInput' + } + } + } + } + } + } + }; + } +} + +module.exports = MigrateSqlServerSqlServerDatabaseInput; diff --git a/lib/services/datamigrationManagement/lib/models/migrateSyncCompleteCommandInput.js b/lib/services/datamigrationManagement/lib/models/migrateSyncCompleteCommandInput.js new file mode 100644 index 0000000000..57e3d8781a --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateSyncCompleteCommandInput.js @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Input for command that completes sync migration for a database. + * + */ +class MigrateSyncCompleteCommandInput { + /** + * Create a MigrateSyncCompleteCommandInput. + * @member {string} databaseName Name of database + * @member {date} [commitTimeStamp] Time stamp to complete + */ + constructor() { + } + + /** + * Defines the metadata of MigrateSyncCompleteCommandInput + * + * @returns {object} metadata of MigrateSyncCompleteCommandInput + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrateSyncCompleteCommandInput', + type: { + name: 'Composite', + className: 'MigrateSyncCompleteCommandInput', + modelProperties: { + databaseName: { + required: true, + serializedName: 'databaseName', + type: { + name: 'String' + } + }, + commitTimeStamp: { + required: false, + serializedName: 'commitTimeStamp', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = MigrateSyncCompleteCommandInput; diff --git a/lib/services/datamigrationManagement/lib/models/migrateSyncCompleteCommandOutput.js b/lib/services/datamigrationManagement/lib/models/migrateSyncCompleteCommandOutput.js new file mode 100644 index 0000000000..ed94039b2d --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateSyncCompleteCommandOutput.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Output for command that completes sync migration for a database. + * + */ +class MigrateSyncCompleteCommandOutput { + /** + * Create a MigrateSyncCompleteCommandOutput. + * @member {array} [errors] List of errors that happened during the command + * execution + */ + constructor() { + } + + /** + * Defines the metadata of MigrateSyncCompleteCommandOutput + * + * @returns {object} metadata of MigrateSyncCompleteCommandOutput + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrateSyncCompleteCommandOutput', + type: { + name: 'Composite', + className: 'MigrateSyncCompleteCommandOutput', + modelProperties: { + errors: { + required: false, + serializedName: 'errors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ReportableExceptionElementType', + type: { + name: 'Composite', + className: 'ReportableException' + } + } + } + } + } + } + }; + } +} + +module.exports = MigrateSyncCompleteCommandOutput; diff --git a/lib/services/datamigrationManagement/lib/models/migrateSyncCompleteCommandProperties.js b/lib/services/datamigrationManagement/lib/models/migrateSyncCompleteCommandProperties.js new file mode 100644 index 0000000000..a483716388 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrateSyncCompleteCommandProperties.js @@ -0,0 +1,108 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Properties for the command that completes sync migration for a database. + * + * @extends models['CommandProperties'] + */ +class MigrateSyncCompleteCommandProperties extends models['CommandProperties'] { + /** + * Create a MigrateSyncCompleteCommandProperties. + * @member {object} [input] Command input + * @member {string} [input.databaseName] Name of database + * @member {date} [input.commitTimeStamp] Time stamp to complete + * @member {object} [output] Command output. This is ignored if submitted. + * @member {array} [output.errors] List of errors that happened during the + * command execution + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MigrateSyncCompleteCommandProperties + * + * @returns {object} metadata of MigrateSyncCompleteCommandProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'Migrate.Sync.Complete.Database', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'commandType', + clientName: 'commandType' + }, + uberParent: 'CommandProperties', + className: 'MigrateSyncCompleteCommandProperties', + modelProperties: { + errors: { + required: false, + readOnly: true, + serializedName: 'errors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ODataErrorElementType', + type: { + name: 'Composite', + className: 'ODataError' + } + } + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + commandType: { + required: true, + serializedName: 'commandType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + input: { + required: false, + serializedName: 'input', + type: { + name: 'Composite', + className: 'MigrateSyncCompleteCommandInput' + } + }, + output: { + required: false, + readOnly: true, + serializedName: 'output', + type: { + name: 'Composite', + className: 'MigrateSyncCompleteCommandOutput' + } + } + } + } + }; + } +} + +module.exports = MigrateSyncCompleteCommandProperties; diff --git a/lib/services/datamigrationManagement/lib/models/migrationEligibilityInfo.js b/lib/services/datamigrationManagement/lib/models/migrationEligibilityInfo.js new file mode 100644 index 0000000000..1b1c3d7945 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrationEligibilityInfo.js @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Information about migration eligibility of a server object + * + */ +class MigrationEligibilityInfo { + /** + * Create a MigrationEligibilityInfo. + * @member {boolean} [isEligibileForMigration] Whether object is eligible for + * migration or not. + * @member {array} [validationMessages] Information about eligibility failure + * for the server object. + */ + constructor() { + } + + /** + * Defines the metadata of MigrationEligibilityInfo + * + * @returns {object} metadata of MigrationEligibilityInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrationEligibilityInfo', + type: { + name: 'Composite', + className: 'MigrationEligibilityInfo', + modelProperties: { + isEligibileForMigration: { + required: false, + readOnly: true, + serializedName: 'isEligibileForMigration', + type: { + name: 'Boolean' + } + }, + validationMessages: { + required: false, + readOnly: true, + serializedName: 'validationMessages', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = MigrationEligibilityInfo; diff --git a/lib/services/datamigrationManagement/lib/models/migrationReportResult.js b/lib/services/datamigrationManagement/lib/models/migrationReportResult.js new file mode 100644 index 0000000000..522d8e5980 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrationReportResult.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Migration validation report result, contains the url for downloading the + * generated report. + * + */ +class MigrationReportResult { + /** + * Create a MigrationReportResult. + * @member {string} [id] Migration validation result identifier + * @member {string} [reportUrl] The url of the report. + */ + constructor() { + } + + /** + * Defines the metadata of MigrationReportResult + * + * @returns {object} metadata of MigrationReportResult + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrationReportResult', + type: { + name: 'Composite', + className: 'MigrationReportResult', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + reportUrl: { + required: false, + serializedName: 'reportUrl', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MigrationReportResult; diff --git a/lib/services/datamigrationManagement/lib/models/migrationTableMetadata.js b/lib/services/datamigrationManagement/lib/models/migrationTableMetadata.js new file mode 100644 index 0000000000..a2c0014312 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrationTableMetadata.js @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Metadata for tables selected in migration project + * + */ +class MigrationTableMetadata { + /** + * Create a MigrationTableMetadata. + * @member {string} [sourceTableName] Source table name + * @member {string} [targetTableName] Target table name + */ + constructor() { + } + + /** + * Defines the metadata of MigrationTableMetadata + * + * @returns {object} metadata of MigrationTableMetadata + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrationTableMetadata', + type: { + name: 'Composite', + className: 'MigrationTableMetadata', + modelProperties: { + sourceTableName: { + required: false, + readOnly: true, + serializedName: 'sourceTableName', + type: { + name: 'String' + } + }, + targetTableName: { + required: false, + readOnly: true, + serializedName: 'targetTableName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MigrationTableMetadata; diff --git a/lib/services/datamigrationManagement/lib/models/migrationValidationDatabaseLevelResult.js b/lib/services/datamigrationManagement/lib/models/migrationValidationDatabaseLevelResult.js new file mode 100644 index 0000000000..befb1accbd --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrationValidationDatabaseLevelResult.js @@ -0,0 +1,226 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Database level validation results + * + */ +class MigrationValidationDatabaseLevelResult { + /** + * Create a MigrationValidationDatabaseLevelResult. + * @member {string} [id] Result identifier + * @member {string} [migrationId] Migration Identifier + * @member {string} [sourceDatabaseName] Name of the source database + * @member {string} [targetDatabaseName] Name of the target database + * @member {date} [startedOn] Validation start time + * @member {date} [endedOn] Validation end time + * @member {object} [dataIntegrityValidationResult] Provides data integrity + * validation result between the source and target tables that are migrated. + * @member {object} [dataIntegrityValidationResult.failedObjects] List of + * failed table names of source and target pair + * @member {object} [dataIntegrityValidationResult.validationErrors] List of + * errors that happened while performing data integrity validation + * @member {string} [dataIntegrityValidationResult.validationErrors.text] + * Error Text + * @member {string} [dataIntegrityValidationResult.validationErrors.severity] + * Severity of the error. Possible values include: 'Message', 'Warning', + * 'Error' + * @member {object} [schemaValidationResult] Provides schema comparison + * result between source and target database + * @member {object} [schemaValidationResult.schemaDifferences] List of schema + * differences between the source and target databases + * @member {string} [schemaValidationResult.schemaDifferences.objectName] + * Name of the object that has the difference + * @member {string} [schemaValidationResult.schemaDifferences.objectType] + * Type of the object that has the difference. e.g + * (Table/View/StoredProcedure). Possible values include: 'StoredProcedures', + * 'Table', 'User', 'View', 'Function' + * @member {string} [schemaValidationResult.schemaDifferences.updateAction] + * Update action type with respect to target. Possible values include: + * 'DeletedOnTarget', 'ChangedOnTarget', 'AddedOnTarget' + * @member {object} [schemaValidationResult.validationErrors] List of errors + * that happened while performing schema compare validation + * @member {string} [schemaValidationResult.validationErrors.text] Error Text + * @member {string} [schemaValidationResult.validationErrors.severity] + * Severity of the error. Possible values include: 'Message', 'Warning', + * 'Error' + * @member {object} [schemaValidationResult.sourceDatabaseObjectCount] Count + * of source database objects + * @member {object} [schemaValidationResult.targetDatabaseObjectCount] Count + * of target database objects + * @member {object} [queryAnalysisValidationResult] Results of some of the + * query execution result between source and target database + * @member {object} [queryAnalysisValidationResult.queryResults] List of + * queries executed and it's execution results in source and target + * @member {string} [queryAnalysisValidationResult.queryResults.queryText] + * Query text retrieved from the source server + * @member {number} + * [queryAnalysisValidationResult.queryResults.statementsInBatch] Total no. + * of statements in the batch + * @member {object} [queryAnalysisValidationResult.queryResults.sourceResult] + * Query analysis result from the source + * @member {number} + * [queryAnalysisValidationResult.queryResults.sourceResult.executionCount] + * No. of query executions + * @member {number} + * [queryAnalysisValidationResult.queryResults.sourceResult.cpuTimeMs] CPU + * Time in millisecond(s) for the query execution + * @member {number} + * [queryAnalysisValidationResult.queryResults.sourceResult.elapsedTimeMs] + * Time taken in millisecond(s) for executing the query + * @member {object} + * [queryAnalysisValidationResult.queryResults.sourceResult.waitStats] + * Dictionary of sql query execution wait types and the respective statistics + * @member {boolean} + * [queryAnalysisValidationResult.queryResults.sourceResult.hasErrors] + * Indicates whether the query resulted in an error + * @member {array} + * [queryAnalysisValidationResult.queryResults.sourceResult.sqlErrors] List + * of sql Errors + * @member {object} [queryAnalysisValidationResult.queryResults.targetResult] + * Query analysis result from the target + * @member {number} + * [queryAnalysisValidationResult.queryResults.targetResult.executionCount] + * No. of query executions + * @member {number} + * [queryAnalysisValidationResult.queryResults.targetResult.cpuTimeMs] CPU + * Time in millisecond(s) for the query execution + * @member {number} + * [queryAnalysisValidationResult.queryResults.targetResult.elapsedTimeMs] + * Time taken in millisecond(s) for executing the query + * @member {object} + * [queryAnalysisValidationResult.queryResults.targetResult.waitStats] + * Dictionary of sql query execution wait types and the respective statistics + * @member {boolean} + * [queryAnalysisValidationResult.queryResults.targetResult.hasErrors] + * Indicates whether the query resulted in an error + * @member {array} + * [queryAnalysisValidationResult.queryResults.targetResult.sqlErrors] List + * of sql Errors + * @member {object} [queryAnalysisValidationResult.validationErrors] Errors + * that are part of the execution + * @member {string} [queryAnalysisValidationResult.validationErrors.text] + * Error Text + * @member {string} [queryAnalysisValidationResult.validationErrors.severity] + * Severity of the error. Possible values include: 'Message', 'Warning', + * 'Error' + * @member {string} [status] Current status of validation at the database + * level. Possible values include: 'Default', 'NotStarted', 'Initialized', + * 'InProgress', 'Completed', 'CompletedWithIssues', 'Stopped', 'Failed' + */ + constructor() { + } + + /** + * Defines the metadata of MigrationValidationDatabaseLevelResult + * + * @returns {object} metadata of MigrationValidationDatabaseLevelResult + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrationValidationDatabaseLevelResult', + type: { + name: 'Composite', + className: 'MigrationValidationDatabaseLevelResult', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + migrationId: { + required: false, + readOnly: true, + serializedName: 'migrationId', + type: { + name: 'String' + } + }, + sourceDatabaseName: { + required: false, + readOnly: true, + serializedName: 'sourceDatabaseName', + type: { + name: 'String' + } + }, + targetDatabaseName: { + required: false, + readOnly: true, + serializedName: 'targetDatabaseName', + type: { + name: 'String' + } + }, + startedOn: { + required: false, + readOnly: true, + serializedName: 'startedOn', + type: { + name: 'DateTime' + } + }, + endedOn: { + required: false, + readOnly: true, + serializedName: 'endedOn', + type: { + name: 'DateTime' + } + }, + dataIntegrityValidationResult: { + required: false, + readOnly: true, + serializedName: 'dataIntegrityValidationResult', + type: { + name: 'Composite', + className: 'DataIntegrityValidationResult' + } + }, + schemaValidationResult: { + required: false, + readOnly: true, + serializedName: 'schemaValidationResult', + type: { + name: 'Composite', + className: 'SchemaComparisonValidationResult' + } + }, + queryAnalysisValidationResult: { + required: false, + readOnly: true, + serializedName: 'queryAnalysisValidationResult', + type: { + name: 'Composite', + className: 'QueryAnalysisValidationResult' + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'status', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MigrationValidationDatabaseLevelResult; diff --git a/lib/services/datamigrationManagement/lib/models/migrationValidationDatabaseSummaryResult.js b/lib/services/datamigrationManagement/lib/models/migrationValidationDatabaseSummaryResult.js new file mode 100644 index 0000000000..ba98ac0c8d --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrationValidationDatabaseSummaryResult.js @@ -0,0 +1,109 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Migration Validation Database level summary result + * + */ +class MigrationValidationDatabaseSummaryResult { + /** + * Create a MigrationValidationDatabaseSummaryResult. + * @member {string} [id] Result identifier + * @member {string} [migrationId] Migration Identifier + * @member {string} [sourceDatabaseName] Name of the source database + * @member {string} [targetDatabaseName] Name of the target database + * @member {date} [startedOn] Validation start time + * @member {date} [endedOn] Validation end time + * @member {string} [status] Current status of validation at the database + * level. Possible values include: 'Default', 'NotStarted', 'Initialized', + * 'InProgress', 'Completed', 'CompletedWithIssues', 'Stopped', 'Failed' + */ + constructor() { + } + + /** + * Defines the metadata of MigrationValidationDatabaseSummaryResult + * + * @returns {object} metadata of MigrationValidationDatabaseSummaryResult + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrationValidationDatabaseSummaryResult', + type: { + name: 'Composite', + className: 'MigrationValidationDatabaseSummaryResult', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + migrationId: { + required: false, + readOnly: true, + serializedName: 'migrationId', + type: { + name: 'String' + } + }, + sourceDatabaseName: { + required: false, + readOnly: true, + serializedName: 'sourceDatabaseName', + type: { + name: 'String' + } + }, + targetDatabaseName: { + required: false, + readOnly: true, + serializedName: 'targetDatabaseName', + type: { + name: 'String' + } + }, + startedOn: { + required: false, + readOnly: true, + serializedName: 'startedOn', + type: { + name: 'DateTime' + } + }, + endedOn: { + required: false, + readOnly: true, + serializedName: 'endedOn', + type: { + name: 'DateTime' + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'status', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MigrationValidationDatabaseSummaryResult; diff --git a/lib/services/datamigrationManagement/lib/models/migrationValidationOptions.js b/lib/services/datamigrationManagement/lib/models/migrationValidationOptions.js new file mode 100644 index 0000000000..92e27ef8e2 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrationValidationOptions.js @@ -0,0 +1,75 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Types of validations to run after the migration + * + */ +class MigrationValidationOptions { + /** + * Create a MigrationValidationOptions. + * @member {boolean} [enableSchemaValidation] Allows to compare the schema + * information between source and target. + * @member {boolean} [enableDataIntegrityValidation] Allows to perform a + * checksum based data integrity validation between source and target for the + * selected database / tables . + * @member {boolean} [enableQueryAnalysisValidation] Allows to perform a + * quick and intelligent query analysis by retrieving queries from the source + * database and executes them in the target. The result will have execution + * statistics for executions in source and target databases for the extracted + * queries. + */ + constructor() { + } + + /** + * Defines the metadata of MigrationValidationOptions + * + * @returns {object} metadata of MigrationValidationOptions + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrationValidationOptions', + type: { + name: 'Composite', + className: 'MigrationValidationOptions', + modelProperties: { + enableSchemaValidation: { + required: false, + serializedName: 'enableSchemaValidation', + type: { + name: 'Boolean' + } + }, + enableDataIntegrityValidation: { + required: false, + serializedName: 'enableDataIntegrityValidation', + type: { + name: 'Boolean' + } + }, + enableQueryAnalysisValidation: { + required: false, + serializedName: 'enableQueryAnalysisValidation', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = MigrationValidationOptions; diff --git a/lib/services/datamigrationManagement/lib/models/migrationValidationResult.js b/lib/services/datamigrationManagement/lib/models/migrationValidationResult.js new file mode 100644 index 0000000000..f9fd96bb4a --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/migrationValidationResult.js @@ -0,0 +1,92 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Migration Validation Result + * + */ +class MigrationValidationResult { + /** + * Create a MigrationValidationResult. + * @member {string} [id] Migration validation result identifier + * @member {string} [migrationId] Migration Identifier + * @member {object} [summaryResults] Validation summary results for each + * database + * @member {string} [status] Current status of validation at the migration + * level. Status from the database validation result status will be + * aggregated here. Possible values include: 'Default', 'NotStarted', + * 'Initialized', 'InProgress', 'Completed', 'CompletedWithIssues', + * 'Stopped', 'Failed' + */ + constructor() { + } + + /** + * Defines the metadata of MigrationValidationResult + * + * @returns {object} metadata of MigrationValidationResult + * + */ + mapper() { + return { + required: false, + serializedName: 'MigrationValidationResult', + type: { + name: 'Composite', + className: 'MigrationValidationResult', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + migrationId: { + required: false, + readOnly: true, + serializedName: 'migrationId', + type: { + name: 'String' + } + }, + summaryResults: { + required: false, + serializedName: 'summaryResults', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'MigrationValidationDatabaseSummaryResultElementType', + type: { + name: 'Composite', + className: 'MigrationValidationDatabaseSummaryResult' + } + } + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'status', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MigrationValidationResult; diff --git a/lib/services/datamigrationManagement/lib/models/mongoDbCancelCommand.js b/lib/services/datamigrationManagement/lib/models/mongoDbCancelCommand.js new file mode 100644 index 0000000000..ba742ab7ba --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/mongoDbCancelCommand.js @@ -0,0 +1,96 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Properties for the command that cancels a migration in whole or in part + * + * @extends models['CommandProperties'] + */ +class MongoDbCancelCommand extends models['CommandProperties'] { + /** + * Create a MongoDbCancelCommand. + * @member {object} [input] Command input + * @member {string} [input.objectName] The qualified name of a database or + * collection to act upon, or null to act upon the entire migration + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MongoDbCancelCommand + * + * @returns {object} metadata of MongoDbCancelCommand + * + */ + mapper() { + return { + required: false, + serializedName: 'cancel', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'commandType', + clientName: 'commandType' + }, + uberParent: 'CommandProperties', + className: 'MongoDbCancelCommand', + modelProperties: { + errors: { + required: false, + readOnly: true, + serializedName: 'errors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ODataErrorElementType', + type: { + name: 'Composite', + className: 'ODataError' + } + } + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + commandType: { + required: true, + serializedName: 'commandType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + input: { + required: false, + serializedName: 'input', + type: { + name: 'Composite', + className: 'MongoDbCommandInput' + } + } + } + } + }; + } +} + +module.exports = MongoDbCancelCommand; diff --git a/lib/services/datamigrationManagement/lib/models/mongoDbClusterInfo.js b/lib/services/datamigrationManagement/lib/models/mongoDbClusterInfo.js new file mode 100644 index 0000000000..086dbdcb34 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/mongoDbClusterInfo.js @@ -0,0 +1,87 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Describes a MongoDB data source + * + */ +class MongoDbClusterInfo { + /** + * Create a MongoDbClusterInfo. + * @member {array} databases A list of non-system databases in the cluster + * @member {boolean} supportsSharding Whether the cluster supports sharded + * collections + * @member {string} type The type of data source. Possible values include: + * 'BlobContainer', 'CosmosDb', 'MongoDb' + * @member {string} version The version of the data source in the form x.y.z + * (e.g. 3.6.7). Not used if Type is BlobContainer. + */ + constructor() { + } + + /** + * Defines the metadata of MongoDbClusterInfo + * + * @returns {object} metadata of MongoDbClusterInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'MongoDbClusterInfo', + type: { + name: 'Composite', + className: 'MongoDbClusterInfo', + modelProperties: { + databases: { + required: true, + serializedName: 'databases', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'MongoDbDatabaseInfoElementType', + type: { + name: 'Composite', + className: 'MongoDbDatabaseInfo' + } + } + } + }, + supportsSharding: { + required: true, + serializedName: 'supportsSharding', + type: { + name: 'Boolean' + } + }, + type: { + required: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + version: { + required: true, + serializedName: 'version', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MongoDbClusterInfo; diff --git a/lib/services/datamigrationManagement/lib/models/mongoDbCollectionInfo.js b/lib/services/datamigrationManagement/lib/models/mongoDbCollectionInfo.js new file mode 100644 index 0000000000..cc741871e4 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/mongoDbCollectionInfo.js @@ -0,0 +1,150 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a supported collection within a MongoDB database + * + * @extends models['MongoDbObjectInfo'] + */ +class MongoDbCollectionInfo extends models['MongoDbObjectInfo'] { + /** + * Create a MongoDbCollectionInfo. + * @member {string} databaseName The name of the database containing the + * collection + * @member {boolean} isCapped Whether the collection is a capped collection + * (i.e. whether it has a fixed size and acts like a circular buffer) + * @member {boolean} isSystemCollection Whether the collection is system + * collection + * @member {boolean} isView Whether the collection is a view of another + * collection + * @member {object} [shardKey] The shard key on the collection, or null if + * the collection is not sharded + * @member {array} [shardKey.fields] The fields within the shard key + * @member {boolean} [shardKey.isUnique] Whether the shard key is unique + * @member {boolean} supportsSharding Whether the database has sharding + * enabled. Note that the migration task will enable sharding on the target + * if necessary. + * @member {string} [viewOf] The name of the collection that this is a view + * of, if IsView is true + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MongoDbCollectionInfo + * + * @returns {object} metadata of MongoDbCollectionInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'MongoDbCollectionInfo', + type: { + name: 'Composite', + className: 'MongoDbCollectionInfo', + modelProperties: { + averageDocumentSize: { + required: true, + serializedName: 'averageDocumentSize', + type: { + name: 'Number' + } + }, + dataSize: { + required: true, + serializedName: 'dataSize', + type: { + name: 'Number' + } + }, + documentCount: { + required: true, + serializedName: 'documentCount', + type: { + name: 'Number' + } + }, + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + qualifiedName: { + required: true, + serializedName: 'qualifiedName', + type: { + name: 'String' + } + }, + databaseName: { + required: true, + serializedName: 'databaseName', + type: { + name: 'String' + } + }, + isCapped: { + required: true, + serializedName: 'isCapped', + type: { + name: 'Boolean' + } + }, + isSystemCollection: { + required: true, + serializedName: 'isSystemCollection', + type: { + name: 'Boolean' + } + }, + isView: { + required: true, + serializedName: 'isView', + type: { + name: 'Boolean' + } + }, + shardKey: { + required: false, + serializedName: 'shardKey', + type: { + name: 'Composite', + className: 'MongoDbShardKeyInfo' + } + }, + supportsSharding: { + required: true, + serializedName: 'supportsSharding', + type: { + name: 'Boolean' + } + }, + viewOf: { + required: false, + serializedName: 'viewOf', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MongoDbCollectionInfo; diff --git a/lib/services/datamigrationManagement/lib/models/mongoDbCollectionProgress.js b/lib/services/datamigrationManagement/lib/models/mongoDbCollectionProgress.js new file mode 100644 index 0000000000..e4c6e32eb8 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/mongoDbCollectionProgress.js @@ -0,0 +1,154 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes the progress of a collection + * + * @extends models['MongoDbProgress'] + */ +class MongoDbCollectionProgress extends models['MongoDbProgress'] { + /** + * Create a MongoDbCollectionProgress. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MongoDbCollectionProgress + * + * @returns {object} metadata of MongoDbCollectionProgress + * + */ + mapper() { + return { + required: false, + serializedName: 'Collection', + type: { + name: 'Composite', + className: 'MongoDbCollectionProgress', + modelProperties: { + bytesCopied: { + required: true, + serializedName: 'bytesCopied', + type: { + name: 'Number' + } + }, + documentsCopied: { + required: true, + serializedName: 'documentsCopied', + type: { + name: 'Number' + } + }, + elapsedTime: { + required: true, + serializedName: 'elapsedTime', + type: { + name: 'String' + } + }, + errors: { + required: true, + serializedName: 'errors', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'MongoDbErrorElementType', + type: { + name: 'Composite', + className: 'MongoDbError' + } + } + } + }, + eventsPending: { + required: true, + serializedName: 'eventsPending', + type: { + name: 'Number' + } + }, + eventsReplayed: { + required: true, + serializedName: 'eventsReplayed', + type: { + name: 'Number' + } + }, + lastEventTime: { + required: false, + serializedName: 'lastEventTime', + type: { + name: 'DateTime' + } + }, + lastReplayTime: { + required: false, + serializedName: 'lastReplayTime', + type: { + name: 'DateTime' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + qualifiedName: { + required: false, + serializedName: 'qualifiedName', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + type: { + name: 'String' + } + }, + state: { + required: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + totalBytes: { + required: true, + serializedName: 'totalBytes', + type: { + name: 'Number' + } + }, + totalDocuments: { + required: true, + serializedName: 'totalDocuments', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = MongoDbCollectionProgress; diff --git a/lib/services/datamigrationManagement/lib/models/mongoDbCollectionSettings.js b/lib/services/datamigrationManagement/lib/models/mongoDbCollectionSettings.js new file mode 100644 index 0000000000..6f808d4f68 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/mongoDbCollectionSettings.js @@ -0,0 +1,75 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Describes how an individual MongoDB collection should be migrated + * + */ +class MongoDbCollectionSettings { + /** + * Create a MongoDbCollectionSettings. + * @member {boolean} [canDelete] Whether the migrator is allowed to drop the + * target collection in the course of performing a migration. The default is + * true. + * @member {object} [shardKey] + * @member {array} [shardKey.fields] The fields within the shard key + * @member {boolean} [shardKey.isUnique] Whether the shard key is unique + * @member {number} [targetRUs] The RUs that should be configured on a + * CosmosDB target, or null to use the default. This has no effect on + * non-CosmosDB targets. + */ + constructor() { + } + + /** + * Defines the metadata of MongoDbCollectionSettings + * + * @returns {object} metadata of MongoDbCollectionSettings + * + */ + mapper() { + return { + required: false, + serializedName: 'MongoDbCollectionSettings', + type: { + name: 'Composite', + className: 'MongoDbCollectionSettings', + modelProperties: { + canDelete: { + required: false, + serializedName: 'canDelete', + type: { + name: 'Boolean' + } + }, + shardKey: { + required: false, + serializedName: 'shardKey', + type: { + name: 'Composite', + className: 'MongoDbShardKeySetting' + } + }, + targetRUs: { + required: false, + serializedName: 'targetRUs', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = MongoDbCollectionSettings; diff --git a/lib/services/datamigrationManagement/lib/models/mongoDbCommandInput.js b/lib/services/datamigrationManagement/lib/models/mongoDbCommandInput.js new file mode 100644 index 0000000000..cf672f0987 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/mongoDbCommandInput.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Describes the input to the 'cancel' and 'restart' MongoDB migration commands + * + */ +class MongoDbCommandInput { + /** + * Create a MongoDbCommandInput. + * @member {string} [objectName] The qualified name of a database or + * collection to act upon, or null to act upon the entire migration + */ + constructor() { + } + + /** + * Defines the metadata of MongoDbCommandInput + * + * @returns {object} metadata of MongoDbCommandInput + * + */ + mapper() { + return { + required: false, + serializedName: 'MongoDbCommandInput', + type: { + name: 'Composite', + className: 'MongoDbCommandInput', + modelProperties: { + objectName: { + required: false, + serializedName: 'objectName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MongoDbCommandInput; diff --git a/lib/services/datamigrationManagement/lib/models/mongoDbConnectionInfo.js b/lib/services/datamigrationManagement/lib/models/mongoDbConnectionInfo.js new file mode 100644 index 0000000000..5e9d14501d --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/mongoDbConnectionInfo.js @@ -0,0 +1,85 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a connection to a MongoDB data source + * + * @extends models['ConnectionInfo'] + */ +class MongoDbConnectionInfo extends models['ConnectionInfo'] { + /** + * Create a MongoDbConnectionInfo. + * @member {string} connectionString A MongoDB connection string or blob + * container URL. The user name and password can be specified here or in the + * userName and password properties + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MongoDbConnectionInfo + * + * @returns {object} metadata of MongoDbConnectionInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'MongoDbConnectionInfo', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'ConnectionInfo', + className: 'MongoDbConnectionInfo', + modelProperties: { + userName: { + required: false, + serializedName: 'userName', + type: { + name: 'String' + } + }, + password: { + required: false, + serializedName: 'password', + type: { + name: 'String' + } + }, + type: { + required: true, + serializedName: 'type', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + connectionString: { + required: true, + serializedName: 'connectionString', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MongoDbConnectionInfo; diff --git a/lib/services/datamigrationManagement/lib/models/mongoDbDatabaseInfo.js b/lib/services/datamigrationManagement/lib/models/mongoDbDatabaseInfo.js new file mode 100644 index 0000000000..3cb811ecc8 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/mongoDbDatabaseInfo.js @@ -0,0 +1,110 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes a database within a MongoDB data source + * + * @extends models['MongoDbObjectInfo'] + */ +class MongoDbDatabaseInfo extends models['MongoDbObjectInfo'] { + /** + * Create a MongoDbDatabaseInfo. + * @member {array} collections A list of supported collections in a MongoDB + * database + * @member {boolean} supportsSharding Whether the database has sharding + * enabled. Note that the migration task will enable sharding on the target + * if necessary. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MongoDbDatabaseInfo + * + * @returns {object} metadata of MongoDbDatabaseInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'MongoDbDatabaseInfo', + type: { + name: 'Composite', + className: 'MongoDbDatabaseInfo', + modelProperties: { + averageDocumentSize: { + required: true, + serializedName: 'averageDocumentSize', + type: { + name: 'Number' + } + }, + dataSize: { + required: true, + serializedName: 'dataSize', + type: { + name: 'Number' + } + }, + documentCount: { + required: true, + serializedName: 'documentCount', + type: { + name: 'Number' + } + }, + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + qualifiedName: { + required: true, + serializedName: 'qualifiedName', + type: { + name: 'String' + } + }, + collections: { + required: true, + serializedName: 'collections', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'MongoDbCollectionInfoElementType', + type: { + name: 'Composite', + className: 'MongoDbCollectionInfo' + } + } + } + }, + supportsSharding: { + required: true, + serializedName: 'supportsSharding', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = MongoDbDatabaseInfo; diff --git a/lib/services/datamigrationManagement/lib/models/mongoDbDatabaseProgress.js b/lib/services/datamigrationManagement/lib/models/mongoDbDatabaseProgress.js new file mode 100644 index 0000000000..c1ac5a99e8 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/mongoDbDatabaseProgress.js @@ -0,0 +1,171 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes the progress of a database + * + * @extends models['MongoDbProgress'] + */ +class MongoDbDatabaseProgress extends models['MongoDbProgress'] { + /** + * Create a MongoDbDatabaseProgress. + * @member {object} [collections] The progress of the collections in the + * database. The keys are the unqualified names of the collections + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MongoDbDatabaseProgress + * + * @returns {object} metadata of MongoDbDatabaseProgress + * + */ + mapper() { + return { + required: false, + serializedName: 'Database', + type: { + name: 'Composite', + className: 'MongoDbDatabaseProgress', + modelProperties: { + bytesCopied: { + required: true, + serializedName: 'bytesCopied', + type: { + name: 'Number' + } + }, + documentsCopied: { + required: true, + serializedName: 'documentsCopied', + type: { + name: 'Number' + } + }, + elapsedTime: { + required: true, + serializedName: 'elapsedTime', + type: { + name: 'String' + } + }, + errors: { + required: true, + serializedName: 'errors', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'MongoDbErrorElementType', + type: { + name: 'Composite', + className: 'MongoDbError' + } + } + } + }, + eventsPending: { + required: true, + serializedName: 'eventsPending', + type: { + name: 'Number' + } + }, + eventsReplayed: { + required: true, + serializedName: 'eventsReplayed', + type: { + name: 'Number' + } + }, + lastEventTime: { + required: false, + serializedName: 'lastEventTime', + type: { + name: 'DateTime' + } + }, + lastReplayTime: { + required: false, + serializedName: 'lastReplayTime', + type: { + name: 'DateTime' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + qualifiedName: { + required: false, + serializedName: 'qualifiedName', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + type: { + name: 'String' + } + }, + state: { + required: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + totalBytes: { + required: true, + serializedName: 'totalBytes', + type: { + name: 'Number' + } + }, + totalDocuments: { + required: true, + serializedName: 'totalDocuments', + type: { + name: 'Number' + } + }, + collections: { + required: false, + serializedName: 'collections', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'MongoDbCollectionProgressElementType', + type: { + name: 'Composite', + className: 'MongoDbCollectionProgress' + } + } + } + } + } + } + }; + } +} + +module.exports = MongoDbDatabaseProgress; diff --git a/lib/services/datamigrationManagement/lib/models/mongoDbDatabaseSettings.js b/lib/services/datamigrationManagement/lib/models/mongoDbDatabaseSettings.js new file mode 100644 index 0000000000..a59754d71c --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/mongoDbDatabaseSettings.js @@ -0,0 +1,73 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Describes how an individual MongoDB database should be migrated + * + */ +class MongoDbDatabaseSettings { + /** + * Create a MongoDbDatabaseSettings. + * @member {object} collections The collections on the source database to + * migrate to the target. The keys are the unqualified names of the + * collections. + * @member {number} [targetRUs] The RUs that should be configured on a + * CosmosDB target, or null to use the default, or 0 if throughput should not + * be provisioned for the database. This has no effect on non-CosmosDB + * targets. + */ + constructor() { + } + + /** + * Defines the metadata of MongoDbDatabaseSettings + * + * @returns {object} metadata of MongoDbDatabaseSettings + * + */ + mapper() { + return { + required: false, + serializedName: 'MongoDbDatabaseSettings', + type: { + name: 'Composite', + className: 'MongoDbDatabaseSettings', + modelProperties: { + collections: { + required: true, + serializedName: 'collections', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'MongoDbCollectionSettingsElementType', + type: { + name: 'Composite', + className: 'MongoDbCollectionSettings' + } + } + } + }, + targetRUs: { + required: false, + serializedName: 'targetRUs', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = MongoDbDatabaseSettings; diff --git a/lib/services/datamigrationManagement/lib/models/mongoDbError.js b/lib/services/datamigrationManagement/lib/models/mongoDbError.js new file mode 100644 index 0000000000..3c2adbdbba --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/mongoDbError.js @@ -0,0 +1,80 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Describes an error or warning that occurred during a MongoDB migration + * + */ +class MongoDbError { + /** + * Create a MongoDbError. + * @member {string} [code] The non-localized, machine-readable code that + * describes the error or warning + * @member {number} [count] The number of times the error or warning has + * occurred + * @member {string} [message] The localized, human-readable message that + * describes the error or warning + * @member {string} [type] The type of error or warning. Possible values + * include: 'Error', 'ValidationError', 'Warning' + */ + constructor() { + } + + /** + * Defines the metadata of MongoDbError + * + * @returns {object} metadata of MongoDbError + * + */ + mapper() { + return { + required: false, + serializedName: 'MongoDbError', + type: { + name: 'Composite', + className: 'MongoDbError', + modelProperties: { + code: { + required: false, + serializedName: 'code', + type: { + name: 'String' + } + }, + count: { + required: false, + serializedName: 'count', + type: { + name: 'Number' + } + }, + message: { + required: false, + serializedName: 'message', + type: { + name: 'String' + } + }, + type: { + required: false, + serializedName: 'type', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MongoDbError; diff --git a/lib/services/datamigrationManagement/lib/models/mongoDbFinishCommand.js b/lib/services/datamigrationManagement/lib/models/mongoDbFinishCommand.js new file mode 100644 index 0000000000..37c6102dfc --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/mongoDbFinishCommand.js @@ -0,0 +1,97 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Properties for the command that finishes a migration in whole or in part + * + * @extends models['CommandProperties'] + */ +class MongoDbFinishCommand extends models['CommandProperties'] { + /** + * Create a MongoDbFinishCommand. + * @member {object} [input] Command input + * @member {boolean} [input.immediate] If true, replication for the affected + * objects will be stopped immediately. If false, the migrator will finish + * replaying queued events before finishing the replication. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MongoDbFinishCommand + * + * @returns {object} metadata of MongoDbFinishCommand + * + */ + mapper() { + return { + required: false, + serializedName: 'finish', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'commandType', + clientName: 'commandType' + }, + uberParent: 'CommandProperties', + className: 'MongoDbFinishCommand', + modelProperties: { + errors: { + required: false, + readOnly: true, + serializedName: 'errors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ODataErrorElementType', + type: { + name: 'Composite', + className: 'ODataError' + } + } + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + commandType: { + required: true, + serializedName: 'commandType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + input: { + required: false, + serializedName: 'input', + type: { + name: 'Composite', + className: 'MongoDbFinishCommandInput' + } + } + } + } + }; + } +} + +module.exports = MongoDbFinishCommand; diff --git a/lib/services/datamigrationManagement/lib/models/mongoDbFinishCommandInput.js b/lib/services/datamigrationManagement/lib/models/mongoDbFinishCommandInput.js new file mode 100644 index 0000000000..0fd8b792c8 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/mongoDbFinishCommandInput.js @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes the input to the 'finish' MongoDB migration command + * + * @extends models['MongoDbCommandInput'] + */ +class MongoDbFinishCommandInput extends models['MongoDbCommandInput'] { + /** + * Create a MongoDbFinishCommandInput. + * @member {boolean} immediate If true, replication for the affected objects + * will be stopped immediately. If false, the migrator will finish replaying + * queued events before finishing the replication. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MongoDbFinishCommandInput + * + * @returns {object} metadata of MongoDbFinishCommandInput + * + */ + mapper() { + return { + required: false, + serializedName: 'MongoDbFinishCommandInput', + type: { + name: 'Composite', + className: 'MongoDbFinishCommandInput', + modelProperties: { + objectName: { + required: false, + serializedName: 'objectName', + type: { + name: 'String' + } + }, + immediate: { + required: true, + serializedName: 'immediate', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = MongoDbFinishCommandInput; diff --git a/lib/services/datamigrationManagement/lib/models/mongoDbMigrationProgress.js b/lib/services/datamigrationManagement/lib/models/mongoDbMigrationProgress.js new file mode 100644 index 0000000000..a353c54dc9 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/mongoDbMigrationProgress.js @@ -0,0 +1,171 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Describes the progress of the overall migration + * + * @extends models['MongoDbProgress'] + */ +class MongoDbMigrationProgress extends models['MongoDbProgress'] { + /** + * Create a MongoDbMigrationProgress. + * @member {object} [databases] The progress of the databases in the + * migration. The keys are the names of the databases + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MongoDbMigrationProgress + * + * @returns {object} metadata of MongoDbMigrationProgress + * + */ + mapper() { + return { + required: false, + serializedName: 'Migration', + type: { + name: 'Composite', + className: 'MongoDbMigrationProgress', + modelProperties: { + bytesCopied: { + required: true, + serializedName: 'bytesCopied', + type: { + name: 'Number' + } + }, + documentsCopied: { + required: true, + serializedName: 'documentsCopied', + type: { + name: 'Number' + } + }, + elapsedTime: { + required: true, + serializedName: 'elapsedTime', + type: { + name: 'String' + } + }, + errors: { + required: true, + serializedName: 'errors', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'MongoDbErrorElementType', + type: { + name: 'Composite', + className: 'MongoDbError' + } + } + } + }, + eventsPending: { + required: true, + serializedName: 'eventsPending', + type: { + name: 'Number' + } + }, + eventsReplayed: { + required: true, + serializedName: 'eventsReplayed', + type: { + name: 'Number' + } + }, + lastEventTime: { + required: false, + serializedName: 'lastEventTime', + type: { + name: 'DateTime' + } + }, + lastReplayTime: { + required: false, + serializedName: 'lastReplayTime', + type: { + name: 'DateTime' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + qualifiedName: { + required: false, + serializedName: 'qualifiedName', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + type: { + name: 'String' + } + }, + state: { + required: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + totalBytes: { + required: true, + serializedName: 'totalBytes', + type: { + name: 'Number' + } + }, + totalDocuments: { + required: true, + serializedName: 'totalDocuments', + type: { + name: 'Number' + } + }, + databases: { + required: false, + serializedName: 'databases', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'MongoDbDatabaseProgressElementType', + type: { + name: 'Composite', + className: 'MongoDbDatabaseProgress' + } + } + } + } + } + } + }; + } +} + +module.exports = MongoDbMigrationProgress; diff --git a/lib/services/datamigrationManagement/lib/models/mongoDbMigrationSettings.js b/lib/services/datamigrationManagement/lib/models/mongoDbMigrationSettings.js new file mode 100644 index 0000000000..80eb2cb57d --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/mongoDbMigrationSettings.js @@ -0,0 +1,133 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Describes how a MongoDB data migration should be performed + * + */ +class MongoDbMigrationSettings { + /** + * Create a MongoDbMigrationSettings. + * @member {number} [boostRUs] The RU limit on a CosmosDB target that + * collections will be temporarily increased to (if lower) during the initial + * copy of a migration, from 10,000 to 1,000,000, or 0 to use the default + * boost (which is generally the maximum), or null to not boost the RUs. This + * setting has no effect on non-CosmosDB targets. + * @member {object} databases The databases on the source cluster to migrate + * to the target. The keys are the names of the databases. + * @member {string} [replication] Describes how changes will be replicated + * from the source to the target. The default is OneTime. Possible values + * include: 'Disabled', 'OneTime', 'Continuous' + * @member {object} source Settings used to connect to the source cluster + * @member {string} [source.connectionString] A MongoDB connection string or + * blob container URL. The user name and password can be specified here or in + * the userName and password properties + * @member {object} target Settings used to connect to the target cluster + * @member {string} [target.connectionString] A MongoDB connection string or + * blob container URL. The user name and password can be specified here or in + * the userName and password properties + * @member {object} [throttling] Settings used to limit the resource usage of + * the migration + * @member {number} [throttling.minFreeCpu] The percentage of CPU time that + * the migrator will try to avoid using, from 0 to 100 + * @member {number} [throttling.minFreeMemoryMb] The number of megabytes of + * RAM that the migrator will try to avoid using + * @member {number} [throttling.maxParallelism] The maximum number of work + * items (e.g. collection copies) that will be processed in parallel + */ + constructor() { + } + + /** + * Defines the metadata of MongoDbMigrationSettings + * + * @returns {object} metadata of MongoDbMigrationSettings + * + */ + mapper() { + return { + required: false, + serializedName: 'MongoDbMigrationSettings', + type: { + name: 'Composite', + className: 'MongoDbMigrationSettings', + modelProperties: { + boostRUs: { + required: false, + serializedName: 'boostRUs', + type: { + name: 'Number' + } + }, + databases: { + required: true, + serializedName: 'databases', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'MongoDbDatabaseSettingsElementType', + type: { + name: 'Composite', + className: 'MongoDbDatabaseSettings' + } + } + } + }, + replication: { + required: false, + serializedName: 'replication', + type: { + name: 'String' + } + }, + source: { + required: true, + serializedName: 'source', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'ConnectionInfo', + className: 'MongoDbConnectionInfo' + } + }, + target: { + required: true, + serializedName: 'target', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'ConnectionInfo', + className: 'MongoDbConnectionInfo' + } + }, + throttling: { + required: false, + serializedName: 'throttling', + type: { + name: 'Composite', + className: 'MongoDbThrottlingSettings' + } + } + } + } + }; + } +} + +module.exports = MongoDbMigrationSettings; diff --git a/lib/services/datamigrationManagement/lib/models/mongoDbObjectInfo.js b/lib/services/datamigrationManagement/lib/models/mongoDbObjectInfo.js new file mode 100644 index 0000000000..79c29357b8 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/mongoDbObjectInfo.js @@ -0,0 +1,88 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Describes a database or collection within a MongoDB data source + * + */ +class MongoDbObjectInfo { + /** + * Create a MongoDbObjectInfo. + * @member {number} averageDocumentSize The average document size, or -1 if + * the average size is unknown + * @member {number} dataSize The estimated total data size, in bytes, or -1 + * if the size is unknown. + * @member {number} documentCount The estimated total number of documents, or + * -1 if the document count is unknown + * @member {string} name The unqualified name of the database or collection + * @member {string} qualifiedName The qualified name of the database or + * collection. For a collection, this is the database-qualified name. + */ + constructor() { + } + + /** + * Defines the metadata of MongoDbObjectInfo + * + * @returns {object} metadata of MongoDbObjectInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'MongoDbObjectInfo', + type: { + name: 'Composite', + className: 'MongoDbObjectInfo', + modelProperties: { + averageDocumentSize: { + required: true, + serializedName: 'averageDocumentSize', + type: { + name: 'Number' + } + }, + dataSize: { + required: true, + serializedName: 'dataSize', + type: { + name: 'Number' + } + }, + documentCount: { + required: true, + serializedName: 'documentCount', + type: { + name: 'Number' + } + }, + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + qualifiedName: { + required: true, + serializedName: 'qualifiedName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MongoDbObjectInfo; diff --git a/lib/services/datamigrationManagement/lib/models/mongoDbProgress.js b/lib/services/datamigrationManagement/lib/models/mongoDbProgress.js new file mode 100644 index 0000000000..3d690adaee --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/mongoDbProgress.js @@ -0,0 +1,183 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Base class for MongoDB migration outputs + * + */ +class MongoDbProgress { + /** + * Create a MongoDbProgress. + * @member {number} bytesCopied The number of document bytes copied during + * the Copying stage + * @member {number} documentsCopied The number of documents copied during the + * Copying stage + * @member {string} elapsedTime The elapsed time in the format + * [ddd.]hh:mm:ss[.fffffff] (i.e. TimeSpan format) + * @member {object} errors The errors and warnings that have occurred for the + * current object. The keys are the error codes. + * @member {number} eventsPending The number of oplog events awaiting replay + * @member {number} eventsReplayed The number of oplog events replayed so far + * @member {date} [lastEventTime] The timestamp of the last oplog event + * received, or null if no oplog event has been received yet + * @member {date} [lastReplayTime] The timestamp of the last oplog event + * replayed, or null if no oplog event has been replayed yet + * @member {string} [name] The name of the progress object. For a collection, + * this is the unqualified collection name. For a database, this is the + * database name. For the overall migration, this is null. + * @member {string} [qualifiedName] The qualified name of the progress + * object. For a collection, this is the database-qualified name. For a + * database, this is the database name. For the overall migration, this is + * null. + * @member {string} resultType The type of progress object. Possible values + * include: 'Migration', 'Database', 'Collection' + * @member {string} state Possible values include: 'NotStarted', + * 'ValidatingInput', 'Initializing', 'Restarting', 'Copying', + * 'InitialReplay', 'Replaying', 'Finalizing', 'Complete', 'Canceled', + * 'Failed' + * @member {number} totalBytes The total number of document bytes on the + * source at the beginning of the Copying stage, or -1 if the total size was + * unknown + * @member {number} totalDocuments The total number of documents on the + * source at the beginning of the Copying stage, or -1 if the total count was + * unknown + */ + constructor() { + } + + /** + * Defines the metadata of MongoDbProgress + * + * @returns {object} metadata of MongoDbProgress + * + */ + mapper() { + return { + required: false, + serializedName: 'MongoDbProgress', + type: { + name: 'Composite', + className: 'MongoDbProgress', + modelProperties: { + bytesCopied: { + required: true, + serializedName: 'bytesCopied', + type: { + name: 'Number' + } + }, + documentsCopied: { + required: true, + serializedName: 'documentsCopied', + type: { + name: 'Number' + } + }, + elapsedTime: { + required: true, + serializedName: 'elapsedTime', + type: { + name: 'String' + } + }, + errors: { + required: true, + serializedName: 'errors', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'MongoDbErrorElementType', + type: { + name: 'Composite', + className: 'MongoDbError' + } + } + } + }, + eventsPending: { + required: true, + serializedName: 'eventsPending', + type: { + name: 'Number' + } + }, + eventsReplayed: { + required: true, + serializedName: 'eventsReplayed', + type: { + name: 'Number' + } + }, + lastEventTime: { + required: false, + serializedName: 'lastEventTime', + type: { + name: 'DateTime' + } + }, + lastReplayTime: { + required: false, + serializedName: 'lastReplayTime', + type: { + name: 'DateTime' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + qualifiedName: { + required: false, + serializedName: 'qualifiedName', + type: { + name: 'String' + } + }, + resultType: { + required: true, + serializedName: 'resultType', + type: { + name: 'String' + } + }, + state: { + required: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + totalBytes: { + required: true, + serializedName: 'totalBytes', + type: { + name: 'Number' + } + }, + totalDocuments: { + required: true, + serializedName: 'totalDocuments', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = MongoDbProgress; diff --git a/lib/services/datamigrationManagement/lib/models/mongoDbRestartCommand.js b/lib/services/datamigrationManagement/lib/models/mongoDbRestartCommand.js new file mode 100644 index 0000000000..5f00a4030e --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/mongoDbRestartCommand.js @@ -0,0 +1,96 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Properties for the command that restarts a migration in whole or in part + * + * @extends models['CommandProperties'] + */ +class MongoDbRestartCommand extends models['CommandProperties'] { + /** + * Create a MongoDbRestartCommand. + * @member {object} [input] Command input + * @member {string} [input.objectName] The qualified name of a database or + * collection to act upon, or null to act upon the entire migration + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MongoDbRestartCommand + * + * @returns {object} metadata of MongoDbRestartCommand + * + */ + mapper() { + return { + required: false, + serializedName: 'restart', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'commandType', + clientName: 'commandType' + }, + uberParent: 'CommandProperties', + className: 'MongoDbRestartCommand', + modelProperties: { + errors: { + required: false, + readOnly: true, + serializedName: 'errors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ODataErrorElementType', + type: { + name: 'Composite', + className: 'ODataError' + } + } + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + commandType: { + required: true, + serializedName: 'commandType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + input: { + required: false, + serializedName: 'input', + type: { + name: 'Composite', + className: 'MongoDbCommandInput' + } + } + } + } + }; + } +} + +module.exports = MongoDbRestartCommand; diff --git a/lib/services/datamigrationManagement/lib/models/mongoDbShardKeyField.js b/lib/services/datamigrationManagement/lib/models/mongoDbShardKeyField.js new file mode 100644 index 0000000000..d14a8d4015 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/mongoDbShardKeyField.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Describes a field reference within a MongoDB shard key + * + */ +class MongoDbShardKeyField { + /** + * Create a MongoDbShardKeyField. + * @member {string} name The name of the field + * @member {string} order The field ordering. Possible values include: + * 'Forward', 'Reverse', 'Hashed' + */ + constructor() { + } + + /** + * Defines the metadata of MongoDbShardKeyField + * + * @returns {object} metadata of MongoDbShardKeyField + * + */ + mapper() { + return { + required: false, + serializedName: 'MongoDbShardKeyField', + type: { + name: 'Composite', + className: 'MongoDbShardKeyField', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + order: { + required: true, + serializedName: 'order', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MongoDbShardKeyField; diff --git a/lib/services/datamigrationManagement/lib/models/mongoDbShardKeyInfo.js b/lib/services/datamigrationManagement/lib/models/mongoDbShardKeyInfo.js new file mode 100644 index 0000000000..a88415cc1b --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/mongoDbShardKeyInfo.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Describes a MongoDB shard key + * + */ +class MongoDbShardKeyInfo { + /** + * Create a MongoDbShardKeyInfo. + * @member {array} fields The fields within the shard key + * @member {boolean} isUnique Whether the shard key is unique + */ + constructor() { + } + + /** + * Defines the metadata of MongoDbShardKeyInfo + * + * @returns {object} metadata of MongoDbShardKeyInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'MongoDbShardKeyInfo', + type: { + name: 'Composite', + className: 'MongoDbShardKeyInfo', + modelProperties: { + fields: { + required: true, + serializedName: 'fields', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'MongoDbShardKeyFieldElementType', + type: { + name: 'Composite', + className: 'MongoDbShardKeyField' + } + } + } + }, + isUnique: { + required: true, + serializedName: 'isUnique', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = MongoDbShardKeyInfo; diff --git a/lib/services/datamigrationManagement/lib/models/mongoDbShardKeySetting.js b/lib/services/datamigrationManagement/lib/models/mongoDbShardKeySetting.js new file mode 100644 index 0000000000..5b1de7e5c3 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/mongoDbShardKeySetting.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Describes a MongoDB shard key + * + */ +class MongoDbShardKeySetting { + /** + * Create a MongoDbShardKeySetting. + * @member {array} fields The fields within the shard key + * @member {boolean} isUnique Whether the shard key is unique + */ + constructor() { + } + + /** + * Defines the metadata of MongoDbShardKeySetting + * + * @returns {object} metadata of MongoDbShardKeySetting + * + */ + mapper() { + return { + required: false, + serializedName: 'MongoDbShardKeySetting', + type: { + name: 'Composite', + className: 'MongoDbShardKeySetting', + modelProperties: { + fields: { + required: true, + serializedName: 'fields', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'MongoDbShardKeyFieldElementType', + type: { + name: 'Composite', + className: 'MongoDbShardKeyField' + } + } + } + }, + isUnique: { + required: true, + serializedName: 'isUnique', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = MongoDbShardKeySetting; diff --git a/lib/services/datamigrationManagement/lib/models/mongoDbThrottlingSettings.js b/lib/services/datamigrationManagement/lib/models/mongoDbThrottlingSettings.js new file mode 100644 index 0000000000..85eb809deb --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/mongoDbThrottlingSettings.js @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Specifies resource limits for the migration + * + */ +class MongoDbThrottlingSettings { + /** + * Create a MongoDbThrottlingSettings. + * @member {number} [minFreeCpu] The percentage of CPU time that the migrator + * will try to avoid using, from 0 to 100 + * @member {number} [minFreeMemoryMb] The number of megabytes of RAM that the + * migrator will try to avoid using + * @member {number} [maxParallelism] The maximum number of work items (e.g. + * collection copies) that will be processed in parallel + */ + constructor() { + } + + /** + * Defines the metadata of MongoDbThrottlingSettings + * + * @returns {object} metadata of MongoDbThrottlingSettings + * + */ + mapper() { + return { + required: false, + serializedName: 'MongoDbThrottlingSettings', + type: { + name: 'Composite', + className: 'MongoDbThrottlingSettings', + modelProperties: { + minFreeCpu: { + required: false, + serializedName: 'minFreeCpu', + type: { + name: 'Number' + } + }, + minFreeMemoryMb: { + required: false, + serializedName: 'minFreeMemoryMb', + type: { + name: 'Number' + } + }, + maxParallelism: { + required: false, + serializedName: 'maxParallelism', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = MongoDbThrottlingSettings; diff --git a/lib/services/datamigrationManagement/lib/models/mySqlConnectionInfo.js b/lib/services/datamigrationManagement/lib/models/mySqlConnectionInfo.js new file mode 100644 index 0000000000..a9c4052e6c --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/mySqlConnectionInfo.js @@ -0,0 +1,91 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Information for connecting to MySQL server + * + * @extends models['ConnectionInfo'] + */ +class MySqlConnectionInfo extends models['ConnectionInfo'] { + /** + * Create a MySqlConnectionInfo. + * @member {string} serverName Name of the server + * @member {number} port Port for Server + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MySqlConnectionInfo + * + * @returns {object} metadata of MySqlConnectionInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'MySqlConnectionInfo', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'ConnectionInfo', + className: 'MySqlConnectionInfo', + modelProperties: { + userName: { + required: false, + serializedName: 'userName', + type: { + name: 'String' + } + }, + password: { + required: false, + serializedName: 'password', + type: { + name: 'String' + } + }, + type: { + required: true, + serializedName: 'type', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + serverName: { + required: true, + serializedName: 'serverName', + type: { + name: 'String' + } + }, + port: { + required: true, + serializedName: 'port', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = MySqlConnectionInfo; diff --git a/lib/services/datamigrationManagement/lib/models/nameAvailabilityRequest.js b/lib/services/datamigrationManagement/lib/models/nameAvailabilityRequest.js new file mode 100644 index 0000000000..26ac26b44b --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/nameAvailabilityRequest.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * A resource type and proposed name + * + */ +class NameAvailabilityRequest { + /** + * Create a NameAvailabilityRequest. + * @member {string} [name] The proposed resource name + * @member {string} [type] The resource type chain (e.g. + * virtualMachines/extensions) + */ + constructor() { + } + + /** + * Defines the metadata of NameAvailabilityRequest + * + * @returns {object} metadata of NameAvailabilityRequest + * + */ + mapper() { + return { + required: false, + serializedName: 'NameAvailabilityRequest', + type: { + name: 'Composite', + className: 'NameAvailabilityRequest', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + serializedName: 'type', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = NameAvailabilityRequest; diff --git a/lib/services/datamigrationManagement/lib/models/nameAvailabilityResponse.js b/lib/services/datamigrationManagement/lib/models/nameAvailabilityResponse.js new file mode 100644 index 0000000000..9f66e616ae --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/nameAvailabilityResponse.js @@ -0,0 +1,72 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Indicates whether a proposed resource name is available + * + */ +class NameAvailabilityResponse { + /** + * Create a NameAvailabilityResponse. + * @member {boolean} [nameAvailable] If true, the name is valid and + * available. If false, 'reason' describes why not. + * @member {string} [reason] The reason why the name is not available, if + * nameAvailable is false. Possible values include: 'AlreadyExists', + * 'Invalid' + * @member {string} [message] The localized reason why the name is not + * available, if nameAvailable is false + */ + constructor() { + } + + /** + * Defines the metadata of NameAvailabilityResponse + * + * @returns {object} metadata of NameAvailabilityResponse + * + */ + mapper() { + return { + required: false, + serializedName: 'NameAvailabilityResponse', + type: { + name: 'Composite', + className: 'NameAvailabilityResponse', + modelProperties: { + nameAvailable: { + required: false, + serializedName: 'nameAvailable', + type: { + name: 'Boolean' + } + }, + reason: { + required: false, + serializedName: 'reason', + type: { + name: 'String' + } + }, + message: { + required: false, + serializedName: 'message', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = NameAvailabilityResponse; diff --git a/lib/services/datamigrationManagement/lib/models/nonSqlDataMigrationTable.js b/lib/services/datamigrationManagement/lib/models/nonSqlDataMigrationTable.js new file mode 100644 index 0000000000..17635ca14a --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/nonSqlDataMigrationTable.js @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Defines metadata for table to be migrated + * + */ +class NonSqlDataMigrationTable { + /** + * Create a NonSqlDataMigrationTable. + * @member {string} [sourceName] Source table name + */ + constructor() { + } + + /** + * Defines the metadata of NonSqlDataMigrationTable + * + * @returns {object} metadata of NonSqlDataMigrationTable + * + */ + mapper() { + return { + required: false, + serializedName: 'NonSqlDataMigrationTable', + type: { + name: 'Composite', + className: 'NonSqlDataMigrationTable', + modelProperties: { + sourceName: { + required: false, + serializedName: 'sourceName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = NonSqlDataMigrationTable; diff --git a/lib/services/datamigrationManagement/lib/models/nonSqlDataMigrationTableResult.js b/lib/services/datamigrationManagement/lib/models/nonSqlDataMigrationTableResult.js new file mode 100644 index 0000000000..700f21e302 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/nonSqlDataMigrationTableResult.js @@ -0,0 +1,117 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Object used to report the data migration results of a table + * + */ +class NonSqlDataMigrationTableResult { + /** + * Create a NonSqlDataMigrationTableResult. + * @member {string} [resultCode] Result code of the data migration. Possible + * values include: 'Initial', 'Completed', 'ObjectNotExistsInSource', + * 'ObjectNotExistsInTarget', 'TargetObjectIsInaccessible', 'FatalError' + * @member {string} [sourceName] Name of the source table + * @member {string} [targetName] Name of the target table + * @member {number} [sourceRowCount] Number of rows in the source table + * @member {number} [targetRowCount] Number of rows in the target table + * @member {number} [elapsedTimeInMiliseconds] Time taken to migrate the data + * @member {array} [errors] List of errors, if any, during migration + */ + constructor() { + } + + /** + * Defines the metadata of NonSqlDataMigrationTableResult + * + * @returns {object} metadata of NonSqlDataMigrationTableResult + * + */ + mapper() { + return { + required: false, + serializedName: 'NonSqlDataMigrationTableResult', + type: { + name: 'Composite', + className: 'NonSqlDataMigrationTableResult', + modelProperties: { + resultCode: { + required: false, + readOnly: true, + serializedName: 'resultCode', + type: { + name: 'String' + } + }, + sourceName: { + required: false, + readOnly: true, + serializedName: 'sourceName', + type: { + name: 'String' + } + }, + targetName: { + required: false, + readOnly: true, + serializedName: 'targetName', + type: { + name: 'String' + } + }, + sourceRowCount: { + required: false, + readOnly: true, + serializedName: 'sourceRowCount', + type: { + name: 'Number' + } + }, + targetRowCount: { + required: false, + readOnly: true, + serializedName: 'targetRowCount', + type: { + name: 'Number' + } + }, + elapsedTimeInMiliseconds: { + required: false, + readOnly: true, + serializedName: 'elapsedTimeInMiliseconds', + type: { + name: 'Number' + } + }, + errors: { + required: false, + readOnly: true, + serializedName: 'errors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DataMigrationErrorElementType', + type: { + name: 'Composite', + className: 'DataMigrationError' + } + } + } + } + } + } + }; + } +} + +module.exports = NonSqlDataMigrationTableResult; diff --git a/lib/services/datamigrationManagement/lib/models/nonSqlMigrationTaskInput.js b/lib/services/datamigrationManagement/lib/models/nonSqlMigrationTaskInput.js new file mode 100644 index 0000000000..ed89be11ca --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/nonSqlMigrationTaskInput.js @@ -0,0 +1,114 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Base class for non sql migration task input + * + */ +class NonSqlMigrationTaskInput { + /** + * Create a NonSqlMigrationTaskInput. + * @member {object} targetConnectionInfo Information for connecting to target + * @member {string} [targetConnectionInfo.dataSource] Data source in the + * format Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [targetConnectionInfo.authentication] Authentication type + * to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [targetConnectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [targetConnectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [targetConnectionInfo.trustServerCertificate] Whether to + * trust the server certificate + * @member {string} [targetConnectionInfo.platform] Server platform type for + * connection. Possible values include: 'SqlOnPrem' + * @member {string} targetDatabaseName Target database name + * @member {string} projectName Name of the migration project + * @member {string} projectLocation A URL that points to the drop location to + * access project artifacts + * @member {array} selectedTables Metadata of the tables selected for + * migration + */ + constructor() { + } + + /** + * Defines the metadata of NonSqlMigrationTaskInput + * + * @returns {object} metadata of NonSqlMigrationTaskInput + * + */ + mapper() { + return { + required: false, + serializedName: 'NonSqlMigrationTaskInput', + type: { + name: 'Composite', + className: 'NonSqlMigrationTaskInput', + modelProperties: { + targetConnectionInfo: { + required: true, + serializedName: 'targetConnectionInfo', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'ConnectionInfo', + className: 'SqlConnectionInfo' + } + }, + targetDatabaseName: { + required: true, + serializedName: 'targetDatabaseName', + type: { + name: 'String' + } + }, + projectName: { + required: true, + serializedName: 'projectName', + type: { + name: 'String' + } + }, + projectLocation: { + required: true, + serializedName: 'projectLocation', + type: { + name: 'String' + } + }, + selectedTables: { + required: true, + serializedName: 'selectedTables', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NonSqlDataMigrationTableElementType', + type: { + name: 'Composite', + className: 'NonSqlDataMigrationTable' + } + } + } + } + } + } + }; + } +} + +module.exports = NonSqlMigrationTaskInput; diff --git a/lib/services/datamigrationManagement/lib/models/nonSqlMigrationTaskOutput.js b/lib/services/datamigrationManagement/lib/models/nonSqlMigrationTaskOutput.js new file mode 100644 index 0000000000..b229b8c90c --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/nonSqlMigrationTaskOutput.js @@ -0,0 +1,129 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Base class for non sql migration task output + * + */ +class NonSqlMigrationTaskOutput { + /** + * Create a NonSqlMigrationTaskOutput. + * @member {string} [id] Result identifier + * @member {date} [startedOn] Migration start time + * @member {date} [endedOn] Migration end time + * @member {string} [status] Current state of migration. Possible values + * include: 'Default', 'Connecting', 'SourceAndTargetSelected', + * 'SelectLogins', 'Configured', 'Running', 'Error', 'Stopped', 'Completed', + * 'CompletedWithWarnings' + * @member {object} [dataMigrationTableResults] Results of the migration. The + * key contains the table name and the value the table result object + * @member {string} [progressMessage] Message about the progress of the + * migration + * @member {string} [sourceServerName] Name of source server + * @member {string} [targetServerName] Name of target server + */ + constructor() { + } + + /** + * Defines the metadata of NonSqlMigrationTaskOutput + * + * @returns {object} metadata of NonSqlMigrationTaskOutput + * + */ + mapper() { + return { + required: false, + serializedName: 'NonSqlMigrationTaskOutput', + type: { + name: 'Composite', + className: 'NonSqlMigrationTaskOutput', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + startedOn: { + required: false, + readOnly: true, + serializedName: 'startedOn', + type: { + name: 'DateTime' + } + }, + endedOn: { + required: false, + readOnly: true, + serializedName: 'endedOn', + type: { + name: 'DateTime' + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'status', + type: { + name: 'String' + } + }, + dataMigrationTableResults: { + required: false, + readOnly: true, + serializedName: 'dataMigrationTableResults', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'NonSqlDataMigrationTableResultElementType', + type: { + name: 'Composite', + className: 'NonSqlDataMigrationTableResult' + } + } + } + }, + progressMessage: { + required: false, + readOnly: true, + serializedName: 'progressMessage', + type: { + name: 'String' + } + }, + sourceServerName: { + required: false, + readOnly: true, + serializedName: 'sourceServerName', + type: { + name: 'String' + } + }, + targetServerName: { + required: false, + readOnly: true, + serializedName: 'targetServerName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = NonSqlMigrationTaskOutput; diff --git a/lib/services/datamigrationManagement/lib/models/oDataError.js b/lib/services/datamigrationManagement/lib/models/oDataError.js new file mode 100644 index 0000000000..deadc9903f --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/oDataError.js @@ -0,0 +1,77 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Error information in OData format. + * + */ +class ODataError { + /** + * Create a ODataError. + * @member {string} [code] The machine-readable description of the error, + * such as 'InvalidRequest' or 'InternalServerError' + * @member {string} [message] The human-readable description of the error + * @member {array} [details] Inner errors that caused this error + */ + constructor() { + } + + /** + * Defines the metadata of ODataError + * + * @returns {object} metadata of ODataError + * + */ + mapper() { + return { + required: false, + serializedName: 'ODataError', + type: { + name: 'Composite', + className: 'ODataError', + modelProperties: { + code: { + required: false, + serializedName: 'code', + type: { + name: 'String' + } + }, + message: { + required: false, + serializedName: 'message', + type: { + name: 'String' + } + }, + details: { + required: false, + serializedName: 'details', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ODataErrorElementType', + type: { + name: 'Composite', + className: 'ODataError' + } + } + } + } + } + } + }; + } +} + +module.exports = ODataError; diff --git a/lib/services/datamigrationManagement/lib/models/postgreSqlConnectionInfo.js b/lib/services/datamigrationManagement/lib/models/postgreSqlConnectionInfo.js new file mode 100644 index 0000000000..5fa35d41e2 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/postgreSqlConnectionInfo.js @@ -0,0 +1,99 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Information for connecting to PostgreSQL server + * + * @extends models['ConnectionInfo'] + */ +class PostgreSqlConnectionInfo extends models['ConnectionInfo'] { + /** + * Create a PostgreSqlConnectionInfo. + * @member {string} serverName Name of the server + * @member {string} [databaseName] Name of the database + * @member {number} port Port for Server + */ + constructor() { + super(); + } + + /** + * Defines the metadata of PostgreSqlConnectionInfo + * + * @returns {object} metadata of PostgreSqlConnectionInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'PostgreSqlConnectionInfo', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'ConnectionInfo', + className: 'PostgreSqlConnectionInfo', + modelProperties: { + userName: { + required: false, + serializedName: 'userName', + type: { + name: 'String' + } + }, + password: { + required: false, + serializedName: 'password', + type: { + name: 'String' + } + }, + type: { + required: true, + serializedName: 'type', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + serverName: { + required: true, + serializedName: 'serverName', + type: { + name: 'String' + } + }, + databaseName: { + required: false, + serializedName: 'databaseName', + type: { + name: 'String' + } + }, + port: { + required: true, + serializedName: 'port', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = PostgreSqlConnectionInfo; diff --git a/lib/services/datamigrationManagement/lib/models/project.js b/lib/services/datamigrationManagement/lib/models/project.js new file mode 100644 index 0000000000..267eb35810 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/project.js @@ -0,0 +1,183 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * A project resource + * + * @extends models['TrackedResource'] + */ +class Project extends models['TrackedResource'] { + /** + * Create a Project. + * @member {string} sourcePlatform Source platform for the project. Possible + * values include: 'SQL', 'MySQL', 'PostgreSql', 'MongoDb', 'Unknown' + * @member {string} targetPlatform Target platform for the project. Possible + * values include: 'SQLDB', 'SQLMI', 'AzureDbForMySql', + * 'AzureDbForPostgreSql', 'MongoDb', 'Unknown' + * @member {date} [creationTime] UTC Date and time when project was created + * @member {object} [sourceConnectionInfo] Information for connecting to + * source + * @member {string} [sourceConnectionInfo.userName] User name + * @member {string} [sourceConnectionInfo.password] Password credential. + * @member {string} [sourceConnectionInfo.type] Polymorphic Discriminator + * @member {object} [targetConnectionInfo] Information for connecting to + * target + * @member {string} [targetConnectionInfo.userName] User name + * @member {string} [targetConnectionInfo.password] Password credential. + * @member {string} [targetConnectionInfo.type] Polymorphic Discriminator + * @member {array} [databasesInfo] List of DatabaseInfo + * @member {string} [provisioningState] The project's provisioning state. + * Possible values include: 'Deleting', 'Succeeded' + */ + constructor() { + super(); + } + + /** + * Defines the metadata of Project + * + * @returns {object} metadata of Project + * + */ + mapper() { + return { + required: false, + serializedName: 'Project', + type: { + name: 'Composite', + className: 'Project', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + sourcePlatform: { + required: true, + serializedName: 'properties.sourcePlatform', + type: { + name: 'String' + } + }, + targetPlatform: { + required: true, + serializedName: 'properties.targetPlatform', + type: { + name: 'String' + } + }, + creationTime: { + required: false, + readOnly: true, + serializedName: 'properties.creationTime', + type: { + name: 'DateTime' + } + }, + sourceConnectionInfo: { + required: false, + serializedName: 'properties.sourceConnectionInfo', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'ConnectionInfo', + className: 'ConnectionInfo' + } + }, + targetConnectionInfo: { + required: false, + serializedName: 'properties.targetConnectionInfo', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'ConnectionInfo', + className: 'ConnectionInfo' + } + }, + databasesInfo: { + required: false, + serializedName: 'properties.databasesInfo', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DatabaseInfoElementType', + type: { + name: 'Composite', + className: 'DatabaseInfo' + } + } + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Project; diff --git a/lib/services/datamigrationManagement/lib/models/projectFile.js b/lib/services/datamigrationManagement/lib/models/projectFile.js new file mode 100644 index 0000000000..ce492d4e0b --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/projectFile.js @@ -0,0 +1,100 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * A file resource + * + * @extends models['Resource'] + */ +class ProjectFile extends models['Resource'] { + /** + * Create a ProjectFile. + * @member {string} [etag] HTTP strong entity tag value. This is ignored if + * submitted. + * @member {object} [properties] Custom file properties + * @member {string} [properties.extension] Optional File extension. If + * submitted it should not have a leading period and must match the extension + * from filePath. + * @member {string} [properties.filePath] Relative path of this file + * resource. This property can be set when creating or updating the file + * resource. + * @member {date} [properties.lastModified] Modification DateTime. + * @member {string} [properties.mediaType] File content type. This propery + * can be modified to reflect the file content type. + * @member {number} [properties.size] File size. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ProjectFile + * + * @returns {object} metadata of ProjectFile + * + */ + mapper() { + return { + required: false, + serializedName: 'ProjectFile', + type: { + name: 'Composite', + className: 'ProjectFile', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + }, + properties: { + required: false, + serializedName: 'properties', + type: { + name: 'Composite', + className: 'ProjectFileProperties' + } + } + } + } + }; + } +} + +module.exports = ProjectFile; diff --git a/lib/services/datamigrationManagement/lib/models/projectFileProperties.js b/lib/services/datamigrationManagement/lib/models/projectFileProperties.js new file mode 100644 index 0000000000..2d846584a0 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/projectFileProperties.js @@ -0,0 +1,90 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Base class for file properties. + * + */ +class ProjectFileProperties { + /** + * Create a ProjectFileProperties. + * @member {string} [extension] Optional File extension. If submitted it + * should not have a leading period and must match the extension from + * filePath. + * @member {string} [filePath] Relative path of this file resource. This + * property can be set when creating or updating the file resource. + * @member {date} [lastModified] Modification DateTime. + * @member {string} [mediaType] File content type. This propery can be + * modified to reflect the file content type. + * @member {number} [size] File size. + */ + constructor() { + } + + /** + * Defines the metadata of ProjectFileProperties + * + * @returns {object} metadata of ProjectFileProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'ProjectFileProperties', + type: { + name: 'Composite', + className: 'ProjectFileProperties', + modelProperties: { + extension: { + required: false, + serializedName: 'extension', + type: { + name: 'String' + } + }, + filePath: { + required: false, + serializedName: 'filePath', + type: { + name: 'String' + } + }, + lastModified: { + required: false, + readOnly: true, + serializedName: 'lastModified', + type: { + name: 'DateTime' + } + }, + mediaType: { + required: false, + serializedName: 'mediaType', + type: { + name: 'String' + } + }, + size: { + required: false, + readOnly: true, + serializedName: 'size', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = ProjectFileProperties; diff --git a/lib/services/datamigrationManagement/lib/models/projectList.js b/lib/services/datamigrationManagement/lib/models/projectList.js new file mode 100644 index 0000000000..a372b6b4f3 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/projectList.js @@ -0,0 +1,67 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * OData page of project resources + */ +class ProjectList extends Array { + /** + * Create a ProjectList. + * @member {string} [nextLink] URL to load the next page of projects + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ProjectList + * + * @returns {object} metadata of ProjectList + * + */ + mapper() { + return { + required: false, + serializedName: 'ProjectList', + type: { + name: 'Composite', + className: 'ProjectList', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ProjectElementType', + type: { + name: 'Composite', + className: 'Project' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ProjectList; diff --git a/lib/services/datamigrationManagement/lib/models/projectTask.js b/lib/services/datamigrationManagement/lib/models/projectTask.js new file mode 100644 index 0000000000..9feffc680f --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/projectTask.js @@ -0,0 +1,102 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * A task resource + * + * @extends models['Resource'] + */ +class ProjectTask extends models['Resource'] { + /** + * Create a ProjectTask. + * @member {string} [etag] HTTP strong entity tag value. This is ignored if + * submitted. + * @member {object} [properties] Custom task properties + * @member {array} [properties.errors] Array of errors. This is ignored if + * submitted. + * @member {string} [properties.state] The state of the task. This is ignored + * if submitted. Possible values include: 'Unknown', 'Queued', 'Running', + * 'Canceled', 'Succeeded', 'Failed', 'FailedInputValidation', 'Faulted' + * @member {array} [properties.commands] Array of command properties. + * @member {string} [properties.taskType] Polymorphic Discriminator + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ProjectTask + * + * @returns {object} metadata of ProjectTask + * + */ + mapper() { + return { + required: false, + serializedName: 'ProjectTask', + type: { + name: 'Composite', + className: 'ProjectTask', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + }, + properties: { + required: false, + serializedName: 'properties', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'taskType', + clientName: 'taskType' + }, + uberParent: 'ProjectTaskProperties', + className: 'ProjectTaskProperties' + } + } + } + } + }; + } +} + +module.exports = ProjectTask; diff --git a/lib/services/datamigrationManagement/lib/models/projectTaskProperties.js b/lib/services/datamigrationManagement/lib/models/projectTaskProperties.js new file mode 100644 index 0000000000..49e72e917e --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/projectTaskProperties.js @@ -0,0 +1,109 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Base class for all types of DMS task properties. If task is not supported by + * current client, this object is returned. + * + */ +class ProjectTaskProperties { + /** + * Create a ProjectTaskProperties. + * @member {array} [errors] Array of errors. This is ignored if submitted. + * @member {string} [state] The state of the task. This is ignored if + * submitted. Possible values include: 'Unknown', 'Queued', 'Running', + * 'Canceled', 'Succeeded', 'Failed', 'FailedInputValidation', 'Faulted' + * @member {array} [commands] Array of command properties. + * @member {string} taskType Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of ProjectTaskProperties + * + * @returns {object} metadata of ProjectTaskProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'Unknown', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'taskType', + clientName: 'taskType' + }, + uberParent: 'ProjectTaskProperties', + className: 'ProjectTaskProperties', + modelProperties: { + errors: { + required: false, + readOnly: true, + serializedName: 'errors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ODataErrorElementType', + type: { + name: 'Composite', + className: 'ODataError' + } + } + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + commands: { + required: false, + readOnly: true, + serializedName: 'commands', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CommandPropertiesElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'commandType', + clientName: 'commandType' + }, + uberParent: 'CommandProperties', + className: 'CommandProperties' + } + } + } + }, + taskType: { + required: true, + serializedName: 'taskType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ProjectTaskProperties; diff --git a/lib/services/datamigrationManagement/lib/models/queryAnalysisValidationResult.js b/lib/services/datamigrationManagement/lib/models/queryAnalysisValidationResult.js new file mode 100644 index 0000000000..73fa654eb5 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/queryAnalysisValidationResult.js @@ -0,0 +1,96 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Results for query analysis comparison between the source and target + * + */ +class QueryAnalysisValidationResult { + /** + * Create a QueryAnalysisValidationResult. + * @member {object} [queryResults] List of queries executed and it's + * execution results in source and target + * @member {string} [queryResults.queryText] Query text retrieved from the + * source server + * @member {number} [queryResults.statementsInBatch] Total no. of statements + * in the batch + * @member {object} [queryResults.sourceResult] Query analysis result from + * the source + * @member {number} [queryResults.sourceResult.executionCount] No. of query + * executions + * @member {number} [queryResults.sourceResult.cpuTimeMs] CPU Time in + * millisecond(s) for the query execution + * @member {number} [queryResults.sourceResult.elapsedTimeMs] Time taken in + * millisecond(s) for executing the query + * @member {object} [queryResults.sourceResult.waitStats] Dictionary of sql + * query execution wait types and the respective statistics + * @member {boolean} [queryResults.sourceResult.hasErrors] Indicates whether + * the query resulted in an error + * @member {array} [queryResults.sourceResult.sqlErrors] List of sql Errors + * @member {object} [queryResults.targetResult] Query analysis result from + * the target + * @member {number} [queryResults.targetResult.executionCount] No. of query + * executions + * @member {number} [queryResults.targetResult.cpuTimeMs] CPU Time in + * millisecond(s) for the query execution + * @member {number} [queryResults.targetResult.elapsedTimeMs] Time taken in + * millisecond(s) for executing the query + * @member {object} [queryResults.targetResult.waitStats] Dictionary of sql + * query execution wait types and the respective statistics + * @member {boolean} [queryResults.targetResult.hasErrors] Indicates whether + * the query resulted in an error + * @member {array} [queryResults.targetResult.sqlErrors] List of sql Errors + * @member {object} [validationErrors] Errors that are part of the execution + * @member {string} [validationErrors.text] Error Text + * @member {string} [validationErrors.severity] Severity of the error. + * Possible values include: 'Message', 'Warning', 'Error' + */ + constructor() { + } + + /** + * Defines the metadata of QueryAnalysisValidationResult + * + * @returns {object} metadata of QueryAnalysisValidationResult + * + */ + mapper() { + return { + required: false, + serializedName: 'QueryAnalysisValidationResult', + type: { + name: 'Composite', + className: 'QueryAnalysisValidationResult', + modelProperties: { + queryResults: { + required: false, + serializedName: 'queryResults', + type: { + name: 'Composite', + className: 'QueryExecutionResult' + } + }, + validationErrors: { + required: false, + serializedName: 'validationErrors', + type: { + name: 'Composite', + className: 'ValidationError' + } + } + } + } + }; + } +} + +module.exports = QueryAnalysisValidationResult; diff --git a/lib/services/datamigrationManagement/lib/models/queryExecutionResult.js b/lib/services/datamigrationManagement/lib/models/queryExecutionResult.js new file mode 100644 index 0000000000..1204bf153e --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/queryExecutionResult.js @@ -0,0 +1,98 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Describes query analysis results for execution in source and target + * + */ +class QueryExecutionResult { + /** + * Create a QueryExecutionResult. + * @member {string} [queryText] Query text retrieved from the source server + * @member {number} [statementsInBatch] Total no. of statements in the batch + * @member {object} [sourceResult] Query analysis result from the source + * @member {number} [sourceResult.executionCount] No. of query executions + * @member {number} [sourceResult.cpuTimeMs] CPU Time in millisecond(s) for + * the query execution + * @member {number} [sourceResult.elapsedTimeMs] Time taken in millisecond(s) + * for executing the query + * @member {object} [sourceResult.waitStats] Dictionary of sql query + * execution wait types and the respective statistics + * @member {boolean} [sourceResult.hasErrors] Indicates whether the query + * resulted in an error + * @member {array} [sourceResult.sqlErrors] List of sql Errors + * @member {object} [targetResult] Query analysis result from the target + * @member {number} [targetResult.executionCount] No. of query executions + * @member {number} [targetResult.cpuTimeMs] CPU Time in millisecond(s) for + * the query execution + * @member {number} [targetResult.elapsedTimeMs] Time taken in millisecond(s) + * for executing the query + * @member {object} [targetResult.waitStats] Dictionary of sql query + * execution wait types and the respective statistics + * @member {boolean} [targetResult.hasErrors] Indicates whether the query + * resulted in an error + * @member {array} [targetResult.sqlErrors] List of sql Errors + */ + constructor() { + } + + /** + * Defines the metadata of QueryExecutionResult + * + * @returns {object} metadata of QueryExecutionResult + * + */ + mapper() { + return { + required: false, + serializedName: 'QueryExecutionResult', + type: { + name: 'Composite', + className: 'QueryExecutionResult', + modelProperties: { + queryText: { + required: false, + serializedName: 'queryText', + type: { + name: 'String' + } + }, + statementsInBatch: { + required: false, + serializedName: 'statementsInBatch', + type: { + name: 'Number' + } + }, + sourceResult: { + required: false, + serializedName: 'sourceResult', + type: { + name: 'Composite', + className: 'ExecutionStatistics' + } + }, + targetResult: { + required: false, + serializedName: 'targetResult', + type: { + name: 'Composite', + className: 'ExecutionStatistics' + } + } + } + } + }; + } +} + +module.exports = QueryExecutionResult; diff --git a/lib/services/datamigrationManagement/lib/models/quota.js b/lib/services/datamigrationManagement/lib/models/quota.js new file mode 100644 index 0000000000..6bc8d8fae4 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/quota.js @@ -0,0 +1,91 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Describes a quota for or usage details about a resource + * + */ +class Quota { + /** + * Create a Quota. + * @member {number} [currentValue] The current value of the quota. If null or + * missing, the current value cannot be determined in the context of the + * request. + * @member {string} [id] The resource ID of the quota object + * @member {number} [limit] The maximum value of the quota. If null or + * missing, the quota has no maximum, in which case it merely tracks usage. + * @member {object} [name] The name of the quota + * @member {string} [name.localizedValue] The localized name of the quota + * @member {string} [name.value] The unlocalized name (or ID) of the quota + * @member {string} [unit] The unit for the quota, such as Count, Bytes, + * BytesPerSecond, etc. + */ + constructor() { + } + + /** + * Defines the metadata of Quota + * + * @returns {object} metadata of Quota + * + */ + mapper() { + return { + required: false, + serializedName: 'Quota', + type: { + name: 'Composite', + className: 'Quota', + modelProperties: { + currentValue: { + required: false, + serializedName: 'currentValue', + type: { + name: 'Number' + } + }, + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + limit: { + required: false, + serializedName: 'limit', + type: { + name: 'Number' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'Composite', + className: 'QuotaName' + } + }, + unit: { + required: false, + serializedName: 'unit', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Quota; diff --git a/lib/services/datamigrationManagement/lib/models/quotaList.js b/lib/services/datamigrationManagement/lib/models/quotaList.js new file mode 100644 index 0000000000..2ac658d23d --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/quotaList.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * OData page of quota objects + */ +class QuotaList extends Array { + /** + * Create a QuotaList. + * @member {string} [nextLink] URL to load the next page of quotas, or null + * or missing if this is the last page + */ + constructor() { + super(); + } + + /** + * Defines the metadata of QuotaList + * + * @returns {object} metadata of QuotaList + * + */ + mapper() { + return { + required: false, + serializedName: 'QuotaList', + type: { + name: 'Composite', + className: 'QuotaList', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'QuotaElementType', + type: { + name: 'Composite', + className: 'Quota' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = QuotaList; diff --git a/lib/services/datamigrationManagement/lib/models/quotaName.js b/lib/services/datamigrationManagement/lib/models/quotaName.js new file mode 100644 index 0000000000..d9e303cbb4 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/quotaName.js @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The name of the quota + * + */ +class QuotaName { + /** + * Create a QuotaName. + * @member {string} [localizedValue] The localized name of the quota + * @member {string} [value] The unlocalized name (or ID) of the quota + */ + constructor() { + } + + /** + * Defines the metadata of QuotaName + * + * @returns {object} metadata of QuotaName + * + */ + mapper() { + return { + required: false, + serializedName: 'Quota_name', + type: { + name: 'Composite', + className: 'QuotaName', + modelProperties: { + localizedValue: { + required: false, + serializedName: 'localizedValue', + type: { + name: 'String' + } + }, + value: { + required: false, + serializedName: 'value', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = QuotaName; diff --git a/lib/services/datamigrationManagement/lib/models/reportableException.js b/lib/services/datamigrationManagement/lib/models/reportableException.js new file mode 100644 index 0000000000..b17b3e9479 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/reportableException.js @@ -0,0 +1,93 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Exception object for all custom exceptions + * + */ +class ReportableException { + /** + * Create a ReportableException. + * @member {string} [message] Error message + * @member {string} [actionableMessage] Actionable steps for this exception + * @member {string} [filePath] The path to the file where exception occurred + * @member {string} [lineNumber] The line number where exception occurred + * @member {number} [hResult] Coded numerical value that is assigned to a + * specific exception + * @member {string} [stackTrace] Stack trace + */ + constructor() { + } + + /** + * Defines the metadata of ReportableException + * + * @returns {object} metadata of ReportableException + * + */ + mapper() { + return { + required: false, + serializedName: 'ReportableException', + type: { + name: 'Composite', + className: 'ReportableException', + modelProperties: { + message: { + required: false, + serializedName: 'message', + type: { + name: 'String' + } + }, + actionableMessage: { + required: false, + serializedName: 'actionableMessage', + type: { + name: 'String' + } + }, + filePath: { + required: false, + serializedName: 'filePath', + type: { + name: 'String' + } + }, + lineNumber: { + required: false, + serializedName: 'lineNumber', + type: { + name: 'String' + } + }, + hResult: { + required: false, + serializedName: 'hResult', + type: { + name: 'Number' + } + }, + stackTrace: { + required: false, + serializedName: 'stackTrace', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ReportableException; diff --git a/lib/services/datamigrationManagement/lib/models/resource.js b/lib/services/datamigrationManagement/lib/models/resource.js new file mode 100644 index 0000000000..57088e37e3 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/resource.js @@ -0,0 +1,75 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * ARM resource. + * + * @extends models['BaseResource'] + */ +class Resource extends models['BaseResource'] { + /** + * Create a Resource. + * @member {string} [id] Resource ID. + * @member {string} [name] Resource name. + * @member {string} [type] Resource type. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of Resource + * + * @returns {object} metadata of Resource + * + */ + mapper() { + return { + required: false, + serializedName: 'Resource', + type: { + name: 'Composite', + className: 'Resource', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Resource; diff --git a/lib/services/datamigrationManagement/lib/models/resourceSku.js b/lib/services/datamigrationManagement/lib/models/resourceSku.js new file mode 100644 index 0000000000..77ef2fa5dc --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/resourceSku.js @@ -0,0 +1,200 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Describes an available DMS SKU. + * + */ +class ResourceSku { + /** + * Create a ResourceSku. + * @member {string} [resourceType] The type of resource the SKU applies to. + * @member {string} [name] The name of SKU. + * @member {string} [tier] Specifies the tier of DMS in a scale set. + * @member {string} [size] The Size of the SKU. + * @member {string} [family] The Family of this particular SKU. + * @member {string} [kind] The Kind of resources that are supported in this + * SKU. + * @member {object} [capacity] Not used. + * @member {number} [capacity.minimum] The minimum capacity. + * @member {number} [capacity.maximum] The maximum capacity. + * @member {number} [capacity.default] The default capacity. + * @member {string} [capacity.scaleType] The scale type applicable to the + * SKU. Possible values include: 'Automatic', 'Manual', 'None' + * @member {array} [locations] The set of locations that the SKU is + * available. + * @member {array} [apiVersions] The api versions that support this SKU. + * @member {array} [costs] Metadata for retrieving price info. + * @member {array} [capabilities] A name value pair to describe the + * capability. + * @member {array} [restrictions] The restrictions because of which SKU + * cannot be used. This is empty if there are no restrictions. + */ + constructor() { + } + + /** + * Defines the metadata of ResourceSku + * + * @returns {object} metadata of ResourceSku + * + */ + mapper() { + return { + required: false, + serializedName: 'ResourceSku', + type: { + name: 'Composite', + className: 'ResourceSku', + modelProperties: { + resourceType: { + required: false, + readOnly: true, + serializedName: 'resourceType', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + tier: { + required: false, + readOnly: true, + serializedName: 'tier', + type: { + name: 'String' + } + }, + size: { + required: false, + readOnly: true, + serializedName: 'size', + type: { + name: 'String' + } + }, + family: { + required: false, + readOnly: true, + serializedName: 'family', + type: { + name: 'String' + } + }, + kind: { + required: false, + readOnly: true, + serializedName: 'kind', + type: { + name: 'String' + } + }, + capacity: { + required: false, + readOnly: true, + serializedName: 'capacity', + type: { + name: 'Composite', + className: 'ResourceSkuCapacity' + } + }, + locations: { + required: false, + readOnly: true, + serializedName: 'locations', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + apiVersions: { + required: false, + readOnly: true, + serializedName: 'apiVersions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + costs: { + required: false, + readOnly: true, + serializedName: 'costs', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ResourceSkuCostsElementType', + type: { + name: 'Composite', + className: 'ResourceSkuCosts' + } + } + } + }, + capabilities: { + required: false, + readOnly: true, + serializedName: 'capabilities', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ResourceSkuCapabilitiesElementType', + type: { + name: 'Composite', + className: 'ResourceSkuCapabilities' + } + } + } + }, + restrictions: { + required: false, + readOnly: true, + serializedName: 'restrictions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ResourceSkuRestrictionsElementType', + type: { + name: 'Composite', + className: 'ResourceSkuRestrictions' + } + } + } + } + } + } + }; + } +} + +module.exports = ResourceSku; diff --git a/lib/services/datamigrationManagement/lib/models/resourceSkuCapabilities.js b/lib/services/datamigrationManagement/lib/models/resourceSkuCapabilities.js new file mode 100644 index 0000000000..77ae0d4489 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/resourceSkuCapabilities.js @@ -0,0 +1,63 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Describes The SKU capabilites object. + * + */ +class ResourceSkuCapabilities { + /** + * Create a ResourceSkuCapabilities. + * @member {string} [name] An invariant to describe the feature. + * @member {string} [value] An invariant if the feature is measured by + * quantity. + */ + constructor() { + } + + /** + * Defines the metadata of ResourceSkuCapabilities + * + * @returns {object} metadata of ResourceSkuCapabilities + * + */ + mapper() { + return { + required: false, + serializedName: 'ResourceSkuCapabilities', + type: { + name: 'Composite', + className: 'ResourceSkuCapabilities', + modelProperties: { + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + value: { + required: false, + readOnly: true, + serializedName: 'value', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ResourceSkuCapabilities; diff --git a/lib/services/datamigrationManagement/lib/models/resourceSkuCapacity.js b/lib/services/datamigrationManagement/lib/models/resourceSkuCapacity.js new file mode 100644 index 0000000000..ad984f7e90 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/resourceSkuCapacity.js @@ -0,0 +1,81 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Describes scaling information of a SKU. + * + */ +class ResourceSkuCapacity { + /** + * Create a ResourceSkuCapacity. + * @member {number} [minimum] The minimum capacity. + * @member {number} [maximum] The maximum capacity. + * @member {number} [default] The default capacity. + * @member {string} [scaleType] The scale type applicable to the SKU. + * Possible values include: 'Automatic', 'Manual', 'None' + */ + constructor() { + } + + /** + * Defines the metadata of ResourceSkuCapacity + * + * @returns {object} metadata of ResourceSkuCapacity + * + */ + mapper() { + return { + required: false, + serializedName: 'ResourceSkuCapacity', + type: { + name: 'Composite', + className: 'ResourceSkuCapacity', + modelProperties: { + minimum: { + required: false, + readOnly: true, + serializedName: 'minimum', + type: { + name: 'Number' + } + }, + maximum: { + required: false, + readOnly: true, + serializedName: 'maximum', + type: { + name: 'Number' + } + }, + default: { + required: false, + readOnly: true, + serializedName: 'default', + type: { + name: 'Number' + } + }, + scaleType: { + required: false, + readOnly: true, + serializedName: 'scaleType', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ResourceSkuCapacity; diff --git a/lib/services/datamigrationManagement/lib/models/resourceSkuCosts.js b/lib/services/datamigrationManagement/lib/models/resourceSkuCosts.js new file mode 100644 index 0000000000..08e2bd632b --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/resourceSkuCosts.js @@ -0,0 +1,72 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Describes metadata for retrieving price info. + * + */ +class ResourceSkuCosts { + /** + * Create a ResourceSkuCosts. + * @member {string} [meterID] Used for querying price from commerce. + * @member {number} [quantity] The multiplier is needed to extend the base + * metered cost. + * @member {string} [extendedUnit] An invariant to show the extended unit. + */ + constructor() { + } + + /** + * Defines the metadata of ResourceSkuCosts + * + * @returns {object} metadata of ResourceSkuCosts + * + */ + mapper() { + return { + required: false, + serializedName: 'ResourceSkuCosts', + type: { + name: 'Composite', + className: 'ResourceSkuCosts', + modelProperties: { + meterID: { + required: false, + readOnly: true, + serializedName: 'meterID', + type: { + name: 'String' + } + }, + quantity: { + required: false, + readOnly: true, + serializedName: 'quantity', + type: { + name: 'Number' + } + }, + extendedUnit: { + required: false, + readOnly: true, + serializedName: 'extendedUnit', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ResourceSkuCosts; diff --git a/lib/services/datamigrationManagement/lib/models/resourceSkuRestrictions.js b/lib/services/datamigrationManagement/lib/models/resourceSkuRestrictions.js new file mode 100644 index 0000000000..bf7925972f --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/resourceSkuRestrictions.js @@ -0,0 +1,82 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Describes scaling information of a SKU. + * + */ +class ResourceSkuRestrictions { + /** + * Create a ResourceSkuRestrictions. + * @member {string} [type] The type of restrictions. Possible values include: + * 'location' + * @member {array} [values] The value of restrictions. If the restriction + * type is set to location. This would be different locations where the SKU + * is restricted. + * @member {string} [reasonCode] The reason code for restriction. Possible + * values include: 'QuotaId', 'NotAvailableForSubscription' + */ + constructor() { + } + + /** + * Defines the metadata of ResourceSkuRestrictions + * + * @returns {object} metadata of ResourceSkuRestrictions + * + */ + mapper() { + return { + required: false, + serializedName: 'ResourceSkuRestrictions', + type: { + name: 'Composite', + className: 'ResourceSkuRestrictions', + modelProperties: { + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + values: { + required: false, + readOnly: true, + serializedName: 'values', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + reasonCode: { + required: false, + readOnly: true, + serializedName: 'reasonCode', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ResourceSkuRestrictions; diff --git a/lib/services/datamigrationManagement/lib/models/resourceSkusResult.js b/lib/services/datamigrationManagement/lib/models/resourceSkusResult.js new file mode 100644 index 0000000000..d009490792 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/resourceSkusResult.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The DMS List SKUs operation response. + */ +class ResourceSkusResult extends Array { + /** + * Create a ResourceSkusResult. + * @member {string} [nextLink] The uri to fetch the next page of DMS SKUs. + * Call ListNext() with this to fetch the next page of DMS SKUs. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ResourceSkusResult + * + * @returns {object} metadata of ResourceSkusResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ResourceSkusResult', + type: { + name: 'Composite', + className: 'ResourceSkusResult', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ResourceSkuElementType', + type: { + name: 'Composite', + className: 'ResourceSku' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ResourceSkusResult; diff --git a/lib/services/datamigrationManagement/lib/models/schemaComparisonValidationResult.js b/lib/services/datamigrationManagement/lib/models/schemaComparisonValidationResult.js new file mode 100644 index 0000000000..6220830f64 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/schemaComparisonValidationResult.js @@ -0,0 +1,107 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Results for schema comparison between the source and target + * + */ +class SchemaComparisonValidationResult { + /** + * Create a SchemaComparisonValidationResult. + * @member {object} [schemaDifferences] List of schema differences between + * the source and target databases + * @member {string} [schemaDifferences.objectName] Name of the object that + * has the difference + * @member {string} [schemaDifferences.objectType] Type of the object that + * has the difference. e.g (Table/View/StoredProcedure). Possible values + * include: 'StoredProcedures', 'Table', 'User', 'View', 'Function' + * @member {string} [schemaDifferences.updateAction] Update action type with + * respect to target. Possible values include: 'DeletedOnTarget', + * 'ChangedOnTarget', 'AddedOnTarget' + * @member {object} [validationErrors] List of errors that happened while + * performing schema compare validation + * @member {string} [validationErrors.text] Error Text + * @member {string} [validationErrors.severity] Severity of the error. + * Possible values include: 'Message', 'Warning', 'Error' + * @member {object} [sourceDatabaseObjectCount] Count of source database + * objects + * @member {object} [targetDatabaseObjectCount] Count of target database + * objects + */ + constructor() { + } + + /** + * Defines the metadata of SchemaComparisonValidationResult + * + * @returns {object} metadata of SchemaComparisonValidationResult + * + */ + mapper() { + return { + required: false, + serializedName: 'SchemaComparisonValidationResult', + type: { + name: 'Composite', + className: 'SchemaComparisonValidationResult', + modelProperties: { + schemaDifferences: { + required: false, + serializedName: 'schemaDifferences', + type: { + name: 'Composite', + className: 'SchemaComparisonValidationResultType' + } + }, + validationErrors: { + required: false, + serializedName: 'validationErrors', + type: { + name: 'Composite', + className: 'ValidationError' + } + }, + sourceDatabaseObjectCount: { + required: false, + serializedName: 'sourceDatabaseObjectCount', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'NumberElementType', + type: { + name: 'Number' + } + } + } + }, + targetDatabaseObjectCount: { + required: false, + serializedName: 'targetDatabaseObjectCount', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'NumberElementType', + type: { + name: 'Number' + } + } + } + } + } + } + }; + } +} + +module.exports = SchemaComparisonValidationResult; diff --git a/lib/services/datamigrationManagement/lib/models/schemaComparisonValidationResultType.js b/lib/services/datamigrationManagement/lib/models/schemaComparisonValidationResultType.js new file mode 100644 index 0000000000..95cb62671b --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/schemaComparisonValidationResultType.js @@ -0,0 +1,72 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Description about the errors happen while performing migration validation + * + */ +class SchemaComparisonValidationResultType { + /** + * Create a SchemaComparisonValidationResultType. + * @member {string} [objectName] Name of the object that has the difference + * @member {string} [objectType] Type of the object that has the difference. + * e.g (Table/View/StoredProcedure). Possible values include: + * 'StoredProcedures', 'Table', 'User', 'View', 'Function' + * @member {string} [updateAction] Update action type with respect to target. + * Possible values include: 'DeletedOnTarget', 'ChangedOnTarget', + * 'AddedOnTarget' + */ + constructor() { + } + + /** + * Defines the metadata of SchemaComparisonValidationResultType + * + * @returns {object} metadata of SchemaComparisonValidationResultType + * + */ + mapper() { + return { + required: false, + serializedName: 'SchemaComparisonValidationResultType', + type: { + name: 'Composite', + className: 'SchemaComparisonValidationResultType', + modelProperties: { + objectName: { + required: false, + serializedName: 'objectName', + type: { + name: 'String' + } + }, + objectType: { + required: false, + serializedName: 'objectType', + type: { + name: 'String' + } + }, + updateAction: { + required: false, + serializedName: 'updateAction', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SchemaComparisonValidationResultType; diff --git a/lib/services/datamigrationManagement/lib/models/schemaMigrationSetting.js b/lib/services/datamigrationManagement/lib/models/schemaMigrationSetting.js new file mode 100644 index 0000000000..583d3cb1da --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/schemaMigrationSetting.js @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Settings for migrating schema from source to target + * + */ +class SchemaMigrationSetting { + /** + * Create a SchemaMigrationSetting. + * @member {string} [schemaOption] Option on how to migrate the schema. + * Possible values include: 'None', 'ExtractFromSource', 'UseStorageFile' + * @member {string} [fileId] Resource Identifier of a file resource + * containing the uploaded schema file + */ + constructor() { + } + + /** + * Defines the metadata of SchemaMigrationSetting + * + * @returns {object} metadata of SchemaMigrationSetting + * + */ + mapper() { + return { + required: false, + serializedName: 'SchemaMigrationSetting', + type: { + name: 'Composite', + className: 'SchemaMigrationSetting', + modelProperties: { + schemaOption: { + required: false, + serializedName: 'schemaOption', + type: { + name: 'String' + } + }, + fileId: { + required: false, + serializedName: 'fileId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SchemaMigrationSetting; diff --git a/lib/services/datamigrationManagement/lib/models/selectedCertificateInput.js b/lib/services/datamigrationManagement/lib/models/selectedCertificateInput.js new file mode 100644 index 0000000000..bfd6e0018d --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/selectedCertificateInput.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Info for ertificate to be exported for TDE enabled databases. + * + */ +class SelectedCertificateInput { + /** + * Create a SelectedCertificateInput. + * @member {string} certificateName Name of certificate to be exported. + * @member {string} password Password to use for encrypting the exported + * certificate. + */ + constructor() { + } + + /** + * Defines the metadata of SelectedCertificateInput + * + * @returns {object} metadata of SelectedCertificateInput + * + */ + mapper() { + return { + required: false, + serializedName: 'SelectedCertificateInput', + type: { + name: 'Composite', + className: 'SelectedCertificateInput', + modelProperties: { + certificateName: { + required: true, + serializedName: 'certificateName', + type: { + name: 'String' + } + }, + password: { + required: true, + serializedName: 'password', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SelectedCertificateInput; diff --git a/lib/services/datamigrationManagement/lib/models/serverProperties.js b/lib/services/datamigrationManagement/lib/models/serverProperties.js new file mode 100644 index 0000000000..bfcd221cb4 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/serverProperties.js @@ -0,0 +1,99 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Server properties for Oracle, MySQL type source + * + */ +class ServerProperties { + /** + * Create a ServerProperties. + * @member {string} [serverPlatform] Name of the server platform + * @member {string} [serverName] Name of the server + * @member {string} [serverVersion] Version of the database server + * @member {string} [serverEdition] Edition of the database server + * @member {string} [serverOperatingSystemVersion] Version of the operating + * system + * @member {number} [serverDatabaseCount] Number of databases in the server + */ + constructor() { + } + + /** + * Defines the metadata of ServerProperties + * + * @returns {object} metadata of ServerProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'ServerProperties', + type: { + name: 'Composite', + className: 'ServerProperties', + modelProperties: { + serverPlatform: { + required: false, + readOnly: true, + serializedName: 'serverPlatform', + type: { + name: 'String' + } + }, + serverName: { + required: false, + readOnly: true, + serializedName: 'serverName', + type: { + name: 'String' + } + }, + serverVersion: { + required: false, + readOnly: true, + serializedName: 'serverVersion', + type: { + name: 'String' + } + }, + serverEdition: { + required: false, + readOnly: true, + serializedName: 'serverEdition', + type: { + name: 'String' + } + }, + serverOperatingSystemVersion: { + required: false, + readOnly: true, + serializedName: 'serverOperatingSystemVersion', + type: { + name: 'String' + } + }, + serverDatabaseCount: { + required: false, + readOnly: true, + serializedName: 'serverDatabaseCount', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = ServerProperties; diff --git a/lib/services/datamigrationManagement/lib/models/serviceOperation.js b/lib/services/datamigrationManagement/lib/models/serviceOperation.js new file mode 100644 index 0000000000..aa170e7c13 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/serviceOperation.js @@ -0,0 +1,66 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Description of an action supported by the Database Migration Service + * + */ +class ServiceOperation { + /** + * Create a ServiceOperation. + * @member {string} [name] The fully qualified action name, e.g. + * Microsoft.DataMigration/services/read + * @member {object} [display] Localized display text + * @member {string} [display.provider] The localized resource provider name + * @member {string} [display.resource] The localized resource type name + * @member {string} [display.operation] The localized operation name + * @member {string} [display.description] The localized operation description + */ + constructor() { + } + + /** + * Defines the metadata of ServiceOperation + * + * @returns {object} metadata of ServiceOperation + * + */ + mapper() { + return { + required: false, + serializedName: 'ServiceOperation', + type: { + name: 'Composite', + className: 'ServiceOperation', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + display: { + required: false, + serializedName: 'display', + type: { + name: 'Composite', + className: 'ServiceOperationDisplay' + } + } + } + } + }; + } +} + +module.exports = ServiceOperation; diff --git a/lib/services/datamigrationManagement/lib/models/serviceOperationDisplay.js b/lib/services/datamigrationManagement/lib/models/serviceOperationDisplay.js new file mode 100644 index 0000000000..84f10f4bc7 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/serviceOperationDisplay.js @@ -0,0 +1,76 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Localized display text + * + */ +class ServiceOperationDisplay { + /** + * Create a ServiceOperationDisplay. + * @member {string} [provider] The localized resource provider name + * @member {string} [resource] The localized resource type name + * @member {string} [operation] The localized operation name + * @member {string} [description] The localized operation description + */ + constructor() { + } + + /** + * Defines the metadata of ServiceOperationDisplay + * + * @returns {object} metadata of ServiceOperationDisplay + * + */ + mapper() { + return { + required: false, + serializedName: 'ServiceOperation_display', + type: { + name: 'Composite', + className: 'ServiceOperationDisplay', + modelProperties: { + provider: { + required: false, + serializedName: 'provider', + type: { + name: 'String' + } + }, + resource: { + required: false, + serializedName: 'resource', + type: { + name: 'String' + } + }, + operation: { + required: false, + serializedName: 'operation', + type: { + name: 'String' + } + }, + description: { + required: false, + serializedName: 'description', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ServiceOperationDisplay; diff --git a/lib/services/datamigrationManagement/lib/models/serviceOperationList.js b/lib/services/datamigrationManagement/lib/models/serviceOperationList.js new file mode 100644 index 0000000000..1ecb603c4a --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/serviceOperationList.js @@ -0,0 +1,67 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * OData page of action (operation) objects + */ +class ServiceOperationList extends Array { + /** + * Create a ServiceOperationList. + * @member {string} [nextLink] URL to load the next page of actions + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ServiceOperationList + * + * @returns {object} metadata of ServiceOperationList + * + */ + mapper() { + return { + required: false, + serializedName: 'ServiceOperationList', + type: { + name: 'Composite', + className: 'ServiceOperationList', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ServiceOperationElementType', + type: { + name: 'Composite', + className: 'ServiceOperation' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ServiceOperationList; diff --git a/lib/services/datamigrationManagement/lib/models/serviceSku.js b/lib/services/datamigrationManagement/lib/models/serviceSku.js new file mode 100644 index 0000000000..c3fda51aa3 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/serviceSku.js @@ -0,0 +1,90 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * An Azure SKU instance + * + */ +class ServiceSku { + /** + * Create a ServiceSku. + * @member {string} [name] The unique name of the SKU, such as 'P3' + * @member {string} [tier] The tier of the SKU, such as 'Basic', 'General + * Purpose', or 'Business Critical' + * @member {string} [family] The SKU family, used when the service has + * multiple performance classes within a tier, such as 'A', 'D', etc. for + * virtual machines + * @member {string} [size] The size of the SKU, used when the name alone does + * not denote a service size or when a SKU has multiple performance classes + * within a family, e.g. 'A1' for virtual machines + * @member {number} [capacity] The capacity of the SKU, if it supports + * scaling + */ + constructor() { + } + + /** + * Defines the metadata of ServiceSku + * + * @returns {object} metadata of ServiceSku + * + */ + mapper() { + return { + required: false, + serializedName: 'ServiceSku', + type: { + name: 'Composite', + className: 'ServiceSku', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + tier: { + required: false, + serializedName: 'tier', + type: { + name: 'String' + } + }, + family: { + required: false, + serializedName: 'family', + type: { + name: 'String' + } + }, + size: { + required: false, + serializedName: 'size', + type: { + name: 'String' + } + }, + capacity: { + required: false, + serializedName: 'capacity', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = ServiceSku; diff --git a/lib/services/datamigrationManagement/lib/models/serviceSkuList.js b/lib/services/datamigrationManagement/lib/models/serviceSkuList.js new file mode 100644 index 0000000000..41821705f1 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/serviceSkuList.js @@ -0,0 +1,67 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * OData page of available SKUs + */ +class ServiceSkuList extends Array { + /** + * Create a ServiceSkuList. + * @member {string} [nextLink] URL to load the next page of service SKUs + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ServiceSkuList + * + * @returns {object} metadata of ServiceSkuList + * + */ + mapper() { + return { + required: false, + serializedName: 'ServiceSkuList', + type: { + name: 'Composite', + className: 'ServiceSkuList', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AvailableServiceSkuElementType', + type: { + name: 'Composite', + className: 'AvailableServiceSku' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ServiceSkuList; diff --git a/lib/services/datamigrationManagement/lib/models/sqlConnectionInfo.js b/lib/services/datamigrationManagement/lib/models/sqlConnectionInfo.js new file mode 100644 index 0000000000..c5fee5efd0 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/sqlConnectionInfo.js @@ -0,0 +1,132 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Information for connecting to SQL database server + * + * @extends models['ConnectionInfo'] + */ +class SqlConnectionInfo extends models['ConnectionInfo'] { + /** + * Create a SqlConnectionInfo. + * @member {string} dataSource Data source in the format + * Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [authentication] Authentication type to use for + * connection. Possible values include: 'None', 'WindowsAuthentication', + * 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [encryptConnection] Whether to encrypt the connection. + * Default value: true . + * @member {string} [additionalSettings] Additional connection settings + * @member {boolean} [trustServerCertificate] Whether to trust the server + * certificate. Default value: false . + * @member {string} [platform] Server platform type for connection. Possible + * values include: 'SqlOnPrem' + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SqlConnectionInfo + * + * @returns {object} metadata of SqlConnectionInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'SqlConnectionInfo', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'ConnectionInfo', + className: 'SqlConnectionInfo', + modelProperties: { + userName: { + required: false, + serializedName: 'userName', + type: { + name: 'String' + } + }, + password: { + required: false, + serializedName: 'password', + type: { + name: 'String' + } + }, + type: { + required: true, + serializedName: 'type', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + dataSource: { + required: true, + serializedName: 'dataSource', + type: { + name: 'String' + } + }, + authentication: { + required: false, + serializedName: 'authentication', + type: { + name: 'String' + } + }, + encryptConnection: { + required: false, + serializedName: 'encryptConnection', + defaultValue: true, + type: { + name: 'Boolean' + } + }, + additionalSettings: { + required: false, + serializedName: 'additionalSettings', + type: { + name: 'String' + } + }, + trustServerCertificate: { + required: false, + serializedName: 'trustServerCertificate', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + platform: { + required: false, + serializedName: 'platform', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SqlConnectionInfo; diff --git a/lib/services/datamigrationManagement/lib/models/sqlMigrationTaskInput.js b/lib/services/datamigrationManagement/lib/models/sqlMigrationTaskInput.js new file mode 100644 index 0000000000..c48ceef148 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/sqlMigrationTaskInput.js @@ -0,0 +1,100 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Base class for migration task input + * + */ +class SqlMigrationTaskInput { + /** + * Create a SqlMigrationTaskInput. + * @member {object} sourceConnectionInfo Information for connecting to source + * @member {string} [sourceConnectionInfo.dataSource] Data source in the + * format Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [sourceConnectionInfo.authentication] Authentication type + * to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [sourceConnectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [sourceConnectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [sourceConnectionInfo.trustServerCertificate] Whether to + * trust the server certificate + * @member {string} [sourceConnectionInfo.platform] Server platform type for + * connection. Possible values include: 'SqlOnPrem' + * @member {object} targetConnectionInfo Information for connecting to target + * @member {string} [targetConnectionInfo.dataSource] Data source in the + * format Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [targetConnectionInfo.authentication] Authentication type + * to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [targetConnectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [targetConnectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [targetConnectionInfo.trustServerCertificate] Whether to + * trust the server certificate + * @member {string} [targetConnectionInfo.platform] Server platform type for + * connection. Possible values include: 'SqlOnPrem' + */ + constructor() { + } + + /** + * Defines the metadata of SqlMigrationTaskInput + * + * @returns {object} metadata of SqlMigrationTaskInput + * + */ + mapper() { + return { + required: false, + serializedName: 'SqlMigrationTaskInput', + type: { + name: 'Composite', + className: 'SqlMigrationTaskInput', + modelProperties: { + sourceConnectionInfo: { + required: true, + serializedName: 'sourceConnectionInfo', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'ConnectionInfo', + className: 'SqlConnectionInfo' + } + }, + targetConnectionInfo: { + required: true, + serializedName: 'targetConnectionInfo', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'ConnectionInfo', + className: 'SqlConnectionInfo' + } + } + } + } + }; + } +} + +module.exports = SqlMigrationTaskInput; diff --git a/lib/services/datamigrationManagement/lib/models/startMigrationScenarioServerRoleResult.js b/lib/services/datamigrationManagement/lib/models/startMigrationScenarioServerRoleResult.js new file mode 100644 index 0000000000..7f3c4bb528 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/startMigrationScenarioServerRoleResult.js @@ -0,0 +1,81 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Server role migration result + * + */ +class StartMigrationScenarioServerRoleResult { + /** + * Create a StartMigrationScenarioServerRoleResult. + * @member {string} [name] Name of server role. + * @member {string} [state] Current state of migration. Possible values + * include: 'None', 'InProgress', 'Failed', 'Warning', 'Completed', + * 'Skipped', 'Stopped' + * @member {array} [exceptionsAndWarnings] Migration exceptions and warnings. + */ + constructor() { + } + + /** + * Defines the metadata of StartMigrationScenarioServerRoleResult + * + * @returns {object} metadata of StartMigrationScenarioServerRoleResult + * + */ + mapper() { + return { + required: false, + serializedName: 'StartMigrationScenarioServerRoleResult', + type: { + name: 'Composite', + className: 'StartMigrationScenarioServerRoleResult', + modelProperties: { + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + exceptionsAndWarnings: { + required: false, + readOnly: true, + serializedName: 'exceptionsAndWarnings', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ReportableExceptionElementType', + type: { + name: 'Composite', + className: 'ReportableException' + } + } + } + } + } + } + }; + } +} + +module.exports = StartMigrationScenarioServerRoleResult; diff --git a/lib/services/datamigrationManagement/lib/models/syncMigrationDatabaseErrorEvent.js b/lib/services/datamigrationManagement/lib/models/syncMigrationDatabaseErrorEvent.js new file mode 100644 index 0000000000..6c22da4764 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/syncMigrationDatabaseErrorEvent.js @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Database migration errors for online migration + * + */ +class SyncMigrationDatabaseErrorEvent { + /** + * Create a SyncMigrationDatabaseErrorEvent. + * @member {string} [timestampString] String value of timestamp. + * @member {string} [eventTypeString] Event type. + * @member {string} [eventText] Event text. + */ + constructor() { + } + + /** + * Defines the metadata of SyncMigrationDatabaseErrorEvent + * + * @returns {object} metadata of SyncMigrationDatabaseErrorEvent + * + */ + mapper() { + return { + required: false, + serializedName: 'SyncMigrationDatabaseErrorEvent', + type: { + name: 'Composite', + className: 'SyncMigrationDatabaseErrorEvent', + modelProperties: { + timestampString: { + required: false, + readOnly: true, + serializedName: 'timestampString', + type: { + name: 'String' + } + }, + eventTypeString: { + required: false, + readOnly: true, + serializedName: 'eventTypeString', + type: { + name: 'String' + } + }, + eventText: { + required: false, + readOnly: true, + serializedName: 'eventText', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SyncMigrationDatabaseErrorEvent; diff --git a/lib/services/datamigrationManagement/lib/models/taskList.js b/lib/services/datamigrationManagement/lib/models/taskList.js new file mode 100644 index 0000000000..8649bf12f9 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/taskList.js @@ -0,0 +1,67 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * OData page of tasks + */ +class TaskList extends Array { + /** + * Create a TaskList. + * @member {string} [nextLink] URL to load the next page of tasks + */ + constructor() { + super(); + } + + /** + * Defines the metadata of TaskList + * + * @returns {object} metadata of TaskList + * + */ + mapper() { + return { + required: false, + serializedName: 'TaskList', + type: { + name: 'Composite', + className: 'TaskList', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ProjectTaskElementType', + type: { + name: 'Composite', + className: 'ProjectTask' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = TaskList; diff --git a/lib/services/datamigrationManagement/lib/models/trackedResource.js b/lib/services/datamigrationManagement/lib/models/trackedResource.js new file mode 100644 index 0000000000..34062b983a --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/trackedResource.js @@ -0,0 +1,95 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * ARM tracked top level resource. + * + * @extends models['Resource'] + */ +class TrackedResource extends models['Resource'] { + /** + * Create a TrackedResource. + * @member {object} [tags] Resource tags. + * @member {string} location Resource location. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of TrackedResource + * + * @returns {object} metadata of TrackedResource + * + */ + mapper() { + return { + required: false, + serializedName: 'TrackedResource', + type: { + name: 'Composite', + className: 'TrackedResource', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = TrackedResource; diff --git a/lib/services/datamigrationManagement/lib/models/validateMigrationInputSqlServerSqlDbSyncTaskProperties.js b/lib/services/datamigrationManagement/lib/models/validateMigrationInputSqlServerSqlDbSyncTaskProperties.js new file mode 100644 index 0000000000..31ac0a6cab --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/validateMigrationInputSqlServerSqlDbSyncTaskProperties.js @@ -0,0 +1,166 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Properties for task that validates migration input for SQL to Azure SQL DB + * sync migrations + * + * @extends models['ProjectTaskProperties'] + */ +class ValidateMigrationInputSqlServerSqlDbSyncTaskProperties extends models['ProjectTaskProperties'] { + /** + * Create a ValidateMigrationInputSqlServerSqlDbSyncTaskProperties. + * @member {object} [input] Task input + * @member {object} [input.sourceConnectionInfo] Information for connecting + * to source SQL server + * @member {string} [input.sourceConnectionInfo.dataSource] Data source in + * the format Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [input.sourceConnectionInfo.authentication] + * Authentication type to use for connection. Possible values include: + * 'None', 'WindowsAuthentication', 'SqlAuthentication', + * 'ActiveDirectoryIntegrated', 'ActiveDirectoryPassword' + * @member {boolean} [input.sourceConnectionInfo.encryptConnection] Whether + * to encrypt the connection + * @member {string} [input.sourceConnectionInfo.additionalSettings] + * Additional connection settings + * @member {boolean} [input.sourceConnectionInfo.trustServerCertificate] + * Whether to trust the server certificate + * @member {string} [input.sourceConnectionInfo.platform] Server platform + * type for connection. Possible values include: 'SqlOnPrem' + * @member {object} [input.targetConnectionInfo] Information for connecting + * to target + * @member {string} [input.targetConnectionInfo.dataSource] Data source in + * the format Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [input.targetConnectionInfo.authentication] + * Authentication type to use for connection. Possible values include: + * 'None', 'WindowsAuthentication', 'SqlAuthentication', + * 'ActiveDirectoryIntegrated', 'ActiveDirectoryPassword' + * @member {boolean} [input.targetConnectionInfo.encryptConnection] Whether + * to encrypt the connection + * @member {string} [input.targetConnectionInfo.additionalSettings] + * Additional connection settings + * @member {boolean} [input.targetConnectionInfo.trustServerCertificate] + * Whether to trust the server certificate + * @member {string} [input.targetConnectionInfo.platform] Server platform + * type for connection. Possible values include: 'SqlOnPrem' + * @member {array} [input.selectedDatabases] Databases to migrate + * @member {array} [output] Task output. This is ignored if submitted. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ValidateMigrationInputSqlServerSqlDbSyncTaskProperties + * + * @returns {object} metadata of ValidateMigrationInputSqlServerSqlDbSyncTaskProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'ValidateMigrationInput.SqlServer.SqlDb.Sync', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'taskType', + clientName: 'taskType' + }, + uberParent: 'ProjectTaskProperties', + className: 'ValidateMigrationInputSqlServerSqlDbSyncTaskProperties', + modelProperties: { + errors: { + required: false, + readOnly: true, + serializedName: 'errors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ODataErrorElementType', + type: { + name: 'Composite', + className: 'ODataError' + } + } + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + commands: { + required: false, + readOnly: true, + serializedName: 'commands', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CommandPropertiesElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'commandType', + clientName: 'commandType' + }, + uberParent: 'CommandProperties', + className: 'CommandProperties' + } + } + } + }, + taskType: { + required: true, + serializedName: 'taskType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + input: { + required: false, + serializedName: 'input', + type: { + name: 'Composite', + className: 'ValidateSyncMigrationInputSqlServerTaskInput' + } + }, + output: { + required: false, + readOnly: true, + serializedName: 'output', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ValidateSyncMigrationInputSqlServerTaskOutputElementType', + type: { + name: 'Composite', + className: 'ValidateSyncMigrationInputSqlServerTaskOutput' + } + } + } + } + } + } + }; + } +} + +module.exports = ValidateMigrationInputSqlServerSqlDbSyncTaskProperties; diff --git a/lib/services/datamigrationManagement/lib/models/validateMigrationInputSqlServerSqlMITaskInput.js b/lib/services/datamigrationManagement/lib/models/validateMigrationInputSqlServerSqlMITaskInput.js new file mode 100644 index 0000000000..e046dd2eff --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/validateMigrationInputSqlServerSqlMITaskInput.js @@ -0,0 +1,169 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Input for task that validates migration input for SQL to Azure SQL Managed + * Instance + * + */ +class ValidateMigrationInputSqlServerSqlMITaskInput { + /** + * Create a ValidateMigrationInputSqlServerSqlMITaskInput. + * @member {object} sourceConnectionInfo Information for connecting to source + * @member {string} [sourceConnectionInfo.dataSource] Data source in the + * format Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [sourceConnectionInfo.authentication] Authentication type + * to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [sourceConnectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [sourceConnectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [sourceConnectionInfo.trustServerCertificate] Whether to + * trust the server certificate + * @member {string} [sourceConnectionInfo.platform] Server platform type for + * connection. Possible values include: 'SqlOnPrem' + * @member {object} targetConnectionInfo Information for connecting to target + * @member {string} [targetConnectionInfo.dataSource] Data source in the + * format Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [targetConnectionInfo.authentication] Authentication type + * to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [targetConnectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [targetConnectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [targetConnectionInfo.trustServerCertificate] Whether to + * trust the server certificate + * @member {string} [targetConnectionInfo.platform] Server platform type for + * connection. Possible values include: 'SqlOnPrem' + * @member {array} selectedDatabases Databases to migrate + * @member {array} [selectedLogins] Logins to migrate + * @member {object} [backupFileShare] Backup file share information for all + * selected databases. + * @member {string} [backupFileShare.userName] User name credential to + * connect to the share location + * @member {string} [backupFileShare.password] Password credential used to + * connect to the share location. + * @member {string} [backupFileShare.path] The folder path for this share. + * @member {object} backupBlobShare SAS URI of Azure Storage Account + * Container to be used for storing backup files. + * @member {string} [backupBlobShare.sasUri] SAS URI of Azure Storage Account + * Container. + * @member {string} [backupMode] Backup Mode to specify whether to use + * existing backup or create new backup. Possible values include: + * 'CreateBackup', 'ExistingBackup' + */ + constructor() { + } + + /** + * Defines the metadata of ValidateMigrationInputSqlServerSqlMITaskInput + * + * @returns {object} metadata of ValidateMigrationInputSqlServerSqlMITaskInput + * + */ + mapper() { + return { + required: false, + serializedName: 'ValidateMigrationInputSqlServerSqlMITaskInput', + type: { + name: 'Composite', + className: 'ValidateMigrationInputSqlServerSqlMITaskInput', + modelProperties: { + sourceConnectionInfo: { + required: true, + serializedName: 'sourceConnectionInfo', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'ConnectionInfo', + className: 'SqlConnectionInfo' + } + }, + targetConnectionInfo: { + required: true, + serializedName: 'targetConnectionInfo', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'ConnectionInfo', + className: 'SqlConnectionInfo' + } + }, + selectedDatabases: { + required: true, + serializedName: 'selectedDatabases', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'MigrateSqlServerSqlMIDatabaseInputElementType', + type: { + name: 'Composite', + className: 'MigrateSqlServerSqlMIDatabaseInput' + } + } + } + }, + selectedLogins: { + required: false, + serializedName: 'selectedLogins', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + backupFileShare: { + required: false, + serializedName: 'backupFileShare', + type: { + name: 'Composite', + className: 'FileShare' + } + }, + backupBlobShare: { + required: true, + serializedName: 'backupBlobShare', + type: { + name: 'Composite', + className: 'BlobShare' + } + }, + backupMode: { + required: false, + serializedName: 'backupMode', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ValidateMigrationInputSqlServerSqlMITaskInput; diff --git a/lib/services/datamigrationManagement/lib/models/validateMigrationInputSqlServerSqlMITaskOutput.js b/lib/services/datamigrationManagement/lib/models/validateMigrationInputSqlServerSqlMITaskOutput.js new file mode 100644 index 0000000000..d0fadad7f2 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/validateMigrationInputSqlServerSqlMITaskOutput.js @@ -0,0 +1,181 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Output for task that validates migration input for SQL to Azure SQL Managed + * Instance migrations + * + */ +class ValidateMigrationInputSqlServerSqlMITaskOutput { + /** + * Create a ValidateMigrationInputSqlServerSqlMITaskOutput. + * @member {string} [id] Result identifier + * @member {string} [name] Name of database + * @member {array} [restoreDatabaseNameErrors] Errors associated with the + * RestoreDatabaseName + * @member {array} [backupFolderErrors] Errors associated with the + * BackupFolder path + * @member {array} [backupShareCredentialsErrors] Errors associated with + * backup share user name and password credentials + * @member {array} [backupStorageAccountErrors] Errors associated with the + * storage account provided. + * @member {array} [existingBackupErrors] Errors associated with existing + * backup files. + * @member {object} [databaseBackupInfo] Information about backup files when + * existing backup mode is used. + * @member {string} [databaseBackupInfo.databaseName] Database name. + * @member {string} [databaseBackupInfo.backupType] Backup Type. Possible + * values include: 'Database', 'TransactionLog', 'File', + * 'DifferentialDatabase', 'DifferentialFile', 'Partial', + * 'DifferentialPartial' + * @member {array} [databaseBackupInfo.backupFiles] The list of backup files + * for the current database. + * @member {number} [databaseBackupInfo.position] Position of current + * database backup in the file. + * @member {boolean} [databaseBackupInfo.isDamaged] Database was damaged when + * backed up, but the backup operation was requested to continue despite + * errors. + * @member {boolean} [databaseBackupInfo.isCompressed] Whether the backup set + * is compressed + * @member {number} [databaseBackupInfo.familyCount] Number of files in the + * backup set. + * @member {date} [databaseBackupInfo.backupFinishDate] Date and time when + * the backup operation finished. + */ + constructor() { + } + + /** + * Defines the metadata of ValidateMigrationInputSqlServerSqlMITaskOutput + * + * @returns {object} metadata of ValidateMigrationInputSqlServerSqlMITaskOutput + * + */ + mapper() { + return { + required: false, + serializedName: 'ValidateMigrationInputSqlServerSqlMITaskOutput', + type: { + name: 'Composite', + className: 'ValidateMigrationInputSqlServerSqlMITaskOutput', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + restoreDatabaseNameErrors: { + required: false, + readOnly: true, + serializedName: 'restoreDatabaseNameErrors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ReportableExceptionElementType', + type: { + name: 'Composite', + className: 'ReportableException' + } + } + } + }, + backupFolderErrors: { + required: false, + readOnly: true, + serializedName: 'backupFolderErrors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ReportableExceptionElementType', + type: { + name: 'Composite', + className: 'ReportableException' + } + } + } + }, + backupShareCredentialsErrors: { + required: false, + readOnly: true, + serializedName: 'backupShareCredentialsErrors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ReportableExceptionElementType', + type: { + name: 'Composite', + className: 'ReportableException' + } + } + } + }, + backupStorageAccountErrors: { + required: false, + readOnly: true, + serializedName: 'backupStorageAccountErrors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ReportableExceptionElementType', + type: { + name: 'Composite', + className: 'ReportableException' + } + } + } + }, + existingBackupErrors: { + required: false, + readOnly: true, + serializedName: 'existingBackupErrors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ReportableExceptionElementType', + type: { + name: 'Composite', + className: 'ReportableException' + } + } + } + }, + databaseBackupInfo: { + required: false, + serializedName: 'databaseBackupInfo', + type: { + name: 'Composite', + className: 'DatabaseBackupInfo' + } + } + } + } + }; + } +} + +module.exports = ValidateMigrationInputSqlServerSqlMITaskOutput; diff --git a/lib/services/datamigrationManagement/lib/models/validateMigrationInputSqlServerSqlMITaskProperties.js b/lib/services/datamigrationManagement/lib/models/validateMigrationInputSqlServerSqlMITaskProperties.js new file mode 100644 index 0000000000..0fc6d3c797 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/validateMigrationInputSqlServerSqlMITaskProperties.js @@ -0,0 +1,182 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Properties for task that validates migration input for SQL to Azure SQL + * Database Managed Instance + * + * @extends models['ProjectTaskProperties'] + */ +class ValidateMigrationInputSqlServerSqlMITaskProperties extends models['ProjectTaskProperties'] { + /** + * Create a ValidateMigrationInputSqlServerSqlMITaskProperties. + * @member {object} [input] Task input + * @member {object} [input.sourceConnectionInfo] Information for connecting + * to source + * @member {string} [input.sourceConnectionInfo.dataSource] Data source in + * the format Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [input.sourceConnectionInfo.authentication] + * Authentication type to use for connection. Possible values include: + * 'None', 'WindowsAuthentication', 'SqlAuthentication', + * 'ActiveDirectoryIntegrated', 'ActiveDirectoryPassword' + * @member {boolean} [input.sourceConnectionInfo.encryptConnection] Whether + * to encrypt the connection + * @member {string} [input.sourceConnectionInfo.additionalSettings] + * Additional connection settings + * @member {boolean} [input.sourceConnectionInfo.trustServerCertificate] + * Whether to trust the server certificate + * @member {string} [input.sourceConnectionInfo.platform] Server platform + * type for connection. Possible values include: 'SqlOnPrem' + * @member {object} [input.targetConnectionInfo] Information for connecting + * to target + * @member {string} [input.targetConnectionInfo.dataSource] Data source in + * the format Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [input.targetConnectionInfo.authentication] + * Authentication type to use for connection. Possible values include: + * 'None', 'WindowsAuthentication', 'SqlAuthentication', + * 'ActiveDirectoryIntegrated', 'ActiveDirectoryPassword' + * @member {boolean} [input.targetConnectionInfo.encryptConnection] Whether + * to encrypt the connection + * @member {string} [input.targetConnectionInfo.additionalSettings] + * Additional connection settings + * @member {boolean} [input.targetConnectionInfo.trustServerCertificate] + * Whether to trust the server certificate + * @member {string} [input.targetConnectionInfo.platform] Server platform + * type for connection. Possible values include: 'SqlOnPrem' + * @member {array} [input.selectedDatabases] Databases to migrate + * @member {array} [input.selectedLogins] Logins to migrate + * @member {object} [input.backupFileShare] Backup file share information for + * all selected databases. + * @member {string} [input.backupFileShare.userName] User name credential to + * connect to the share location + * @member {string} [input.backupFileShare.password] Password credential used + * to connect to the share location. + * @member {string} [input.backupFileShare.path] The folder path for this + * share. + * @member {object} [input.backupBlobShare] SAS URI of Azure Storage Account + * Container to be used for storing backup files. + * @member {string} [input.backupBlobShare.sasUri] SAS URI of Azure Storage + * Account Container. + * @member {string} [input.backupMode] Backup Mode to specify whether to use + * existing backup or create new backup. Possible values include: + * 'CreateBackup', 'ExistingBackup' + * @member {array} [output] Task output. This is ignored if submitted. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ValidateMigrationInputSqlServerSqlMITaskProperties + * + * @returns {object} metadata of ValidateMigrationInputSqlServerSqlMITaskProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'ValidateMigrationInput.SqlServer.AzureSqlDbMI', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'taskType', + clientName: 'taskType' + }, + uberParent: 'ProjectTaskProperties', + className: 'ValidateMigrationInputSqlServerSqlMITaskProperties', + modelProperties: { + errors: { + required: false, + readOnly: true, + serializedName: 'errors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ODataErrorElementType', + type: { + name: 'Composite', + className: 'ODataError' + } + } + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + commands: { + required: false, + readOnly: true, + serializedName: 'commands', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CommandPropertiesElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'commandType', + clientName: 'commandType' + }, + uberParent: 'CommandProperties', + className: 'CommandProperties' + } + } + } + }, + taskType: { + required: true, + serializedName: 'taskType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + input: { + required: false, + serializedName: 'input', + type: { + name: 'Composite', + className: 'ValidateMigrationInputSqlServerSqlMITaskInput' + } + }, + output: { + required: false, + readOnly: true, + serializedName: 'output', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ValidateMigrationInputSqlServerSqlMITaskOutputElementType', + type: { + name: 'Composite', + className: 'ValidateMigrationInputSqlServerSqlMITaskOutput' + } + } + } + } + } + } + }; + } +} + +module.exports = ValidateMigrationInputSqlServerSqlMITaskProperties; diff --git a/lib/services/datamigrationManagement/lib/models/validateMongoDbTaskProperties.js b/lib/services/datamigrationManagement/lib/models/validateMongoDbTaskProperties.js new file mode 100644 index 0000000000..7c784bd31e --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/validateMongoDbTaskProperties.js @@ -0,0 +1,162 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Properties for the task that validates a migration between MongoDB data + * sources + * + * @extends models['ProjectTaskProperties'] + */ +class ValidateMongoDbTaskProperties extends models['ProjectTaskProperties'] { + /** + * Create a ValidateMongoDbTaskProperties. + * @member {object} [input] + * @member {number} [input.boostRUs] The RU limit on a CosmosDB target that + * collections will be temporarily increased to (if lower) during the initial + * copy of a migration, from 10,000 to 1,000,000, or 0 to use the default + * boost (which is generally the maximum), or null to not boost the RUs. This + * setting has no effect on non-CosmosDB targets. + * @member {object} [input.databases] The databases on the source cluster to + * migrate to the target. The keys are the names of the databases. + * @member {string} [input.replication] Describes how changes will be + * replicated from the source to the target. The default is OneTime. Possible + * values include: 'Disabled', 'OneTime', 'Continuous' + * @member {object} [input.source] Settings used to connect to the source + * cluster + * @member {string} [input.source.connectionString] A MongoDB connection + * string or blob container URL. The user name and password can be specified + * here or in the userName and password properties + * @member {object} [input.target] Settings used to connect to the target + * cluster + * @member {string} [input.target.connectionString] A MongoDB connection + * string or blob container URL. The user name and password can be specified + * here or in the userName and password properties + * @member {object} [input.throttling] Settings used to limit the resource + * usage of the migration + * @member {number} [input.throttling.minFreeCpu] The percentage of CPU time + * that the migrator will try to avoid using, from 0 to 100 + * @member {number} [input.throttling.minFreeMemoryMb] The number of + * megabytes of RAM that the migrator will try to avoid using + * @member {number} [input.throttling.maxParallelism] The maximum number of + * work items (e.g. collection copies) that will be processed in parallel + * @member {array} [output] An array containing a single + * MongoDbMigrationProgress object + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ValidateMongoDbTaskProperties + * + * @returns {object} metadata of ValidateMongoDbTaskProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'Validate.MongoDb', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'taskType', + clientName: 'taskType' + }, + uberParent: 'ProjectTaskProperties', + className: 'ValidateMongoDbTaskProperties', + modelProperties: { + errors: { + required: false, + readOnly: true, + serializedName: 'errors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ODataErrorElementType', + type: { + name: 'Composite', + className: 'ODataError' + } + } + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + commands: { + required: false, + readOnly: true, + serializedName: 'commands', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CommandPropertiesElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'commandType', + clientName: 'commandType' + }, + uberParent: 'CommandProperties', + className: 'CommandProperties' + } + } + } + }, + taskType: { + required: true, + serializedName: 'taskType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + input: { + required: false, + serializedName: 'input', + type: { + name: 'Composite', + className: 'MongoDbMigrationSettings' + } + }, + output: { + required: false, + readOnly: true, + serializedName: 'output', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'MongoDbMigrationProgressElementType', + type: { + name: 'Composite', + className: 'MongoDbMigrationProgress' + } + } + } + } + } + } + }; + } +} + +module.exports = ValidateMongoDbTaskProperties; diff --git a/lib/services/datamigrationManagement/lib/models/validateSyncMigrationInputSqlServerTaskInput.js b/lib/services/datamigrationManagement/lib/models/validateSyncMigrationInputSqlServerTaskInput.js new file mode 100644 index 0000000000..2905f6a368 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/validateSyncMigrationInputSqlServerTaskInput.js @@ -0,0 +1,117 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Input for task that validates migration input for SQL sync migrations + * + */ +class ValidateSyncMigrationInputSqlServerTaskInput { + /** + * Create a ValidateSyncMigrationInputSqlServerTaskInput. + * @member {object} sourceConnectionInfo Information for connecting to source + * SQL server + * @member {string} [sourceConnectionInfo.dataSource] Data source in the + * format Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [sourceConnectionInfo.authentication] Authentication type + * to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [sourceConnectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [sourceConnectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [sourceConnectionInfo.trustServerCertificate] Whether to + * trust the server certificate + * @member {string} [sourceConnectionInfo.platform] Server platform type for + * connection. Possible values include: 'SqlOnPrem' + * @member {object} targetConnectionInfo Information for connecting to target + * @member {string} [targetConnectionInfo.dataSource] Data source in the + * format Protocol:MachineName\SQLServerInstanceName,PortNumber + * @member {string} [targetConnectionInfo.authentication] Authentication type + * to use for connection. Possible values include: 'None', + * 'WindowsAuthentication', 'SqlAuthentication', 'ActiveDirectoryIntegrated', + * 'ActiveDirectoryPassword' + * @member {boolean} [targetConnectionInfo.encryptConnection] Whether to + * encrypt the connection + * @member {string} [targetConnectionInfo.additionalSettings] Additional + * connection settings + * @member {boolean} [targetConnectionInfo.trustServerCertificate] Whether to + * trust the server certificate + * @member {string} [targetConnectionInfo.platform] Server platform type for + * connection. Possible values include: 'SqlOnPrem' + * @member {array} selectedDatabases Databases to migrate + */ + constructor() { + } + + /** + * Defines the metadata of ValidateSyncMigrationInputSqlServerTaskInput + * + * @returns {object} metadata of ValidateSyncMigrationInputSqlServerTaskInput + * + */ + mapper() { + return { + required: false, + serializedName: 'ValidateSyncMigrationInputSqlServerTaskInput', + type: { + name: 'Composite', + className: 'ValidateSyncMigrationInputSqlServerTaskInput', + modelProperties: { + sourceConnectionInfo: { + required: true, + serializedName: 'sourceConnectionInfo', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'ConnectionInfo', + className: 'SqlConnectionInfo' + } + }, + targetConnectionInfo: { + required: true, + serializedName: 'targetConnectionInfo', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'ConnectionInfo', + className: 'SqlConnectionInfo' + } + }, + selectedDatabases: { + required: true, + serializedName: 'selectedDatabases', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'MigrateSqlServerSqlDbSyncDatabaseInputElementType', + type: { + name: 'Composite', + className: 'MigrateSqlServerSqlDbSyncDatabaseInput' + } + } + } + } + } + } + }; + } +} + +module.exports = ValidateSyncMigrationInputSqlServerTaskInput; diff --git a/lib/services/datamigrationManagement/lib/models/validateSyncMigrationInputSqlServerTaskOutput.js b/lib/services/datamigrationManagement/lib/models/validateSyncMigrationInputSqlServerTaskOutput.js new file mode 100644 index 0000000000..a3e3c7ce4f --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/validateSyncMigrationInputSqlServerTaskOutput.js @@ -0,0 +1,80 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Output for task that validates migration input for SQL sync migrations + * + */ +class ValidateSyncMigrationInputSqlServerTaskOutput { + /** + * Create a ValidateSyncMigrationInputSqlServerTaskOutput. + * @member {string} [id] Database identifier + * @member {string} [name] Name of database + * @member {array} [validationErrors] Errors associated with a selected + * database object + */ + constructor() { + } + + /** + * Defines the metadata of ValidateSyncMigrationInputSqlServerTaskOutput + * + * @returns {object} metadata of ValidateSyncMigrationInputSqlServerTaskOutput + * + */ + mapper() { + return { + required: false, + serializedName: 'ValidateSyncMigrationInputSqlServerTaskOutput', + type: { + name: 'Composite', + className: 'ValidateSyncMigrationInputSqlServerTaskOutput', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + validationErrors: { + required: false, + readOnly: true, + serializedName: 'validationErrors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ReportableExceptionElementType', + type: { + name: 'Composite', + className: 'ReportableException' + } + } + } + } + } + } + }; + } +} + +module.exports = ValidateSyncMigrationInputSqlServerTaskOutput; diff --git a/lib/services/datamigrationManagement/lib/models/validationError.js b/lib/services/datamigrationManagement/lib/models/validationError.js new file mode 100644 index 0000000000..1e651f771b --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/validationError.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Description about the errors happen while performing migration validation + * + */ +class ValidationError { + /** + * Create a ValidationError. + * @member {string} [text] Error Text + * @member {string} [severity] Severity of the error. Possible values + * include: 'Message', 'Warning', 'Error' + */ + constructor() { + } + + /** + * Defines the metadata of ValidationError + * + * @returns {object} metadata of ValidationError + * + */ + mapper() { + return { + required: false, + serializedName: 'ValidationError', + type: { + name: 'Composite', + className: 'ValidationError', + modelProperties: { + text: { + required: false, + serializedName: 'text', + type: { + name: 'String' + } + }, + severity: { + required: false, + serializedName: 'severity', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ValidationError; diff --git a/lib/services/datamigrationManagement/lib/models/waitStatistics.js b/lib/services/datamigrationManagement/lib/models/waitStatistics.js new file mode 100644 index 0000000000..5865a98715 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/models/waitStatistics.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Wait statistics gathered during query batch execution + * + */ +class WaitStatistics { + /** + * Create a WaitStatistics. + * @member {string} [waitType] Type of the Wait + * @member {number} [waitTimeMs] Total wait time in millisecond(s) . Default + * value: 0 . + * @member {number} [waitCount] Total no. of waits + */ + constructor() { + } + + /** + * Defines the metadata of WaitStatistics + * + * @returns {object} metadata of WaitStatistics + * + */ + mapper() { + return { + required: false, + serializedName: 'WaitStatistics', + type: { + name: 'Composite', + className: 'WaitStatistics', + modelProperties: { + waitType: { + required: false, + serializedName: 'waitType', + type: { + name: 'String' + } + }, + waitTimeMs: { + required: false, + serializedName: 'waitTimeMs', + defaultValue: 0, + type: { + name: 'Number' + } + }, + waitCount: { + required: false, + serializedName: 'waitCount', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = WaitStatistics; diff --git a/lib/services/datamigrationManagement/lib/operations/files.js b/lib/services/datamigrationManagement/lib/operations/files.js new file mode 100644 index 0000000000..ced2045139 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/operations/files.js @@ -0,0 +1,2195 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * @summary Get files in a project + * + * The project resource is a nested resource representing a stored migration + * project. This method returns a list of files owned by a project resource. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FileList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(groupName, serviceName, projectName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-07-15-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (groupName === null || groupName === undefined || typeof groupName.valueOf() !== 'string') { + throw new Error('groupName cannot be null or undefined and it must be of type string.'); + } + if (serviceName === null || serviceName === undefined || typeof serviceName.valueOf() !== 'string') { + throw new Error('serviceName cannot be null or undefined and it must be of type string.'); + } + if (projectName === null || projectName === undefined || typeof projectName.valueOf() !== 'string') { + throw new Error('projectName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{groupName}', encodeURIComponent(groupName)); + requestUrl = requestUrl.replace('{serviceName}', encodeURIComponent(serviceName)); + requestUrl = requestUrl.replace('{projectName}', encodeURIComponent(projectName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['FileList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Get file information + * + * The files resource is a nested, proxy-only resource representing a file + * stored under the project resource. This method retrieves information about a + * file. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} fileName Name of the File + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProjectFile} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(groupName, serviceName, projectName, fileName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-07-15-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (groupName === null || groupName === undefined || typeof groupName.valueOf() !== 'string') { + throw new Error('groupName cannot be null or undefined and it must be of type string.'); + } + if (serviceName === null || serviceName === undefined || typeof serviceName.valueOf() !== 'string') { + throw new Error('serviceName cannot be null or undefined and it must be of type string.'); + } + if (projectName === null || projectName === undefined || typeof projectName.valueOf() !== 'string') { + throw new Error('projectName cannot be null or undefined and it must be of type string.'); + } + if (fileName === null || fileName === undefined || typeof fileName.valueOf() !== 'string') { + throw new Error('fileName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{groupName}', encodeURIComponent(groupName)); + requestUrl = requestUrl.replace('{serviceName}', encodeURIComponent(serviceName)); + requestUrl = requestUrl.replace('{projectName}', encodeURIComponent(projectName)); + requestUrl = requestUrl.replace('{fileName}', encodeURIComponent(fileName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ProjectFile']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Create a file resource + * + * The PUT method creates a new file or updates an existing one. + * + * @param {object} parameters Information about the file + * + * @param {string} [parameters.etag] HTTP strong entity tag value. This is + * ignored if submitted. + * + * @param {object} [parameters.properties] Custom file properties + * + * @param {string} [parameters.properties.extension] Optional File extension. + * If submitted it should not have a leading period and must match the + * extension from filePath. + * + * @param {string} [parameters.properties.filePath] Relative path of this file + * resource. This property can be set when creating or updating the file + * resource. + * + * @param {string} [parameters.properties.mediaType] File content type. This + * propery can be modified to reflect the file content type. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} fileName Name of the File + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProjectFile} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(parameters, groupName, serviceName, projectName, fileName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-07-15-preview'; + // Validate + try { + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (groupName === null || groupName === undefined || typeof groupName.valueOf() !== 'string') { + throw new Error('groupName cannot be null or undefined and it must be of type string.'); + } + if (serviceName === null || serviceName === undefined || typeof serviceName.valueOf() !== 'string') { + throw new Error('serviceName cannot be null or undefined and it must be of type string.'); + } + if (projectName === null || projectName === undefined || typeof projectName.valueOf() !== 'string') { + throw new Error('projectName cannot be null or undefined and it must be of type string.'); + } + if (fileName === null || fileName === undefined || typeof fileName.valueOf() !== 'string') { + throw new Error('fileName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{groupName}', encodeURIComponent(groupName)); + requestUrl = requestUrl.replace('{serviceName}', encodeURIComponent(serviceName)); + requestUrl = requestUrl.replace('{projectName}', encodeURIComponent(projectName)); + requestUrl = requestUrl.replace('{fileName}', encodeURIComponent(fileName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ProjectFile']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ProjectFile']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ProjectFile']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Delete file + * + * This method deletes a file. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} fileName Name of the File + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(groupName, serviceName, projectName, fileName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-07-15-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (groupName === null || groupName === undefined || typeof groupName.valueOf() !== 'string') { + throw new Error('groupName cannot be null or undefined and it must be of type string.'); + } + if (serviceName === null || serviceName === undefined || typeof serviceName.valueOf() !== 'string') { + throw new Error('serviceName cannot be null or undefined and it must be of type string.'); + } + if (projectName === null || projectName === undefined || typeof projectName.valueOf() !== 'string') { + throw new Error('projectName cannot be null or undefined and it must be of type string.'); + } + if (fileName === null || fileName === undefined || typeof fileName.valueOf() !== 'string') { + throw new Error('fileName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{groupName}', encodeURIComponent(groupName)); + requestUrl = requestUrl.replace('{serviceName}', encodeURIComponent(serviceName)); + requestUrl = requestUrl.replace('{projectName}', encodeURIComponent(projectName)); + requestUrl = requestUrl.replace('{fileName}', encodeURIComponent(fileName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Update a file + * + * This method updates an existing file. + * + * @param {object} parameters Information about the file + * + * @param {string} [parameters.etag] HTTP strong entity tag value. This is + * ignored if submitted. + * + * @param {object} [parameters.properties] Custom file properties + * + * @param {string} [parameters.properties.extension] Optional File extension. + * If submitted it should not have a leading period and must match the + * extension from filePath. + * + * @param {string} [parameters.properties.filePath] Relative path of this file + * resource. This property can be set when creating or updating the file + * resource. + * + * @param {string} [parameters.properties.mediaType] File content type. This + * propery can be modified to reflect the file content type. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} fileName Name of the File + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProjectFile} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _update(parameters, groupName, serviceName, projectName, fileName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-07-15-preview'; + // Validate + try { + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (groupName === null || groupName === undefined || typeof groupName.valueOf() !== 'string') { + throw new Error('groupName cannot be null or undefined and it must be of type string.'); + } + if (serviceName === null || serviceName === undefined || typeof serviceName.valueOf() !== 'string') { + throw new Error('serviceName cannot be null or undefined and it must be of type string.'); + } + if (projectName === null || projectName === undefined || typeof projectName.valueOf() !== 'string') { + throw new Error('projectName cannot be null or undefined and it must be of type string.'); + } + if (fileName === null || fileName === undefined || typeof fileName.valueOf() !== 'string') { + throw new Error('fileName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{groupName}', encodeURIComponent(groupName)); + requestUrl = requestUrl.replace('{serviceName}', encodeURIComponent(serviceName)); + requestUrl = requestUrl.replace('{projectName}', encodeURIComponent(projectName)); + requestUrl = requestUrl.replace('{fileName}', encodeURIComponent(fileName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ProjectFile']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ProjectFile']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Request storage information for downloading the file content + * + * This method is used for requesting storage information using which contents + * of the file can be downloaded. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} fileName Name of the File + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FileStorageInfo} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _read(groupName, serviceName, projectName, fileName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-07-15-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (groupName === null || groupName === undefined || typeof groupName.valueOf() !== 'string') { + throw new Error('groupName cannot be null or undefined and it must be of type string.'); + } + if (serviceName === null || serviceName === undefined || typeof serviceName.valueOf() !== 'string') { + throw new Error('serviceName cannot be null or undefined and it must be of type string.'); + } + if (projectName === null || projectName === undefined || typeof projectName.valueOf() !== 'string') { + throw new Error('projectName cannot be null or undefined and it must be of type string.'); + } + if (fileName === null || fileName === undefined || typeof fileName.valueOf() !== 'string') { + throw new Error('fileName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}/read'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{groupName}', encodeURIComponent(groupName)); + requestUrl = requestUrl.replace('{serviceName}', encodeURIComponent(serviceName)); + requestUrl = requestUrl.replace('{projectName}', encodeURIComponent(projectName)); + requestUrl = requestUrl.replace('{fileName}', encodeURIComponent(fileName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['FileStorageInfo']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Request information for reading and writing file content. + * + * This method is used for requesting information for reading and writing the + * file content. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} fileName Name of the File + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FileStorageInfo} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _readWrite(groupName, serviceName, projectName, fileName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-07-15-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (groupName === null || groupName === undefined || typeof groupName.valueOf() !== 'string') { + throw new Error('groupName cannot be null or undefined and it must be of type string.'); + } + if (serviceName === null || serviceName === undefined || typeof serviceName.valueOf() !== 'string') { + throw new Error('serviceName cannot be null or undefined and it must be of type string.'); + } + if (projectName === null || projectName === undefined || typeof projectName.valueOf() !== 'string') { + throw new Error('projectName cannot be null or undefined and it must be of type string.'); + } + if (fileName === null || fileName === undefined || typeof fileName.valueOf() !== 'string') { + throw new Error('fileName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/files/{fileName}/readwrite'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{groupName}', encodeURIComponent(groupName)); + requestUrl = requestUrl.replace('{serviceName}', encodeURIComponent(serviceName)); + requestUrl = requestUrl.replace('{projectName}', encodeURIComponent(projectName)); + requestUrl = requestUrl.replace('{fileName}', encodeURIComponent(fileName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['FileStorageInfo']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Get files in a project + * + * The project resource is a nested resource representing a stored migration + * project. This method returns a list of files owned by a project resource. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FileList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['FileList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a Files. */ +class Files { + /** + * Create a Files. + * @param {DataMigrationServiceClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._deleteMethod = _deleteMethod; + this._update = _update; + this._read = _read; + this._readWrite = _readWrite; + this._listNext = _listNext; + } + + /** + * @summary Get files in a project + * + * The project resource is a nested resource representing a stored migration + * project. This method returns a list of files owned by a project resource. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(groupName, serviceName, projectName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(groupName, serviceName, projectName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get files in a project + * + * The project resource is a nested resource representing a stored migration + * project. This method returns a list of files owned by a project resource. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {FileList} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FileList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(groupName, serviceName, projectName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(groupName, serviceName, projectName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(groupName, serviceName, projectName, options, optionalCallback); + } + } + + /** + * @summary Get file information + * + * The files resource is a nested, proxy-only resource representing a file + * stored under the project resource. This method retrieves information about a + * file. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} fileName Name of the File + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(groupName, serviceName, projectName, fileName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(groupName, serviceName, projectName, fileName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get file information + * + * The files resource is a nested, proxy-only resource representing a file + * stored under the project resource. This method retrieves information about a + * file. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} fileName Name of the File + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ProjectFile} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProjectFile} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(groupName, serviceName, projectName, fileName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(groupName, serviceName, projectName, fileName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(groupName, serviceName, projectName, fileName, options, optionalCallback); + } + } + + /** + * @summary Create a file resource + * + * The PUT method creates a new file or updates an existing one. + * + * @param {object} parameters Information about the file + * + * @param {string} [parameters.etag] HTTP strong entity tag value. This is + * ignored if submitted. + * + * @param {object} [parameters.properties] Custom file properties + * + * @param {string} [parameters.properties.extension] Optional File extension. + * If submitted it should not have a leading period and must match the + * extension from filePath. + * + * @param {string} [parameters.properties.filePath] Relative path of this file + * resource. This property can be set when creating or updating the file + * resource. + * + * @param {string} [parameters.properties.mediaType] File content type. This + * propery can be modified to reflect the file content type. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} fileName Name of the File + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(parameters, groupName, serviceName, projectName, fileName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(parameters, groupName, serviceName, projectName, fileName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Create a file resource + * + * The PUT method creates a new file or updates an existing one. + * + * @param {object} parameters Information about the file + * + * @param {string} [parameters.etag] HTTP strong entity tag value. This is + * ignored if submitted. + * + * @param {object} [parameters.properties] Custom file properties + * + * @param {string} [parameters.properties.extension] Optional File extension. + * If submitted it should not have a leading period and must match the + * extension from filePath. + * + * @param {string} [parameters.properties.filePath] Relative path of this file + * resource. This property can be set when creating or updating the file + * resource. + * + * @param {string} [parameters.properties.mediaType] File content type. This + * propery can be modified to reflect the file content type. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} fileName Name of the File + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ProjectFile} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProjectFile} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(parameters, groupName, serviceName, projectName, fileName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdate(parameters, groupName, serviceName, projectName, fileName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(parameters, groupName, serviceName, projectName, fileName, options, optionalCallback); + } + } + + /** + * @summary Delete file + * + * This method deletes a file. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} fileName Name of the File + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteMethodWithHttpOperationResponse(groupName, serviceName, projectName, fileName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(groupName, serviceName, projectName, fileName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Delete file + * + * This method deletes a file. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} fileName Name of the File + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(groupName, serviceName, projectName, fileName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(groupName, serviceName, projectName, fileName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(groupName, serviceName, projectName, fileName, options, optionalCallback); + } + } + + /** + * @summary Update a file + * + * This method updates an existing file. + * + * @param {object} parameters Information about the file + * + * @param {string} [parameters.etag] HTTP strong entity tag value. This is + * ignored if submitted. + * + * @param {object} [parameters.properties] Custom file properties + * + * @param {string} [parameters.properties.extension] Optional File extension. + * If submitted it should not have a leading period and must match the + * extension from filePath. + * + * @param {string} [parameters.properties.filePath] Relative path of this file + * resource. This property can be set when creating or updating the file + * resource. + * + * @param {string} [parameters.properties.mediaType] File content type. This + * propery can be modified to reflect the file content type. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} fileName Name of the File + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateWithHttpOperationResponse(parameters, groupName, serviceName, projectName, fileName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(parameters, groupName, serviceName, projectName, fileName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Update a file + * + * This method updates an existing file. + * + * @param {object} parameters Information about the file + * + * @param {string} [parameters.etag] HTTP strong entity tag value. This is + * ignored if submitted. + * + * @param {object} [parameters.properties] Custom file properties + * + * @param {string} [parameters.properties.extension] Optional File extension. + * If submitted it should not have a leading period and must match the + * extension from filePath. + * + * @param {string} [parameters.properties.filePath] Relative path of this file + * resource. This property can be set when creating or updating the file + * resource. + * + * @param {string} [parameters.properties.mediaType] File content type. This + * propery can be modified to reflect the file content type. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} fileName Name of the File + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ProjectFile} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProjectFile} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + update(parameters, groupName, serviceName, projectName, fileName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._update(parameters, groupName, serviceName, projectName, fileName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(parameters, groupName, serviceName, projectName, fileName, options, optionalCallback); + } + } + + /** + * @summary Request storage information for downloading the file content + * + * This method is used for requesting storage information using which contents + * of the file can be downloaded. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} fileName Name of the File + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + readWithHttpOperationResponse(groupName, serviceName, projectName, fileName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._read(groupName, serviceName, projectName, fileName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Request storage information for downloading the file content + * + * This method is used for requesting storage information using which contents + * of the file can be downloaded. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} fileName Name of the File + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {FileStorageInfo} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FileStorageInfo} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + read(groupName, serviceName, projectName, fileName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._read(groupName, serviceName, projectName, fileName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._read(groupName, serviceName, projectName, fileName, options, optionalCallback); + } + } + + /** + * @summary Request information for reading and writing file content. + * + * This method is used for requesting information for reading and writing the + * file content. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} fileName Name of the File + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + readWriteWithHttpOperationResponse(groupName, serviceName, projectName, fileName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._readWrite(groupName, serviceName, projectName, fileName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Request information for reading and writing file content. + * + * This method is used for requesting information for reading and writing the + * file content. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} fileName Name of the File + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {FileStorageInfo} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FileStorageInfo} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + readWrite(groupName, serviceName, projectName, fileName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._readWrite(groupName, serviceName, projectName, fileName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._readWrite(groupName, serviceName, projectName, fileName, options, optionalCallback); + } + } + + /** + * @summary Get files in a project + * + * The project resource is a nested resource representing a stored migration + * project. This method returns a list of files owned by a project resource. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get files in a project + * + * The project resource is a nested resource representing a stored migration + * project. This method returns a list of files owned by a project resource. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {FileList} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FileList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = Files; diff --git a/lib/services/datamigrationManagement/lib/operations/index.d.ts b/lib/services/datamigrationManagement/lib/operations/index.d.ts new file mode 100644 index 0000000000..0c2f8a73ce --- /dev/null +++ b/lib/services/datamigrationManagement/lib/operations/index.d.ts @@ -0,0 +1,3948 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. +*/ + +import { ServiceClientOptions, RequestOptions, ServiceCallback, HttpOperationResponse } from 'ms-rest'; +import * as models from '../models'; + + +/** + * @class + * ResourceSkus + * __NOTE__: An instance of this class is automatically created for an + * instance of the DataMigrationServiceClient. + */ +export interface ResourceSkus { + + + /** + * @summary Get supported SKUs + * + * The skus action returns the list of SKUs that DMS supports. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listSkusWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get supported SKUs + * + * The skus action returns the list of SKUs that DMS supports. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ResourceSkusResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ResourceSkusResult} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceSkusResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listSkus(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSkus(callback: ServiceCallback): void; + listSkus(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get supported SKUs + * + * The skus action returns the list of SKUs that DMS supports. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listSkusNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get supported SKUs + * + * The skus action returns the list of SKUs that DMS supports. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ResourceSkusResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ResourceSkusResult} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceSkusResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listSkusNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSkusNext(nextPageLink: string, callback: ServiceCallback): void; + listSkusNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Services + * __NOTE__: An instance of this class is automatically created for an + * instance of the DataMigrationServiceClient. + */ +export interface Services { + + + /** + * @summary Create or update DMS Instance + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The PUT method creates a new service or updates an + * existing one. When a service is updated, existing child resources (i.e. + * tasks) are unaffected. Services currently support a single kind, "vm", which + * refers to a VM-based service, although other kinds may be added in the + * future. This method can change the kind, SKU, and network of the service, + * but if tasks are currently running (i.e. the service is busy), this will + * fail with 400 Bad Request ("ServiceIsBusy"). The provider will reply when + * successful with 200 OK or 201 Created. Long-running operations use the + * provisioningState property. + * + * @param {object} parameters Information about the service + * + * @param {string} [parameters.etag] HTTP strong entity tag value. Ignored if + * submitted + * + * @param {string} [parameters.kind] The resource kind. Only 'vm' (the default) + * is supported. + * + * @param {string} [parameters.publicKey] The public key of the service, used + * to encrypt secrets sent to the service + * + * @param {string} parameters.virtualSubnetId The ID of the + * Microsoft.Network/virtualNetworks/subnets resource to which the service + * should be joined + * + * @param {object} [parameters.sku] Service SKU + * + * @param {string} [parameters.sku.name] The unique name of the SKU, such as + * 'P3' + * + * @param {string} [parameters.sku.tier] The tier of the SKU, such as 'Basic', + * 'General Purpose', or 'Business Critical' + * + * @param {string} [parameters.sku.family] The SKU family, used when the + * service has multiple performance classes within a tier, such as 'A', 'D', + * etc. for virtual machines + * + * @param {string} [parameters.sku.size] The size of the SKU, used when the + * name alone does not denote a service size or when a SKU has multiple + * performance classes within a family, e.g. 'A1' for virtual machines + * + * @param {number} [parameters.sku.capacity] The capacity of the SKU, if it + * supports scaling + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(parameters: models.DataMigrationService, groupName: string, serviceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Create or update DMS Instance + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The PUT method creates a new service or updates an + * existing one. When a service is updated, existing child resources (i.e. + * tasks) are unaffected. Services currently support a single kind, "vm", which + * refers to a VM-based service, although other kinds may be added in the + * future. This method can change the kind, SKU, and network of the service, + * but if tasks are currently running (i.e. the service is busy), this will + * fail with 400 Bad Request ("ServiceIsBusy"). The provider will reply when + * successful with 200 OK or 201 Created. Long-running operations use the + * provisioningState property. + * + * @param {object} parameters Information about the service + * + * @param {string} [parameters.etag] HTTP strong entity tag value. Ignored if + * submitted + * + * @param {string} [parameters.kind] The resource kind. Only 'vm' (the default) + * is supported. + * + * @param {string} [parameters.publicKey] The public key of the service, used + * to encrypt secrets sent to the service + * + * @param {string} parameters.virtualSubnetId The ID of the + * Microsoft.Network/virtualNetworks/subnets resource to which the service + * should be joined + * + * @param {object} [parameters.sku] Service SKU + * + * @param {string} [parameters.sku.name] The unique name of the SKU, such as + * 'P3' + * + * @param {string} [parameters.sku.tier] The tier of the SKU, such as 'Basic', + * 'General Purpose', or 'Business Critical' + * + * @param {string} [parameters.sku.family] The SKU family, used when the + * service has multiple performance classes within a tier, such as 'A', 'D', + * etc. for virtual machines + * + * @param {string} [parameters.sku.size] The size of the SKU, used when the + * name alone does not denote a service size or when a SKU has multiple + * performance classes within a family, e.g. 'A1' for virtual machines + * + * @param {number} [parameters.sku.capacity] The capacity of the SKU, if it + * supports scaling + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DataMigrationService} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DataMigrationService} [result] - The deserialized result object if an error did not occur. + * See {@link DataMigrationService} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(parameters: models.DataMigrationService, groupName: string, serviceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(parameters: models.DataMigrationService, groupName: string, serviceName: string, callback: ServiceCallback): void; + createOrUpdate(parameters: models.DataMigrationService, groupName: string, serviceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get DMS Service Instance + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The GET method retrieves information about a service + * instance. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(groupName: string, serviceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get DMS Service Instance + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The GET method retrieves information about a service + * instance. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DataMigrationService} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DataMigrationService} [result] - The deserialized result object if an error did not occur. + * See {@link DataMigrationService} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(groupName: string, serviceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(groupName: string, serviceName: string, callback: ServiceCallback): void; + get(groupName: string, serviceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Delete DMS Service Instance + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The DELETE method deletes a service. Any running tasks + * will be canceled. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.deleteRunningTasks] Delete the resource even if it + * contains running tasks + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(groupName: string, serviceName: string, options?: { deleteRunningTasks? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Delete DMS Service Instance + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The DELETE method deletes a service. Any running tasks + * will be canceled. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.deleteRunningTasks] Delete the resource even if it + * contains running tasks + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(groupName: string, serviceName: string, options?: { deleteRunningTasks? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(groupName: string, serviceName: string, callback: ServiceCallback): void; + deleteMethod(groupName: string, serviceName: string, options: { deleteRunningTasks? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Create or update DMS Service Instance + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The PATCH method updates an existing service. This method + * can change the kind, SKU, and network of the service, but if tasks are + * currently running (i.e. the service is busy), this will fail with 400 Bad + * Request ("ServiceIsBusy"). + * + * @param {object} parameters Information about the service + * + * @param {string} [parameters.etag] HTTP strong entity tag value. Ignored if + * submitted + * + * @param {string} [parameters.kind] The resource kind. Only 'vm' (the default) + * is supported. + * + * @param {string} [parameters.publicKey] The public key of the service, used + * to encrypt secrets sent to the service + * + * @param {string} parameters.virtualSubnetId The ID of the + * Microsoft.Network/virtualNetworks/subnets resource to which the service + * should be joined + * + * @param {object} [parameters.sku] Service SKU + * + * @param {string} [parameters.sku.name] The unique name of the SKU, such as + * 'P3' + * + * @param {string} [parameters.sku.tier] The tier of the SKU, such as 'Basic', + * 'General Purpose', or 'Business Critical' + * + * @param {string} [parameters.sku.family] The SKU family, used when the + * service has multiple performance classes within a tier, such as 'A', 'D', + * etc. for virtual machines + * + * @param {string} [parameters.sku.size] The size of the SKU, used when the + * name alone does not denote a service size or when a SKU has multiple + * performance classes within a family, e.g. 'A1' for virtual machines + * + * @param {number} [parameters.sku.capacity] The capacity of the SKU, if it + * supports scaling + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateWithHttpOperationResponse(parameters: models.DataMigrationService, groupName: string, serviceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Create or update DMS Service Instance + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The PATCH method updates an existing service. This method + * can change the kind, SKU, and network of the service, but if tasks are + * currently running (i.e. the service is busy), this will fail with 400 Bad + * Request ("ServiceIsBusy"). + * + * @param {object} parameters Information about the service + * + * @param {string} [parameters.etag] HTTP strong entity tag value. Ignored if + * submitted + * + * @param {string} [parameters.kind] The resource kind. Only 'vm' (the default) + * is supported. + * + * @param {string} [parameters.publicKey] The public key of the service, used + * to encrypt secrets sent to the service + * + * @param {string} parameters.virtualSubnetId The ID of the + * Microsoft.Network/virtualNetworks/subnets resource to which the service + * should be joined + * + * @param {object} [parameters.sku] Service SKU + * + * @param {string} [parameters.sku.name] The unique name of the SKU, such as + * 'P3' + * + * @param {string} [parameters.sku.tier] The tier of the SKU, such as 'Basic', + * 'General Purpose', or 'Business Critical' + * + * @param {string} [parameters.sku.family] The SKU family, used when the + * service has multiple performance classes within a tier, such as 'A', 'D', + * etc. for virtual machines + * + * @param {string} [parameters.sku.size] The size of the SKU, used when the + * name alone does not denote a service size or when a SKU has multiple + * performance classes within a family, e.g. 'A1' for virtual machines + * + * @param {number} [parameters.sku.capacity] The capacity of the SKU, if it + * supports scaling + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DataMigrationService} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DataMigrationService} [result] - The deserialized result object if an error did not occur. + * See {@link DataMigrationService} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + update(parameters: models.DataMigrationService, groupName: string, serviceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(parameters: models.DataMigrationService, groupName: string, serviceName: string, callback: ServiceCallback): void; + update(parameters: models.DataMigrationService, groupName: string, serviceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Check service health status + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This action performs a health check and returns the + * status of the service and virtual machine size. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + checkStatusWithHttpOperationResponse(groupName: string, serviceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Check service health status + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This action performs a health check and returns the + * status of the service and virtual machine size. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DataMigrationServiceStatusResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DataMigrationServiceStatusResponse} [result] - The deserialized result object if an error did not occur. + * See {@link DataMigrationServiceStatusResponse} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + checkStatus(groupName: string, serviceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + checkStatus(groupName: string, serviceName: string, callback: ServiceCallback): void; + checkStatus(groupName: string, serviceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Start service + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This action starts the service and the service can be + * used for data migration. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + startWithHttpOperationResponse(groupName: string, serviceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Start service + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This action starts the service and the service can be + * used for data migration. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + start(groupName: string, serviceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + start(groupName: string, serviceName: string, callback: ServiceCallback): void; + start(groupName: string, serviceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Stop service + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This action stops the service and the service cannot be + * used for data migration. The service owner won't be billed when the service + * is stopped. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + stopWithHttpOperationResponse(groupName: string, serviceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Stop service + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This action stops the service and the service cannot be + * used for data migration. The service owner won't be billed when the service + * is stopped. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + stop(groupName: string, serviceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + stop(groupName: string, serviceName: string, callback: ServiceCallback): void; + stop(groupName: string, serviceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get compatible SKUs + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The skus action returns the list of SKUs that a service + * resource can be updated to. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listSkusWithHttpOperationResponse(groupName: string, serviceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get compatible SKUs + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The skus action returns the list of SKUs that a service + * resource can be updated to. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ServiceSkuList} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ServiceSkuList} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceSkuList} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listSkus(groupName: string, serviceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSkus(groupName: string, serviceName: string, callback: ServiceCallback): void; + listSkus(groupName: string, serviceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Check nested resource name validity and availability + * + * This method checks whether a proposed nested resource name is valid and + * available. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} parameters Requested name to validate + * + * @param {string} [parameters.name] The proposed resource name + * + * @param {string} [parameters.type] The resource type chain (e.g. + * virtualMachines/extensions) + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + checkChildrenNameAvailabilityWithHttpOperationResponse(groupName: string, serviceName: string, parameters: models.NameAvailabilityRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Check nested resource name validity and availability + * + * This method checks whether a proposed nested resource name is valid and + * available. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} parameters Requested name to validate + * + * @param {string} [parameters.name] The proposed resource name + * + * @param {string} [parameters.type] The resource type chain (e.g. + * virtualMachines/extensions) + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {NameAvailabilityResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {NameAvailabilityResponse} [result] - The deserialized result object if an error did not occur. + * See {@link NameAvailabilityResponse} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + checkChildrenNameAvailability(groupName: string, serviceName: string, parameters: models.NameAvailabilityRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + checkChildrenNameAvailability(groupName: string, serviceName: string, parameters: models.NameAvailabilityRequest, callback: ServiceCallback): void; + checkChildrenNameAvailability(groupName: string, serviceName: string, parameters: models.NameAvailabilityRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get services in resource group + * + * The Services resource is the top-level resource that represents the Database + * Migration Service. This method returns a list of service resources in a + * resource group. + * + * @param {string} groupName Name of the resource group + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByResourceGroupWithHttpOperationResponse(groupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get services in resource group + * + * The Services resource is the top-level resource that represents the Database + * Migration Service. This method returns a list of service resources in a + * resource group. + * + * @param {string} groupName Name of the resource group + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DataMigrationServiceList} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DataMigrationServiceList} [result] - The deserialized result object if an error did not occur. + * See {@link DataMigrationServiceList} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroup(groupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroup(groupName: string, callback: ServiceCallback): void; + listByResourceGroup(groupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get services in subscription + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This method returns a list of service resources in a + * subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get services in subscription + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This method returns a list of service resources in a + * subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DataMigrationServiceList} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DataMigrationServiceList} [result] - The deserialized result object if an error did not occur. + * See {@link DataMigrationServiceList} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Check name validity and availability + * + * This method checks whether a proposed top-level resource name is valid and + * available. + * + * @param {string} location The Azure region of the operation + * + * @param {object} parameters Requested name to validate + * + * @param {string} [parameters.name] The proposed resource name + * + * @param {string} [parameters.type] The resource type chain (e.g. + * virtualMachines/extensions) + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + checkNameAvailabilityWithHttpOperationResponse(location: string, parameters: models.NameAvailabilityRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Check name validity and availability + * + * This method checks whether a proposed top-level resource name is valid and + * available. + * + * @param {string} location The Azure region of the operation + * + * @param {object} parameters Requested name to validate + * + * @param {string} [parameters.name] The proposed resource name + * + * @param {string} [parameters.type] The resource type chain (e.g. + * virtualMachines/extensions) + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {NameAvailabilityResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {NameAvailabilityResponse} [result] - The deserialized result object if an error did not occur. + * See {@link NameAvailabilityResponse} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + checkNameAvailability(location: string, parameters: models.NameAvailabilityRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + checkNameAvailability(location: string, parameters: models.NameAvailabilityRequest, callback: ServiceCallback): void; + checkNameAvailability(location: string, parameters: models.NameAvailabilityRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Create or update DMS Instance + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The PUT method creates a new service or updates an + * existing one. When a service is updated, existing child resources (i.e. + * tasks) are unaffected. Services currently support a single kind, "vm", which + * refers to a VM-based service, although other kinds may be added in the + * future. This method can change the kind, SKU, and network of the service, + * but if tasks are currently running (i.e. the service is busy), this will + * fail with 400 Bad Request ("ServiceIsBusy"). The provider will reply when + * successful with 200 OK or 201 Created. Long-running operations use the + * provisioningState property. + * + * @param {object} parameters Information about the service + * + * @param {string} [parameters.etag] HTTP strong entity tag value. Ignored if + * submitted + * + * @param {string} [parameters.kind] The resource kind. Only 'vm' (the default) + * is supported. + * + * @param {string} [parameters.publicKey] The public key of the service, used + * to encrypt secrets sent to the service + * + * @param {string} parameters.virtualSubnetId The ID of the + * Microsoft.Network/virtualNetworks/subnets resource to which the service + * should be joined + * + * @param {object} [parameters.sku] Service SKU + * + * @param {string} [parameters.sku.name] The unique name of the SKU, such as + * 'P3' + * + * @param {string} [parameters.sku.tier] The tier of the SKU, such as 'Basic', + * 'General Purpose', or 'Business Critical' + * + * @param {string} [parameters.sku.family] The SKU family, used when the + * service has multiple performance classes within a tier, such as 'A', 'D', + * etc. for virtual machines + * + * @param {string} [parameters.sku.size] The size of the SKU, used when the + * name alone does not denote a service size or when a SKU has multiple + * performance classes within a family, e.g. 'A1' for virtual machines + * + * @param {number} [parameters.sku.capacity] The capacity of the SKU, if it + * supports scaling + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(parameters: models.DataMigrationService, groupName: string, serviceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Create or update DMS Instance + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The PUT method creates a new service or updates an + * existing one. When a service is updated, existing child resources (i.e. + * tasks) are unaffected. Services currently support a single kind, "vm", which + * refers to a VM-based service, although other kinds may be added in the + * future. This method can change the kind, SKU, and network of the service, + * but if tasks are currently running (i.e. the service is busy), this will + * fail with 400 Bad Request ("ServiceIsBusy"). The provider will reply when + * successful with 200 OK or 201 Created. Long-running operations use the + * provisioningState property. + * + * @param {object} parameters Information about the service + * + * @param {string} [parameters.etag] HTTP strong entity tag value. Ignored if + * submitted + * + * @param {string} [parameters.kind] The resource kind. Only 'vm' (the default) + * is supported. + * + * @param {string} [parameters.publicKey] The public key of the service, used + * to encrypt secrets sent to the service + * + * @param {string} parameters.virtualSubnetId The ID of the + * Microsoft.Network/virtualNetworks/subnets resource to which the service + * should be joined + * + * @param {object} [parameters.sku] Service SKU + * + * @param {string} [parameters.sku.name] The unique name of the SKU, such as + * 'P3' + * + * @param {string} [parameters.sku.tier] The tier of the SKU, such as 'Basic', + * 'General Purpose', or 'Business Critical' + * + * @param {string} [parameters.sku.family] The SKU family, used when the + * service has multiple performance classes within a tier, such as 'A', 'D', + * etc. for virtual machines + * + * @param {string} [parameters.sku.size] The size of the SKU, used when the + * name alone does not denote a service size or when a SKU has multiple + * performance classes within a family, e.g. 'A1' for virtual machines + * + * @param {number} [parameters.sku.capacity] The capacity of the SKU, if it + * supports scaling + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DataMigrationService} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DataMigrationService} [result] - The deserialized result object if an error did not occur. + * See {@link DataMigrationService} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(parameters: models.DataMigrationService, groupName: string, serviceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(parameters: models.DataMigrationService, groupName: string, serviceName: string, callback: ServiceCallback): void; + beginCreateOrUpdate(parameters: models.DataMigrationService, groupName: string, serviceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Delete DMS Service Instance + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The DELETE method deletes a service. Any running tasks + * will be canceled. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.deleteRunningTasks] Delete the resource even if it + * contains running tasks + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(groupName: string, serviceName: string, options?: { deleteRunningTasks? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Delete DMS Service Instance + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The DELETE method deletes a service. Any running tasks + * will be canceled. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.deleteRunningTasks] Delete the resource even if it + * contains running tasks + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(groupName: string, serviceName: string, options?: { deleteRunningTasks? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(groupName: string, serviceName: string, callback: ServiceCallback): void; + beginDeleteMethod(groupName: string, serviceName: string, options: { deleteRunningTasks? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Create or update DMS Service Instance + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The PATCH method updates an existing service. This method + * can change the kind, SKU, and network of the service, but if tasks are + * currently running (i.e. the service is busy), this will fail with 400 Bad + * Request ("ServiceIsBusy"). + * + * @param {object} parameters Information about the service + * + * @param {string} [parameters.etag] HTTP strong entity tag value. Ignored if + * submitted + * + * @param {string} [parameters.kind] The resource kind. Only 'vm' (the default) + * is supported. + * + * @param {string} [parameters.publicKey] The public key of the service, used + * to encrypt secrets sent to the service + * + * @param {string} parameters.virtualSubnetId The ID of the + * Microsoft.Network/virtualNetworks/subnets resource to which the service + * should be joined + * + * @param {object} [parameters.sku] Service SKU + * + * @param {string} [parameters.sku.name] The unique name of the SKU, such as + * 'P3' + * + * @param {string} [parameters.sku.tier] The tier of the SKU, such as 'Basic', + * 'General Purpose', or 'Business Critical' + * + * @param {string} [parameters.sku.family] The SKU family, used when the + * service has multiple performance classes within a tier, such as 'A', 'D', + * etc. for virtual machines + * + * @param {string} [parameters.sku.size] The size of the SKU, used when the + * name alone does not denote a service size or when a SKU has multiple + * performance classes within a family, e.g. 'A1' for virtual machines + * + * @param {number} [parameters.sku.capacity] The capacity of the SKU, if it + * supports scaling + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginUpdateWithHttpOperationResponse(parameters: models.DataMigrationService, groupName: string, serviceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Create or update DMS Service Instance + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The PATCH method updates an existing service. This method + * can change the kind, SKU, and network of the service, but if tasks are + * currently running (i.e. the service is busy), this will fail with 400 Bad + * Request ("ServiceIsBusy"). + * + * @param {object} parameters Information about the service + * + * @param {string} [parameters.etag] HTTP strong entity tag value. Ignored if + * submitted + * + * @param {string} [parameters.kind] The resource kind. Only 'vm' (the default) + * is supported. + * + * @param {string} [parameters.publicKey] The public key of the service, used + * to encrypt secrets sent to the service + * + * @param {string} parameters.virtualSubnetId The ID of the + * Microsoft.Network/virtualNetworks/subnets resource to which the service + * should be joined + * + * @param {object} [parameters.sku] Service SKU + * + * @param {string} [parameters.sku.name] The unique name of the SKU, such as + * 'P3' + * + * @param {string} [parameters.sku.tier] The tier of the SKU, such as 'Basic', + * 'General Purpose', or 'Business Critical' + * + * @param {string} [parameters.sku.family] The SKU family, used when the + * service has multiple performance classes within a tier, such as 'A', 'D', + * etc. for virtual machines + * + * @param {string} [parameters.sku.size] The size of the SKU, used when the + * name alone does not denote a service size or when a SKU has multiple + * performance classes within a family, e.g. 'A1' for virtual machines + * + * @param {number} [parameters.sku.capacity] The capacity of the SKU, if it + * supports scaling + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DataMigrationService} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DataMigrationService} [result] - The deserialized result object if an error did not occur. + * See {@link DataMigrationService} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdate(parameters: models.DataMigrationService, groupName: string, serviceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(parameters: models.DataMigrationService, groupName: string, serviceName: string, callback: ServiceCallback): void; + beginUpdate(parameters: models.DataMigrationService, groupName: string, serviceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Start service + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This action starts the service and the service can be + * used for data migration. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginStartWithHttpOperationResponse(groupName: string, serviceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Start service + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This action starts the service and the service can be + * used for data migration. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginStart(groupName: string, serviceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginStart(groupName: string, serviceName: string, callback: ServiceCallback): void; + beginStart(groupName: string, serviceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Stop service + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This action stops the service and the service cannot be + * used for data migration. The service owner won't be billed when the service + * is stopped. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginStopWithHttpOperationResponse(groupName: string, serviceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Stop service + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This action stops the service and the service cannot be + * used for data migration. The service owner won't be billed when the service + * is stopped. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginStop(groupName: string, serviceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginStop(groupName: string, serviceName: string, callback: ServiceCallback): void; + beginStop(groupName: string, serviceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get compatible SKUs + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The skus action returns the list of SKUs that a service + * resource can be updated to. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listSkusNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get compatible SKUs + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The skus action returns the list of SKUs that a service + * resource can be updated to. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ServiceSkuList} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ServiceSkuList} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceSkuList} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listSkusNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSkusNext(nextPageLink: string, callback: ServiceCallback): void; + listSkusNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get services in resource group + * + * The Services resource is the top-level resource that represents the Database + * Migration Service. This method returns a list of service resources in a + * resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get services in resource group + * + * The Services resource is the top-level resource that represents the Database + * Migration Service. This method returns a list of service resources in a + * resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DataMigrationServiceList} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DataMigrationServiceList} [result] - The deserialized result object if an error did not occur. + * See {@link DataMigrationServiceList} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get services in subscription + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This method returns a list of service resources in a + * subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get services in subscription + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This method returns a list of service resources in a + * subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DataMigrationServiceList} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DataMigrationServiceList} [result] - The deserialized result object if an error did not occur. + * See {@link DataMigrationServiceList} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Tasks + * __NOTE__: An instance of this class is automatically created for an + * instance of the DataMigrationServiceClient. + */ +export interface Tasks { + + + /** + * @summary Get tasks in a service + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This method returns a list of tasks owned by a service + * resource. Some tasks may have a status of Unknown, which indicates that an + * error occurred while querying the status of that task. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.taskType] Filter tasks by task type + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(groupName: string, serviceName: string, projectName: string, options?: { taskType? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get tasks in a service + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This method returns a list of tasks owned by a service + * resource. Some tasks may have a status of Unknown, which indicates that an + * error occurred while querying the status of that task. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.taskType] Filter tasks by task type + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {TaskList} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {TaskList} [result] - The deserialized result object if an error did not occur. + * See {@link TaskList} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(groupName: string, serviceName: string, projectName: string, options?: { taskType? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + list(groupName: string, serviceName: string, projectName: string, callback: ServiceCallback): void; + list(groupName: string, serviceName: string, projectName: string, options: { taskType? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Create or update task + * + * The tasks resource is a nested, proxy-only resource representing work + * performed by a DMS instance. The PUT method creates a new task or updates an + * existing one, although since tasks have no mutable custom properties, there + * is little reason to update an exising one. + * + * @param {object} parameters Information about the task + * + * @param {string} [parameters.etag] HTTP strong entity tag value. This is + * ignored if submitted. + * + * @param {object} [parameters.properties] Custom task properties + * + * @param {string} parameters.properties.taskType Polymorphic Discriminator + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} taskName Name of the Task + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(parameters: models.ProjectTask, groupName: string, serviceName: string, projectName: string, taskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Create or update task + * + * The tasks resource is a nested, proxy-only resource representing work + * performed by a DMS instance. The PUT method creates a new task or updates an + * existing one, although since tasks have no mutable custom properties, there + * is little reason to update an exising one. + * + * @param {object} parameters Information about the task + * + * @param {string} [parameters.etag] HTTP strong entity tag value. This is + * ignored if submitted. + * + * @param {object} [parameters.properties] Custom task properties + * + * @param {string} parameters.properties.taskType Polymorphic Discriminator + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} taskName Name of the Task + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ProjectTask} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ProjectTask} [result] - The deserialized result object if an error did not occur. + * See {@link ProjectTask} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(parameters: models.ProjectTask, groupName: string, serviceName: string, projectName: string, taskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(parameters: models.ProjectTask, groupName: string, serviceName: string, projectName: string, taskName: string, callback: ServiceCallback): void; + createOrUpdate(parameters: models.ProjectTask, groupName: string, serviceName: string, projectName: string, taskName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get task information + * + * The tasks resource is a nested, proxy-only resource representing work + * performed by a DMS instance. The GET method retrieves information about a + * task. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} taskName Name of the Task + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expand the response + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(groupName: string, serviceName: string, projectName: string, taskName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get task information + * + * The tasks resource is a nested, proxy-only resource representing work + * performed by a DMS instance. The GET method retrieves information about a + * task. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} taskName Name of the Task + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expand the response + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ProjectTask} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ProjectTask} [result] - The deserialized result object if an error did not occur. + * See {@link ProjectTask} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(groupName: string, serviceName: string, projectName: string, taskName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + get(groupName: string, serviceName: string, projectName: string, taskName: string, callback: ServiceCallback): void; + get(groupName: string, serviceName: string, projectName: string, taskName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Delete task + * + * The tasks resource is a nested, proxy-only resource representing work + * performed by a DMS instance. The DELETE method deletes a task, canceling it + * first if it's running. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} taskName Name of the Task + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.deleteRunningTasks] Delete the resource even if it + * contains running tasks + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(groupName: string, serviceName: string, projectName: string, taskName: string, options?: { deleteRunningTasks? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Delete task + * + * The tasks resource is a nested, proxy-only resource representing work + * performed by a DMS instance. The DELETE method deletes a task, canceling it + * first if it's running. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} taskName Name of the Task + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.deleteRunningTasks] Delete the resource even if it + * contains running tasks + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(groupName: string, serviceName: string, projectName: string, taskName: string, options?: { deleteRunningTasks? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(groupName: string, serviceName: string, projectName: string, taskName: string, callback: ServiceCallback): void; + deleteMethod(groupName: string, serviceName: string, projectName: string, taskName: string, options: { deleteRunningTasks? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Create or update task + * + * The tasks resource is a nested, proxy-only resource representing work + * performed by a DMS instance. The PATCH method updates an existing task, but + * since tasks have no mutable custom properties, there is little reason to do + * so. + * + * @param {object} parameters Information about the task + * + * @param {string} [parameters.etag] HTTP strong entity tag value. This is + * ignored if submitted. + * + * @param {object} [parameters.properties] Custom task properties + * + * @param {string} parameters.properties.taskType Polymorphic Discriminator + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} taskName Name of the Task + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateWithHttpOperationResponse(parameters: models.ProjectTask, groupName: string, serviceName: string, projectName: string, taskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Create or update task + * + * The tasks resource is a nested, proxy-only resource representing work + * performed by a DMS instance. The PATCH method updates an existing task, but + * since tasks have no mutable custom properties, there is little reason to do + * so. + * + * @param {object} parameters Information about the task + * + * @param {string} [parameters.etag] HTTP strong entity tag value. This is + * ignored if submitted. + * + * @param {object} [parameters.properties] Custom task properties + * + * @param {string} parameters.properties.taskType Polymorphic Discriminator + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} taskName Name of the Task + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ProjectTask} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ProjectTask} [result] - The deserialized result object if an error did not occur. + * See {@link ProjectTask} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + update(parameters: models.ProjectTask, groupName: string, serviceName: string, projectName: string, taskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(parameters: models.ProjectTask, groupName: string, serviceName: string, projectName: string, taskName: string, callback: ServiceCallback): void; + update(parameters: models.ProjectTask, groupName: string, serviceName: string, projectName: string, taskName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Cancel a task + * + * The tasks resource is a nested, proxy-only resource representing work + * performed by a DMS instance. This method cancels a task if it's currently + * queued or running. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} taskName Name of the Task + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + cancelWithHttpOperationResponse(groupName: string, serviceName: string, projectName: string, taskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Cancel a task + * + * The tasks resource is a nested, proxy-only resource representing work + * performed by a DMS instance. This method cancels a task if it's currently + * queued or running. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} taskName Name of the Task + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ProjectTask} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ProjectTask} [result] - The deserialized result object if an error did not occur. + * See {@link ProjectTask} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + cancel(groupName: string, serviceName: string, projectName: string, taskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + cancel(groupName: string, serviceName: string, projectName: string, taskName: string, callback: ServiceCallback): void; + cancel(groupName: string, serviceName: string, projectName: string, taskName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Execute a command on a task + * + * The tasks resource is a nested, proxy-only resource representing work + * performed by a DMS instance. This method executes a command on a running + * task. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} taskName Name of the Task + * + * @param {object} parameters Command to execute + * + * @param {string} parameters.commandType Polymorphic Discriminator + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + commandWithHttpOperationResponse(groupName: string, serviceName: string, projectName: string, taskName: string, parameters: models.CommandProperties, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Execute a command on a task + * + * The tasks resource is a nested, proxy-only resource representing work + * performed by a DMS instance. This method executes a command on a running + * task. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} taskName Name of the Task + * + * @param {object} parameters Command to execute + * + * @param {string} parameters.commandType Polymorphic Discriminator + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {CommandProperties} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {CommandProperties} [result] - The deserialized result object if an error did not occur. + * See {@link CommandProperties} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + command(groupName: string, serviceName: string, projectName: string, taskName: string, parameters: models.CommandProperties, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + command(groupName: string, serviceName: string, projectName: string, taskName: string, parameters: models.CommandProperties, callback: ServiceCallback): void; + command(groupName: string, serviceName: string, projectName: string, taskName: string, parameters: models.CommandProperties, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get tasks in a service + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This method returns a list of tasks owned by a service + * resource. Some tasks may have a status of Unknown, which indicates that an + * error occurred while querying the status of that task. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get tasks in a service + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This method returns a list of tasks owned by a service + * resource. Some tasks may have a status of Unknown, which indicates that an + * error occurred while querying the status of that task. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {TaskList} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {TaskList} [result] - The deserialized result object if an error did not occur. + * See {@link TaskList} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Projects + * __NOTE__: An instance of this class is automatically created for an + * instance of the DataMigrationServiceClient. + */ +export interface Projects { + + + /** + * @summary Get projects in a service + * + * The project resource is a nested resource representing a stored migration + * project. This method returns a list of projects owned by a service resource. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(groupName: string, serviceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get projects in a service + * + * The project resource is a nested resource representing a stored migration + * project. This method returns a list of projects owned by a service resource. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ProjectList} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ProjectList} [result] - The deserialized result object if an error did not occur. + * See {@link ProjectList} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(groupName: string, serviceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(groupName: string, serviceName: string, callback: ServiceCallback): void; + list(groupName: string, serviceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Create or update project + * + * The project resource is a nested resource representing a stored migration + * project. The PUT method creates a new project or updates an existing one. + * + * @param {object} parameters Information about the project + * + * @param {string} parameters.sourcePlatform Source platform for the project. + * Possible values include: 'SQL', 'MySQL', 'PostgreSql', 'MongoDb', 'Unknown' + * + * @param {string} parameters.targetPlatform Target platform for the project. + * Possible values include: 'SQLDB', 'SQLMI', 'AzureDbForMySql', + * 'AzureDbForPostgreSql', 'MongoDb', 'Unknown' + * + * @param {object} [parameters.sourceConnectionInfo] Information for connecting + * to source + * + * @param {object} [parameters.targetConnectionInfo] Information for connecting + * to target + * + * @param {string} [parameters.targetConnectionInfo.userName] User name + * + * @param {string} [parameters.targetConnectionInfo.password] Password + * credential. + * + * @param {string} parameters.targetConnectionInfo.type Polymorphic + * Discriminator + * + * @param {array} [parameters.databasesInfo] List of DatabaseInfo + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(parameters: models.Project, groupName: string, serviceName: string, projectName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Create or update project + * + * The project resource is a nested resource representing a stored migration + * project. The PUT method creates a new project or updates an existing one. + * + * @param {object} parameters Information about the project + * + * @param {string} parameters.sourcePlatform Source platform for the project. + * Possible values include: 'SQL', 'MySQL', 'PostgreSql', 'MongoDb', 'Unknown' + * + * @param {string} parameters.targetPlatform Target platform for the project. + * Possible values include: 'SQLDB', 'SQLMI', 'AzureDbForMySql', + * 'AzureDbForPostgreSql', 'MongoDb', 'Unknown' + * + * @param {object} [parameters.sourceConnectionInfo] Information for connecting + * to source + * + * @param {object} [parameters.targetConnectionInfo] Information for connecting + * to target + * + * @param {string} [parameters.targetConnectionInfo.userName] User name + * + * @param {string} [parameters.targetConnectionInfo.password] Password + * credential. + * + * @param {string} parameters.targetConnectionInfo.type Polymorphic + * Discriminator + * + * @param {array} [parameters.databasesInfo] List of DatabaseInfo + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Project} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Project} [result] - The deserialized result object if an error did not occur. + * See {@link Project} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(parameters: models.Project, groupName: string, serviceName: string, projectName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(parameters: models.Project, groupName: string, serviceName: string, projectName: string, callback: ServiceCallback): void; + createOrUpdate(parameters: models.Project, groupName: string, serviceName: string, projectName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get project information + * + * The project resource is a nested resource representing a stored migration + * project. The GET method retrieves information about a project. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(groupName: string, serviceName: string, projectName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get project information + * + * The project resource is a nested resource representing a stored migration + * project. The GET method retrieves information about a project. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Project} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Project} [result] - The deserialized result object if an error did not occur. + * See {@link Project} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(groupName: string, serviceName: string, projectName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(groupName: string, serviceName: string, projectName: string, callback: ServiceCallback): void; + get(groupName: string, serviceName: string, projectName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Delete project + * + * The project resource is a nested resource representing a stored migration + * project. The DELETE method deletes a project. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.deleteRunningTasks] Delete the resource even if it + * contains running tasks + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(groupName: string, serviceName: string, projectName: string, options?: { deleteRunningTasks? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Delete project + * + * The project resource is a nested resource representing a stored migration + * project. The DELETE method deletes a project. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.deleteRunningTasks] Delete the resource even if it + * contains running tasks + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(groupName: string, serviceName: string, projectName: string, options?: { deleteRunningTasks? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(groupName: string, serviceName: string, projectName: string, callback: ServiceCallback): void; + deleteMethod(groupName: string, serviceName: string, projectName: string, options: { deleteRunningTasks? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Update project + * + * The project resource is a nested resource representing a stored migration + * project. The PATCH method updates an existing project. + * + * @param {object} parameters Information about the project + * + * @param {string} parameters.sourcePlatform Source platform for the project. + * Possible values include: 'SQL', 'MySQL', 'PostgreSql', 'MongoDb', 'Unknown' + * + * @param {string} parameters.targetPlatform Target platform for the project. + * Possible values include: 'SQLDB', 'SQLMI', 'AzureDbForMySql', + * 'AzureDbForPostgreSql', 'MongoDb', 'Unknown' + * + * @param {object} [parameters.sourceConnectionInfo] Information for connecting + * to source + * + * @param {object} [parameters.targetConnectionInfo] Information for connecting + * to target + * + * @param {string} [parameters.targetConnectionInfo.userName] User name + * + * @param {string} [parameters.targetConnectionInfo.password] Password + * credential. + * + * @param {string} parameters.targetConnectionInfo.type Polymorphic + * Discriminator + * + * @param {array} [parameters.databasesInfo] List of DatabaseInfo + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateWithHttpOperationResponse(parameters: models.Project, groupName: string, serviceName: string, projectName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Update project + * + * The project resource is a nested resource representing a stored migration + * project. The PATCH method updates an existing project. + * + * @param {object} parameters Information about the project + * + * @param {string} parameters.sourcePlatform Source platform for the project. + * Possible values include: 'SQL', 'MySQL', 'PostgreSql', 'MongoDb', 'Unknown' + * + * @param {string} parameters.targetPlatform Target platform for the project. + * Possible values include: 'SQLDB', 'SQLMI', 'AzureDbForMySql', + * 'AzureDbForPostgreSql', 'MongoDb', 'Unknown' + * + * @param {object} [parameters.sourceConnectionInfo] Information for connecting + * to source + * + * @param {object} [parameters.targetConnectionInfo] Information for connecting + * to target + * + * @param {string} [parameters.targetConnectionInfo.userName] User name + * + * @param {string} [parameters.targetConnectionInfo.password] Password + * credential. + * + * @param {string} parameters.targetConnectionInfo.type Polymorphic + * Discriminator + * + * @param {array} [parameters.databasesInfo] List of DatabaseInfo + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Project} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Project} [result] - The deserialized result object if an error did not occur. + * See {@link Project} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + update(parameters: models.Project, groupName: string, serviceName: string, projectName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(parameters: models.Project, groupName: string, serviceName: string, projectName: string, callback: ServiceCallback): void; + update(parameters: models.Project, groupName: string, serviceName: string, projectName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get projects in a service + * + * The project resource is a nested resource representing a stored migration + * project. This method returns a list of projects owned by a service resource. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get projects in a service + * + * The project resource is a nested resource representing a stored migration + * project. This method returns a list of projects owned by a service resource. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ProjectList} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ProjectList} [result] - The deserialized result object if an error did not occur. + * See {@link ProjectList} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Usages + * __NOTE__: An instance of this class is automatically created for an + * instance of the DataMigrationServiceClient. + */ +export interface Usages { + + + /** + * @summary Get resource quotas and usage information + * + * This method returns region-specific quotas and resource usage information + * for the Database Migration Service. + * + * @param {string} location The Azure region of the operation + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get resource quotas and usage information + * + * This method returns region-specific quotas and resource usage information + * for the Database Migration Service. + * + * @param {string} location The Azure region of the operation + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {QuotaList} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {QuotaList} [result] - The deserialized result object if an error did not occur. + * See {@link QuotaList} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(location: string, callback: ServiceCallback): void; + list(location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get resource quotas and usage information + * + * This method returns region-specific quotas and resource usage information + * for the Database Migration Service. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get resource quotas and usage information + * + * This method returns region-specific quotas and resource usage information + * for the Database Migration Service. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {QuotaList} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {QuotaList} [result] - The deserialized result object if an error did not occur. + * See {@link QuotaList} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Operations + * __NOTE__: An instance of this class is automatically created for an + * instance of the DataMigrationServiceClient. + */ +export interface Operations { + + + /** + * @summary Get available resource provider actions (operations) + * + * Lists all available actions exposed by the Database Migration Service + * resource provider. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get available resource provider actions (operations) + * + * Lists all available actions exposed by the Database Migration Service + * resource provider. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ServiceOperationList} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ServiceOperationList} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceOperationList} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get available resource provider actions (operations) + * + * Lists all available actions exposed by the Database Migration Service + * resource provider. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get available resource provider actions (operations) + * + * Lists all available actions exposed by the Database Migration Service + * resource provider. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ServiceOperationList} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ServiceOperationList} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceOperationList} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Files + * __NOTE__: An instance of this class is automatically created for an + * instance of the DataMigrationServiceClient. + */ +export interface Files { + + + /** + * @summary Get files in a project + * + * The project resource is a nested resource representing a stored migration + * project. This method returns a list of files owned by a project resource. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(groupName: string, serviceName: string, projectName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get files in a project + * + * The project resource is a nested resource representing a stored migration + * project. This method returns a list of files owned by a project resource. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {FileList} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {FileList} [result] - The deserialized result object if an error did not occur. + * See {@link FileList} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(groupName: string, serviceName: string, projectName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(groupName: string, serviceName: string, projectName: string, callback: ServiceCallback): void; + list(groupName: string, serviceName: string, projectName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get file information + * + * The files resource is a nested, proxy-only resource representing a file + * stored under the project resource. This method retrieves information about a + * file. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} fileName Name of the File + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(groupName: string, serviceName: string, projectName: string, fileName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get file information + * + * The files resource is a nested, proxy-only resource representing a file + * stored under the project resource. This method retrieves information about a + * file. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} fileName Name of the File + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ProjectFile} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ProjectFile} [result] - The deserialized result object if an error did not occur. + * See {@link ProjectFile} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(groupName: string, serviceName: string, projectName: string, fileName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(groupName: string, serviceName: string, projectName: string, fileName: string, callback: ServiceCallback): void; + get(groupName: string, serviceName: string, projectName: string, fileName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Create a file resource + * + * The PUT method creates a new file or updates an existing one. + * + * @param {object} parameters Information about the file + * + * @param {string} [parameters.etag] HTTP strong entity tag value. This is + * ignored if submitted. + * + * @param {object} [parameters.properties] Custom file properties + * + * @param {string} [parameters.properties.extension] Optional File extension. + * If submitted it should not have a leading period and must match the + * extension from filePath. + * + * @param {string} [parameters.properties.filePath] Relative path of this file + * resource. This property can be set when creating or updating the file + * resource. + * + * @param {string} [parameters.properties.mediaType] File content type. This + * propery can be modified to reflect the file content type. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} fileName Name of the File + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(parameters: models.ProjectFile, groupName: string, serviceName: string, projectName: string, fileName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Create a file resource + * + * The PUT method creates a new file or updates an existing one. + * + * @param {object} parameters Information about the file + * + * @param {string} [parameters.etag] HTTP strong entity tag value. This is + * ignored if submitted. + * + * @param {object} [parameters.properties] Custom file properties + * + * @param {string} [parameters.properties.extension] Optional File extension. + * If submitted it should not have a leading period and must match the + * extension from filePath. + * + * @param {string} [parameters.properties.filePath] Relative path of this file + * resource. This property can be set when creating or updating the file + * resource. + * + * @param {string} [parameters.properties.mediaType] File content type. This + * propery can be modified to reflect the file content type. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} fileName Name of the File + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ProjectFile} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ProjectFile} [result] - The deserialized result object if an error did not occur. + * See {@link ProjectFile} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(parameters: models.ProjectFile, groupName: string, serviceName: string, projectName: string, fileName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(parameters: models.ProjectFile, groupName: string, serviceName: string, projectName: string, fileName: string, callback: ServiceCallback): void; + createOrUpdate(parameters: models.ProjectFile, groupName: string, serviceName: string, projectName: string, fileName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Delete file + * + * This method deletes a file. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} fileName Name of the File + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(groupName: string, serviceName: string, projectName: string, fileName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Delete file + * + * This method deletes a file. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} fileName Name of the File + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(groupName: string, serviceName: string, projectName: string, fileName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(groupName: string, serviceName: string, projectName: string, fileName: string, callback: ServiceCallback): void; + deleteMethod(groupName: string, serviceName: string, projectName: string, fileName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Update a file + * + * This method updates an existing file. + * + * @param {object} parameters Information about the file + * + * @param {string} [parameters.etag] HTTP strong entity tag value. This is + * ignored if submitted. + * + * @param {object} [parameters.properties] Custom file properties + * + * @param {string} [parameters.properties.extension] Optional File extension. + * If submitted it should not have a leading period and must match the + * extension from filePath. + * + * @param {string} [parameters.properties.filePath] Relative path of this file + * resource. This property can be set when creating or updating the file + * resource. + * + * @param {string} [parameters.properties.mediaType] File content type. This + * propery can be modified to reflect the file content type. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} fileName Name of the File + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateWithHttpOperationResponse(parameters: models.ProjectFile, groupName: string, serviceName: string, projectName: string, fileName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Update a file + * + * This method updates an existing file. + * + * @param {object} parameters Information about the file + * + * @param {string} [parameters.etag] HTTP strong entity tag value. This is + * ignored if submitted. + * + * @param {object} [parameters.properties] Custom file properties + * + * @param {string} [parameters.properties.extension] Optional File extension. + * If submitted it should not have a leading period and must match the + * extension from filePath. + * + * @param {string} [parameters.properties.filePath] Relative path of this file + * resource. This property can be set when creating or updating the file + * resource. + * + * @param {string} [parameters.properties.mediaType] File content type. This + * propery can be modified to reflect the file content type. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} fileName Name of the File + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ProjectFile} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ProjectFile} [result] - The deserialized result object if an error did not occur. + * See {@link ProjectFile} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + update(parameters: models.ProjectFile, groupName: string, serviceName: string, projectName: string, fileName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(parameters: models.ProjectFile, groupName: string, serviceName: string, projectName: string, fileName: string, callback: ServiceCallback): void; + update(parameters: models.ProjectFile, groupName: string, serviceName: string, projectName: string, fileName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Request storage information for downloading the file content + * + * This method is used for requesting storage information using which contents + * of the file can be downloaded. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} fileName Name of the File + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + readWithHttpOperationResponse(groupName: string, serviceName: string, projectName: string, fileName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Request storage information for downloading the file content + * + * This method is used for requesting storage information using which contents + * of the file can be downloaded. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} fileName Name of the File + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {FileStorageInfo} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {FileStorageInfo} [result] - The deserialized result object if an error did not occur. + * See {@link FileStorageInfo} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + read(groupName: string, serviceName: string, projectName: string, fileName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + read(groupName: string, serviceName: string, projectName: string, fileName: string, callback: ServiceCallback): void; + read(groupName: string, serviceName: string, projectName: string, fileName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Request information for reading and writing file content. + * + * This method is used for requesting information for reading and writing the + * file content. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} fileName Name of the File + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + readWriteWithHttpOperationResponse(groupName: string, serviceName: string, projectName: string, fileName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Request information for reading and writing file content. + * + * This method is used for requesting information for reading and writing the + * file content. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} fileName Name of the File + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {FileStorageInfo} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {FileStorageInfo} [result] - The deserialized result object if an error did not occur. + * See {@link FileStorageInfo} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + readWrite(groupName: string, serviceName: string, projectName: string, fileName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + readWrite(groupName: string, serviceName: string, projectName: string, fileName: string, callback: ServiceCallback): void; + readWrite(groupName: string, serviceName: string, projectName: string, fileName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get files in a project + * + * The project resource is a nested resource representing a stored migration + * project. This method returns a list of files owned by a project resource. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get files in a project + * + * The project resource is a nested resource representing a stored migration + * project. This method returns a list of files owned by a project resource. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {FileList} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {FileList} [result] - The deserialized result object if an error did not occur. + * See {@link FileList} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} diff --git a/lib/services/datamigrationManagement/lib/operations/index.js b/lib/services/datamigrationManagement/lib/operations/index.js new file mode 100644 index 0000000000..856499ae83 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/operations/index.js @@ -0,0 +1,23 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +/* jshint latedef:false */ +/* jshint forin:false */ +/* jshint noempty:false */ + +'use strict'; + +exports.ResourceSkus = require('./resourceSkus'); +exports.Services = require('./services'); +exports.Tasks = require('./tasks'); +exports.Projects = require('./projects'); +exports.Usages = require('./usages'); +exports.Operations = require('./operations'); +exports.Files = require('./files'); diff --git a/lib/services/datamigrationManagement/lib/operations/operations.js b/lib/services/datamigrationManagement/lib/operations/operations.js new file mode 100644 index 0000000000..9d19ebe799 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/operations/operations.js @@ -0,0 +1,467 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * @summary Get available resource provider actions (operations) + * + * Lists all available actions exposed by the Database Migration Service + * resource provider. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceOperationList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-07-15-preview'; + // Validate + try { + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.DataMigration/operations'; + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ServiceOperationList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Get available resource provider actions (operations) + * + * Lists all available actions exposed by the Database Migration Service + * resource provider. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceOperationList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ServiceOperationList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a Operations. */ +class Operations { + /** + * Create a Operations. + * @param {DataMigrationServiceClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._listNext = _listNext; + } + + /** + * @summary Get available resource provider actions (operations) + * + * Lists all available actions exposed by the Database Migration Service + * resource provider. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get available resource provider actions (operations) + * + * Lists all available actions exposed by the Database Migration Service + * resource provider. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ServiceOperationList} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceOperationList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(options, optionalCallback); + } + } + + /** + * @summary Get available resource provider actions (operations) + * + * Lists all available actions exposed by the Database Migration Service + * resource provider. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get available resource provider actions (operations) + * + * Lists all available actions exposed by the Database Migration Service + * resource provider. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ServiceOperationList} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceOperationList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = Operations; diff --git a/lib/services/datamigrationManagement/lib/operations/projects.js b/lib/services/datamigrationManagement/lib/operations/projects.js new file mode 100644 index 0000000000..90e841d5c2 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/operations/projects.js @@ -0,0 +1,1713 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * @summary Get projects in a service + * + * The project resource is a nested resource representing a stored migration + * project. This method returns a list of projects owned by a service resource. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProjectList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(groupName, serviceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-07-15-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (groupName === null || groupName === undefined || typeof groupName.valueOf() !== 'string') { + throw new Error('groupName cannot be null or undefined and it must be of type string.'); + } + if (serviceName === null || serviceName === undefined || typeof serviceName.valueOf() !== 'string') { + throw new Error('serviceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{groupName}', encodeURIComponent(groupName)); + requestUrl = requestUrl.replace('{serviceName}', encodeURIComponent(serviceName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ProjectList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Create or update project + * + * The project resource is a nested resource representing a stored migration + * project. The PUT method creates a new project or updates an existing one. + * + * @param {object} parameters Information about the project + * + * @param {string} parameters.sourcePlatform Source platform for the project. + * Possible values include: 'SQL', 'MySQL', 'PostgreSql', 'MongoDb', 'Unknown' + * + * @param {string} parameters.targetPlatform Target platform for the project. + * Possible values include: 'SQLDB', 'SQLMI', 'AzureDbForMySql', + * 'AzureDbForPostgreSql', 'MongoDb', 'Unknown' + * + * @param {object} [parameters.sourceConnectionInfo] Information for connecting + * to source + * + * @param {object} [parameters.targetConnectionInfo] Information for connecting + * to target + * + * @param {string} [parameters.targetConnectionInfo.userName] User name + * + * @param {string} [parameters.targetConnectionInfo.password] Password + * credential. + * + * @param {string} parameters.targetConnectionInfo.type Polymorphic + * Discriminator + * + * @param {array} [parameters.databasesInfo] List of DatabaseInfo + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Project} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(parameters, groupName, serviceName, projectName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-07-15-preview'; + // Validate + try { + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (groupName === null || groupName === undefined || typeof groupName.valueOf() !== 'string') { + throw new Error('groupName cannot be null or undefined and it must be of type string.'); + } + if (serviceName === null || serviceName === undefined || typeof serviceName.valueOf() !== 'string') { + throw new Error('serviceName cannot be null or undefined and it must be of type string.'); + } + if (projectName === null || projectName === undefined || typeof projectName.valueOf() !== 'string') { + throw new Error('projectName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{groupName}', encodeURIComponent(groupName)); + requestUrl = requestUrl.replace('{serviceName}', encodeURIComponent(serviceName)); + requestUrl = requestUrl.replace('{projectName}', encodeURIComponent(projectName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['Project']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Project']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Project']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Get project information + * + * The project resource is a nested resource representing a stored migration + * project. The GET method retrieves information about a project. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Project} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(groupName, serviceName, projectName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-07-15-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (groupName === null || groupName === undefined || typeof groupName.valueOf() !== 'string') { + throw new Error('groupName cannot be null or undefined and it must be of type string.'); + } + if (serviceName === null || serviceName === undefined || typeof serviceName.valueOf() !== 'string') { + throw new Error('serviceName cannot be null or undefined and it must be of type string.'); + } + if (projectName === null || projectName === undefined || typeof projectName.valueOf() !== 'string') { + throw new Error('projectName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{groupName}', encodeURIComponent(groupName)); + requestUrl = requestUrl.replace('{serviceName}', encodeURIComponent(serviceName)); + requestUrl = requestUrl.replace('{projectName}', encodeURIComponent(projectName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Project']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Delete project + * + * The project resource is a nested resource representing a stored migration + * project. The DELETE method deletes a project. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.deleteRunningTasks] Delete the resource even if it + * contains running tasks + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(groupName, serviceName, projectName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let deleteRunningTasks = (options && options.deleteRunningTasks !== undefined) ? options.deleteRunningTasks : undefined; + let apiVersion = '2018-07-15-preview'; + // Validate + try { + if (deleteRunningTasks !== null && deleteRunningTasks !== undefined && typeof deleteRunningTasks !== 'boolean') { + throw new Error('deleteRunningTasks must be of type boolean.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (groupName === null || groupName === undefined || typeof groupName.valueOf() !== 'string') { + throw new Error('groupName cannot be null or undefined and it must be of type string.'); + } + if (serviceName === null || serviceName === undefined || typeof serviceName.valueOf() !== 'string') { + throw new Error('serviceName cannot be null or undefined and it must be of type string.'); + } + if (projectName === null || projectName === undefined || typeof projectName.valueOf() !== 'string') { + throw new Error('projectName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{groupName}', encodeURIComponent(groupName)); + requestUrl = requestUrl.replace('{serviceName}', encodeURIComponent(serviceName)); + requestUrl = requestUrl.replace('{projectName}', encodeURIComponent(projectName)); + let queryParameters = []; + if (deleteRunningTasks !== null && deleteRunningTasks !== undefined) { + queryParameters.push('deleteRunningTasks=' + encodeURIComponent(deleteRunningTasks.toString())); + } + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Update project + * + * The project resource is a nested resource representing a stored migration + * project. The PATCH method updates an existing project. + * + * @param {object} parameters Information about the project + * + * @param {string} parameters.sourcePlatform Source platform for the project. + * Possible values include: 'SQL', 'MySQL', 'PostgreSql', 'MongoDb', 'Unknown' + * + * @param {string} parameters.targetPlatform Target platform for the project. + * Possible values include: 'SQLDB', 'SQLMI', 'AzureDbForMySql', + * 'AzureDbForPostgreSql', 'MongoDb', 'Unknown' + * + * @param {object} [parameters.sourceConnectionInfo] Information for connecting + * to source + * + * @param {object} [parameters.targetConnectionInfo] Information for connecting + * to target + * + * @param {string} [parameters.targetConnectionInfo.userName] User name + * + * @param {string} [parameters.targetConnectionInfo.password] Password + * credential. + * + * @param {string} parameters.targetConnectionInfo.type Polymorphic + * Discriminator + * + * @param {array} [parameters.databasesInfo] List of DatabaseInfo + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Project} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _update(parameters, groupName, serviceName, projectName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-07-15-preview'; + // Validate + try { + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (groupName === null || groupName === undefined || typeof groupName.valueOf() !== 'string') { + throw new Error('groupName cannot be null or undefined and it must be of type string.'); + } + if (serviceName === null || serviceName === undefined || typeof serviceName.valueOf() !== 'string') { + throw new Error('serviceName cannot be null or undefined and it must be of type string.'); + } + if (projectName === null || projectName === undefined || typeof projectName.valueOf() !== 'string') { + throw new Error('projectName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{groupName}', encodeURIComponent(groupName)); + requestUrl = requestUrl.replace('{serviceName}', encodeURIComponent(serviceName)); + requestUrl = requestUrl.replace('{projectName}', encodeURIComponent(projectName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['Project']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Project']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Get projects in a service + * + * The project resource is a nested resource representing a stored migration + * project. This method returns a list of projects owned by a service resource. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProjectList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ProjectList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a Projects. */ +class Projects { + /** + * Create a Projects. + * @param {DataMigrationServiceClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._createOrUpdate = _createOrUpdate; + this._get = _get; + this._deleteMethod = _deleteMethod; + this._update = _update; + this._listNext = _listNext; + } + + /** + * @summary Get projects in a service + * + * The project resource is a nested resource representing a stored migration + * project. This method returns a list of projects owned by a service resource. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(groupName, serviceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(groupName, serviceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get projects in a service + * + * The project resource is a nested resource representing a stored migration + * project. This method returns a list of projects owned by a service resource. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ProjectList} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProjectList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(groupName, serviceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(groupName, serviceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(groupName, serviceName, options, optionalCallback); + } + } + + /** + * @summary Create or update project + * + * The project resource is a nested resource representing a stored migration + * project. The PUT method creates a new project or updates an existing one. + * + * @param {object} parameters Information about the project + * + * @param {string} parameters.sourcePlatform Source platform for the project. + * Possible values include: 'SQL', 'MySQL', 'PostgreSql', 'MongoDb', 'Unknown' + * + * @param {string} parameters.targetPlatform Target platform for the project. + * Possible values include: 'SQLDB', 'SQLMI', 'AzureDbForMySql', + * 'AzureDbForPostgreSql', 'MongoDb', 'Unknown' + * + * @param {object} [parameters.sourceConnectionInfo] Information for connecting + * to source + * + * @param {object} [parameters.targetConnectionInfo] Information for connecting + * to target + * + * @param {string} [parameters.targetConnectionInfo.userName] User name + * + * @param {string} [parameters.targetConnectionInfo.password] Password + * credential. + * + * @param {string} parameters.targetConnectionInfo.type Polymorphic + * Discriminator + * + * @param {array} [parameters.databasesInfo] List of DatabaseInfo + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(parameters, groupName, serviceName, projectName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(parameters, groupName, serviceName, projectName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Create or update project + * + * The project resource is a nested resource representing a stored migration + * project. The PUT method creates a new project or updates an existing one. + * + * @param {object} parameters Information about the project + * + * @param {string} parameters.sourcePlatform Source platform for the project. + * Possible values include: 'SQL', 'MySQL', 'PostgreSql', 'MongoDb', 'Unknown' + * + * @param {string} parameters.targetPlatform Target platform for the project. + * Possible values include: 'SQLDB', 'SQLMI', 'AzureDbForMySql', + * 'AzureDbForPostgreSql', 'MongoDb', 'Unknown' + * + * @param {object} [parameters.sourceConnectionInfo] Information for connecting + * to source + * + * @param {object} [parameters.targetConnectionInfo] Information for connecting + * to target + * + * @param {string} [parameters.targetConnectionInfo.userName] User name + * + * @param {string} [parameters.targetConnectionInfo.password] Password + * credential. + * + * @param {string} parameters.targetConnectionInfo.type Polymorphic + * Discriminator + * + * @param {array} [parameters.databasesInfo] List of DatabaseInfo + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Project} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Project} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(parameters, groupName, serviceName, projectName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdate(parameters, groupName, serviceName, projectName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(parameters, groupName, serviceName, projectName, options, optionalCallback); + } + } + + /** + * @summary Get project information + * + * The project resource is a nested resource representing a stored migration + * project. The GET method retrieves information about a project. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(groupName, serviceName, projectName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(groupName, serviceName, projectName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get project information + * + * The project resource is a nested resource representing a stored migration + * project. The GET method retrieves information about a project. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Project} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Project} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(groupName, serviceName, projectName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(groupName, serviceName, projectName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(groupName, serviceName, projectName, options, optionalCallback); + } + } + + /** + * @summary Delete project + * + * The project resource is a nested resource representing a stored migration + * project. The DELETE method deletes a project. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.deleteRunningTasks] Delete the resource even if it + * contains running tasks + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteMethodWithHttpOperationResponse(groupName, serviceName, projectName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(groupName, serviceName, projectName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Delete project + * + * The project resource is a nested resource representing a stored migration + * project. The DELETE method deletes a project. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.deleteRunningTasks] Delete the resource even if it + * contains running tasks + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(groupName, serviceName, projectName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(groupName, serviceName, projectName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(groupName, serviceName, projectName, options, optionalCallback); + } + } + + /** + * @summary Update project + * + * The project resource is a nested resource representing a stored migration + * project. The PATCH method updates an existing project. + * + * @param {object} parameters Information about the project + * + * @param {string} parameters.sourcePlatform Source platform for the project. + * Possible values include: 'SQL', 'MySQL', 'PostgreSql', 'MongoDb', 'Unknown' + * + * @param {string} parameters.targetPlatform Target platform for the project. + * Possible values include: 'SQLDB', 'SQLMI', 'AzureDbForMySql', + * 'AzureDbForPostgreSql', 'MongoDb', 'Unknown' + * + * @param {object} [parameters.sourceConnectionInfo] Information for connecting + * to source + * + * @param {object} [parameters.targetConnectionInfo] Information for connecting + * to target + * + * @param {string} [parameters.targetConnectionInfo.userName] User name + * + * @param {string} [parameters.targetConnectionInfo.password] Password + * credential. + * + * @param {string} parameters.targetConnectionInfo.type Polymorphic + * Discriminator + * + * @param {array} [parameters.databasesInfo] List of DatabaseInfo + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateWithHttpOperationResponse(parameters, groupName, serviceName, projectName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(parameters, groupName, serviceName, projectName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Update project + * + * The project resource is a nested resource representing a stored migration + * project. The PATCH method updates an existing project. + * + * @param {object} parameters Information about the project + * + * @param {string} parameters.sourcePlatform Source platform for the project. + * Possible values include: 'SQL', 'MySQL', 'PostgreSql', 'MongoDb', 'Unknown' + * + * @param {string} parameters.targetPlatform Target platform for the project. + * Possible values include: 'SQLDB', 'SQLMI', 'AzureDbForMySql', + * 'AzureDbForPostgreSql', 'MongoDb', 'Unknown' + * + * @param {object} [parameters.sourceConnectionInfo] Information for connecting + * to source + * + * @param {object} [parameters.targetConnectionInfo] Information for connecting + * to target + * + * @param {string} [parameters.targetConnectionInfo.userName] User name + * + * @param {string} [parameters.targetConnectionInfo.password] Password + * credential. + * + * @param {string} parameters.targetConnectionInfo.type Polymorphic + * Discriminator + * + * @param {array} [parameters.databasesInfo] List of DatabaseInfo + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Project} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Project} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + update(parameters, groupName, serviceName, projectName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._update(parameters, groupName, serviceName, projectName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(parameters, groupName, serviceName, projectName, options, optionalCallback); + } + } + + /** + * @summary Get projects in a service + * + * The project resource is a nested resource representing a stored migration + * project. This method returns a list of projects owned by a service resource. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get projects in a service + * + * The project resource is a nested resource representing a stored migration + * project. This method returns a list of projects owned by a service resource. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ProjectList} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProjectList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = Projects; diff --git a/lib/services/datamigrationManagement/lib/operations/resourceSkus.js b/lib/services/datamigrationManagement/lib/operations/resourceSkus.js new file mode 100644 index 0000000000..dc2cf35070 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/operations/resourceSkus.js @@ -0,0 +1,465 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * @summary Get supported SKUs + * + * The skus action returns the list of SKUs that DMS supports. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceSkusResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listSkus(options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-07-15-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/skus'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ResourceSkusResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Get supported SKUs + * + * The skus action returns the list of SKUs that DMS supports. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceSkusResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listSkusNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ResourceSkusResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a ResourceSkus. */ +class ResourceSkus { + /** + * Create a ResourceSkus. + * @param {DataMigrationServiceClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._listSkus = _listSkus; + this._listSkusNext = _listSkusNext; + } + + /** + * @summary Get supported SKUs + * + * The skus action returns the list of SKUs that DMS supports. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listSkusWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSkus(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get supported SKUs + * + * The skus action returns the list of SKUs that DMS supports. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ResourceSkusResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceSkusResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listSkus(options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listSkus(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSkus(options, optionalCallback); + } + } + + /** + * @summary Get supported SKUs + * + * The skus action returns the list of SKUs that DMS supports. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listSkusNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSkusNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get supported SKUs + * + * The skus action returns the list of SKUs that DMS supports. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ResourceSkusResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceSkusResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listSkusNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listSkusNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSkusNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = ResourceSkus; diff --git a/lib/services/datamigrationManagement/lib/operations/services.js b/lib/services/datamigrationManagement/lib/operations/services.js new file mode 100644 index 0000000000..89118559a4 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/operations/services.js @@ -0,0 +1,5036 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + + +/** + * @summary Create or update DMS Instance + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The PUT method creates a new service or updates an + * existing one. When a service is updated, existing child resources (i.e. + * tasks) are unaffected. Services currently support a single kind, "vm", which + * refers to a VM-based service, although other kinds may be added in the + * future. This method can change the kind, SKU, and network of the service, + * but if tasks are currently running (i.e. the service is busy), this will + * fail with 400 Bad Request ("ServiceIsBusy"). The provider will reply when + * successful with 200 OK or 201 Created. Long-running operations use the + * provisioningState property. + * + * @param {object} parameters Information about the service + * + * @param {string} [parameters.etag] HTTP strong entity tag value. Ignored if + * submitted + * + * @param {string} [parameters.kind] The resource kind. Only 'vm' (the default) + * is supported. + * + * @param {string} [parameters.publicKey] The public key of the service, used + * to encrypt secrets sent to the service + * + * @param {string} parameters.virtualSubnetId The ID of the + * Microsoft.Network/virtualNetworks/subnets resource to which the service + * should be joined + * + * @param {object} [parameters.sku] Service SKU + * + * @param {string} [parameters.sku.name] The unique name of the SKU, such as + * 'P3' + * + * @param {string} [parameters.sku.tier] The tier of the SKU, such as 'Basic', + * 'General Purpose', or 'Business Critical' + * + * @param {string} [parameters.sku.family] The SKU family, used when the + * service has multiple performance classes within a tier, such as 'A', 'D', + * etc. for virtual machines + * + * @param {string} [parameters.sku.size] The size of the SKU, used when the + * name alone does not denote a service size or when a SKU has multiple + * performance classes within a family, e.g. 'A1' for virtual machines + * + * @param {number} [parameters.sku.capacity] The capacity of the SKU, if it + * supports scaling + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DataMigrationService} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(parameters, groupName, serviceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateOrUpdate(parameters, groupName, serviceName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DataMigrationService']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * @summary Get DMS Service Instance + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The GET method retrieves information about a service + * instance. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DataMigrationService} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(groupName, serviceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-07-15-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (groupName === null || groupName === undefined || typeof groupName.valueOf() !== 'string') { + throw new Error('groupName cannot be null or undefined and it must be of type string.'); + } + if (serviceName === null || serviceName === undefined || typeof serviceName.valueOf() !== 'string') { + throw new Error('serviceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{groupName}', encodeURIComponent(groupName)); + requestUrl = requestUrl.replace('{serviceName}', encodeURIComponent(serviceName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DataMigrationService']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * @summary Delete DMS Service Instance + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The DELETE method deletes a service. Any running tasks + * will be canceled. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.deleteRunningTasks] Delete the resource even if it + * contains running tasks + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(groupName, serviceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginDeleteMethod(groupName, serviceName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * @summary Create or update DMS Service Instance + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The PATCH method updates an existing service. This method + * can change the kind, SKU, and network of the service, but if tasks are + * currently running (i.e. the service is busy), this will fail with 400 Bad + * Request ("ServiceIsBusy"). + * + * @param {object} parameters Information about the service + * + * @param {string} [parameters.etag] HTTP strong entity tag value. Ignored if + * submitted + * + * @param {string} [parameters.kind] The resource kind. Only 'vm' (the default) + * is supported. + * + * @param {string} [parameters.publicKey] The public key of the service, used + * to encrypt secrets sent to the service + * + * @param {string} parameters.virtualSubnetId The ID of the + * Microsoft.Network/virtualNetworks/subnets resource to which the service + * should be joined + * + * @param {object} [parameters.sku] Service SKU + * + * @param {string} [parameters.sku.name] The unique name of the SKU, such as + * 'P3' + * + * @param {string} [parameters.sku.tier] The tier of the SKU, such as 'Basic', + * 'General Purpose', or 'Business Critical' + * + * @param {string} [parameters.sku.family] The SKU family, used when the + * service has multiple performance classes within a tier, such as 'A', 'D', + * etc. for virtual machines + * + * @param {string} [parameters.sku.size] The size of the SKU, used when the + * name alone does not denote a service size or when a SKU has multiple + * performance classes within a family, e.g. 'A1' for virtual machines + * + * @param {number} [parameters.sku.capacity] The capacity of the SKU, if it + * supports scaling + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DataMigrationService} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _update(parameters, groupName, serviceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginUpdate(parameters, groupName, serviceName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DataMigrationService']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * @summary Check service health status + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This action performs a health check and returns the + * status of the service and virtual machine size. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DataMigrationServiceStatusResponse} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _checkStatus(groupName, serviceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-07-15-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (groupName === null || groupName === undefined || typeof groupName.valueOf() !== 'string') { + throw new Error('groupName cannot be null or undefined and it must be of type string.'); + } + if (serviceName === null || serviceName === undefined || typeof serviceName.valueOf() !== 'string') { + throw new Error('serviceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/checkStatus'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{groupName}', encodeURIComponent(groupName)); + requestUrl = requestUrl.replace('{serviceName}', encodeURIComponent(serviceName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DataMigrationServiceStatusResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * @summary Start service + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This action starts the service and the service can be + * used for data migration. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _start(groupName, serviceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginStart(groupName, serviceName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * @summary Stop service + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This action stops the service and the service cannot be + * used for data migration. The service owner won't be billed when the service + * is stopped. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _stop(groupName, serviceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginStop(groupName, serviceName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * @summary Get compatible SKUs + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The skus action returns the list of SKUs that a service + * resource can be updated to. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceSkuList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listSkus(groupName, serviceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-07-15-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (groupName === null || groupName === undefined || typeof groupName.valueOf() !== 'string') { + throw new Error('groupName cannot be null or undefined and it must be of type string.'); + } + if (serviceName === null || serviceName === undefined || typeof serviceName.valueOf() !== 'string') { + throw new Error('serviceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/skus'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{groupName}', encodeURIComponent(groupName)); + requestUrl = requestUrl.replace('{serviceName}', encodeURIComponent(serviceName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ServiceSkuList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Check nested resource name validity and availability + * + * This method checks whether a proposed nested resource name is valid and + * available. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} parameters Requested name to validate + * + * @param {string} [parameters.name] The proposed resource name + * + * @param {string} [parameters.type] The resource type chain (e.g. + * virtualMachines/extensions) + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link NameAvailabilityResponse} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _checkChildrenNameAvailability(groupName, serviceName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-07-15-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (groupName === null || groupName === undefined || typeof groupName.valueOf() !== 'string') { + throw new Error('groupName cannot be null or undefined and it must be of type string.'); + } + if (serviceName === null || serviceName === undefined || typeof serviceName.valueOf() !== 'string') { + throw new Error('serviceName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/checkNameAvailability'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{groupName}', encodeURIComponent(groupName)); + requestUrl = requestUrl.replace('{serviceName}', encodeURIComponent(serviceName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['NameAvailabilityRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['NameAvailabilityResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Get services in resource group + * + * The Services resource is the top-level resource that represents the Database + * Migration Service. This method returns a list of service resources in a + * resource group. + * + * @param {string} groupName Name of the resource group + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DataMigrationServiceList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByResourceGroup(groupName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-07-15-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (groupName === null || groupName === undefined || typeof groupName.valueOf() !== 'string') { + throw new Error('groupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{groupName}', encodeURIComponent(groupName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DataMigrationServiceList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Get services in subscription + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This method returns a list of service resources in a + * subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DataMigrationServiceList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-07-15-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/services'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DataMigrationServiceList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Check name validity and availability + * + * This method checks whether a proposed top-level resource name is valid and + * available. + * + * @param {string} location The Azure region of the operation + * + * @param {object} parameters Requested name to validate + * + * @param {string} [parameters.name] The proposed resource name + * + * @param {string} [parameters.type] The resource type chain (e.g. + * virtualMachines/extensions) + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link NameAvailabilityResponse} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _checkNameAvailability(location, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-07-15-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (location === null || location === undefined || typeof location.valueOf() !== 'string') { + throw new Error('location cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/locations/{location}/checkNameAvailability'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{location}', encodeURIComponent(location)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['NameAvailabilityRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['NameAvailabilityResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Create or update DMS Instance + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The PUT method creates a new service or updates an + * existing one. When a service is updated, existing child resources (i.e. + * tasks) are unaffected. Services currently support a single kind, "vm", which + * refers to a VM-based service, although other kinds may be added in the + * future. This method can change the kind, SKU, and network of the service, + * but if tasks are currently running (i.e. the service is busy), this will + * fail with 400 Bad Request ("ServiceIsBusy"). The provider will reply when + * successful with 200 OK or 201 Created. Long-running operations use the + * provisioningState property. + * + * @param {object} parameters Information about the service + * + * @param {string} [parameters.etag] HTTP strong entity tag value. Ignored if + * submitted + * + * @param {string} [parameters.kind] The resource kind. Only 'vm' (the default) + * is supported. + * + * @param {string} [parameters.publicKey] The public key of the service, used + * to encrypt secrets sent to the service + * + * @param {string} parameters.virtualSubnetId The ID of the + * Microsoft.Network/virtualNetworks/subnets resource to which the service + * should be joined + * + * @param {object} [parameters.sku] Service SKU + * + * @param {string} [parameters.sku.name] The unique name of the SKU, such as + * 'P3' + * + * @param {string} [parameters.sku.tier] The tier of the SKU, such as 'Basic', + * 'General Purpose', or 'Business Critical' + * + * @param {string} [parameters.sku.family] The SKU family, used when the + * service has multiple performance classes within a tier, such as 'A', 'D', + * etc. for virtual machines + * + * @param {string} [parameters.sku.size] The size of the SKU, used when the + * name alone does not denote a service size or when a SKU has multiple + * performance classes within a family, e.g. 'A1' for virtual machines + * + * @param {number} [parameters.sku.capacity] The capacity of the SKU, if it + * supports scaling + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DataMigrationService} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(parameters, groupName, serviceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-07-15-preview'; + // Validate + try { + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (groupName === null || groupName === undefined || typeof groupName.valueOf() !== 'string') { + throw new Error('groupName cannot be null or undefined and it must be of type string.'); + } + if (serviceName === null || serviceName === undefined || typeof serviceName.valueOf() !== 'string') { + throw new Error('serviceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{groupName}', encodeURIComponent(groupName)); + requestUrl = requestUrl.replace('{serviceName}', encodeURIComponent(serviceName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['DataMigrationService']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DataMigrationService']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DataMigrationService']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Delete DMS Service Instance + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The DELETE method deletes a service. Any running tasks + * will be canceled. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.deleteRunningTasks] Delete the resource even if it + * contains running tasks + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginDeleteMethod(groupName, serviceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let deleteRunningTasks = (options && options.deleteRunningTasks !== undefined) ? options.deleteRunningTasks : undefined; + let apiVersion = '2018-07-15-preview'; + // Validate + try { + if (deleteRunningTasks !== null && deleteRunningTasks !== undefined && typeof deleteRunningTasks !== 'boolean') { + throw new Error('deleteRunningTasks must be of type boolean.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (groupName === null || groupName === undefined || typeof groupName.valueOf() !== 'string') { + throw new Error('groupName cannot be null or undefined and it must be of type string.'); + } + if (serviceName === null || serviceName === undefined || typeof serviceName.valueOf() !== 'string') { + throw new Error('serviceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{groupName}', encodeURIComponent(groupName)); + requestUrl = requestUrl.replace('{serviceName}', encodeURIComponent(serviceName)); + let queryParameters = []; + if (deleteRunningTasks !== null && deleteRunningTasks !== undefined) { + queryParameters.push('deleteRunningTasks=' + encodeURIComponent(deleteRunningTasks.toString())); + } + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Create or update DMS Service Instance + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The PATCH method updates an existing service. This method + * can change the kind, SKU, and network of the service, but if tasks are + * currently running (i.e. the service is busy), this will fail with 400 Bad + * Request ("ServiceIsBusy"). + * + * @param {object} parameters Information about the service + * + * @param {string} [parameters.etag] HTTP strong entity tag value. Ignored if + * submitted + * + * @param {string} [parameters.kind] The resource kind. Only 'vm' (the default) + * is supported. + * + * @param {string} [parameters.publicKey] The public key of the service, used + * to encrypt secrets sent to the service + * + * @param {string} parameters.virtualSubnetId The ID of the + * Microsoft.Network/virtualNetworks/subnets resource to which the service + * should be joined + * + * @param {object} [parameters.sku] Service SKU + * + * @param {string} [parameters.sku.name] The unique name of the SKU, such as + * 'P3' + * + * @param {string} [parameters.sku.tier] The tier of the SKU, such as 'Basic', + * 'General Purpose', or 'Business Critical' + * + * @param {string} [parameters.sku.family] The SKU family, used when the + * service has multiple performance classes within a tier, such as 'A', 'D', + * etc. for virtual machines + * + * @param {string} [parameters.sku.size] The size of the SKU, used when the + * name alone does not denote a service size or when a SKU has multiple + * performance classes within a family, e.g. 'A1' for virtual machines + * + * @param {number} [parameters.sku.capacity] The capacity of the SKU, if it + * supports scaling + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DataMigrationService} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginUpdate(parameters, groupName, serviceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-07-15-preview'; + // Validate + try { + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (groupName === null || groupName === undefined || typeof groupName.valueOf() !== 'string') { + throw new Error('groupName cannot be null or undefined and it must be of type string.'); + } + if (serviceName === null || serviceName === undefined || typeof serviceName.valueOf() !== 'string') { + throw new Error('serviceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{groupName}', encodeURIComponent(groupName)); + requestUrl = requestUrl.replace('{serviceName}', encodeURIComponent(serviceName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['DataMigrationService']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DataMigrationService']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Start service + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This action starts the service and the service can be + * used for data migration. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginStart(groupName, serviceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-07-15-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (groupName === null || groupName === undefined || typeof groupName.valueOf() !== 'string') { + throw new Error('groupName cannot be null or undefined and it must be of type string.'); + } + if (serviceName === null || serviceName === undefined || typeof serviceName.valueOf() !== 'string') { + throw new Error('serviceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/start'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{groupName}', encodeURIComponent(groupName)); + requestUrl = requestUrl.replace('{serviceName}', encodeURIComponent(serviceName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Stop service + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This action stops the service and the service cannot be + * used for data migration. The service owner won't be billed when the service + * is stopped. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginStop(groupName, serviceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-07-15-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (groupName === null || groupName === undefined || typeof groupName.valueOf() !== 'string') { + throw new Error('groupName cannot be null or undefined and it must be of type string.'); + } + if (serviceName === null || serviceName === undefined || typeof serviceName.valueOf() !== 'string') { + throw new Error('serviceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/stop'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{groupName}', encodeURIComponent(groupName)); + requestUrl = requestUrl.replace('{serviceName}', encodeURIComponent(serviceName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Get compatible SKUs + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The skus action returns the list of SKUs that a service + * resource can be updated to. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceSkuList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listSkusNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ServiceSkuList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Get services in resource group + * + * The Services resource is the top-level resource that represents the Database + * Migration Service. This method returns a list of service resources in a + * resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DataMigrationServiceList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByResourceGroupNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DataMigrationServiceList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Get services in subscription + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This method returns a list of service resources in a + * subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DataMigrationServiceList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DataMigrationServiceList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a Services. */ +class Services { + /** + * Create a Services. + * @param {DataMigrationServiceClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._createOrUpdate = _createOrUpdate; + this._get = _get; + this._deleteMethod = _deleteMethod; + this._update = _update; + this._checkStatus = _checkStatus; + this._start = _start; + this._stop = _stop; + this._listSkus = _listSkus; + this._checkChildrenNameAvailability = _checkChildrenNameAvailability; + this._listByResourceGroup = _listByResourceGroup; + this._list = _list; + this._checkNameAvailability = _checkNameAvailability; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginUpdate = _beginUpdate; + this._beginStart = _beginStart; + this._beginStop = _beginStop; + this._listSkusNext = _listSkusNext; + this._listByResourceGroupNext = _listByResourceGroupNext; + this._listNext = _listNext; + } + + /** + * @summary Create or update DMS Instance + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The PUT method creates a new service or updates an + * existing one. When a service is updated, existing child resources (i.e. + * tasks) are unaffected. Services currently support a single kind, "vm", which + * refers to a VM-based service, although other kinds may be added in the + * future. This method can change the kind, SKU, and network of the service, + * but if tasks are currently running (i.e. the service is busy), this will + * fail with 400 Bad Request ("ServiceIsBusy"). The provider will reply when + * successful with 200 OK or 201 Created. Long-running operations use the + * provisioningState property. + * + * @param {object} parameters Information about the service + * + * @param {string} [parameters.etag] HTTP strong entity tag value. Ignored if + * submitted + * + * @param {string} [parameters.kind] The resource kind. Only 'vm' (the default) + * is supported. + * + * @param {string} [parameters.publicKey] The public key of the service, used + * to encrypt secrets sent to the service + * + * @param {string} parameters.virtualSubnetId The ID of the + * Microsoft.Network/virtualNetworks/subnets resource to which the service + * should be joined + * + * @param {object} [parameters.sku] Service SKU + * + * @param {string} [parameters.sku.name] The unique name of the SKU, such as + * 'P3' + * + * @param {string} [parameters.sku.tier] The tier of the SKU, such as 'Basic', + * 'General Purpose', or 'Business Critical' + * + * @param {string} [parameters.sku.family] The SKU family, used when the + * service has multiple performance classes within a tier, such as 'A', 'D', + * etc. for virtual machines + * + * @param {string} [parameters.sku.size] The size of the SKU, used when the + * name alone does not denote a service size or when a SKU has multiple + * performance classes within a family, e.g. 'A1' for virtual machines + * + * @param {number} [parameters.sku.capacity] The capacity of the SKU, if it + * supports scaling + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(parameters, groupName, serviceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(parameters, groupName, serviceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Create or update DMS Instance + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The PUT method creates a new service or updates an + * existing one. When a service is updated, existing child resources (i.e. + * tasks) are unaffected. Services currently support a single kind, "vm", which + * refers to a VM-based service, although other kinds may be added in the + * future. This method can change the kind, SKU, and network of the service, + * but if tasks are currently running (i.e. the service is busy), this will + * fail with 400 Bad Request ("ServiceIsBusy"). The provider will reply when + * successful with 200 OK or 201 Created. Long-running operations use the + * provisioningState property. + * + * @param {object} parameters Information about the service + * + * @param {string} [parameters.etag] HTTP strong entity tag value. Ignored if + * submitted + * + * @param {string} [parameters.kind] The resource kind. Only 'vm' (the default) + * is supported. + * + * @param {string} [parameters.publicKey] The public key of the service, used + * to encrypt secrets sent to the service + * + * @param {string} parameters.virtualSubnetId The ID of the + * Microsoft.Network/virtualNetworks/subnets resource to which the service + * should be joined + * + * @param {object} [parameters.sku] Service SKU + * + * @param {string} [parameters.sku.name] The unique name of the SKU, such as + * 'P3' + * + * @param {string} [parameters.sku.tier] The tier of the SKU, such as 'Basic', + * 'General Purpose', or 'Business Critical' + * + * @param {string} [parameters.sku.family] The SKU family, used when the + * service has multiple performance classes within a tier, such as 'A', 'D', + * etc. for virtual machines + * + * @param {string} [parameters.sku.size] The size of the SKU, used when the + * name alone does not denote a service size or when a SKU has multiple + * performance classes within a family, e.g. 'A1' for virtual machines + * + * @param {number} [parameters.sku.capacity] The capacity of the SKU, if it + * supports scaling + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DataMigrationService} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DataMigrationService} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(parameters, groupName, serviceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdate(parameters, groupName, serviceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(parameters, groupName, serviceName, options, optionalCallback); + } + } + + /** + * @summary Get DMS Service Instance + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The GET method retrieves information about a service + * instance. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(groupName, serviceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(groupName, serviceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get DMS Service Instance + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The GET method retrieves information about a service + * instance. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DataMigrationService} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DataMigrationService} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(groupName, serviceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(groupName, serviceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(groupName, serviceName, options, optionalCallback); + } + } + + /** + * @summary Delete DMS Service Instance + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The DELETE method deletes a service. Any running tasks + * will be canceled. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.deleteRunningTasks] Delete the resource even if it + * contains running tasks + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteMethodWithHttpOperationResponse(groupName, serviceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(groupName, serviceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Delete DMS Service Instance + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The DELETE method deletes a service. Any running tasks + * will be canceled. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.deleteRunningTasks] Delete the resource even if it + * contains running tasks + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(groupName, serviceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(groupName, serviceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(groupName, serviceName, options, optionalCallback); + } + } + + /** + * @summary Create or update DMS Service Instance + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The PATCH method updates an existing service. This method + * can change the kind, SKU, and network of the service, but if tasks are + * currently running (i.e. the service is busy), this will fail with 400 Bad + * Request ("ServiceIsBusy"). + * + * @param {object} parameters Information about the service + * + * @param {string} [parameters.etag] HTTP strong entity tag value. Ignored if + * submitted + * + * @param {string} [parameters.kind] The resource kind. Only 'vm' (the default) + * is supported. + * + * @param {string} [parameters.publicKey] The public key of the service, used + * to encrypt secrets sent to the service + * + * @param {string} parameters.virtualSubnetId The ID of the + * Microsoft.Network/virtualNetworks/subnets resource to which the service + * should be joined + * + * @param {object} [parameters.sku] Service SKU + * + * @param {string} [parameters.sku.name] The unique name of the SKU, such as + * 'P3' + * + * @param {string} [parameters.sku.tier] The tier of the SKU, such as 'Basic', + * 'General Purpose', or 'Business Critical' + * + * @param {string} [parameters.sku.family] The SKU family, used when the + * service has multiple performance classes within a tier, such as 'A', 'D', + * etc. for virtual machines + * + * @param {string} [parameters.sku.size] The size of the SKU, used when the + * name alone does not denote a service size or when a SKU has multiple + * performance classes within a family, e.g. 'A1' for virtual machines + * + * @param {number} [parameters.sku.capacity] The capacity of the SKU, if it + * supports scaling + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateWithHttpOperationResponse(parameters, groupName, serviceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(parameters, groupName, serviceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Create or update DMS Service Instance + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The PATCH method updates an existing service. This method + * can change the kind, SKU, and network of the service, but if tasks are + * currently running (i.e. the service is busy), this will fail with 400 Bad + * Request ("ServiceIsBusy"). + * + * @param {object} parameters Information about the service + * + * @param {string} [parameters.etag] HTTP strong entity tag value. Ignored if + * submitted + * + * @param {string} [parameters.kind] The resource kind. Only 'vm' (the default) + * is supported. + * + * @param {string} [parameters.publicKey] The public key of the service, used + * to encrypt secrets sent to the service + * + * @param {string} parameters.virtualSubnetId The ID of the + * Microsoft.Network/virtualNetworks/subnets resource to which the service + * should be joined + * + * @param {object} [parameters.sku] Service SKU + * + * @param {string} [parameters.sku.name] The unique name of the SKU, such as + * 'P3' + * + * @param {string} [parameters.sku.tier] The tier of the SKU, such as 'Basic', + * 'General Purpose', or 'Business Critical' + * + * @param {string} [parameters.sku.family] The SKU family, used when the + * service has multiple performance classes within a tier, such as 'A', 'D', + * etc. for virtual machines + * + * @param {string} [parameters.sku.size] The size of the SKU, used when the + * name alone does not denote a service size or when a SKU has multiple + * performance classes within a family, e.g. 'A1' for virtual machines + * + * @param {number} [parameters.sku.capacity] The capacity of the SKU, if it + * supports scaling + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DataMigrationService} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DataMigrationService} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + update(parameters, groupName, serviceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._update(parameters, groupName, serviceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(parameters, groupName, serviceName, options, optionalCallback); + } + } + + /** + * @summary Check service health status + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This action performs a health check and returns the + * status of the service and virtual machine size. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + checkStatusWithHttpOperationResponse(groupName, serviceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._checkStatus(groupName, serviceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Check service health status + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This action performs a health check and returns the + * status of the service and virtual machine size. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DataMigrationServiceStatusResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DataMigrationServiceStatusResponse} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + checkStatus(groupName, serviceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._checkStatus(groupName, serviceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._checkStatus(groupName, serviceName, options, optionalCallback); + } + } + + /** + * @summary Start service + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This action starts the service and the service can be + * used for data migration. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + startWithHttpOperationResponse(groupName, serviceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._start(groupName, serviceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Start service + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This action starts the service and the service can be + * used for data migration. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + start(groupName, serviceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._start(groupName, serviceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._start(groupName, serviceName, options, optionalCallback); + } + } + + /** + * @summary Stop service + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This action stops the service and the service cannot be + * used for data migration. The service owner won't be billed when the service + * is stopped. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + stopWithHttpOperationResponse(groupName, serviceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._stop(groupName, serviceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Stop service + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This action stops the service and the service cannot be + * used for data migration. The service owner won't be billed when the service + * is stopped. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + stop(groupName, serviceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._stop(groupName, serviceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._stop(groupName, serviceName, options, optionalCallback); + } + } + + /** + * @summary Get compatible SKUs + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The skus action returns the list of SKUs that a service + * resource can be updated to. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listSkusWithHttpOperationResponse(groupName, serviceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSkus(groupName, serviceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get compatible SKUs + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The skus action returns the list of SKUs that a service + * resource can be updated to. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ServiceSkuList} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceSkuList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listSkus(groupName, serviceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listSkus(groupName, serviceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSkus(groupName, serviceName, options, optionalCallback); + } + } + + /** + * @summary Check nested resource name validity and availability + * + * This method checks whether a proposed nested resource name is valid and + * available. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} parameters Requested name to validate + * + * @param {string} [parameters.name] The proposed resource name + * + * @param {string} [parameters.type] The resource type chain (e.g. + * virtualMachines/extensions) + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + checkChildrenNameAvailabilityWithHttpOperationResponse(groupName, serviceName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._checkChildrenNameAvailability(groupName, serviceName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Check nested resource name validity and availability + * + * This method checks whether a proposed nested resource name is valid and + * available. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} parameters Requested name to validate + * + * @param {string} [parameters.name] The proposed resource name + * + * @param {string} [parameters.type] The resource type chain (e.g. + * virtualMachines/extensions) + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {NameAvailabilityResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link NameAvailabilityResponse} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + checkChildrenNameAvailability(groupName, serviceName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._checkChildrenNameAvailability(groupName, serviceName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._checkChildrenNameAvailability(groupName, serviceName, parameters, options, optionalCallback); + } + } + + /** + * @summary Get services in resource group + * + * The Services resource is the top-level resource that represents the Database + * Migration Service. This method returns a list of service resources in a + * resource group. + * + * @param {string} groupName Name of the resource group + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByResourceGroupWithHttpOperationResponse(groupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroup(groupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get services in resource group + * + * The Services resource is the top-level resource that represents the Database + * Migration Service. This method returns a list of service resources in a + * resource group. + * + * @param {string} groupName Name of the resource group + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DataMigrationServiceList} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DataMigrationServiceList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroup(groupName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByResourceGroup(groupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroup(groupName, options, optionalCallback); + } + } + + /** + * @summary Get services in subscription + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This method returns a list of service resources in a + * subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get services in subscription + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This method returns a list of service resources in a + * subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DataMigrationServiceList} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DataMigrationServiceList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(options, optionalCallback); + } + } + + /** + * @summary Check name validity and availability + * + * This method checks whether a proposed top-level resource name is valid and + * available. + * + * @param {string} location The Azure region of the operation + * + * @param {object} parameters Requested name to validate + * + * @param {string} [parameters.name] The proposed resource name + * + * @param {string} [parameters.type] The resource type chain (e.g. + * virtualMachines/extensions) + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + checkNameAvailabilityWithHttpOperationResponse(location, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._checkNameAvailability(location, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Check name validity and availability + * + * This method checks whether a proposed top-level resource name is valid and + * available. + * + * @param {string} location The Azure region of the operation + * + * @param {object} parameters Requested name to validate + * + * @param {string} [parameters.name] The proposed resource name + * + * @param {string} [parameters.type] The resource type chain (e.g. + * virtualMachines/extensions) + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {NameAvailabilityResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link NameAvailabilityResponse} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + checkNameAvailability(location, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._checkNameAvailability(location, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._checkNameAvailability(location, parameters, options, optionalCallback); + } + } + + /** + * @summary Create or update DMS Instance + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The PUT method creates a new service or updates an + * existing one. When a service is updated, existing child resources (i.e. + * tasks) are unaffected. Services currently support a single kind, "vm", which + * refers to a VM-based service, although other kinds may be added in the + * future. This method can change the kind, SKU, and network of the service, + * but if tasks are currently running (i.e. the service is busy), this will + * fail with 400 Bad Request ("ServiceIsBusy"). The provider will reply when + * successful with 200 OK or 201 Created. Long-running operations use the + * provisioningState property. + * + * @param {object} parameters Information about the service + * + * @param {string} [parameters.etag] HTTP strong entity tag value. Ignored if + * submitted + * + * @param {string} [parameters.kind] The resource kind. Only 'vm' (the default) + * is supported. + * + * @param {string} [parameters.publicKey] The public key of the service, used + * to encrypt secrets sent to the service + * + * @param {string} parameters.virtualSubnetId The ID of the + * Microsoft.Network/virtualNetworks/subnets resource to which the service + * should be joined + * + * @param {object} [parameters.sku] Service SKU + * + * @param {string} [parameters.sku.name] The unique name of the SKU, such as + * 'P3' + * + * @param {string} [parameters.sku.tier] The tier of the SKU, such as 'Basic', + * 'General Purpose', or 'Business Critical' + * + * @param {string} [parameters.sku.family] The SKU family, used when the + * service has multiple performance classes within a tier, such as 'A', 'D', + * etc. for virtual machines + * + * @param {string} [parameters.sku.size] The size of the SKU, used when the + * name alone does not denote a service size or when a SKU has multiple + * performance classes within a family, e.g. 'A1' for virtual machines + * + * @param {number} [parameters.sku.capacity] The capacity of the SKU, if it + * supports scaling + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(parameters, groupName, serviceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(parameters, groupName, serviceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Create or update DMS Instance + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The PUT method creates a new service or updates an + * existing one. When a service is updated, existing child resources (i.e. + * tasks) are unaffected. Services currently support a single kind, "vm", which + * refers to a VM-based service, although other kinds may be added in the + * future. This method can change the kind, SKU, and network of the service, + * but if tasks are currently running (i.e. the service is busy), this will + * fail with 400 Bad Request ("ServiceIsBusy"). The provider will reply when + * successful with 200 OK or 201 Created. Long-running operations use the + * provisioningState property. + * + * @param {object} parameters Information about the service + * + * @param {string} [parameters.etag] HTTP strong entity tag value. Ignored if + * submitted + * + * @param {string} [parameters.kind] The resource kind. Only 'vm' (the default) + * is supported. + * + * @param {string} [parameters.publicKey] The public key of the service, used + * to encrypt secrets sent to the service + * + * @param {string} parameters.virtualSubnetId The ID of the + * Microsoft.Network/virtualNetworks/subnets resource to which the service + * should be joined + * + * @param {object} [parameters.sku] Service SKU + * + * @param {string} [parameters.sku.name] The unique name of the SKU, such as + * 'P3' + * + * @param {string} [parameters.sku.tier] The tier of the SKU, such as 'Basic', + * 'General Purpose', or 'Business Critical' + * + * @param {string} [parameters.sku.family] The SKU family, used when the + * service has multiple performance classes within a tier, such as 'A', 'D', + * etc. for virtual machines + * + * @param {string} [parameters.sku.size] The size of the SKU, used when the + * name alone does not denote a service size or when a SKU has multiple + * performance classes within a family, e.g. 'A1' for virtual machines + * + * @param {number} [parameters.sku.capacity] The capacity of the SKU, if it + * supports scaling + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DataMigrationService} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DataMigrationService} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(parameters, groupName, serviceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(parameters, groupName, serviceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(parameters, groupName, serviceName, options, optionalCallback); + } + } + + /** + * @summary Delete DMS Service Instance + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The DELETE method deletes a service. Any running tasks + * will be canceled. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.deleteRunningTasks] Delete the resource even if it + * contains running tasks + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(groupName, serviceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(groupName, serviceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Delete DMS Service Instance + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The DELETE method deletes a service. Any running tasks + * will be canceled. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.deleteRunningTasks] Delete the resource even if it + * contains running tasks + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(groupName, serviceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginDeleteMethod(groupName, serviceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(groupName, serviceName, options, optionalCallback); + } + } + + /** + * @summary Create or update DMS Service Instance + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The PATCH method updates an existing service. This method + * can change the kind, SKU, and network of the service, but if tasks are + * currently running (i.e. the service is busy), this will fail with 400 Bad + * Request ("ServiceIsBusy"). + * + * @param {object} parameters Information about the service + * + * @param {string} [parameters.etag] HTTP strong entity tag value. Ignored if + * submitted + * + * @param {string} [parameters.kind] The resource kind. Only 'vm' (the default) + * is supported. + * + * @param {string} [parameters.publicKey] The public key of the service, used + * to encrypt secrets sent to the service + * + * @param {string} parameters.virtualSubnetId The ID of the + * Microsoft.Network/virtualNetworks/subnets resource to which the service + * should be joined + * + * @param {object} [parameters.sku] Service SKU + * + * @param {string} [parameters.sku.name] The unique name of the SKU, such as + * 'P3' + * + * @param {string} [parameters.sku.tier] The tier of the SKU, such as 'Basic', + * 'General Purpose', or 'Business Critical' + * + * @param {string} [parameters.sku.family] The SKU family, used when the + * service has multiple performance classes within a tier, such as 'A', 'D', + * etc. for virtual machines + * + * @param {string} [parameters.sku.size] The size of the SKU, used when the + * name alone does not denote a service size or when a SKU has multiple + * performance classes within a family, e.g. 'A1' for virtual machines + * + * @param {number} [parameters.sku.capacity] The capacity of the SKU, if it + * supports scaling + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginUpdateWithHttpOperationResponse(parameters, groupName, serviceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdate(parameters, groupName, serviceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Create or update DMS Service Instance + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The PATCH method updates an existing service. This method + * can change the kind, SKU, and network of the service, but if tasks are + * currently running (i.e. the service is busy), this will fail with 400 Bad + * Request ("ServiceIsBusy"). + * + * @param {object} parameters Information about the service + * + * @param {string} [parameters.etag] HTTP strong entity tag value. Ignored if + * submitted + * + * @param {string} [parameters.kind] The resource kind. Only 'vm' (the default) + * is supported. + * + * @param {string} [parameters.publicKey] The public key of the service, used + * to encrypt secrets sent to the service + * + * @param {string} parameters.virtualSubnetId The ID of the + * Microsoft.Network/virtualNetworks/subnets resource to which the service + * should be joined + * + * @param {object} [parameters.sku] Service SKU + * + * @param {string} [parameters.sku.name] The unique name of the SKU, such as + * 'P3' + * + * @param {string} [parameters.sku.tier] The tier of the SKU, such as 'Basic', + * 'General Purpose', or 'Business Critical' + * + * @param {string} [parameters.sku.family] The SKU family, used when the + * service has multiple performance classes within a tier, such as 'A', 'D', + * etc. for virtual machines + * + * @param {string} [parameters.sku.size] The size of the SKU, used when the + * name alone does not denote a service size or when a SKU has multiple + * performance classes within a family, e.g. 'A1' for virtual machines + * + * @param {number} [parameters.sku.capacity] The capacity of the SKU, if it + * supports scaling + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DataMigrationService} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DataMigrationService} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdate(parameters, groupName, serviceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginUpdate(parameters, groupName, serviceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdate(parameters, groupName, serviceName, options, optionalCallback); + } + } + + /** + * @summary Start service + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This action starts the service and the service can be + * used for data migration. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginStartWithHttpOperationResponse(groupName, serviceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginStart(groupName, serviceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Start service + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This action starts the service and the service can be + * used for data migration. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginStart(groupName, serviceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginStart(groupName, serviceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginStart(groupName, serviceName, options, optionalCallback); + } + } + + /** + * @summary Stop service + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This action stops the service and the service cannot be + * used for data migration. The service owner won't be billed when the service + * is stopped. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginStopWithHttpOperationResponse(groupName, serviceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginStop(groupName, serviceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Stop service + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This action stops the service and the service cannot be + * used for data migration. The service owner won't be billed when the service + * is stopped. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginStop(groupName, serviceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginStop(groupName, serviceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginStop(groupName, serviceName, options, optionalCallback); + } + } + + /** + * @summary Get compatible SKUs + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The skus action returns the list of SKUs that a service + * resource can be updated to. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listSkusNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSkusNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get compatible SKUs + * + * The services resource is the top-level resource that represents the Database + * Migration Service. The skus action returns the list of SKUs that a service + * resource can be updated to. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ServiceSkuList} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceSkuList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listSkusNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listSkusNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSkusNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get services in resource group + * + * The Services resource is the top-level resource that represents the Database + * Migration Service. This method returns a list of service resources in a + * resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get services in resource group + * + * The Services resource is the top-level resource that represents the Database + * Migration Service. This method returns a list of service resources in a + * resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DataMigrationServiceList} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DataMigrationServiceList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroupNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get services in subscription + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This method returns a list of service resources in a + * subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get services in subscription + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This method returns a list of service resources in a + * subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DataMigrationServiceList} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DataMigrationServiceList} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = Services; diff --git a/lib/services/datamigrationManagement/lib/operations/tasks.js b/lib/services/datamigrationManagement/lib/operations/tasks.js new file mode 100644 index 0000000000..d13a57c569 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/operations/tasks.js @@ -0,0 +1,2254 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * @summary Get tasks in a service + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This method returns a list of tasks owned by a service + * resource. Some tasks may have a status of Unknown, which indicates that an + * error occurred while querying the status of that task. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.taskType] Filter tasks by task type + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link TaskList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(groupName, serviceName, projectName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let taskType = (options && options.taskType !== undefined) ? options.taskType : undefined; + let apiVersion = '2018-07-15-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (groupName === null || groupName === undefined || typeof groupName.valueOf() !== 'string') { + throw new Error('groupName cannot be null or undefined and it must be of type string.'); + } + if (serviceName === null || serviceName === undefined || typeof serviceName.valueOf() !== 'string') { + throw new Error('serviceName cannot be null or undefined and it must be of type string.'); + } + if (projectName === null || projectName === undefined || typeof projectName.valueOf() !== 'string') { + throw new Error('projectName cannot be null or undefined and it must be of type string.'); + } + if (taskType !== null && taskType !== undefined && typeof taskType.valueOf() !== 'string') { + throw new Error('taskType must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{groupName}', encodeURIComponent(groupName)); + requestUrl = requestUrl.replace('{serviceName}', encodeURIComponent(serviceName)); + requestUrl = requestUrl.replace('{projectName}', encodeURIComponent(projectName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (taskType !== null && taskType !== undefined) { + queryParameters.push('taskType=' + encodeURIComponent(taskType)); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['TaskList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Create or update task + * + * The tasks resource is a nested, proxy-only resource representing work + * performed by a DMS instance. The PUT method creates a new task or updates an + * existing one, although since tasks have no mutable custom properties, there + * is little reason to update an exising one. + * + * @param {object} parameters Information about the task + * + * @param {string} [parameters.etag] HTTP strong entity tag value. This is + * ignored if submitted. + * + * @param {object} [parameters.properties] Custom task properties + * + * @param {string} parameters.properties.taskType Polymorphic Discriminator + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} taskName Name of the Task + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProjectTask} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(parameters, groupName, serviceName, projectName, taskName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-07-15-preview'; + // Validate + try { + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (groupName === null || groupName === undefined || typeof groupName.valueOf() !== 'string') { + throw new Error('groupName cannot be null or undefined and it must be of type string.'); + } + if (serviceName === null || serviceName === undefined || typeof serviceName.valueOf() !== 'string') { + throw new Error('serviceName cannot be null or undefined and it must be of type string.'); + } + if (projectName === null || projectName === undefined || typeof projectName.valueOf() !== 'string') { + throw new Error('projectName cannot be null or undefined and it must be of type string.'); + } + if (taskName === null || taskName === undefined || typeof taskName.valueOf() !== 'string') { + throw new Error('taskName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{groupName}', encodeURIComponent(groupName)); + requestUrl = requestUrl.replace('{serviceName}', encodeURIComponent(serviceName)); + requestUrl = requestUrl.replace('{projectName}', encodeURIComponent(projectName)); + requestUrl = requestUrl.replace('{taskName}', encodeURIComponent(taskName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ProjectTask']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ProjectTask']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ProjectTask']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Get task information + * + * The tasks resource is a nested, proxy-only resource representing work + * performed by a DMS instance. The GET method retrieves information about a + * task. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} taskName Name of the Task + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expand the response + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProjectTask} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(groupName, serviceName, projectName, taskName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let expand = (options && options.expand !== undefined) ? options.expand : undefined; + let apiVersion = '2018-07-15-preview'; + // Validate + try { + if (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { + throw new Error('expand must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (groupName === null || groupName === undefined || typeof groupName.valueOf() !== 'string') { + throw new Error('groupName cannot be null or undefined and it must be of type string.'); + } + if (serviceName === null || serviceName === undefined || typeof serviceName.valueOf() !== 'string') { + throw new Error('serviceName cannot be null or undefined and it must be of type string.'); + } + if (projectName === null || projectName === undefined || typeof projectName.valueOf() !== 'string') { + throw new Error('projectName cannot be null or undefined and it must be of type string.'); + } + if (taskName === null || taskName === undefined || typeof taskName.valueOf() !== 'string') { + throw new Error('taskName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{groupName}', encodeURIComponent(groupName)); + requestUrl = requestUrl.replace('{serviceName}', encodeURIComponent(serviceName)); + requestUrl = requestUrl.replace('{projectName}', encodeURIComponent(projectName)); + requestUrl = requestUrl.replace('{taskName}', encodeURIComponent(taskName)); + let queryParameters = []; + if (expand !== null && expand !== undefined) { + queryParameters.push('$expand=' + encodeURIComponent(expand)); + } + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ProjectTask']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Delete task + * + * The tasks resource is a nested, proxy-only resource representing work + * performed by a DMS instance. The DELETE method deletes a task, canceling it + * first if it's running. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} taskName Name of the Task + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.deleteRunningTasks] Delete the resource even if it + * contains running tasks + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(groupName, serviceName, projectName, taskName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let deleteRunningTasks = (options && options.deleteRunningTasks !== undefined) ? options.deleteRunningTasks : undefined; + let apiVersion = '2018-07-15-preview'; + // Validate + try { + if (deleteRunningTasks !== null && deleteRunningTasks !== undefined && typeof deleteRunningTasks !== 'boolean') { + throw new Error('deleteRunningTasks must be of type boolean.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (groupName === null || groupName === undefined || typeof groupName.valueOf() !== 'string') { + throw new Error('groupName cannot be null or undefined and it must be of type string.'); + } + if (serviceName === null || serviceName === undefined || typeof serviceName.valueOf() !== 'string') { + throw new Error('serviceName cannot be null or undefined and it must be of type string.'); + } + if (projectName === null || projectName === undefined || typeof projectName.valueOf() !== 'string') { + throw new Error('projectName cannot be null or undefined and it must be of type string.'); + } + if (taskName === null || taskName === undefined || typeof taskName.valueOf() !== 'string') { + throw new Error('taskName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{groupName}', encodeURIComponent(groupName)); + requestUrl = requestUrl.replace('{serviceName}', encodeURIComponent(serviceName)); + requestUrl = requestUrl.replace('{projectName}', encodeURIComponent(projectName)); + requestUrl = requestUrl.replace('{taskName}', encodeURIComponent(taskName)); + let queryParameters = []; + if (deleteRunningTasks !== null && deleteRunningTasks !== undefined) { + queryParameters.push('deleteRunningTasks=' + encodeURIComponent(deleteRunningTasks.toString())); + } + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Create or update task + * + * The tasks resource is a nested, proxy-only resource representing work + * performed by a DMS instance. The PATCH method updates an existing task, but + * since tasks have no mutable custom properties, there is little reason to do + * so. + * + * @param {object} parameters Information about the task + * + * @param {string} [parameters.etag] HTTP strong entity tag value. This is + * ignored if submitted. + * + * @param {object} [parameters.properties] Custom task properties + * + * @param {string} parameters.properties.taskType Polymorphic Discriminator + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} taskName Name of the Task + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProjectTask} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _update(parameters, groupName, serviceName, projectName, taskName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-07-15-preview'; + // Validate + try { + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (groupName === null || groupName === undefined || typeof groupName.valueOf() !== 'string') { + throw new Error('groupName cannot be null or undefined and it must be of type string.'); + } + if (serviceName === null || serviceName === undefined || typeof serviceName.valueOf() !== 'string') { + throw new Error('serviceName cannot be null or undefined and it must be of type string.'); + } + if (projectName === null || projectName === undefined || typeof projectName.valueOf() !== 'string') { + throw new Error('projectName cannot be null or undefined and it must be of type string.'); + } + if (taskName === null || taskName === undefined || typeof taskName.valueOf() !== 'string') { + throw new Error('taskName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{groupName}', encodeURIComponent(groupName)); + requestUrl = requestUrl.replace('{serviceName}', encodeURIComponent(serviceName)); + requestUrl = requestUrl.replace('{projectName}', encodeURIComponent(projectName)); + requestUrl = requestUrl.replace('{taskName}', encodeURIComponent(taskName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ProjectTask']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ProjectTask']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Cancel a task + * + * The tasks resource is a nested, proxy-only resource representing work + * performed by a DMS instance. This method cancels a task if it's currently + * queued or running. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} taskName Name of the Task + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProjectTask} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _cancel(groupName, serviceName, projectName, taskName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-07-15-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (groupName === null || groupName === undefined || typeof groupName.valueOf() !== 'string') { + throw new Error('groupName cannot be null or undefined and it must be of type string.'); + } + if (serviceName === null || serviceName === undefined || typeof serviceName.valueOf() !== 'string') { + throw new Error('serviceName cannot be null or undefined and it must be of type string.'); + } + if (projectName === null || projectName === undefined || typeof projectName.valueOf() !== 'string') { + throw new Error('projectName cannot be null or undefined and it must be of type string.'); + } + if (taskName === null || taskName === undefined || typeof taskName.valueOf() !== 'string') { + throw new Error('taskName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}/cancel'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{groupName}', encodeURIComponent(groupName)); + requestUrl = requestUrl.replace('{serviceName}', encodeURIComponent(serviceName)); + requestUrl = requestUrl.replace('{projectName}', encodeURIComponent(projectName)); + requestUrl = requestUrl.replace('{taskName}', encodeURIComponent(taskName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ProjectTask']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Execute a command on a task + * + * The tasks resource is a nested, proxy-only resource representing work + * performed by a DMS instance. This method executes a command on a running + * task. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} taskName Name of the Task + * + * @param {object} parameters Command to execute + * + * @param {string} parameters.commandType Polymorphic Discriminator + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CommandProperties} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _command(groupName, serviceName, projectName, taskName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-07-15-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (groupName === null || groupName === undefined || typeof groupName.valueOf() !== 'string') { + throw new Error('groupName cannot be null or undefined and it must be of type string.'); + } + if (serviceName === null || serviceName === undefined || typeof serviceName.valueOf() !== 'string') { + throw new Error('serviceName cannot be null or undefined and it must be of type string.'); + } + if (projectName === null || projectName === undefined || typeof projectName.valueOf() !== 'string') { + throw new Error('projectName cannot be null or undefined and it must be of type string.'); + } + if (taskName === null || taskName === undefined || typeof taskName.valueOf() !== 'string') { + throw new Error('taskName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects/{projectName}/tasks/{taskName}/command'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{groupName}', encodeURIComponent(groupName)); + requestUrl = requestUrl.replace('{serviceName}', encodeURIComponent(serviceName)); + requestUrl = requestUrl.replace('{projectName}', encodeURIComponent(projectName)); + requestUrl = requestUrl.replace('{taskName}', encodeURIComponent(taskName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['CommandProperties']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['CommandProperties']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Get tasks in a service + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This method returns a list of tasks owned by a service + * resource. Some tasks may have a status of Unknown, which indicates that an + * error occurred while querying the status of that task. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link TaskList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['TaskList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a Tasks. */ +class Tasks { + /** + * Create a Tasks. + * @param {DataMigrationServiceClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._createOrUpdate = _createOrUpdate; + this._get = _get; + this._deleteMethod = _deleteMethod; + this._update = _update; + this._cancel = _cancel; + this._command = _command; + this._listNext = _listNext; + } + + /** + * @summary Get tasks in a service + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This method returns a list of tasks owned by a service + * resource. Some tasks may have a status of Unknown, which indicates that an + * error occurred while querying the status of that task. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.taskType] Filter tasks by task type + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(groupName, serviceName, projectName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(groupName, serviceName, projectName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get tasks in a service + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This method returns a list of tasks owned by a service + * resource. Some tasks may have a status of Unknown, which indicates that an + * error occurred while querying the status of that task. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.taskType] Filter tasks by task type + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {TaskList} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link TaskList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(groupName, serviceName, projectName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(groupName, serviceName, projectName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(groupName, serviceName, projectName, options, optionalCallback); + } + } + + /** + * @summary Create or update task + * + * The tasks resource is a nested, proxy-only resource representing work + * performed by a DMS instance. The PUT method creates a new task or updates an + * existing one, although since tasks have no mutable custom properties, there + * is little reason to update an exising one. + * + * @param {object} parameters Information about the task + * + * @param {string} [parameters.etag] HTTP strong entity tag value. This is + * ignored if submitted. + * + * @param {object} [parameters.properties] Custom task properties + * + * @param {string} parameters.properties.taskType Polymorphic Discriminator + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} taskName Name of the Task + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(parameters, groupName, serviceName, projectName, taskName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(parameters, groupName, serviceName, projectName, taskName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Create or update task + * + * The tasks resource is a nested, proxy-only resource representing work + * performed by a DMS instance. The PUT method creates a new task or updates an + * existing one, although since tasks have no mutable custom properties, there + * is little reason to update an exising one. + * + * @param {object} parameters Information about the task + * + * @param {string} [parameters.etag] HTTP strong entity tag value. This is + * ignored if submitted. + * + * @param {object} [parameters.properties] Custom task properties + * + * @param {string} parameters.properties.taskType Polymorphic Discriminator + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} taskName Name of the Task + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ProjectTask} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProjectTask} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(parameters, groupName, serviceName, projectName, taskName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdate(parameters, groupName, serviceName, projectName, taskName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(parameters, groupName, serviceName, projectName, taskName, options, optionalCallback); + } + } + + /** + * @summary Get task information + * + * The tasks resource is a nested, proxy-only resource representing work + * performed by a DMS instance. The GET method retrieves information about a + * task. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} taskName Name of the Task + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expand the response + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(groupName, serviceName, projectName, taskName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(groupName, serviceName, projectName, taskName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get task information + * + * The tasks resource is a nested, proxy-only resource representing work + * performed by a DMS instance. The GET method retrieves information about a + * task. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} taskName Name of the Task + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] Expand the response + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ProjectTask} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProjectTask} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(groupName, serviceName, projectName, taskName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(groupName, serviceName, projectName, taskName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(groupName, serviceName, projectName, taskName, options, optionalCallback); + } + } + + /** + * @summary Delete task + * + * The tasks resource is a nested, proxy-only resource representing work + * performed by a DMS instance. The DELETE method deletes a task, canceling it + * first if it's running. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} taskName Name of the Task + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.deleteRunningTasks] Delete the resource even if it + * contains running tasks + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteMethodWithHttpOperationResponse(groupName, serviceName, projectName, taskName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(groupName, serviceName, projectName, taskName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Delete task + * + * The tasks resource is a nested, proxy-only resource representing work + * performed by a DMS instance. The DELETE method deletes a task, canceling it + * first if it's running. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} taskName Name of the Task + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.deleteRunningTasks] Delete the resource even if it + * contains running tasks + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(groupName, serviceName, projectName, taskName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(groupName, serviceName, projectName, taskName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(groupName, serviceName, projectName, taskName, options, optionalCallback); + } + } + + /** + * @summary Create or update task + * + * The tasks resource is a nested, proxy-only resource representing work + * performed by a DMS instance. The PATCH method updates an existing task, but + * since tasks have no mutable custom properties, there is little reason to do + * so. + * + * @param {object} parameters Information about the task + * + * @param {string} [parameters.etag] HTTP strong entity tag value. This is + * ignored if submitted. + * + * @param {object} [parameters.properties] Custom task properties + * + * @param {string} parameters.properties.taskType Polymorphic Discriminator + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} taskName Name of the Task + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateWithHttpOperationResponse(parameters, groupName, serviceName, projectName, taskName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(parameters, groupName, serviceName, projectName, taskName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Create or update task + * + * The tasks resource is a nested, proxy-only resource representing work + * performed by a DMS instance. The PATCH method updates an existing task, but + * since tasks have no mutable custom properties, there is little reason to do + * so. + * + * @param {object} parameters Information about the task + * + * @param {string} [parameters.etag] HTTP strong entity tag value. This is + * ignored if submitted. + * + * @param {object} [parameters.properties] Custom task properties + * + * @param {string} parameters.properties.taskType Polymorphic Discriminator + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} taskName Name of the Task + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ProjectTask} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProjectTask} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + update(parameters, groupName, serviceName, projectName, taskName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._update(parameters, groupName, serviceName, projectName, taskName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(parameters, groupName, serviceName, projectName, taskName, options, optionalCallback); + } + } + + /** + * @summary Cancel a task + * + * The tasks resource is a nested, proxy-only resource representing work + * performed by a DMS instance. This method cancels a task if it's currently + * queued or running. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} taskName Name of the Task + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + cancelWithHttpOperationResponse(groupName, serviceName, projectName, taskName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._cancel(groupName, serviceName, projectName, taskName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Cancel a task + * + * The tasks resource is a nested, proxy-only resource representing work + * performed by a DMS instance. This method cancels a task if it's currently + * queued or running. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} taskName Name of the Task + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ProjectTask} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProjectTask} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + cancel(groupName, serviceName, projectName, taskName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._cancel(groupName, serviceName, projectName, taskName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._cancel(groupName, serviceName, projectName, taskName, options, optionalCallback); + } + } + + /** + * @summary Execute a command on a task + * + * The tasks resource is a nested, proxy-only resource representing work + * performed by a DMS instance. This method executes a command on a running + * task. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} taskName Name of the Task + * + * @param {object} parameters Command to execute + * + * @param {string} parameters.commandType Polymorphic Discriminator + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + commandWithHttpOperationResponse(groupName, serviceName, projectName, taskName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._command(groupName, serviceName, projectName, taskName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Execute a command on a task + * + * The tasks resource is a nested, proxy-only resource representing work + * performed by a DMS instance. This method executes a command on a running + * task. + * + * @param {string} groupName Name of the resource group + * + * @param {string} serviceName Name of the service + * + * @param {string} projectName Name of the project + * + * @param {string} taskName Name of the Task + * + * @param {object} parameters Command to execute + * + * @param {string} parameters.commandType Polymorphic Discriminator + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {CommandProperties} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CommandProperties} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + command(groupName, serviceName, projectName, taskName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._command(groupName, serviceName, projectName, taskName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._command(groupName, serviceName, projectName, taskName, parameters, options, optionalCallback); + } + } + + /** + * @summary Get tasks in a service + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This method returns a list of tasks owned by a service + * resource. Some tasks may have a status of Unknown, which indicates that an + * error occurred while querying the status of that task. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get tasks in a service + * + * The services resource is the top-level resource that represents the Database + * Migration Service. This method returns a list of tasks owned by a service + * resource. Some tasks may have a status of Unknown, which indicates that an + * error occurred while querying the status of that task. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {TaskList} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link TaskList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = Tasks; diff --git a/lib/services/datamigrationManagement/lib/operations/usages.js b/lib/services/datamigrationManagement/lib/operations/usages.js new file mode 100644 index 0000000000..77ff29ef57 --- /dev/null +++ b/lib/services/datamigrationManagement/lib/operations/usages.js @@ -0,0 +1,481 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * @summary Get resource quotas and usage information + * + * This method returns region-specific quotas and resource usage information + * for the Database Migration Service. + * + * @param {string} location The Azure region of the operation + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link QuotaList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(location, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-07-15-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (location === null || location === undefined || typeof location.valueOf() !== 'string') { + throw new Error('location cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/locations/{location}/usages'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{location}', encodeURIComponent(location)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['QuotaList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Get resource quotas and usage information + * + * This method returns region-specific quotas and resource usage information + * for the Database Migration Service. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link QuotaList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ApiError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['QuotaList']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a Usages. */ +class Usages { + /** + * Create a Usages. + * @param {DataMigrationServiceClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._listNext = _listNext; + } + + /** + * @summary Get resource quotas and usage information + * + * This method returns region-specific quotas and resource usage information + * for the Database Migration Service. + * + * @param {string} location The Azure region of the operation + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(location, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(location, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get resource quotas and usage information + * + * This method returns region-specific quotas and resource usage information + * for the Database Migration Service. + * + * @param {string} location The Azure region of the operation + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {QuotaList} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link QuotaList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(location, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(location, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(location, options, optionalCallback); + } + } + + /** + * @summary Get resource quotas and usage information + * + * This method returns region-specific quotas and resource usage information + * for the Database Migration Service. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get resource quotas and usage information + * + * This method returns region-specific quotas and resource usage information + * for the Database Migration Service. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {QuotaList} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link QuotaList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = Usages; diff --git a/lib/services/datamigrationManagement/package.json b/lib/services/datamigrationManagement/package.json new file mode 100644 index 0000000000..10d965df07 --- /dev/null +++ b/lib/services/datamigrationManagement/package.json @@ -0,0 +1,25 @@ +{ + "name": "azure-arm-datamigration", + "author": "Microsoft Corporation", + "description": "DataMigrationServiceClient Library with typescript type definitions for node", + "version": "1.0.0-preview", + "dependencies": { + "ms-rest": "^2.3.3", + "ms-rest-azure": "^2.5.5" + }, + "keywords": [ + "node", + "azure" + ], + "license": "MIT", + "main": "./lib/dataMigrationServiceClient.js", + "types": "./lib/dataMigrationServiceClient.d.ts", + "homepage": "https://github.com/azure/azure-sdk-for-node/tree/master/lib/services/datamigrationManagement", + "repository": { + "type": "git", + "url": "https://github.com/azure/azure-sdk-for-node.git" + }, + "bugs": { + "url": "https://github.com/azure/azure-sdk-for-node/issues" + } +}