diff --git a/lib/services/storageImportExportManagement/LICENSE.txt b/lib/services/storageImportExportManagement/LICENSE.txt index 0313a903d7..5431ba98b9 100644 --- a/lib/services/storageImportExportManagement/LICENSE.txt +++ b/lib/services/storageImportExportManagement/LICENSE.txt @@ -1,21 +1,21 @@ -The MIT License (MIT) - -Copyright (c) 2017 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. \ No newline at end of file +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/storageImportExportManagement/README.md b/lib/services/storageImportExportManagement/README.md index ab7fc94bc4..f6cc91f871 100644 --- a/lib/services/storageImportExportManagement/README.md +++ b/lib/services/storageImportExportManagement/README.md @@ -1,37 +1,40 @@ -# Microsoft Azure SDK for Node.js - StorageImportExportManagement - -This project provides a Node.js package that makes it easy to manage Microsoft Azure StorageImportExport. -## Minimum node.js version >= 6.x.x - -## How to Install - -```bash -npm install azure-arm-storageimportexport -``` - -## How to Use - -### Authentication, client creation and listing jobs as an example - - ```javascript - const msRestAzure = require('ms-rest-azure'); - const StorageImportExportManagement = require("azure-arm-storageimportexport"); - - // Interactive Login - // It provides a url and code that needs to be copied and pasted in a browser and authenticated over there. If successful, - // the user will get a DeviceTokenCredentials object. - msRestAzure.interactiveLogin().then((credentials) => { - let client = new StorageImportExportManagement(credentials, 'your-subscription-id'); - return client.jobs.list(); - }).then((jobs) => { - console.log('List of jobs:'); - console.dir(jobs, {depth: null, colors: true}); -}).catch((err) => { - console.log('An error ocurred'); - console.dir(err, {depth: null, colors: true}); - }); -``` - -## Related projects - -- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node) \ No newline at end of file +--- +uid: azure-arm-storageimportexport +summary: *content + +--- +# Microsoft Azure SDK for Node.js - StorageImportExportManagementClient +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-storageimportexport +``` + +## How to use + +### Authentication, client creation and list locations as an example. + +```javascript +const msRestAzure = require("ms-rest-azure"); +const StorageImportExportManagementClient = require("azure-arm-storageimportexport"); +msRestAzure.interactiveLogin().then((creds) => { + const subscriptionId = ""; + const client = new StorageImportExportManagementClient(creds, subscriptionId); + return client.locations.list().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/storageImportExportManagement/lib/models/driveBitLockerKey.js b/lib/services/storageImportExportManagement/lib/models/driveBitLockerKey.js new file mode 100644 index 0000000000..4cb9f000b1 --- /dev/null +++ b/lib/services/storageImportExportManagement/lib/models/driveBitLockerKey.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'; + +/** + * BitLocker recovery key or password to the specified drive + * + */ +class DriveBitLockerKey { + /** + * Create a DriveBitLockerKey. + * @member {string} [bitLockerKey] BitLocker recovery key or password + * @member {string} [driveId] Drive ID + */ + constructor() { + } + + /** + * Defines the metadata of DriveBitLockerKey + * + * @returns {object} metadata of DriveBitLockerKey + * + */ + mapper() { + return { + required: false, + serializedName: 'DriveBitLockerKey', + type: { + name: 'Composite', + className: 'DriveBitLockerKey', + modelProperties: { + bitLockerKey: { + required: false, + serializedName: 'bitLockerKey', + type: { + name: 'String' + } + }, + driveId: { + required: false, + serializedName: 'driveId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DriveBitLockerKey; diff --git a/lib/services/storageImportExportManagement/lib/models/driveStatus.js b/lib/services/storageImportExportManagement/lib/models/driveStatus.js index f8859e1ea6..69ba29661c 100755 --- a/lib/services/storageImportExportManagement/lib/models/driveStatus.js +++ b/lib/services/storageImportExportManagement/lib/models/driveStatus.js @@ -10,16 +10,22 @@ 'use strict'; -const models = require('./index'); - /** - * Provides information about the drive's status. + * Provides information about the drive's status * - * @extends models['Drive'] */ -class DriveStatus extends models['Drive'] { +class DriveStatus { /** * Create a DriveStatus. + * @member {string} [driveId] The drive's hardware serial number, without + * spaces. + * @member {string} [bitLockerKey] The BitLocker key used to encrypt the + * drive. + * @member {string} [manifestFile] The relative path of the manifest file on + * the drive. + * @member {string} [manifestHash] The Base16-encoded MD5 hash of the + * manifest file on the drive. + * @member {string} [driveHeaderHash] The drive header hash value. * @member {string} [state] The drive's current state. Possible values * include: 'Specified', 'Received', 'NeverReceived', 'Transferring', * 'Completed', 'CompletedMoreInfo', 'ShippedBack' @@ -33,9 +39,10 @@ class DriveStatus extends models['Drive'] { * the error log for the data transfer operation. * @member {string} [manifestUri] A URI that points to the blob containing * the drive manifest file. + * @member {number} [bytesSucceeded] Bytes successfully transferred for the + * drive. */ constructor() { - super(); } /** @@ -53,33 +60,40 @@ class DriveStatus extends models['Drive'] { className: 'DriveStatus', modelProperties: { driveId: { - required: true, + required: false, serializedName: 'driveId', type: { name: 'String' } }, bitLockerKey: { - required: true, + required: false, serializedName: 'bitLockerKey', type: { name: 'String' } }, manifestFile: { - required: true, + required: false, serializedName: 'manifestFile', type: { name: 'String' } }, manifestHash: { - required: true, + required: false, serializedName: 'manifestHash', type: { name: 'String' } }, + driveHeaderHash: { + required: false, + serializedName: 'driveHeaderHash', + type: { + name: 'String' + } + }, state: { required: false, serializedName: 'state', @@ -121,6 +135,13 @@ class DriveStatus extends models['Drive'] { type: { name: 'String' } + }, + bytesSucceeded: { + required: false, + serializedName: 'bytesSucceeded', + type: { + name: 'Number' + } } } } diff --git a/lib/services/storageImportExportManagement/lib/models/errorResponse.js b/lib/services/storageImportExportManagement/lib/models/errorResponse.js index c861d78e4d..a47b192331 100755 --- a/lib/services/storageImportExportManagement/lib/models/errorResponse.js +++ b/lib/services/storageImportExportManagement/lib/models/errorResponse.js @@ -10,17 +10,18 @@ 'use strict'; -const models = require('./index'); - /** - * Describes the model for Error Response. + * Response when errors occurred * */ class ErrorResponse { /** * Create a ErrorResponse. - * @member {object} [error] Describes the error information - * @member {array} [error.details] Describes the error details if present. + * @member {string} [code] Provides information about the error code. + * @member {string} [message] Provides information about the error message. + * @member {string} [target] Provides information about the error target. + * @member {array} [details] Describes the error details if present. + * @member {object} [innererror] Inner error object if present. */ constructor() { } @@ -39,12 +40,47 @@ class ErrorResponse { name: 'Composite', className: 'ErrorResponse', modelProperties: { - error: { + code: { + required: false, + serializedName: 'error.code', + type: { + name: 'String' + } + }, + message: { + required: false, + serializedName: 'error.message', + type: { + name: 'String' + } + }, + target: { + required: false, + serializedName: 'error.target', + type: { + name: 'String' + } + }, + details: { + required: false, + serializedName: 'error.details', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ErrorResponseErrorDetailsItemElementType', + type: { + name: 'Composite', + className: 'ErrorResponseErrorDetailsItem' + } + } + } + }, + innererror: { required: false, - serializedName: 'error', + serializedName: 'error.innererror', type: { - name: 'Composite', - className: 'ErrorInfo' + name: 'Object' } } } diff --git a/lib/services/storageImportExportManagement/lib/models/errorResponseErrorDetailsItem.js b/lib/services/storageImportExportManagement/lib/models/errorResponseErrorDetailsItem.js new file mode 100644 index 0000000000..dbd2c5b247 --- /dev/null +++ b/lib/services/storageImportExportManagement/lib/models/errorResponseErrorDetailsItem.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'; + +/** + * Class representing a ErrorResponseErrorDetailsItem. + */ +class ErrorResponseErrorDetailsItem { + /** + * Create a ErrorResponseErrorDetailsItem. + * @member {string} [code] Provides information about the error code. + * @member {string} [target] Provides information about the error target. + * @member {string} [message] Provides information about the error message. + */ + constructor() { + } + + /** + * Defines the metadata of ErrorResponseErrorDetailsItem + * + * @returns {object} metadata of ErrorResponseErrorDetailsItem + * + */ + mapper() { + return { + required: false, + serializedName: 'ErrorResponse_error_detailsItem', + type: { + name: 'Composite', + className: 'ErrorResponseErrorDetailsItem', + modelProperties: { + code: { + required: false, + serializedName: 'code', + type: { + name: 'String' + } + }, + target: { + required: false, + serializedName: 'target', + type: { + name: 'String' + } + }, + message: { + required: false, + serializedName: 'message', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ErrorResponseErrorDetailsItem; diff --git a/lib/services/storageImportExportManagement/lib/models/exportModel.js b/lib/services/storageImportExportManagement/lib/models/exportModel.js index e9880faf92..9146673ab7 100755 --- a/lib/services/storageImportExportManagement/lib/models/exportModel.js +++ b/lib/services/storageImportExportManagement/lib/models/exportModel.js @@ -23,7 +23,7 @@ class ExportModel { * @member {array} [blobPathPrefix] A collection of blob-prefix strings. * @member {string} [blobListblobPath] The relative URI to the block blob * that contains the list of blob paths or blob path prefixes as defined - * above, beginning with the container name. If the blob is in the root + * above, beginning with the container name. If the blob is in root * container, the URI must begin with $root. */ constructor() { diff --git a/lib/services/storageImportExportManagement/lib/models/getBitLockerKeysResponse.js b/lib/services/storageImportExportManagement/lib/models/getBitLockerKeysResponse.js new file mode 100644 index 0000000000..889d71ec8e --- /dev/null +++ b/lib/services/storageImportExportManagement/lib/models/getBitLockerKeysResponse.js @@ -0,0 +1,59 @@ +/* + * 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'; + +/** + * GetBitLockerKeys response + */ +class GetBitLockerKeysResponse extends Array { + /** + * Create a GetBitLockerKeysResponse. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of GetBitLockerKeysResponse + * + * @returns {object} metadata of GetBitLockerKeysResponse + * + */ + mapper() { + return { + required: false, + serializedName: 'GetBitLockerKeysResponse', + type: { + name: 'Composite', + className: 'GetBitLockerKeysResponse', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DriveBitLockerKeyElementType', + type: { + name: 'Composite', + className: 'DriveBitLockerKey' + } + } + } + } + } + } + }; + } +} + +module.exports = GetBitLockerKeysResponse; diff --git a/lib/services/storageImportExportManagement/lib/models/index.d.ts b/lib/services/storageImportExportManagement/lib/models/index.d.ts index 97cd721c63..f4e4834d27 100755 --- a/lib/services/storageImportExportManagement/lib/models/index.d.ts +++ b/lib/services/storageImportExportManagement/lib/models/index.d.ts @@ -18,241 +18,36 @@ export { CloudError } from 'ms-rest-azure'; /** * @class - * Initializes a new instance of the Resource class. + * Initializes a new instance of the ErrorResponseErrorDetailsItem class. * @constructor - * The Resource model definition. - * - * @member {string} [id] Specifies the resource identifier of the job. - * @member {string} [name] Specifies the name of the job. - * @member {string} [type] Specifies the type of the job resource. - * @member {string} location Specifies the Azure location where the job is - * created. - * @member {object} [tags] Specifies the tags that are assigned to the job. - */ -export interface Resource { - readonly id?: string; - readonly name?: string; - readonly type?: string; - location: string; - tags?: any; -} - -/** - * @class - * Initializes a new instance of the Operation class. - * @constructor - * Describes a supported operation by the Storage Import/Export job API. - * - * @member {string} name Name of the operation. - * @member {string} [provider] The resource provider name to which the - * operation belongs. - * @member {string} [resource] The name of the resource to which the operation - * belongs. - * @member {string} [operation] The display name of the operation. - * @member {string} [description] Short description of the operation. - */ -export interface Operation { - name: string; - provider?: string; - resource?: string; - operation?: string; - description?: string; -} - -/** - * @class - * Initializes a new instance of the SupportedOperationsListResult class. - * @constructor - * List of supported operations by the import/export resource provider. - * - * @member {array} [value] List of supported operations by the import/export - * resource provider. - */ -export interface SupportedOperationsListResult { - value?: Operation[]; -} - -/** - * @class - * Initializes a new instance of the Drive class. - * @constructor - * Provides information about the drive that contains information about the - * import/export jobs. - * - * @member {string} driveId The drive's hardware serial number, without spaces. - * @member {string} bitLockerKey The BitLocker key used to encrypt the drive. - * @member {string} manifestFile The relative path of the manifest file on the - * drive. - * @member {string} manifestHash The Base16-encoded MD5 hash of the manifest - * file on the drive. - */ -export interface Drive { - driveId: string; - bitLockerKey: string; - manifestFile: string; - manifestHash: string; -} - -/** - * @class - * Initializes a new instance of the DriveStatus class. - * @constructor - * Provides information about the drive's status. - * - * @member {string} [state] The drive's current state. Possible values include: - * 'Specified', 'Received', 'NeverReceived', 'Transferring', 'Completed', - * 'CompletedMoreInfo', 'ShippedBack' - * @member {string} [copyStatus] Detailed status about the data transfer - * process. This field is not returned in the response until the drive is in - * the Transferring state. - * @member {number} [percentComplete] Percentage completed for the drive. - * @member {string} [verboseLogUri] A URI that points to the blob containing - * the verbose log for the data transfer operation. - * @member {string} [errorLogUri] A URI that points to the blob containing the - * error log for the data transfer operation. - * @member {string} [manifestUri] A URI that points to the blob containing the - * drive manifest file. - */ -export interface DriveStatus extends Drive { - state?: string; - copyStatus?: string; - percentComplete?: number; - verboseLogUri?: string; - errorLogUri?: string; - manifestUri?: string; -} - -/** - * @class - * Initializes a new instance of the BitLockerKeysListResult class. - * @constructor - * List of BitLocker keys for the specified import/export job. - * - * @member {array} [value] List of BitLocker keys for the specified - * import/export job. - */ -export interface BitLockerKeysListResult { - value?: DriveStatus[]; -} - -/** - * @class - * Initializes a new instance of the MoveJobParameters class. - * @constructor - * Defines the parameters that need to be provided for moving an import/export - * job from one reesource group to another. - * - * @member {string} targetResourceGroup Specifies the target resource group ID - * to move the jobs to. - * @member {array} resources Specifies the list of jobs to move to the target - * resource group. The jobs must be from the current resource group from the - * request URL. - */ -export interface MoveJobParameters { - targetResourceGroup: string; - resources: string[]; -} - -/** - * @class - * Initializes a new instance of the Location class. - * @constructor - * Provides information about an Azure data center location. - * - * @member {string} [id] Specifies the resource identifier of the location. - * @member {string} [name] Specifies the name of the location. Use List - * Locations to get all supported locations. - * @member {string} [type] Specifies the resource type of the location. - * @member {string} [recipientName] The recipient name to use when shipping the - * drives to the Azure data center. - * @member {string} [streetAddress1] The first line of the street address to - * use when shipping the drives to the Azure data center. - * @member {string} [streetAddress2] The second line of the street address to - * use when shipping the drives to the Azure data center. - * @member {string} [city] The city name to use when shipping the drives to the - * Azure data center. - * @member {string} [stateOrProvince] The state or province to use when - * shipping the drives to the Azure data center. - * @member {string} [postalCode] The postal code to use when shipping the - * drives to the Azure data center. - * @member {string} [countryOrRegion] The country or region to use when - * shipping the drives to the Azure data center. - * @member {string} [phone] The phone number for the Azure data center. - * @member {array} [supportedCarriers] A list of carriers that are supported at - * this location. - * @member {array} [alternateLocations] A list of location IDs that should be - * used to ship shipping drives to for jobs created against the current - * location. If the current location is active, it will be part of the list. If - * it is temporarily closed due to maintenance, this list may contain other - * locations. - */ -export interface Location { - id?: string; - name?: string; - type?: string; - recipientName?: string; - streetAddress1?: string; - streetAddress2?: string; - city?: string; - stateOrProvince?: string; - postalCode?: string; - countryOrRegion?: string; - phone?: string; - supportedCarriers?: string[]; - alternateLocations?: string[]; -} - -/** - * @class - * Initializes a new instance of the LocationsListResult class. - * @constructor - * List of locations. - * - * @member {array} value List of locations. - */ -export interface LocationsListResult { - value: Location[]; -} - -/** - * @class - * Initializes a new instance of the ErrorBase class. - * @constructor - * Describes the common properties of the Error object - * * @member {string} [code] Provides information about the error code. - * @member {string} [message] Provides information about the error message. * @member {string} [target] Provides information about the error target. + * @member {string} [message] Provides information about the error message. */ -export interface ErrorBase { +export interface ErrorResponseErrorDetailsItem { code?: string; - message?: string; target?: string; -} - -/** - * @class - * Initializes a new instance of the ErrorInfo class. - * @constructor - * Describes the error information. - * - * @member {array} [details] Describes the error details if present. - */ -export interface ErrorInfo extends ErrorBase { - details?: ErrorBase[]; + message?: string; } /** * @class * Initializes a new instance of the ErrorResponse class. * @constructor - * Describes the model for Error Response. + * Response when errors occurred * - * @member {object} [error] Describes the error information - * @member {array} [error.details] Describes the error details if present. + * @member {string} [code] Provides information about the error code. + * @member {string} [message] Provides information about the error message. + * @member {string} [target] Provides information about the error target. + * @member {array} [details] Describes the error details if present. + * @member {object} [innererror] Inner error object if present. */ export interface ErrorResponse { - error?: ErrorInfo; + code?: string; + message?: string; + target?: string; + details?: ErrorResponseErrorDetailsItem[]; + innererror?: any; } /** @@ -305,18 +100,52 @@ export interface ReturnShipping { carrierAccountNumber: string; } +/** + * @class + * Initializes a new instance of the ShippingInformation class. + * @constructor + * Contains information about the Microsoft datacenter to which the drives + * should be shipped. + * + * @member {string} recipientName The name of the recipient who will receive + * the hard drives when they are returned. + * @member {string} streetAddress1 The first line of the street address to use + * when returning the drives. + * @member {string} [streetAddress2] The second line of the street address to + * use when returning the drives. + * @member {string} city The city name to use when returning the drives. + * @member {string} stateOrProvince The state or province to use when returning + * the drives. + * @member {string} postalCode The postal code to use when returning the + * drives. + * @member {string} countryOrRegion The country or region to use when returning + * the drives. + * @member {string} [phone] Phone number of the recipient of the returned + * drives. + */ +export interface ShippingInformation { + recipientName: string; + streetAddress1: string; + streetAddress2?: string; + city: string; + stateOrProvince: string; + postalCode: string; + countryOrRegion: string; + phone?: string; +} + /** * @class * Initializes a new instance of the PackageInfomation class. * @constructor - * Provides information about the package being shipped by the customer to the + * Contains information about the package being shipped by the customer to the * Microsoft data center. * * @member {string} carrierName The name of the carrier that is used to ship * the import or export drives. * @member {string} trackingNumber The tracking number of the package. * @member {number} driveCount The number of drives included in the package. - * @member {string} shipDate The date the package is shipped. + * @member {string} shipDate The date when the package is shipped. */ export interface PackageInfomation { carrierName: string; @@ -327,81 +156,47 @@ export interface PackageInfomation { /** * @class - * Initializes a new instance of the MutableJob class. + * Initializes a new instance of the DriveStatus class. * @constructor - * Describes the updatable properties of the job + * Provides information about the drive's status * - * @member {object} [tags] - * @member {boolean} [cancelRequested] If specified, the value must be true. - * The service will attempt to cancel the job. - * @member {string} [state] If specified, the value must be Shipping, which - * tells the Import/Export service that the package for the job has been - * shipped. The ReturnAddress and DeliveryPackage properties must have been set - * either in this request or in a previous request, otherwise the request will - * fail. Possible values include: 'Shipping' - * @member {object} [returnAddress] Specifies the return address information - * for the job. - * @member {string} [returnAddress.recipientName] The name of the recipient who - * will receive the hard drives when they are returned. - * @member {string} [returnAddress.streetAddress1] The first line of the street - * address to use when returning the drives. - * @member {string} [returnAddress.streetAddress2] The second line of the - * street address to use when returning the drives. - * @member {string} [returnAddress.city] The city name to use when returning - * the drives. - * @member {string} [returnAddress.stateOrProvince] The state or province to - * use when returning the drives. - * @member {string} [returnAddress.postalCode] The postal code to use when - * returning the drives. - * @member {string} [returnAddress.countryOrRegion] The country or region to - * use when returning the drives. - * @member {string} [returnAddress.phone] Phone number of the recipient of the - * returned drives. - * @member {string} [returnAddress.email] Email address of the recipient of the - * returned drives. - * @member {object} [returnShipping] Specifies the return carrier and - * customer's account with the carrier. - * @member {string} [returnShipping.carrierName] The carrier's name. - * @member {string} [returnShipping.carrierAccountNumber] The customer's - * account number with the carrier. - * @member {object} [deliveryPackage] Contains information about the package - * being shipped by the customer to the Microsoft data center. - * @member {string} [deliveryPackage.carrierName] The name of the carrier that - * is used to ship the import or export drives. - * @member {string} [deliveryPackage.trackingNumber] The tracking number of the - * package. - * @member {number} [deliveryPackage.driveCount] The number of drives included - * in the package. - * @member {string} [deliveryPackage.shipDate] The date the package is shipped. - * @member {string} [logLevel] Indicates whether error logging or verbose - * logging is enabled. - * @member {boolean} [backupDriveManifest] Indicates whether the manifest files - * on the drives should be copied to block blobs. + * @member {string} [driveId] The drive's hardware serial number, without + * spaces. + * @member {string} [bitLockerKey] The BitLocker key used to encrypt the drive. + * @member {string} [manifestFile] The relative path of the manifest file on + * the drive. + * @member {string} [manifestHash] The Base16-encoded MD5 hash of the manifest + * file on the drive. + * @member {string} [driveHeaderHash] The drive header hash value. + * @member {string} [state] The drive's current state. Possible values include: + * 'Specified', 'Received', 'NeverReceived', 'Transferring', 'Completed', + * 'CompletedMoreInfo', 'ShippedBack' + * @member {string} [copyStatus] Detailed status about the data transfer + * process. This field is not returned in the response until the drive is in + * the Transferring state. + * @member {number} [percentComplete] Percentage completed for the drive. + * @member {string} [verboseLogUri] A URI that points to the blob containing + * the verbose log for the data transfer operation. + * @member {string} [errorLogUri] A URI that points to the blob containing the + * error log for the data transfer operation. + * @member {string} [manifestUri] A URI that points to the blob containing the + * drive manifest file. + * @member {number} [bytesSucceeded] Bytes successfully transferred for the + * drive. */ -export interface MutableJob { - tags?: any; - cancelRequested?: boolean; +export interface DriveStatus { + driveId?: string; + bitLockerKey?: string; + manifestFile?: string; + manifestHash?: string; + driveHeaderHash?: string; state?: string; - returnAddress?: ReturnAddress; - returnShipping?: ReturnShipping; - deliveryPackage?: PackageInfomation; - logLevel?: string; - backupDriveManifest?: boolean; -} - -/** - * @class - * Initializes a new instance of the ShippingInformation class. - * @constructor - * Provides information about the Microsoft datacenter to which the drives - * should be shipped. - * - * @member {string} name The name of the recipient at the datacenter. - * @member {string} address The address of the datacenter. - */ -export interface ShippingInformation { - name: string; - address: string; + copyStatus?: string; + percentComplete?: number; + verboseLogUri?: string; + errorLogUri?: string; + manifestUri?: string; + bytesSucceeded?: number; } /** @@ -416,8 +211,8 @@ export interface ShippingInformation { * @member {array} [blobPathPrefix] A collection of blob-prefix strings. * @member {string} [blobListblobPath] The relative URI to the block blob that * contains the list of blob paths or blob path prefixes as defined above, - * beginning with the container name. If the blob is in the root container, the - * URI must begin with $root. + * beginning with the container name. If the blob is in root container, the URI + * must begin with $root. */ export interface ExportModel { blobPath?: string[]; @@ -427,18 +222,15 @@ export interface ExportModel { /** * @class - * Initializes a new instance of the Job class. + * Initializes a new instance of the JobDetails class. * @constructor - * Describes an import/export job. + * Specifies the job properties * - * @member {string} storageAccountId The resource identifier of the storage + * @member {string} [storageAccountId] The resource identifier of the storage * account where data will be imported to or exported from. - * @member {string} [containerSas] The container shared access signature (SAS) - * to be used to import or export data to or from the storage account. - * @member {string} jobType The type of job: Import or Export. Possible values - * include: 'Import', 'Export' - * @member {object} returnAddress Specifies the return address information for - * the job. + * @member {string} [jobType] The type of job + * @member {object} [returnAddress] Specifies the return address information + * for the job. * @member {string} [returnAddress.recipientName] The name of the recipient who * will receive the hard drives when they are returned. * @member {string} [returnAddress.streetAddress1] The first line of the street @@ -457,17 +249,29 @@ export interface ExportModel { * returned drives. * @member {string} [returnAddress.email] Email address of the recipient of the * returned drives. - * @member {object} returnShipping Specifies the return carrier and customer's - * account with the carrier. + * @member {object} [returnShipping] Specifies the return carrier and + * customer's account with the carrier. * @member {string} [returnShipping.carrierName] The carrier's name. * @member {string} [returnShipping.carrierAccountNumber] The customer's * account number with the carrier. * @member {object} [shippingInformation] Contains information about the * Microsoft datacenter to which the drives should be shipped. - * @member {string} [shippingInformation.name] The name of the recipient at the - * datacenter. - * @member {string} [shippingInformation.address] The address of the - * datacenter. + * @member {string} [shippingInformation.recipientName] The name of the + * recipient who will receive the hard drives when they are returned. + * @member {string} [shippingInformation.streetAddress1] The first line of the + * street address to use when returning the drives. + * @member {string} [shippingInformation.streetAddress2] The second line of the + * street address to use when returning the drives. + * @member {string} [shippingInformation.city] The city name to use when + * returning the drives. + * @member {string} [shippingInformation.stateOrProvince] The state or province + * to use when returning the drives. + * @member {string} [shippingInformation.postalCode] The postal code to use + * when returning the drives. + * @member {string} [shippingInformation.countryOrRegion] The country or region + * to use when returning the drives. + * @member {string} [shippingInformation.phone] Phone number of the recipient + * of the returned drives. * @member {object} [deliveryPackage] Contains information about the package * being shipped by the customer to the Microsoft data center. * @member {string} [deliveryPackage.carrierName] The name of the carrier that @@ -476,7 +280,8 @@ export interface ExportModel { * package. * @member {number} [deliveryPackage.driveCount] The number of drives included * in the package. - * @member {string} [deliveryPackage.shipDate] The date the package is shipped. + * @member {string} [deliveryPackage.shipDate] The date when the package is + * shipped. * @member {object} [returnPackage] Contains information about the package * being shipped from the Microsoft data center to the customer to return the * drives. The format is the same as the deliveryPackage property above. This @@ -487,18 +292,15 @@ export interface ExportModel { * package. * @member {number} [returnPackage.driveCount] The number of drives included in * the package. - * @member {string} [returnPackage.shipDate] The date the package is shipped. - * @member {string} diagnosticsPath The virtual blob directory to which the + * @member {string} [returnPackage.shipDate] The date when the package is + * shipped. + * @member {string} [diagnosticsPath] The virtual blob directory to which the * copy logs and backups of drive manifest files (if enabled) will be stored. * @member {string} [logLevel] Default value is Error. Indicates whether error - * logging or verbose logging will be enabled. Possible values include: - * 'Error', 'Verbose'. Default value: 'Error' . + * logging or verbose logging will be enabled. * @member {boolean} [backupDriveManifest] Default value is false. Indicates * whether the manifest files on the drives should be copied to block blobs. - * Default value: false . - * @member {string} [state] Current state of the job. Possible values include: - * 'Creating', 'Shipping', 'Received', 'Transferring', 'Packaging', 'Closed', - * 'Completed' + * @member {string} [state] Current state of the job. * @member {boolean} [cancelRequested] Indicates whether a request has been * submitted to cancel the job. * @member {number} [percentComplete] Overall percentage completed for the job. @@ -517,41 +319,466 @@ export interface ExportModel { * strings. * @member {string} [exportProperty.blobListblobPath] The relative URI to the * block blob that contains the list of blob paths or blob path prefixes as - * defined above, beginning with the container name. If the blob is in the root + * defined above, beginning with the container name. If the blob is in root * container, the URI must begin with $root. * @member {string} [provisioningState] Specifies the provisioning state of the * job. */ -export interface Job extends Resource { - storageAccountId: string; - containerSas?: string; - jobType: string; - returnAddress: ReturnAddress; - returnShipping: ReturnShipping; - readonly shippingInformation?: ShippingInformation; +export interface JobDetails { + storageAccountId?: string; + jobType?: string; + returnAddress?: ReturnAddress; + returnShipping?: ReturnShipping; + shippingInformation?: ShippingInformation; deliveryPackage?: PackageInfomation; - readonly returnPackage?: PackageInfomation; - diagnosticsPath: string; + returnPackage?: PackageInfomation; + diagnosticsPath?: string; logLevel?: string; backupDriveManifest?: boolean; - readonly state?: string; + state?: string; cancelRequested?: boolean; - readonly percentComplete?: number; - readonly incompleteBlobListUri?: string; + percentComplete?: number; + incompleteBlobListUri?: string; driveList?: DriveStatus[]; exportProperty?: ExportModel; - readonly provisioningState?: string; + provisioningState?: string; } +/** + * @class + * Initializes a new instance of the PutJobParameters class. + * @constructor + * Put Job parameters + * + * @member {string} [location] Specifies the supported Azure location where the + * job should be created + * @member {object} [tags] Specifies the tags that will be assigned to the job. + * @member {object} [properties] Specifies the job properties + * @member {string} [properties.storageAccountId] The resource identifier of + * the storage account where data will be imported to or exported from. + * @member {string} [properties.jobType] The type of job + * @member {object} [properties.returnAddress] Specifies the return address + * information for the job. + * @member {string} [properties.returnAddress.recipientName] The name of the + * recipient who will receive the hard drives when they are returned. + * @member {string} [properties.returnAddress.streetAddress1] The first line of + * the street address to use when returning the drives. + * @member {string} [properties.returnAddress.streetAddress2] The second line + * of the street address to use when returning the drives. + * @member {string} [properties.returnAddress.city] The city name to use when + * returning the drives. + * @member {string} [properties.returnAddress.stateOrProvince] The state or + * province to use when returning the drives. + * @member {string} [properties.returnAddress.postalCode] The postal code to + * use when returning the drives. + * @member {string} [properties.returnAddress.countryOrRegion] The country or + * region to use when returning the drives. + * @member {string} [properties.returnAddress.phone] Phone number of the + * recipient of the returned drives. + * @member {string} [properties.returnAddress.email] Email address of the + * recipient of the returned drives. + * @member {object} [properties.returnShipping] Specifies the return carrier + * and customer's account with the carrier. + * @member {string} [properties.returnShipping.carrierName] The carrier's name. + * @member {string} [properties.returnShipping.carrierAccountNumber] The + * customer's account number with the carrier. + * @member {object} [properties.shippingInformation] Contains information about + * the Microsoft datacenter to which the drives should be shipped. + * @member {string} [properties.shippingInformation.recipientName] The name of + * the recipient who will receive the hard drives when they are returned. + * @member {string} [properties.shippingInformation.streetAddress1] The first + * line of the street address to use when returning the drives. + * @member {string} [properties.shippingInformation.streetAddress2] The second + * line of the street address to use when returning the drives. + * @member {string} [properties.shippingInformation.city] The city name to use + * when returning the drives. + * @member {string} [properties.shippingInformation.stateOrProvince] The state + * or province to use when returning the drives. + * @member {string} [properties.shippingInformation.postalCode] The postal code + * to use when returning the drives. + * @member {string} [properties.shippingInformation.countryOrRegion] The + * country or region to use when returning the drives. + * @member {string} [properties.shippingInformation.phone] Phone number of the + * recipient of the returned drives. + * @member {object} [properties.deliveryPackage] Contains information about the + * package being shipped by the customer to the Microsoft data center. + * @member {string} [properties.deliveryPackage.carrierName] The name of the + * carrier that is used to ship the import or export drives. + * @member {string} [properties.deliveryPackage.trackingNumber] The tracking + * number of the package. + * @member {number} [properties.deliveryPackage.driveCount] The number of + * drives included in the package. + * @member {string} [properties.deliveryPackage.shipDate] The date when the + * package is shipped. + * @member {object} [properties.returnPackage] Contains information about the + * package being shipped from the Microsoft data center to the customer to + * return the drives. The format is the same as the deliveryPackage property + * above. This property is not included if the drives have not yet been + * returned. + * @member {string} [properties.returnPackage.carrierName] The name of the + * carrier that is used to ship the import or export drives. + * @member {string} [properties.returnPackage.trackingNumber] The tracking + * number of the package. + * @member {number} [properties.returnPackage.driveCount] The number of drives + * included in the package. + * @member {string} [properties.returnPackage.shipDate] The date when the + * package is shipped. + * @member {string} [properties.diagnosticsPath] The virtual blob directory to + * which the copy logs and backups of drive manifest files (if enabled) will be + * stored. + * @member {string} [properties.logLevel] Default value is Error. Indicates + * whether error logging or verbose logging will be enabled. + * @member {boolean} [properties.backupDriveManifest] Default value is false. + * Indicates whether the manifest files on the drives should be copied to block + * blobs. + * @member {string} [properties.state] Current state of the job. + * @member {boolean} [properties.cancelRequested] Indicates whether a request + * has been submitted to cancel the job. + * @member {number} [properties.percentComplete] Overall percentage completed + * for the job. + * @member {string} [properties.incompleteBlobListUri] A blob path that points + * to a block blob containing a list of blob names that were not exported due + * to insufficient drive space. If all blobs were exported successfully, then + * this element is not included in the response. + * @member {array} [properties.driveList] List of up to ten drives that + * comprise the job. The drive list is a required element for an import job; it + * is not specified for export jobs. + * @member {object} [properties.exportProperty] A property containing + * information about the blobs to be exported for an export job. This property + * is included for export jobs only. + * @member {array} [properties.exportProperty.blobPath] A collection of + * blob-path strings. + * @member {array} [properties.exportProperty.blobPathPrefix] A collection of + * blob-prefix strings. + * @member {string} [properties.exportProperty.blobListblobPath] The relative + * URI to the block blob that contains the list of blob paths or blob path + * prefixes as defined above, beginning with the container name. If the blob is + * in root container, the URI must begin with $root. + * @member {string} [properties.provisioningState] Specifies the provisioning + * state of the job. + */ +export interface PutJobParameters { + location?: string; + tags?: any; + properties?: JobDetails; +} /** * @class - * Initializes a new instance of the JobListResult class. + * Initializes a new instance of the UpdateJobParameters class. * @constructor - * List of import/export jobs. + * Update Job parameters * - * @member {string} [nextLink] + * @member {object} [tags] Specifies the tags that will be assigned to the job + * @member {boolean} [cancelRequested] If specified, the value must be true. + * The service will attempt to cancel the job. + * @member {string} [state] If specified, the value must be Shipping, which + * tells the Import/Export service that the package for the job has been + * shipped. The ReturnAddress and DeliveryPackage properties must have been set + * either in this request or in a previous request, otherwise the request will + * fail. + * @member {object} [returnAddress] Specifies the return address information + * for the job. + * @member {string} [returnAddress.recipientName] The name of the recipient who + * will receive the hard drives when they are returned. + * @member {string} [returnAddress.streetAddress1] The first line of the street + * address to use when returning the drives. + * @member {string} [returnAddress.streetAddress2] The second line of the + * street address to use when returning the drives. + * @member {string} [returnAddress.city] The city name to use when returning + * the drives. + * @member {string} [returnAddress.stateOrProvince] The state or province to + * use when returning the drives. + * @member {string} [returnAddress.postalCode] The postal code to use when + * returning the drives. + * @member {string} [returnAddress.countryOrRegion] The country or region to + * use when returning the drives. + * @member {string} [returnAddress.phone] Phone number of the recipient of the + * returned drives. + * @member {string} [returnAddress.email] Email address of the recipient of the + * returned drives. + * @member {object} [returnShipping] Specifies the return carrier and + * customer's account with the carrier. + * @member {string} [returnShipping.carrierName] The carrier's name. + * @member {string} [returnShipping.carrierAccountNumber] The customer's + * account number with the carrier. + * @member {object} [deliveryPackage] Contains information about the package + * being shipped by the customer to the Microsoft data center. + * @member {string} [deliveryPackage.carrierName] The name of the carrier that + * is used to ship the import or export drives. + * @member {string} [deliveryPackage.trackingNumber] The tracking number of the + * package. + * @member {number} [deliveryPackage.driveCount] The number of drives included + * in the package. + * @member {string} [deliveryPackage.shipDate] The date when the package is + * shipped. + * @member {string} [logLevel] Indicates whether error logging or verbose + * logging is enabled. + * @member {boolean} [backupDriveManifest] Indicates whether the manifest files + * on the drives should be copied to block blobs. + * @member {array} [driveList] List of drives that comprise the job. */ -export interface JobListResult extends Array { +export interface UpdateJobParameters { + tags?: any; + cancelRequested?: boolean; + state?: string; + returnAddress?: ReturnAddress; + returnShipping?: ReturnShipping; + deliveryPackage?: PackageInfomation; + logLevel?: string; + backupDriveManifest?: boolean; + driveList?: DriveStatus[]; +} + +/** + * @class + * Initializes a new instance of the JobResponse class. + * @constructor + * Contains the job information. + * + * @member {string} [id] Specifies the resource identifier of the job. + * @member {string} [name] Specifies the name of the job. + * @member {string} [type] Specifies the type of the job resource. + * @member {string} [location] Specifies the Azure location where the job is + * created. + * @member {object} [tags] Specifies the tags that are assigned to the job. + * @member {object} [properties] Specifies the job properties + * @member {string} [properties.storageAccountId] The resource identifier of + * the storage account where data will be imported to or exported from. + * @member {string} [properties.jobType] The type of job + * @member {object} [properties.returnAddress] Specifies the return address + * information for the job. + * @member {string} [properties.returnAddress.recipientName] The name of the + * recipient who will receive the hard drives when they are returned. + * @member {string} [properties.returnAddress.streetAddress1] The first line of + * the street address to use when returning the drives. + * @member {string} [properties.returnAddress.streetAddress2] The second line + * of the street address to use when returning the drives. + * @member {string} [properties.returnAddress.city] The city name to use when + * returning the drives. + * @member {string} [properties.returnAddress.stateOrProvince] The state or + * province to use when returning the drives. + * @member {string} [properties.returnAddress.postalCode] The postal code to + * use when returning the drives. + * @member {string} [properties.returnAddress.countryOrRegion] The country or + * region to use when returning the drives. + * @member {string} [properties.returnAddress.phone] Phone number of the + * recipient of the returned drives. + * @member {string} [properties.returnAddress.email] Email address of the + * recipient of the returned drives. + * @member {object} [properties.returnShipping] Specifies the return carrier + * and customer's account with the carrier. + * @member {string} [properties.returnShipping.carrierName] The carrier's name. + * @member {string} [properties.returnShipping.carrierAccountNumber] The + * customer's account number with the carrier. + * @member {object} [properties.shippingInformation] Contains information about + * the Microsoft datacenter to which the drives should be shipped. + * @member {string} [properties.shippingInformation.recipientName] The name of + * the recipient who will receive the hard drives when they are returned. + * @member {string} [properties.shippingInformation.streetAddress1] The first + * line of the street address to use when returning the drives. + * @member {string} [properties.shippingInformation.streetAddress2] The second + * line of the street address to use when returning the drives. + * @member {string} [properties.shippingInformation.city] The city name to use + * when returning the drives. + * @member {string} [properties.shippingInformation.stateOrProvince] The state + * or province to use when returning the drives. + * @member {string} [properties.shippingInformation.postalCode] The postal code + * to use when returning the drives. + * @member {string} [properties.shippingInformation.countryOrRegion] The + * country or region to use when returning the drives. + * @member {string} [properties.shippingInformation.phone] Phone number of the + * recipient of the returned drives. + * @member {object} [properties.deliveryPackage] Contains information about the + * package being shipped by the customer to the Microsoft data center. + * @member {string} [properties.deliveryPackage.carrierName] The name of the + * carrier that is used to ship the import or export drives. + * @member {string} [properties.deliveryPackage.trackingNumber] The tracking + * number of the package. + * @member {number} [properties.deliveryPackage.driveCount] The number of + * drives included in the package. + * @member {string} [properties.deliveryPackage.shipDate] The date when the + * package is shipped. + * @member {object} [properties.returnPackage] Contains information about the + * package being shipped from the Microsoft data center to the customer to + * return the drives. The format is the same as the deliveryPackage property + * above. This property is not included if the drives have not yet been + * returned. + * @member {string} [properties.returnPackage.carrierName] The name of the + * carrier that is used to ship the import or export drives. + * @member {string} [properties.returnPackage.trackingNumber] The tracking + * number of the package. + * @member {number} [properties.returnPackage.driveCount] The number of drives + * included in the package. + * @member {string} [properties.returnPackage.shipDate] The date when the + * package is shipped. + * @member {string} [properties.diagnosticsPath] The virtual blob directory to + * which the copy logs and backups of drive manifest files (if enabled) will be + * stored. + * @member {string} [properties.logLevel] Default value is Error. Indicates + * whether error logging or verbose logging will be enabled. + * @member {boolean} [properties.backupDriveManifest] Default value is false. + * Indicates whether the manifest files on the drives should be copied to block + * blobs. + * @member {string} [properties.state] Current state of the job. + * @member {boolean} [properties.cancelRequested] Indicates whether a request + * has been submitted to cancel the job. + * @member {number} [properties.percentComplete] Overall percentage completed + * for the job. + * @member {string} [properties.incompleteBlobListUri] A blob path that points + * to a block blob containing a list of blob names that were not exported due + * to insufficient drive space. If all blobs were exported successfully, then + * this element is not included in the response. + * @member {array} [properties.driveList] List of up to ten drives that + * comprise the job. The drive list is a required element for an import job; it + * is not specified for export jobs. + * @member {object} [properties.exportProperty] A property containing + * information about the blobs to be exported for an export job. This property + * is included for export jobs only. + * @member {array} [properties.exportProperty.blobPath] A collection of + * blob-path strings. + * @member {array} [properties.exportProperty.blobPathPrefix] A collection of + * blob-prefix strings. + * @member {string} [properties.exportProperty.blobListblobPath] The relative + * URI to the block blob that contains the list of blob paths or blob path + * prefixes as defined above, beginning with the container name. If the blob is + * in root container, the URI must begin with $root. + * @member {string} [properties.provisioningState] Specifies the provisioning + * state of the job. + */ +export interface JobResponse extends BaseResource { + readonly id?: string; + readonly name?: string; + readonly type?: string; + location?: string; + tags?: any; + properties?: JobDetails; +} + +/** + * @class + * Initializes a new instance of the Operation class. + * @constructor + * Describes a supported operation by the Storage Import/Export job API. + * + * @member {string} name Name of the operation. + * @member {string} [provider] The resource provider name to which the + * operation belongs. + * @member {string} [resource] The name of the resource to which the operation + * belongs. + * @member {string} [operation] The display name of the operation. + * @member {string} [description] Short description of the operation. + */ +export interface Operation { + name: string; + provider?: string; + resource?: string; + operation?: string; + description?: string; +} + +/** + * @class + * Initializes a new instance of the Location class. + * @constructor + * Provides information about an Azure data center location. + * + * @member {string} [id] Specifies the resource identifier of the location. + * @member {string} [name] Specifies the name of the location. Use List + * Locations to get all supported locations. + * @member {string} [type] Specifies the type of the location. + * @member {string} [recipientName] The recipient name to use when shipping the + * drives to the Azure data center. + * @member {string} [streetAddress1] The first line of the street address to + * use when shipping the drives to the Azure data center. + * @member {string} [streetAddress2] The second line of the street address to + * use when shipping the drives to the Azure data center. + * @member {string} [city] The city name to use when shipping the drives to the + * Azure data center. + * @member {string} [stateOrProvince] The state or province to use when + * shipping the drives to the Azure data center. + * @member {string} [postalCode] The postal code to use when shipping the + * drives to the Azure data center. + * @member {string} [countryOrRegion] The country or region to use when + * shipping the drives to the Azure data center. + * @member {string} [phone] The phone number for the Azure data center. + * @member {array} [supportedCarriers] A list of carriers that are supported at + * this location. + * @member {array} [alternateLocations] A list of location IDs that should be + * used to ship shipping drives to for jobs created against the current + * location. If the current location is active, it will be part of the list. If + * it is temporarily closed due to maintenance, this list may contain other + * locations. + */ +export interface Location { + id?: string; + name?: string; + type?: string; + recipientName?: string; + streetAddress1?: string; + streetAddress2?: string; + city?: string; + stateOrProvince?: string; + postalCode?: string; + countryOrRegion?: string; + phone?: string; + supportedCarriers?: string[]; + alternateLocations?: string[]; +} + +/** + * @class + * Initializes a new instance of the DriveBitLockerKey class. + * @constructor + * BitLocker recovery key or password to the specified drive + * + * @member {string} [bitLockerKey] BitLocker recovery key or password + * @member {string} [driveId] Drive ID + */ +export interface DriveBitLockerKey { + bitLockerKey?: string; + driveId?: string; +} + + +/** + * @class + * Initializes a new instance of the LocationsResponse class. + * @constructor + * Locations response + * + */ +export interface LocationsResponse extends Array { +} + +/** + * @class + * Initializes a new instance of the ListJobsResponse class. + * @constructor + * List jobs response + * + * @member {string} [nextLink] link to next batch of jobs + */ +export interface ListJobsResponse extends Array { nextLink?: string; } + +/** + * @class + * Initializes a new instance of the GetBitLockerKeysResponse class. + * @constructor + * GetBitLockerKeys response + * + */ +export interface GetBitLockerKeysResponse extends Array { +} + +/** + * @class + * Initializes a new instance of the ListOperationsResponse class. + * @constructor + * List operations response + * + */ +export interface ListOperationsResponse extends Array { +} diff --git a/lib/services/storageImportExportManagement/lib/models/index.js b/lib/services/storageImportExportManagement/lib/models/index.js index 79a7602946..06fcc31dbc 100755 --- a/lib/services/storageImportExportManagement/lib/models/index.js +++ b/lib/services/storageImportExportManagement/lib/models/index.js @@ -18,23 +18,22 @@ var msRestAzure = require('ms-rest-azure'); exports.BaseResource = msRestAzure.BaseResource; exports.CloudError = msRestAzure.CloudError; -exports.Resource = require('./resource'); -exports.Operation = require('./operation'); -exports.SupportedOperationsListResult = require('./supportedOperationsListResult'); -exports.Drive = require('./drive'); -exports.DriveStatus = require('./driveStatus'); -exports.BitLockerKeysListResult = require('./bitLockerKeysListResult'); -exports.MoveJobParameters = require('./moveJobParameters'); -exports.Location = require('./location'); -exports.LocationsListResult = require('./locationsListResult'); -exports.ErrorBase = require('./errorBase'); -exports.ErrorInfo = require('./errorInfo'); +exports.ErrorResponseErrorDetailsItem = require('./errorResponseErrorDetailsItem'); exports.ErrorResponse = require('./errorResponse'); exports.ReturnAddress = require('./returnAddress'); exports.ReturnShipping = require('./returnShipping'); -exports.PackageInfomation = require('./packageInfomation'); -exports.MutableJob = require('./mutableJob'); exports.ShippingInformation = require('./shippingInformation'); +exports.PackageInfomation = require('./packageInfomation'); +exports.DriveStatus = require('./driveStatus'); exports.ExportModel = require('./exportModel'); -exports.Job = require('./job'); -exports.JobListResult = require('./jobListResult'); +exports.JobDetails = require('./jobDetails'); +exports.PutJobParameters = require('./putJobParameters'); +exports.UpdateJobParameters = require('./updateJobParameters'); +exports.JobResponse = require('./jobResponse'); +exports.Operation = require('./operation'); +exports.Location = require('./location'); +exports.DriveBitLockerKey = require('./driveBitLockerKey'); +exports.LocationsResponse = require('./locationsResponse'); +exports.ListJobsResponse = require('./listJobsResponse'); +exports.GetBitLockerKeysResponse = require('./getBitLockerKeysResponse'); +exports.ListOperationsResponse = require('./listOperationsResponse'); diff --git a/lib/services/storageImportExportManagement/lib/models/jobDetails.js b/lib/services/storageImportExportManagement/lib/models/jobDetails.js new file mode 100644 index 0000000000..1d4d0327ea --- /dev/null +++ b/lib/services/storageImportExportManagement/lib/models/jobDetails.js @@ -0,0 +1,276 @@ +/* + * 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 the job properties + * + */ +class JobDetails { + /** + * Create a JobDetails. + * @member {string} [storageAccountId] The resource identifier of the storage + * account where data will be imported to or exported from. + * @member {string} [jobType] The type of job + * @member {object} [returnAddress] Specifies the return address information + * for the job. + * @member {string} [returnAddress.recipientName] The name of the recipient + * who will receive the hard drives when they are returned. + * @member {string} [returnAddress.streetAddress1] The first line of the + * street address to use when returning the drives. + * @member {string} [returnAddress.streetAddress2] The second line of the + * street address to use when returning the drives. + * @member {string} [returnAddress.city] The city name to use when returning + * the drives. + * @member {string} [returnAddress.stateOrProvince] The state or province to + * use when returning the drives. + * @member {string} [returnAddress.postalCode] The postal code to use when + * returning the drives. + * @member {string} [returnAddress.countryOrRegion] The country or region to + * use when returning the drives. + * @member {string} [returnAddress.phone] Phone number of the recipient of + * the returned drives. + * @member {string} [returnAddress.email] Email address of the recipient of + * the returned drives. + * @member {object} [returnShipping] Specifies the return carrier and + * customer's account with the carrier. + * @member {string} [returnShipping.carrierName] The carrier's name. + * @member {string} [returnShipping.carrierAccountNumber] The customer's + * account number with the carrier. + * @member {object} [shippingInformation] Contains information about the + * Microsoft datacenter to which the drives should be shipped. + * @member {string} [shippingInformation.recipientName] The name of the + * recipient who will receive the hard drives when they are returned. + * @member {string} [shippingInformation.streetAddress1] The first line of + * the street address to use when returning the drives. + * @member {string} [shippingInformation.streetAddress2] The second line of + * the street address to use when returning the drives. + * @member {string} [shippingInformation.city] The city name to use when + * returning the drives. + * @member {string} [shippingInformation.stateOrProvince] The state or + * province to use when returning the drives. + * @member {string} [shippingInformation.postalCode] The postal code to use + * when returning the drives. + * @member {string} [shippingInformation.countryOrRegion] The country or + * region to use when returning the drives. + * @member {string} [shippingInformation.phone] Phone number of the recipient + * of the returned drives. + * @member {object} [deliveryPackage] Contains information about the package + * being shipped by the customer to the Microsoft data center. + * @member {string} [deliveryPackage.carrierName] The name of the carrier + * that is used to ship the import or export drives. + * @member {string} [deliveryPackage.trackingNumber] The tracking number of + * the package. + * @member {number} [deliveryPackage.driveCount] The number of drives + * included in the package. + * @member {string} [deliveryPackage.shipDate] The date when the package is + * shipped. + * @member {object} [returnPackage] Contains information about the package + * being shipped from the Microsoft data center to the customer to return the + * drives. The format is the same as the deliveryPackage property above. This + * property is not included if the drives have not yet been returned. + * @member {string} [returnPackage.carrierName] The name of the carrier that + * is used to ship the import or export drives. + * @member {string} [returnPackage.trackingNumber] The tracking number of the + * package. + * @member {number} [returnPackage.driveCount] The number of drives included + * in the package. + * @member {string} [returnPackage.shipDate] The date when the package is + * shipped. + * @member {string} [diagnosticsPath] The virtual blob directory to which the + * copy logs and backups of drive manifest files (if enabled) will be stored. + * @member {string} [logLevel] Default value is Error. Indicates whether + * error logging or verbose logging will be enabled. + * @member {boolean} [backupDriveManifest] Default value is false. Indicates + * whether the manifest files on the drives should be copied to block blobs. + * @member {string} [state] Current state of the job. + * @member {boolean} [cancelRequested] Indicates whether a request has been + * submitted to cancel the job. + * @member {number} [percentComplete] Overall percentage completed for the + * job. + * @member {string} [incompleteBlobListUri] A blob path that points to a + * block blob containing a list of blob names that were not exported due to + * insufficient drive space. If all blobs were exported successfully, then + * this element is not included in the response. + * @member {array} [driveList] List of up to ten drives that comprise the + * job. The drive list is a required element for an import job; it is not + * specified for export jobs. + * @member {object} [exportProperty] A property containing information about + * the blobs to be exported for an export job. This property is included for + * export jobs only. + * @member {array} [exportProperty.blobPath] A collection of blob-path + * strings. + * @member {array} [exportProperty.blobPathPrefix] A collection of + * blob-prefix strings. + * @member {string} [exportProperty.blobListblobPath] The relative URI to the + * block blob that contains the list of blob paths or blob path prefixes as + * defined above, beginning with the container name. If the blob is in root + * container, the URI must begin with $root. + * @member {string} [provisioningState] Specifies the provisioning state of + * the job. + */ + constructor() { + } + + /** + * Defines the metadata of JobDetails + * + * @returns {object} metadata of JobDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'JobDetails', + type: { + name: 'Composite', + className: 'JobDetails', + modelProperties: { + storageAccountId: { + required: false, + serializedName: 'storageAccountId', + type: { + name: 'String' + } + }, + jobType: { + required: false, + serializedName: 'jobType', + type: { + name: 'String' + } + }, + returnAddress: { + required: false, + serializedName: 'returnAddress', + type: { + name: 'Composite', + className: 'ReturnAddress' + } + }, + returnShipping: { + required: false, + serializedName: 'returnShipping', + type: { + name: 'Composite', + className: 'ReturnShipping' + } + }, + shippingInformation: { + required: false, + serializedName: 'shippingInformation', + type: { + name: 'Composite', + className: 'ShippingInformation' + } + }, + deliveryPackage: { + required: false, + serializedName: 'deliveryPackage', + type: { + name: 'Composite', + className: 'PackageInfomation' + } + }, + returnPackage: { + required: false, + serializedName: 'returnPackage', + type: { + name: 'Composite', + className: 'PackageInfomation' + } + }, + diagnosticsPath: { + required: false, + serializedName: 'diagnosticsPath', + type: { + name: 'String' + } + }, + logLevel: { + required: false, + serializedName: 'logLevel', + type: { + name: 'String' + } + }, + backupDriveManifest: { + required: false, + serializedName: 'backupDriveManifest', + type: { + name: 'Boolean' + } + }, + state: { + required: false, + serializedName: 'state', + type: { + name: 'String' + } + }, + cancelRequested: { + required: false, + serializedName: 'cancelRequested', + type: { + name: 'Boolean' + } + }, + percentComplete: { + required: false, + serializedName: 'percentComplete', + type: { + name: 'Number' + } + }, + incompleteBlobListUri: { + required: false, + serializedName: 'incompleteBlobListUri', + type: { + name: 'String' + } + }, + driveList: { + required: false, + serializedName: 'driveList', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DriveStatusElementType', + type: { + name: 'Composite', + className: 'DriveStatus' + } + } + } + }, + exportProperty: { + required: false, + serializedName: 'export', + type: { + name: 'Composite', + className: 'ExportModel' + } + }, + provisioningState: { + required: false, + serializedName: 'provisioningState', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = JobDetails; diff --git a/lib/services/storageImportExportManagement/lib/models/jobResponse.js b/lib/services/storageImportExportManagement/lib/models/jobResponse.js new file mode 100644 index 0000000000..1baa355183 --- /dev/null +++ b/lib/services/storageImportExportManagement/lib/models/jobResponse.js @@ -0,0 +1,204 @@ +/* + * 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'); + +/** + * Contains the job information. + * + * @extends models['BaseResource'] + */ +class JobResponse extends models['BaseResource'] { + /** + * Create a JobResponse. + * @member {string} [id] Specifies the resource identifier of the job. + * @member {string} [name] Specifies the name of the job. + * @member {string} [type] Specifies the type of the job resource. + * @member {string} [location] Specifies the Azure location where the job is + * created. + * @member {object} [tags] Specifies the tags that are assigned to the job. + * @member {object} [properties] Specifies the job properties + * @member {string} [properties.storageAccountId] The resource identifier of + * the storage account where data will be imported to or exported from. + * @member {string} [properties.jobType] The type of job + * @member {object} [properties.returnAddress] Specifies the return address + * information for the job. + * @member {string} [properties.returnAddress.recipientName] The name of the + * recipient who will receive the hard drives when they are returned. + * @member {string} [properties.returnAddress.streetAddress1] The first line + * of the street address to use when returning the drives. + * @member {string} [properties.returnAddress.streetAddress2] The second line + * of the street address to use when returning the drives. + * @member {string} [properties.returnAddress.city] The city name to use when + * returning the drives. + * @member {string} [properties.returnAddress.stateOrProvince] The state or + * province to use when returning the drives. + * @member {string} [properties.returnAddress.postalCode] The postal code to + * use when returning the drives. + * @member {string} [properties.returnAddress.countryOrRegion] The country or + * region to use when returning the drives. + * @member {string} [properties.returnAddress.phone] Phone number of the + * recipient of the returned drives. + * @member {string} [properties.returnAddress.email] Email address of the + * recipient of the returned drives. + * @member {object} [properties.returnShipping] Specifies the return carrier + * and customer's account with the carrier. + * @member {string} [properties.returnShipping.carrierName] The carrier's + * name. + * @member {string} [properties.returnShipping.carrierAccountNumber] The + * customer's account number with the carrier. + * @member {object} [properties.shippingInformation] Contains information + * about the Microsoft datacenter to which the drives should be shipped. + * @member {string} [properties.shippingInformation.recipientName] The name + * of the recipient who will receive the hard drives when they are returned. + * @member {string} [properties.shippingInformation.streetAddress1] The first + * line of the street address to use when returning the drives. + * @member {string} [properties.shippingInformation.streetAddress2] The + * second line of the street address to use when returning the drives. + * @member {string} [properties.shippingInformation.city] The city name to + * use when returning the drives. + * @member {string} [properties.shippingInformation.stateOrProvince] The + * state or province to use when returning the drives. + * @member {string} [properties.shippingInformation.postalCode] The postal + * code to use when returning the drives. + * @member {string} [properties.shippingInformation.countryOrRegion] The + * country or region to use when returning the drives. + * @member {string} [properties.shippingInformation.phone] Phone number of + * the recipient of the returned drives. + * @member {object} [properties.deliveryPackage] Contains information about + * the package being shipped by the customer to the Microsoft data center. + * @member {string} [properties.deliveryPackage.carrierName] The name of the + * carrier that is used to ship the import or export drives. + * @member {string} [properties.deliveryPackage.trackingNumber] The tracking + * number of the package. + * @member {number} [properties.deliveryPackage.driveCount] The number of + * drives included in the package. + * @member {string} [properties.deliveryPackage.shipDate] The date when the + * package is shipped. + * @member {object} [properties.returnPackage] Contains information about the + * package being shipped from the Microsoft data center to the customer to + * return the drives. The format is the same as the deliveryPackage property + * above. This property is not included if the drives have not yet been + * returned. + * @member {string} [properties.returnPackage.carrierName] The name of the + * carrier that is used to ship the import or export drives. + * @member {string} [properties.returnPackage.trackingNumber] The tracking + * number of the package. + * @member {number} [properties.returnPackage.driveCount] The number of + * drives included in the package. + * @member {string} [properties.returnPackage.shipDate] The date when the + * package is shipped. + * @member {string} [properties.diagnosticsPath] The virtual blob directory + * to which the copy logs and backups of drive manifest files (if enabled) + * will be stored. + * @member {string} [properties.logLevel] Default value is Error. Indicates + * whether error logging or verbose logging will be enabled. + * @member {boolean} [properties.backupDriveManifest] Default value is false. + * Indicates whether the manifest files on the drives should be copied to + * block blobs. + * @member {string} [properties.state] Current state of the job. + * @member {boolean} [properties.cancelRequested] Indicates whether a request + * has been submitted to cancel the job. + * @member {number} [properties.percentComplete] Overall percentage completed + * for the job. + * @member {string} [properties.incompleteBlobListUri] A blob path that + * points to a block blob containing a list of blob names that were not + * exported due to insufficient drive space. If all blobs were exported + * successfully, then this element is not included in the response. + * @member {array} [properties.driveList] List of up to ten drives that + * comprise the job. The drive list is a required element for an import job; + * it is not specified for export jobs. + * @member {object} [properties.exportProperty] A property containing + * information about the blobs to be exported for an export job. This + * property is included for export jobs only. + * @member {array} [properties.exportProperty.blobPath] A collection of + * blob-path strings. + * @member {array} [properties.exportProperty.blobPathPrefix] A collection of + * blob-prefix strings. + * @member {string} [properties.exportProperty.blobListblobPath] The relative + * URI to the block blob that contains the list of blob paths or blob path + * prefixes as defined above, beginning with the container name. If the blob + * is in root container, the URI must begin with $root. + * @member {string} [properties.provisioningState] Specifies the provisioning + * state of the job. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of JobResponse + * + * @returns {object} metadata of JobResponse + * + */ + mapper() { + return { + required: false, + serializedName: 'JobResponse', + type: { + name: 'Composite', + className: 'JobResponse', + 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' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Object' + } + }, + properties: { + required: false, + serializedName: 'properties', + type: { + name: 'Composite', + className: 'JobDetails' + } + } + } + } + }; + } +} + +module.exports = JobResponse; diff --git a/lib/services/storageImportExportManagement/lib/models/listJobsResponse.js b/lib/services/storageImportExportManagement/lib/models/listJobsResponse.js new file mode 100644 index 0000000000..16f8ea31bd --- /dev/null +++ b/lib/services/storageImportExportManagement/lib/models/listJobsResponse.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'; + +/** + * List jobs response + */ +class ListJobsResponse extends Array { + /** + * Create a ListJobsResponse. + * @member {string} [nextLink] link to next batch of jobs + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ListJobsResponse + * + * @returns {object} metadata of ListJobsResponse + * + */ + mapper() { + return { + required: false, + serializedName: 'ListJobsResponse', + type: { + name: 'Composite', + className: 'ListJobsResponse', + modelProperties: { + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + }, + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'JobResponseElementType', + type: { + name: 'Composite', + className: 'JobResponse' + } + } + } + } + } + } + }; + } +} + +module.exports = ListJobsResponse; diff --git a/lib/services/storageImportExportManagement/lib/models/listOperationsResponse.js b/lib/services/storageImportExportManagement/lib/models/listOperationsResponse.js new file mode 100644 index 0000000000..cb02773bf1 --- /dev/null +++ b/lib/services/storageImportExportManagement/lib/models/listOperationsResponse.js @@ -0,0 +1,59 @@ +/* + * 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'; + +/** + * List operations response + */ +class ListOperationsResponse extends Array { + /** + * Create a ListOperationsResponse. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ListOperationsResponse + * + * @returns {object} metadata of ListOperationsResponse + * + */ + mapper() { + return { + required: false, + serializedName: 'ListOperationsResponse', + type: { + name: 'Composite', + className: 'ListOperationsResponse', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'OperationElementType', + type: { + name: 'Composite', + className: 'Operation' + } + } + } + } + } + } + }; + } +} + +module.exports = ListOperationsResponse; diff --git a/lib/services/storageImportExportManagement/lib/models/location.js b/lib/services/storageImportExportManagement/lib/models/location.js index 0140afd8d8..65cdee218e 100755 --- a/lib/services/storageImportExportManagement/lib/models/location.js +++ b/lib/services/storageImportExportManagement/lib/models/location.js @@ -20,7 +20,7 @@ class Location { * @member {string} [id] Specifies the resource identifier of the location. * @member {string} [name] Specifies the name of the location. Use List * Locations to get all supported locations. - * @member {string} [type] Specifies the resource type of the location. + * @member {string} [type] Specifies the type of the location. * @member {string} [recipientName] The recipient name to use when shipping * the drives to the Azure data center. * @member {string} [streetAddress1] The first line of the street address to diff --git a/lib/services/storageImportExportManagement/lib/models/locationsResponse.js b/lib/services/storageImportExportManagement/lib/models/locationsResponse.js new file mode 100644 index 0000000000..89c4bb3e12 --- /dev/null +++ b/lib/services/storageImportExportManagement/lib/models/locationsResponse.js @@ -0,0 +1,59 @@ +/* + * 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'; + +/** + * Locations response + */ +class LocationsResponse extends Array { + /** + * Create a LocationsResponse. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of LocationsResponse + * + * @returns {object} metadata of LocationsResponse + * + */ + mapper() { + return { + required: false, + serializedName: 'LocationsResponse', + type: { + name: 'Composite', + className: 'LocationsResponse', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'LocationElementType', + type: { + name: 'Composite', + className: 'Location' + } + } + } + } + } + } + }; + } +} + +module.exports = LocationsResponse; diff --git a/lib/services/storageImportExportManagement/lib/models/packageInfomation.js b/lib/services/storageImportExportManagement/lib/models/packageInfomation.js index 9e0f357341..e9415e5f4a 100755 --- a/lib/services/storageImportExportManagement/lib/models/packageInfomation.js +++ b/lib/services/storageImportExportManagement/lib/models/packageInfomation.js @@ -11,7 +11,7 @@ 'use strict'; /** - * Provides information about the package being shipped by the customer to the + * Contains information about the package being shipped by the customer to the * Microsoft data center. * */ @@ -22,7 +22,7 @@ class PackageInfomation { * the import or export drives. * @member {string} trackingNumber The tracking number of the package. * @member {number} driveCount The number of drives included in the package. - * @member {string} shipDate The date the package is shipped. + * @member {string} shipDate The date when the package is shipped. */ constructor() { } diff --git a/lib/services/storageImportExportManagement/lib/models/putJobParameters.js b/lib/services/storageImportExportManagement/lib/models/putJobParameters.js new file mode 100644 index 0000000000..5a306b1d98 --- /dev/null +++ b/lib/services/storageImportExportManagement/lib/models/putJobParameters.js @@ -0,0 +1,174 @@ +/* + * 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'; + +/** + * Put Job parameters + * + */ +class PutJobParameters { + /** + * Create a PutJobParameters. + * @member {string} [location] Specifies the supported Azure location where + * the job should be created + * @member {object} [tags] Specifies the tags that will be assigned to the + * job. + * @member {object} [properties] Specifies the job properties + * @member {string} [properties.storageAccountId] The resource identifier of + * the storage account where data will be imported to or exported from. + * @member {string} [properties.jobType] The type of job + * @member {object} [properties.returnAddress] Specifies the return address + * information for the job. + * @member {string} [properties.returnAddress.recipientName] The name of the + * recipient who will receive the hard drives when they are returned. + * @member {string} [properties.returnAddress.streetAddress1] The first line + * of the street address to use when returning the drives. + * @member {string} [properties.returnAddress.streetAddress2] The second line + * of the street address to use when returning the drives. + * @member {string} [properties.returnAddress.city] The city name to use when + * returning the drives. + * @member {string} [properties.returnAddress.stateOrProvince] The state or + * province to use when returning the drives. + * @member {string} [properties.returnAddress.postalCode] The postal code to + * use when returning the drives. + * @member {string} [properties.returnAddress.countryOrRegion] The country or + * region to use when returning the drives. + * @member {string} [properties.returnAddress.phone] Phone number of the + * recipient of the returned drives. + * @member {string} [properties.returnAddress.email] Email address of the + * recipient of the returned drives. + * @member {object} [properties.returnShipping] Specifies the return carrier + * and customer's account with the carrier. + * @member {string} [properties.returnShipping.carrierName] The carrier's + * name. + * @member {string} [properties.returnShipping.carrierAccountNumber] The + * customer's account number with the carrier. + * @member {object} [properties.shippingInformation] Contains information + * about the Microsoft datacenter to which the drives should be shipped. + * @member {string} [properties.shippingInformation.recipientName] The name + * of the recipient who will receive the hard drives when they are returned. + * @member {string} [properties.shippingInformation.streetAddress1] The first + * line of the street address to use when returning the drives. + * @member {string} [properties.shippingInformation.streetAddress2] The + * second line of the street address to use when returning the drives. + * @member {string} [properties.shippingInformation.city] The city name to + * use when returning the drives. + * @member {string} [properties.shippingInformation.stateOrProvince] The + * state or province to use when returning the drives. + * @member {string} [properties.shippingInformation.postalCode] The postal + * code to use when returning the drives. + * @member {string} [properties.shippingInformation.countryOrRegion] The + * country or region to use when returning the drives. + * @member {string} [properties.shippingInformation.phone] Phone number of + * the recipient of the returned drives. + * @member {object} [properties.deliveryPackage] Contains information about + * the package being shipped by the customer to the Microsoft data center. + * @member {string} [properties.deliveryPackage.carrierName] The name of the + * carrier that is used to ship the import or export drives. + * @member {string} [properties.deliveryPackage.trackingNumber] The tracking + * number of the package. + * @member {number} [properties.deliveryPackage.driveCount] The number of + * drives included in the package. + * @member {string} [properties.deliveryPackage.shipDate] The date when the + * package is shipped. + * @member {object} [properties.returnPackage] Contains information about the + * package being shipped from the Microsoft data center to the customer to + * return the drives. The format is the same as the deliveryPackage property + * above. This property is not included if the drives have not yet been + * returned. + * @member {string} [properties.returnPackage.carrierName] The name of the + * carrier that is used to ship the import or export drives. + * @member {string} [properties.returnPackage.trackingNumber] The tracking + * number of the package. + * @member {number} [properties.returnPackage.driveCount] The number of + * drives included in the package. + * @member {string} [properties.returnPackage.shipDate] The date when the + * package is shipped. + * @member {string} [properties.diagnosticsPath] The virtual blob directory + * to which the copy logs and backups of drive manifest files (if enabled) + * will be stored. + * @member {string} [properties.logLevel] Default value is Error. Indicates + * whether error logging or verbose logging will be enabled. + * @member {boolean} [properties.backupDriveManifest] Default value is false. + * Indicates whether the manifest files on the drives should be copied to + * block blobs. + * @member {string} [properties.state] Current state of the job. + * @member {boolean} [properties.cancelRequested] Indicates whether a request + * has been submitted to cancel the job. + * @member {number} [properties.percentComplete] Overall percentage completed + * for the job. + * @member {string} [properties.incompleteBlobListUri] A blob path that + * points to a block blob containing a list of blob names that were not + * exported due to insufficient drive space. If all blobs were exported + * successfully, then this element is not included in the response. + * @member {array} [properties.driveList] List of up to ten drives that + * comprise the job. The drive list is a required element for an import job; + * it is not specified for export jobs. + * @member {object} [properties.exportProperty] A property containing + * information about the blobs to be exported for an export job. This + * property is included for export jobs only. + * @member {array} [properties.exportProperty.blobPath] A collection of + * blob-path strings. + * @member {array} [properties.exportProperty.blobPathPrefix] A collection of + * blob-prefix strings. + * @member {string} [properties.exportProperty.blobListblobPath] The relative + * URI to the block blob that contains the list of blob paths or blob path + * prefixes as defined above, beginning with the container name. If the blob + * is in root container, the URI must begin with $root. + * @member {string} [properties.provisioningState] Specifies the provisioning + * state of the job. + */ + constructor() { + } + + /** + * Defines the metadata of PutJobParameters + * + * @returns {object} metadata of PutJobParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'PutJobParameters', + type: { + name: 'Composite', + className: 'PutJobParameters', + modelProperties: { + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Object' + } + }, + properties: { + required: false, + serializedName: 'properties', + type: { + name: 'Composite', + className: 'JobDetails' + } + } + } + } + }; + } +} + +module.exports = PutJobParameters; diff --git a/lib/services/storageImportExportManagement/lib/models/shippingInformation.js b/lib/services/storageImportExportManagement/lib/models/shippingInformation.js index d83579c9e8..d89883d440 100755 --- a/lib/services/storageImportExportManagement/lib/models/shippingInformation.js +++ b/lib/services/storageImportExportManagement/lib/models/shippingInformation.js @@ -11,15 +11,28 @@ 'use strict'; /** - * Provides information about the Microsoft datacenter to which the drives + * Contains information about the Microsoft datacenter to which the drives * should be shipped. * */ class ShippingInformation { /** * Create a ShippingInformation. - * @member {string} name The name of the recipient at the datacenter. - * @member {string} address The address of the datacenter. + * @member {string} recipientName The name of the recipient who will receive + * the hard drives when they are returned. + * @member {string} streetAddress1 The first line of the street address to + * use when returning the drives. + * @member {string} [streetAddress2] The second line of the street address to + * use when returning the drives. + * @member {string} city The city name to use when returning the drives. + * @member {string} stateOrProvince The state or province to use when + * returning the drives. + * @member {string} postalCode The postal code to use when returning the + * drives. + * @member {string} countryOrRegion The country or region to use when + * returning the drives. + * @member {string} [phone] Phone number of the recipient of the returned + * drives. */ constructor() { } @@ -38,16 +51,58 @@ class ShippingInformation { name: 'Composite', className: 'ShippingInformation', modelProperties: { - name: { + recipientName: { required: true, - serializedName: 'name', + serializedName: 'recipientName', type: { name: 'String' } }, - address: { + streetAddress1: { required: true, - serializedName: 'address', + serializedName: 'streetAddress1', + type: { + name: 'String' + } + }, + streetAddress2: { + required: false, + serializedName: 'streetAddress2', + type: { + name: 'String' + } + }, + city: { + required: true, + serializedName: 'city', + type: { + name: 'String' + } + }, + stateOrProvince: { + required: true, + serializedName: 'stateOrProvince', + type: { + name: 'String' + } + }, + postalCode: { + required: true, + serializedName: 'postalCode', + type: { + name: 'String' + } + }, + countryOrRegion: { + required: true, + serializedName: 'countryOrRegion', + type: { + name: 'String' + } + }, + phone: { + required: false, + serializedName: 'phone', type: { name: 'String' } diff --git a/lib/services/storageImportExportManagement/lib/models/updateJobParameters.js b/lib/services/storageImportExportManagement/lib/models/updateJobParameters.js new file mode 100644 index 0000000000..902a2cddd9 --- /dev/null +++ b/lib/services/storageImportExportManagement/lib/models/updateJobParameters.js @@ -0,0 +1,167 @@ +/* + * 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'; + +/** + * Update Job parameters + * + */ +class UpdateJobParameters { + /** + * Create a UpdateJobParameters. + * @member {object} [tags] Specifies the tags that will be assigned to the + * job + * @member {boolean} [cancelRequested] If specified, the value must be true. + * The service will attempt to cancel the job. + * @member {string} [state] If specified, the value must be Shipping, which + * tells the Import/Export service that the package for the job has been + * shipped. The ReturnAddress and DeliveryPackage properties must have been + * set either in this request or in a previous request, otherwise the request + * will fail. + * @member {object} [returnAddress] Specifies the return address information + * for the job. + * @member {string} [returnAddress.recipientName] The name of the recipient + * who will receive the hard drives when they are returned. + * @member {string} [returnAddress.streetAddress1] The first line of the + * street address to use when returning the drives. + * @member {string} [returnAddress.streetAddress2] The second line of the + * street address to use when returning the drives. + * @member {string} [returnAddress.city] The city name to use when returning + * the drives. + * @member {string} [returnAddress.stateOrProvince] The state or province to + * use when returning the drives. + * @member {string} [returnAddress.postalCode] The postal code to use when + * returning the drives. + * @member {string} [returnAddress.countryOrRegion] The country or region to + * use when returning the drives. + * @member {string} [returnAddress.phone] Phone number of the recipient of + * the returned drives. + * @member {string} [returnAddress.email] Email address of the recipient of + * the returned drives. + * @member {object} [returnShipping] Specifies the return carrier and + * customer's account with the carrier. + * @member {string} [returnShipping.carrierName] The carrier's name. + * @member {string} [returnShipping.carrierAccountNumber] The customer's + * account number with the carrier. + * @member {object} [deliveryPackage] Contains information about the package + * being shipped by the customer to the Microsoft data center. + * @member {string} [deliveryPackage.carrierName] The name of the carrier + * that is used to ship the import or export drives. + * @member {string} [deliveryPackage.trackingNumber] The tracking number of + * the package. + * @member {number} [deliveryPackage.driveCount] The number of drives + * included in the package. + * @member {string} [deliveryPackage.shipDate] The date when the package is + * shipped. + * @member {string} [logLevel] Indicates whether error logging or verbose + * logging is enabled. + * @member {boolean} [backupDriveManifest] Indicates whether the manifest + * files on the drives should be copied to block blobs. + * @member {array} [driveList] List of drives that comprise the job. + */ + constructor() { + } + + /** + * Defines the metadata of UpdateJobParameters + * + * @returns {object} metadata of UpdateJobParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'UpdateJobParameters', + type: { + name: 'Composite', + className: 'UpdateJobParameters', + modelProperties: { + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Object' + } + }, + cancelRequested: { + required: false, + serializedName: 'properties.cancelRequested', + type: { + name: 'Boolean' + } + }, + state: { + required: false, + serializedName: 'properties.state', + type: { + name: 'String' + } + }, + returnAddress: { + required: false, + serializedName: 'properties.returnAddress', + type: { + name: 'Composite', + className: 'ReturnAddress' + } + }, + returnShipping: { + required: false, + serializedName: 'properties.returnShipping', + type: { + name: 'Composite', + className: 'ReturnShipping' + } + }, + deliveryPackage: { + required: false, + serializedName: 'properties.deliveryPackage', + type: { + name: 'Composite', + className: 'PackageInfomation' + } + }, + logLevel: { + required: false, + serializedName: 'properties.logLevel', + type: { + name: 'String' + } + }, + backupDriveManifest: { + required: false, + serializedName: 'properties.backupDriveManifest', + type: { + name: 'Boolean' + } + }, + driveList: { + required: false, + serializedName: 'properties.driveList', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DriveStatusElementType', + type: { + name: 'Composite', + className: 'DriveStatus' + } + } + } + } + } + } + }; + } +} + +module.exports = UpdateJobParameters; diff --git a/lib/services/storageImportExportManagement/lib/operations/bitLockerKeys.js b/lib/services/storageImportExportManagement/lib/operations/bitLockerKeys.js new file mode 100644 index 0000000000..8f0dc84940 --- /dev/null +++ b/lib/services/storageImportExportManagement/lib/operations/bitLockerKeys.js @@ -0,0 +1,264 @@ +/* + * 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; + +/** + * Returns the BitLocker Keys for all drives in the specified job. + * + * @param {string} jobName The name of the import/export job. + * + * @param {string} resourceGroupName The resource group name uniquely + * identifies the resource group within the user 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 GetBitLockerKeysResponse} 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(jobName, resourceGroupName, 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 (jobName === null || jobName === undefined || typeof jobName.valueOf() !== 'string') { + throw new Error('jobName cannot be null or undefined and it 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName 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/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}/listBitLockerKeys'; + requestUrl = requestUrl.replace('{jobName}', encodeURIComponent(jobName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.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['ErrorResponse']().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['GetBitLockerKeysResponse']().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 BitLockerKeys. */ +class BitLockerKeys { + /** + * Create a BitLockerKeys. + * @param {StorageImportExportManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + } + + /** + * Returns the BitLocker Keys for all drives in the specified job. + * + * @param {string} jobName The name of the import/export job. + * + * @param {string} resourceGroupName The resource group name uniquely + * identifies the resource group within the user 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(jobName, resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(jobName, resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Returns the BitLocker Keys for all drives in the specified job. + * + * @param {string} jobName The name of the import/export job. + * + * @param {string} resourceGroupName The resource group name uniquely + * identifies the resource group within the user 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 {GetBitLockerKeysResponse} - 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 GetBitLockerKeysResponse} 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(jobName, resourceGroupName, 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(jobName, resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(jobName, resourceGroupName, options, optionalCallback); + } + } + +} + +module.exports = BitLockerKeys; diff --git a/lib/services/storageImportExportManagement/lib/operations/index.d.ts b/lib/services/storageImportExportManagement/lib/operations/index.d.ts index f602e06bd4..513411fbb9 100755 --- a/lib/services/storageImportExportManagement/lib/operations/index.d.ts +++ b/lib/services/storageImportExportManagement/lib/operations/index.d.ts @@ -12,6 +12,127 @@ import { ServiceClientOptions, RequestOptions, ServiceCallback, HttpOperationRes import * as models from '../models'; +/** + * @class + * Locations + * __NOTE__: An instance of this class is automatically created for an + * instance of the StorageImportExportManagementClient. + */ +export interface Locations { + + + /** + * Returns a list of locations to which you can ship the disks associated with + * an import or export job. A location is a Microsoft data center region. + * + * @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>; + + /** + * Returns a list of locations to which you can ship the disks associated with + * an import or export job. A location is a Microsoft data center region. + * + * @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 {LocationsResponse} - 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. + * + * {LocationsResponse} [result] - The deserialized result object if an error did not occur. + * See {@link LocationsResponse} 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; + + + /** + * Returns the details about a location to which you can ship the disks + * associated with an import or export job. A location is an Azure region. + * + * @param {string} locationName The name of the location. For example, West US + * or westus. + * + * @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(locationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Returns the details about a location to which you can ship the disks + * associated with an import or export job. A location is an Azure region. + * + * @param {string} locationName The name of the location. For example, West US + * or westus. + * + * @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 {Location} - 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. + * + * {Location} [result] - The deserialized result object if an error did not occur. + * See {@link Location} 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(locationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(locationName: string, callback: ServiceCallback): void; + get(locationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + /** * @class * Jobs @@ -22,7 +143,7 @@ export interface Jobs { /** - * Gets all the active and completed import/export jobs in a subscription. + * Returns all active and completed jobs in a subscription. * * @param {object} [options] Optional Parameters. * @@ -30,27 +151,21 @@ export interface Jobs { * at most should be returned. The value cannot exceed 100. * * @param {string} [options.filter] Can be used to restrict the results to - * certain conditions. The following possible values can be used with $filter: - * 1) $filter=type eq '{type}'; 2) $filter=trackingnumber eq - * '{trackingnumber}'; 3) $filter=state eq '{state}'; 4) Logical and - * combination of the above, for example: $filter=type eq 'Import' and state eq - * 'Transferring'. Valid values for type are Import and Export. Valid values - * for state are Creating, Shipping, Received, Transferring, Packaging, Closed, - * and Completed. + * certain conditions. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(options?: { top? : number, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + listBySubscriptionWithHttpOperationResponse(options?: { top? : number, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the active and completed import/export jobs in a subscription. + * Returns all active and completed jobs in a subscription. * * @param {object} [options] Optional Parameters. * @@ -58,13 +173,7 @@ export interface Jobs { * at most should be returned. The value cannot exceed 100. * * @param {string} [options.filter] Can be used to restrict the results to - * certain conditions. The following possible values can be used with $filter: - * 1) $filter=type eq '{type}'; 2) $filter=trackingnumber eq - * '{trackingnumber}'; 3) $filter=state eq '{state}'; 4) Logical and - * combination of the above, for example: $filter=type eq 'Import' and state eq - * 'Transferring'. Valid values for type are Import and Export. Valid values - * for state are Creating, Shipping, Received, Transferring, Packaging, Closed, - * and Completed. + * certain conditions. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -76,7 +185,7 @@ export interface Jobs { * * {Promise} A promise is returned. * - * @resolve {JobListResult} - The deserialized result object. + * @resolve {ListJobsResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -84,20 +193,20 @@ export interface Jobs { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobListResult} [result] - The deserialized result object if an error did not occur. - * See {@link JobListResult} for more information. + * {ListJobsResponse} [result] - The deserialized result object if an error did not occur. + * See {@link ListJobsResponse} 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?: { top? : number, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { top? : number, filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listBySubscription(options?: { top? : number, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listBySubscription(callback: ServiceCallback): void; + listBySubscription(options: { top? : number, filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns all active and completed import/export jobs in a resource group. + * Returns all active and completed jobs in a resource group. * * @param {string} resourceGroupName The resource group name uniquely * identifies the resource group within the user subscription. @@ -108,27 +217,21 @@ export interface Jobs { * at most should be returned. The value cannot exceed 100. * * @param {string} [options.filter] Can be used to restrict the results to - * certain conditions. The following possible values can be used with $filter: - * 1) $filter=type eq '{type}'; 2) $filter=trackingnumber eq - * '{trackingnumber}'; 3) $filter=state eq '{state}'; 4) Logical and - * combination of the above, for example: $filter=type eq 'Import' and state eq - * 'Transferring'. Valid values for type are Import and Export. Valid values - * for state are Creating, Shipping, Received, Transferring, Packaging, Closed, - * and Completed. + * certain conditions. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { top? : number, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { top? : number, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns all active and completed import/export jobs in a resource group. + * Returns all active and completed jobs in a resource group. * * @param {string} resourceGroupName The resource group name uniquely * identifies the resource group within the user subscription. @@ -139,13 +242,7 @@ export interface Jobs { * at most should be returned. The value cannot exceed 100. * * @param {string} [options.filter] Can be used to restrict the results to - * certain conditions. The following possible values can be used with $filter: - * 1) $filter=type eq '{type}'; 2) $filter=trackingnumber eq - * '{trackingnumber}'; 3) $filter=state eq '{state}'; 4) Logical and - * combination of the above, for example: $filter=type eq 'Import' and state eq - * 'Transferring'. Valid values for type are Import and Export. Valid values - * for state are Creating, Shipping, Received, Transferring, Packaging, Closed, - * and Completed. + * certain conditions. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -157,7 +254,7 @@ export interface Jobs { * * {Promise} A promise is returned. * - * @resolve {JobListResult} - The deserialized result object. + * @resolve {ListJobsResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -165,26 +262,26 @@ export interface Jobs { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobListResult} [result] - The deserialized result object if an error did not occur. - * See {@link JobListResult} for more information. + * {ListJobsResponse} [result] - The deserialized result object if an error did not occur. + * See {@link ListJobsResponse} 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(resourceGroupName: string, options?: { top? : number, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options: { top? : number, filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options?: { top? : number, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options: { top? : number, filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets information about an existing import/export job. + * Gets information about an existing job. + * + * @param {string} jobName The name of the import/export job. * * @param {string} resourceGroupName The resource group name uniquely * identifies the resource group within the user subscription. * - * @param {string} jobName The name of the import/export job. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -192,20 +289,20 @@ export interface Jobs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(jobName: string, resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets information about an existing import/export job. + * Gets information about an existing job. + * + * @param {string} jobName The name of the import/export job. * * @param {string} resourceGroupName The resource group name uniquely * identifies the resource group within the user subscription. * - * @param {string} jobName The name of the import/export job. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -218,7 +315,7 @@ export interface Jobs { * * {Promise} A promise is returned. * - * @resolve {Job} - The deserialized result object. + * @resolve {JobResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -226,101 +323,103 @@ export interface Jobs { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Job} [result] - The deserialized result object if an error did not occur. - * See {@link Job} for more information. + * {JobResponse} [result] - The deserialized result object if an error did not occur. + * See {@link JobResponse} 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(resourceGroupName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, jobName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, jobName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(jobName: string, resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(jobName: string, resourceGroupName: string, callback: ServiceCallback): void; + get(jobName: string, resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates specific properties of the import/export job. You can call this - * operation to notify the Import/Export service that the hard drives - * comprising the import or export job have been shipped to the Microsoft data - * center. It can also be used to cancel an existing job. + * Updates specific properties of a job. You can call this operation to notify + * the Import/Export service that the hard drives comprising the import or + * export job have been shipped to the Microsoft data center. It can also be + * used to cancel an existing job. + * + * @param {string} jobName The name of the import/export job. * * @param {string} resourceGroupName The resource group name uniquely * identifies the resource group within the user subscription. * - * @param {string} jobName The name of the import/export job. - * - * @param {object} jobProperties Import/export job properties that need to be - * updated. + * @param {object} body The parameters to update in the job * - * @param {object} [jobProperties.tags] + * @param {object} [body.tags] Specifies the tags that will be assigned to the + * job * - * @param {boolean} [jobProperties.cancelRequested] If specified, the value - * must be true. The service will attempt to cancel the job. + * @param {boolean} [body.cancelRequested] If specified, the value must be + * true. The service will attempt to cancel the job. * - * @param {string} [jobProperties.state] If specified, the value must be - * Shipping, which tells the Import/Export service that the package for the job - * has been shipped. The ReturnAddress and DeliveryPackage properties must have - * been set either in this request or in a previous request, otherwise the - * request will fail. Possible values include: 'Shipping' + * @param {string} [body.state] If specified, the value must be Shipping, which + * tells the Import/Export service that the package for the job has been + * shipped. The ReturnAddress and DeliveryPackage properties must have been set + * either in this request or in a previous request, otherwise the request will + * fail. * - * @param {object} [jobProperties.returnAddress] Specifies the return address + * @param {object} [body.returnAddress] Specifies the return address * information for the job. * - * @param {string} jobProperties.returnAddress.recipientName The name of the - * recipient who will receive the hard drives when they are returned. + * @param {string} body.returnAddress.recipientName The name of the recipient + * who will receive the hard drives when they are returned. * - * @param {string} jobProperties.returnAddress.streetAddress1 The first line of - * the street address to use when returning the drives. + * @param {string} body.returnAddress.streetAddress1 The first line of the + * street address to use when returning the drives. * - * @param {string} [jobProperties.returnAddress.streetAddress2] The second line - * of the street address to use when returning the drives. + * @param {string} [body.returnAddress.streetAddress2] The second line of the + * street address to use when returning the drives. * - * @param {string} jobProperties.returnAddress.city The city name to use when - * returning the drives. + * @param {string} body.returnAddress.city The city name to use when returning + * the drives. * - * @param {string} [jobProperties.returnAddress.stateOrProvince] The state or - * province to use when returning the drives. + * @param {string} [body.returnAddress.stateOrProvince] The state or province + * to use when returning the drives. * - * @param {string} jobProperties.returnAddress.postalCode The postal code to + * @param {string} body.returnAddress.postalCode The postal code to use when + * returning the drives. + * + * @param {string} body.returnAddress.countryOrRegion The country or region to * use when returning the drives. * - * @param {string} jobProperties.returnAddress.countryOrRegion The country or - * region to use when returning the drives. + * @param {string} body.returnAddress.phone Phone number of the recipient of + * the returned drives. * - * @param {string} jobProperties.returnAddress.phone Phone number of the - * recipient of the returned drives. + * @param {string} body.returnAddress.email Email address of the recipient of + * the returned drives. * - * @param {string} jobProperties.returnAddress.email Email address of the - * recipient of the returned drives. + * @param {object} [body.returnShipping] Specifies the return carrier and + * customer's account with the carrier. * - * @param {object} [jobProperties.returnShipping] Specifies the return carrier - * and customer's account with the carrier. + * @param {string} body.returnShipping.carrierName The carrier's name. * - * @param {string} jobProperties.returnShipping.carrierName The carrier's name. + * @param {string} body.returnShipping.carrierAccountNumber The customer's + * account number with the carrier. * - * @param {string} jobProperties.returnShipping.carrierAccountNumber The - * customer's account number with the carrier. + * @param {object} [body.deliveryPackage] Contains information about the + * package being shipped by the customer to the Microsoft data center. * - * @param {object} [jobProperties.deliveryPackage] Contains information about - * the package being shipped by the customer to the Microsoft data center. + * @param {string} body.deliveryPackage.carrierName The name of the carrier + * that is used to ship the import or export drives. * - * @param {string} jobProperties.deliveryPackage.carrierName The name of the - * carrier that is used to ship the import or export drives. + * @param {string} body.deliveryPackage.trackingNumber The tracking number of + * the package. * - * @param {string} jobProperties.deliveryPackage.trackingNumber The tracking - * number of the package. + * @param {number} body.deliveryPackage.driveCount The number of drives + * included in the package. * - * @param {number} jobProperties.deliveryPackage.driveCount The number of - * drives included in the package. + * @param {string} body.deliveryPackage.shipDate The date when the package is + * shipped. * - * @param {string} jobProperties.deliveryPackage.shipDate The date the package - * is shipped. + * @param {string} [body.logLevel] Indicates whether error logging or verbose + * logging is enabled. * - * @param {string} [jobProperties.logLevel] Indicates whether error logging or - * verbose logging is enabled. + * @param {boolean} [body.backupDriveManifest] Indicates whether the manifest + * files on the drives should be copied to block blobs. * - * @param {boolean} [jobProperties.backupDriveManifest] Indicates whether the - * manifest files on the drives should be copied to block blobs. + * @param {array} [body.driveList] List of drives that comprise the job. * * @param {object} [options] Optional Parameters. * @@ -329,95 +428,97 @@ export interface Jobs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, jobName: string, jobProperties: models.MutableJob, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(jobName: string, resourceGroupName: string, body: models.UpdateJobParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates specific properties of the import/export job. You can call this - * operation to notify the Import/Export service that the hard drives - * comprising the import or export job have been shipped to the Microsoft data - * center. It can also be used to cancel an existing job. + * Updates specific properties of a job. You can call this operation to notify + * the Import/Export service that the hard drives comprising the import or + * export job have been shipped to the Microsoft data center. It can also be + * used to cancel an existing job. + * + * @param {string} jobName The name of the import/export job. * * @param {string} resourceGroupName The resource group name uniquely * identifies the resource group within the user subscription. * - * @param {string} jobName The name of the import/export job. - * - * @param {object} jobProperties Import/export job properties that need to be - * updated. + * @param {object} body The parameters to update in the job * - * @param {object} [jobProperties.tags] + * @param {object} [body.tags] Specifies the tags that will be assigned to the + * job * - * @param {boolean} [jobProperties.cancelRequested] If specified, the value - * must be true. The service will attempt to cancel the job. + * @param {boolean} [body.cancelRequested] If specified, the value must be + * true. The service will attempt to cancel the job. * - * @param {string} [jobProperties.state] If specified, the value must be - * Shipping, which tells the Import/Export service that the package for the job - * has been shipped. The ReturnAddress and DeliveryPackage properties must have - * been set either in this request or in a previous request, otherwise the - * request will fail. Possible values include: 'Shipping' + * @param {string} [body.state] If specified, the value must be Shipping, which + * tells the Import/Export service that the package for the job has been + * shipped. The ReturnAddress and DeliveryPackage properties must have been set + * either in this request or in a previous request, otherwise the request will + * fail. * - * @param {object} [jobProperties.returnAddress] Specifies the return address + * @param {object} [body.returnAddress] Specifies the return address * information for the job. * - * @param {string} jobProperties.returnAddress.recipientName The name of the - * recipient who will receive the hard drives when they are returned. + * @param {string} body.returnAddress.recipientName The name of the recipient + * who will receive the hard drives when they are returned. * - * @param {string} jobProperties.returnAddress.streetAddress1 The first line of - * the street address to use when returning the drives. + * @param {string} body.returnAddress.streetAddress1 The first line of the + * street address to use when returning the drives. * - * @param {string} [jobProperties.returnAddress.streetAddress2] The second line - * of the street address to use when returning the drives. + * @param {string} [body.returnAddress.streetAddress2] The second line of the + * street address to use when returning the drives. * - * @param {string} jobProperties.returnAddress.city The city name to use when - * returning the drives. + * @param {string} body.returnAddress.city The city name to use when returning + * the drives. * - * @param {string} [jobProperties.returnAddress.stateOrProvince] The state or - * province to use when returning the drives. + * @param {string} [body.returnAddress.stateOrProvince] The state or province + * to use when returning the drives. * - * @param {string} jobProperties.returnAddress.postalCode The postal code to + * @param {string} body.returnAddress.postalCode The postal code to use when + * returning the drives. + * + * @param {string} body.returnAddress.countryOrRegion The country or region to * use when returning the drives. * - * @param {string} jobProperties.returnAddress.countryOrRegion The country or - * region to use when returning the drives. + * @param {string} body.returnAddress.phone Phone number of the recipient of + * the returned drives. * - * @param {string} jobProperties.returnAddress.phone Phone number of the - * recipient of the returned drives. + * @param {string} body.returnAddress.email Email address of the recipient of + * the returned drives. * - * @param {string} jobProperties.returnAddress.email Email address of the - * recipient of the returned drives. + * @param {object} [body.returnShipping] Specifies the return carrier and + * customer's account with the carrier. * - * @param {object} [jobProperties.returnShipping] Specifies the return carrier - * and customer's account with the carrier. + * @param {string} body.returnShipping.carrierName The carrier's name. * - * @param {string} jobProperties.returnShipping.carrierName The carrier's name. + * @param {string} body.returnShipping.carrierAccountNumber The customer's + * account number with the carrier. * - * @param {string} jobProperties.returnShipping.carrierAccountNumber The - * customer's account number with the carrier. + * @param {object} [body.deliveryPackage] Contains information about the + * package being shipped by the customer to the Microsoft data center. * - * @param {object} [jobProperties.deliveryPackage] Contains information about - * the package being shipped by the customer to the Microsoft data center. + * @param {string} body.deliveryPackage.carrierName The name of the carrier + * that is used to ship the import or export drives. * - * @param {string} jobProperties.deliveryPackage.carrierName The name of the - * carrier that is used to ship the import or export drives. + * @param {string} body.deliveryPackage.trackingNumber The tracking number of + * the package. * - * @param {string} jobProperties.deliveryPackage.trackingNumber The tracking - * number of the package. + * @param {number} body.deliveryPackage.driveCount The number of drives + * included in the package. * - * @param {number} jobProperties.deliveryPackage.driveCount The number of - * drives included in the package. + * @param {string} body.deliveryPackage.shipDate The date when the package is + * shipped. * - * @param {string} jobProperties.deliveryPackage.shipDate The date the package - * is shipped. + * @param {string} [body.logLevel] Indicates whether error logging or verbose + * logging is enabled. * - * @param {string} [jobProperties.logLevel] Indicates whether error logging or - * verbose logging is enabled. + * @param {boolean} [body.backupDriveManifest] Indicates whether the manifest + * files on the drives should be copied to block blobs. * - * @param {boolean} [jobProperties.backupDriveManifest] Indicates whether the - * manifest files on the drives should be copied to block blobs. + * @param {array} [body.driveList] List of drives that comprise the job. * * @param {object} [options] Optional Parameters. * @@ -431,7 +532,7 @@ export interface Jobs { * * {Promise} A promise is returned. * - * @resolve {Job} - The deserialized result object. + * @resolve {JobResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -439,263 +540,351 @@ export interface Jobs { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Job} [result] - The deserialized result object if an error did not occur. - * See {@link Job} for more information. + * {JobResponse} [result] - The deserialized result object if an error did not occur. + * See {@link JobResponse} 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(resourceGroupName: string, jobName: string, jobProperties: models.MutableJob, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, jobName: string, jobProperties: models.MutableJob, callback: ServiceCallback): void; - update(resourceGroupName: string, jobName: string, jobProperties: models.MutableJob, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(jobName: string, resourceGroupName: string, body: models.UpdateJobParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(jobName: string, resourceGroupName: string, body: models.UpdateJobParameters, callback: ServiceCallback): void; + update(jobName: string, resourceGroupName: string, body: models.UpdateJobParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates a new import/export job or updates an existing import/export job in - * the specified subscription. + * Creates a new job or updates an existing job in the specified subscription. + * + * @param {string} jobName The name of the import/export job. * * @param {string} resourceGroupName The resource group name uniquely * identifies the resource group within the user subscription. * - * @param {string} jobName The name of the import/export job. + * @param {object} body The parameters used for creating the job * - * @param {object} jobProperties Properties of the import/export job that need - * to be specified during creation. + * @param {string} [body.location] Specifies the supported Azure location where + * the job should be created * - * @param {string} jobProperties.storageAccountId The resource identifier of - * the storage account where data will be imported to or exported from. + * @param {object} [body.tags] Specifies the tags that will be assigned to the + * job. * - * @param {string} [jobProperties.containerSas] The container shared access - * signature (SAS) to be used to import or export data to or from the storage - * account. + * @param {object} [body.properties] Specifies the job properties * - * @param {string} jobProperties.jobType The type of job: Import or Export. - * Possible values include: 'Import', 'Export' + * @param {string} [body.properties.storageAccountId] The resource identifier + * of the storage account where data will be imported to or exported from. * - * @param {object} jobProperties.returnAddress Specifies the return address + * @param {string} [body.properties.jobType] The type of job + * + * @param {object} [body.properties.returnAddress] Specifies the return address * information for the job. * - * @param {string} jobProperties.returnAddress.recipientName The name of the + * @param {string} body.properties.returnAddress.recipientName The name of the * recipient who will receive the hard drives when they are returned. * - * @param {string} jobProperties.returnAddress.streetAddress1 The first line of - * the street address to use when returning the drives. - * - * @param {string} [jobProperties.returnAddress.streetAddress2] The second line + * @param {string} body.properties.returnAddress.streetAddress1 The first line * of the street address to use when returning the drives. * - * @param {string} jobProperties.returnAddress.city The city name to use when + * @param {string} [body.properties.returnAddress.streetAddress2] The second + * line of the street address to use when returning the drives. + * + * @param {string} body.properties.returnAddress.city The city name to use when * returning the drives. * - * @param {string} [jobProperties.returnAddress.stateOrProvince] The state or + * @param {string} [body.properties.returnAddress.stateOrProvince] The state or * province to use when returning the drives. * - * @param {string} jobProperties.returnAddress.postalCode The postal code to + * @param {string} body.properties.returnAddress.postalCode The postal code to * use when returning the drives. * - * @param {string} jobProperties.returnAddress.countryOrRegion The country or + * @param {string} body.properties.returnAddress.countryOrRegion The country or * region to use when returning the drives. * - * @param {string} jobProperties.returnAddress.phone Phone number of the + * @param {string} body.properties.returnAddress.phone Phone number of the * recipient of the returned drives. * - * @param {string} jobProperties.returnAddress.email Email address of the + * @param {string} body.properties.returnAddress.email Email address of the * recipient of the returned drives. * - * @param {object} jobProperties.returnShipping Specifies the return carrier - * and customer's account with the carrier. + * @param {object} [body.properties.returnShipping] Specifies the return + * carrier and customer's account with the carrier. * - * @param {string} jobProperties.returnShipping.carrierName The carrier's name. + * @param {string} body.properties.returnShipping.carrierName The carrier's + * name. * - * @param {string} jobProperties.returnShipping.carrierAccountNumber The + * @param {string} body.properties.returnShipping.carrierAccountNumber The * customer's account number with the carrier. * - * @param {object} [jobProperties.deliveryPackage] Contains information about + * @param {object} [body.properties.shippingInformation] Contains information + * about the Microsoft datacenter to which the drives should be shipped. + * + * @param {string} body.properties.shippingInformation.recipientName The name + * of the recipient who will receive the hard drives when they are returned. + * + * @param {string} body.properties.shippingInformation.streetAddress1 The first + * line of the street address to use when returning the drives. + * + * @param {string} [body.properties.shippingInformation.streetAddress2] The + * second line of the street address to use when returning the drives. + * + * @param {string} body.properties.shippingInformation.city The city name to + * use when returning the drives. + * + * @param {string} body.properties.shippingInformation.stateOrProvince The + * state or province to use when returning the drives. + * + * @param {string} body.properties.shippingInformation.postalCode The postal + * code to use when returning the drives. + * + * @param {string} body.properties.shippingInformation.countryOrRegion The + * country or region to use when returning the drives. + * + * @param {string} [body.properties.shippingInformation.phone] Phone number of + * the recipient of the returned drives. + * + * @param {object} [body.properties.deliveryPackage] Contains information about * the package being shipped by the customer to the Microsoft data center. * - * @param {string} jobProperties.deliveryPackage.carrierName The name of the + * @param {object} [body.properties.returnPackage] Contains information about + * the package being shipped from the Microsoft data center to the customer to + * return the drives. The format is the same as the deliveryPackage property + * above. This property is not included if the drives have not yet been + * returned. + * + * @param {string} body.properties.returnPackage.carrierName The name of the * carrier that is used to ship the import or export drives. * - * @param {string} jobProperties.deliveryPackage.trackingNumber The tracking + * @param {string} body.properties.returnPackage.trackingNumber The tracking * number of the package. * - * @param {number} jobProperties.deliveryPackage.driveCount The number of + * @param {number} body.properties.returnPackage.driveCount The number of * drives included in the package. * - * @param {string} jobProperties.deliveryPackage.shipDate The date the package - * is shipped. + * @param {string} body.properties.returnPackage.shipDate The date when the + * package is shipped. + * + * @param {string} [body.properties.diagnosticsPath] The virtual blob directory + * to which the copy logs and backups of drive manifest files (if enabled) will + * be stored. + * + * @param {string} [body.properties.logLevel] Default value is Error. Indicates + * whether error logging or verbose logging will be enabled. * - * @param {string} jobProperties.diagnosticsPath The virtual blob directory to - * which the copy logs and backups of drive manifest files (if enabled) will be - * stored. + * @param {boolean} [body.properties.backupDriveManifest] Default value is + * false. Indicates whether the manifest files on the drives should be copied + * to block blobs. * - * @param {string} [jobProperties.logLevel] Default value is Error. Indicates - * whether error logging or verbose logging will be enabled. Possible values - * include: 'Error', 'Verbose' + * @param {string} [body.properties.state] Current state of the job. * - * @param {boolean} [jobProperties.backupDriveManifest] Default value is false. - * Indicates whether the manifest files on the drives should be copied to block - * blobs. + * @param {boolean} [body.properties.cancelRequested] Indicates whether a + * request has been submitted to cancel the job. * - * @param {boolean} [jobProperties.cancelRequested] Indicates whether a request - * has been submitted to cancel the job. + * @param {number} [body.properties.percentComplete] Overall percentage + * completed for the job. * - * @param {array} [jobProperties.driveList] List of up to ten drives that + * @param {string} [body.properties.incompleteBlobListUri] A blob path that + * points to a block blob containing a list of blob names that were not + * exported due to insufficient drive space. If all blobs were exported + * successfully, then this element is not included in the response. + * + * @param {array} [body.properties.driveList] List of up to ten drives that * comprise the job. The drive list is a required element for an import job; it * is not specified for export jobs. * - * @param {object} [jobProperties.exportProperty] A property containing + * @param {object} [body.properties.exportProperty] A property containing * information about the blobs to be exported for an export job. This property * is included for export jobs only. * - * @param {array} [jobProperties.exportProperty.blobPath] A collection of + * @param {array} [body.properties.exportProperty.blobPath] A collection of * blob-path strings. * - * @param {array} [jobProperties.exportProperty.blobPathPrefix] A collection of - * blob-prefix strings. - * - * @param {string} [jobProperties.exportProperty.blobListblobPath] The relative - * URI to the block blob that contains the list of blob paths or blob path - * prefixes as defined above, beginning with the container name. If the blob is - * in the root container, the URI must begin with $root. + * @param {array} [body.properties.exportProperty.blobPathPrefix] A collection + * of blob-prefix strings. * - * @param {string} jobProperties.location Specifies the Azure location where - * the job is created. + * @param {string} [body.properties.exportProperty.blobListblobPath] The + * relative URI to the block blob that contains the list of blob paths or blob + * path prefixes as defined above, beginning with the container name. If the + * blob is in root container, the URI must begin with $root. * - * @param {object} [jobProperties.tags] Specifies the tags that are assigned to - * the job. + * @param {string} [body.properties.provisioningState] Specifies the + * provisioning state of the job. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.clientTenantId] The tenant ID of the client making + * the request. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, jobName: string, jobProperties: models.Job, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createWithHttpOperationResponse(jobName: string, resourceGroupName: string, body: models.PutJobParameters, options?: { clientTenantId? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a new import/export job or updates an existing import/export job in - * the specified subscription. + * Creates a new job or updates an existing job in the specified subscription. + * + * @param {string} jobName The name of the import/export job. * * @param {string} resourceGroupName The resource group name uniquely * identifies the resource group within the user subscription. * - * @param {string} jobName The name of the import/export job. + * @param {object} body The parameters used for creating the job * - * @param {object} jobProperties Properties of the import/export job that need - * to be specified during creation. + * @param {string} [body.location] Specifies the supported Azure location where + * the job should be created * - * @param {string} jobProperties.storageAccountId The resource identifier of - * the storage account where data will be imported to or exported from. + * @param {object} [body.tags] Specifies the tags that will be assigned to the + * job. * - * @param {string} [jobProperties.containerSas] The container shared access - * signature (SAS) to be used to import or export data to or from the storage - * account. + * @param {object} [body.properties] Specifies the job properties * - * @param {string} jobProperties.jobType The type of job: Import or Export. - * Possible values include: 'Import', 'Export' + * @param {string} [body.properties.storageAccountId] The resource identifier + * of the storage account where data will be imported to or exported from. * - * @param {object} jobProperties.returnAddress Specifies the return address + * @param {string} [body.properties.jobType] The type of job + * + * @param {object} [body.properties.returnAddress] Specifies the return address * information for the job. * - * @param {string} jobProperties.returnAddress.recipientName The name of the + * @param {string} body.properties.returnAddress.recipientName The name of the * recipient who will receive the hard drives when they are returned. * - * @param {string} jobProperties.returnAddress.streetAddress1 The first line of - * the street address to use when returning the drives. - * - * @param {string} [jobProperties.returnAddress.streetAddress2] The second line + * @param {string} body.properties.returnAddress.streetAddress1 The first line * of the street address to use when returning the drives. * - * @param {string} jobProperties.returnAddress.city The city name to use when + * @param {string} [body.properties.returnAddress.streetAddress2] The second + * line of the street address to use when returning the drives. + * + * @param {string} body.properties.returnAddress.city The city name to use when * returning the drives. * - * @param {string} [jobProperties.returnAddress.stateOrProvince] The state or + * @param {string} [body.properties.returnAddress.stateOrProvince] The state or * province to use when returning the drives. * - * @param {string} jobProperties.returnAddress.postalCode The postal code to + * @param {string} body.properties.returnAddress.postalCode The postal code to * use when returning the drives. * - * @param {string} jobProperties.returnAddress.countryOrRegion The country or + * @param {string} body.properties.returnAddress.countryOrRegion The country or * region to use when returning the drives. * - * @param {string} jobProperties.returnAddress.phone Phone number of the + * @param {string} body.properties.returnAddress.phone Phone number of the * recipient of the returned drives. * - * @param {string} jobProperties.returnAddress.email Email address of the + * @param {string} body.properties.returnAddress.email Email address of the * recipient of the returned drives. * - * @param {object} jobProperties.returnShipping Specifies the return carrier - * and customer's account with the carrier. + * @param {object} [body.properties.returnShipping] Specifies the return + * carrier and customer's account with the carrier. * - * @param {string} jobProperties.returnShipping.carrierName The carrier's name. + * @param {string} body.properties.returnShipping.carrierName The carrier's + * name. * - * @param {string} jobProperties.returnShipping.carrierAccountNumber The + * @param {string} body.properties.returnShipping.carrierAccountNumber The * customer's account number with the carrier. * - * @param {object} [jobProperties.deliveryPackage] Contains information about + * @param {object} [body.properties.shippingInformation] Contains information + * about the Microsoft datacenter to which the drives should be shipped. + * + * @param {string} body.properties.shippingInformation.recipientName The name + * of the recipient who will receive the hard drives when they are returned. + * + * @param {string} body.properties.shippingInformation.streetAddress1 The first + * line of the street address to use when returning the drives. + * + * @param {string} [body.properties.shippingInformation.streetAddress2] The + * second line of the street address to use when returning the drives. + * + * @param {string} body.properties.shippingInformation.city The city name to + * use when returning the drives. + * + * @param {string} body.properties.shippingInformation.stateOrProvince The + * state or province to use when returning the drives. + * + * @param {string} body.properties.shippingInformation.postalCode The postal + * code to use when returning the drives. + * + * @param {string} body.properties.shippingInformation.countryOrRegion The + * country or region to use when returning the drives. + * + * @param {string} [body.properties.shippingInformation.phone] Phone number of + * the recipient of the returned drives. + * + * @param {object} [body.properties.deliveryPackage] Contains information about * the package being shipped by the customer to the Microsoft data center. * - * @param {string} jobProperties.deliveryPackage.carrierName The name of the + * @param {object} [body.properties.returnPackage] Contains information about + * the package being shipped from the Microsoft data center to the customer to + * return the drives. The format is the same as the deliveryPackage property + * above. This property is not included if the drives have not yet been + * returned. + * + * @param {string} body.properties.returnPackage.carrierName The name of the * carrier that is used to ship the import or export drives. * - * @param {string} jobProperties.deliveryPackage.trackingNumber The tracking + * @param {string} body.properties.returnPackage.trackingNumber The tracking * number of the package. * - * @param {number} jobProperties.deliveryPackage.driveCount The number of + * @param {number} body.properties.returnPackage.driveCount The number of * drives included in the package. * - * @param {string} jobProperties.deliveryPackage.shipDate The date the package - * is shipped. + * @param {string} body.properties.returnPackage.shipDate The date when the + * package is shipped. * - * @param {string} jobProperties.diagnosticsPath The virtual blob directory to - * which the copy logs and backups of drive manifest files (if enabled) will be - * stored. + * @param {string} [body.properties.diagnosticsPath] The virtual blob directory + * to which the copy logs and backups of drive manifest files (if enabled) will + * be stored. * - * @param {string} [jobProperties.logLevel] Default value is Error. Indicates - * whether error logging or verbose logging will be enabled. Possible values - * include: 'Error', 'Verbose' + * @param {string} [body.properties.logLevel] Default value is Error. Indicates + * whether error logging or verbose logging will be enabled. * - * @param {boolean} [jobProperties.backupDriveManifest] Default value is false. - * Indicates whether the manifest files on the drives should be copied to block - * blobs. + * @param {boolean} [body.properties.backupDriveManifest] Default value is + * false. Indicates whether the manifest files on the drives should be copied + * to block blobs. * - * @param {boolean} [jobProperties.cancelRequested] Indicates whether a request - * has been submitted to cancel the job. + * @param {string} [body.properties.state] Current state of the job. * - * @param {array} [jobProperties.driveList] List of up to ten drives that + * @param {boolean} [body.properties.cancelRequested] Indicates whether a + * request has been submitted to cancel the job. + * + * @param {number} [body.properties.percentComplete] Overall percentage + * completed for the job. + * + * @param {string} [body.properties.incompleteBlobListUri] A blob path that + * points to a block blob containing a list of blob names that were not + * exported due to insufficient drive space. If all blobs were exported + * successfully, then this element is not included in the response. + * + * @param {array} [body.properties.driveList] List of up to ten drives that * comprise the job. The drive list is a required element for an import job; it * is not specified for export jobs. * - * @param {object} [jobProperties.exportProperty] A property containing + * @param {object} [body.properties.exportProperty] A property containing * information about the blobs to be exported for an export job. This property * is included for export jobs only. * - * @param {array} [jobProperties.exportProperty.blobPath] A collection of + * @param {array} [body.properties.exportProperty.blobPath] A collection of * blob-path strings. * - * @param {array} [jobProperties.exportProperty.blobPathPrefix] A collection of - * blob-prefix strings. - * - * @param {string} [jobProperties.exportProperty.blobListblobPath] The relative - * URI to the block blob that contains the list of blob paths or blob path - * prefixes as defined above, beginning with the container name. If the blob is - * in the root container, the URI must begin with $root. + * @param {array} [body.properties.exportProperty.blobPathPrefix] A collection + * of blob-prefix strings. * - * @param {string} jobProperties.location Specifies the Azure location where - * the job is created. + * @param {string} [body.properties.exportProperty.blobListblobPath] The + * relative URI to the block blob that contains the list of blob paths or blob + * path prefixes as defined above, beginning with the container name. If the + * blob is in root container, the URI must begin with $root. * - * @param {object} [jobProperties.tags] Specifies the tags that are assigned to - * the job. + * @param {string} [body.properties.provisioningState] Specifies the + * provisioning state of the job. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.clientTenantId] The tenant ID of the client making + * the request. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -706,7 +895,7 @@ export interface Jobs { * * {Promise} A promise is returned. * - * @resolve {Job} - The deserialized result object. + * @resolve {JobResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -714,27 +903,27 @@ export interface Jobs { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Job} [result] - The deserialized result object if an error did not occur. - * See {@link Job} for more information. + * {JobResponse} [result] - The deserialized result object if an error did not occur. + * See {@link JobResponse} 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(resourceGroupName: string, jobName: string, jobProperties: models.Job, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, jobName: string, jobProperties: models.Job, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, jobName: string, jobProperties: models.Job, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + create(jobName: string, resourceGroupName: string, body: models.PutJobParameters, options?: { clientTenantId? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + create(jobName: string, resourceGroupName: string, body: models.PutJobParameters, callback: ServiceCallback): void; + create(jobName: string, resourceGroupName: string, body: models.PutJobParameters, options: { clientTenantId? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes an existing import/export job. Only import/export jobs in the - * Creating or Completed states can be deleted. + * Deletes an existing job. Only jobs in the Creating or Completed states can + * be deleted. + * + * @param {string} jobName The name of the import/export job. * * @param {string} resourceGroupName The resource group name uniquely * identifies the resource group within the user subscription. * - * @param {string} jobName The name of the import/export job. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -746,17 +935,17 @@ export interface Jobs { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(jobName: string, resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes an existing import/export job. Only import/export jobs in the - * Creating or Completed states can be deleted. + * Deletes an existing job. Only jobs in the Creating or Completed states can + * be deleted. + * + * @param {string} jobName The name of the import/export job. * * @param {string} resourceGroupName The resource group name uniquely * identifies the resource group within the user subscription. * - * @param {string} jobName The name of the import/export job. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -783,28 +972,16 @@ export interface Jobs { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, jobName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, jobName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(jobName: string, resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(jobName: string, resourceGroupName: string, callback: ServiceCallback): void; + deleteMethod(jobName: string, resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Moves the specified import/export jobs from the resource group to a target - * resource group. The target resource group may be in a different - * subscription. + * Returns all active and completed jobs in a subscription. * - * @param {string} resourceGroupName The resource group name uniquely - * identifies the resource group within the user subscription. - * - * @param {object} moveJobsParameters Parameters to be provided to move a job - * from one resource group to another. - * - * @param {string} moveJobsParameters.targetResourceGroup Specifies the target - * resource group ID to move the jobs to. - * - * @param {array} moveJobsParameters.resources Specifies the list of jobs to - * move to the target resource group. The jobs must be from the current - * resource group from the request URL. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -813,29 +990,17 @@ export interface Jobs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - moveWithHttpOperationResponse(resourceGroupName: string, moveJobsParameters: models.MoveJobParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listBySubscriptionNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Moves the specified import/export jobs from the resource group to a target - * resource group. The target resource group may be in a different - * subscription. - * - * @param {string} resourceGroupName The resource group name uniquely - * identifies the resource group within the user subscription. - * - * @param {object} moveJobsParameters Parameters to be provided to move a job - * from one resource group to another. + * Returns all active and completed jobs in a subscription. * - * @param {string} moveJobsParameters.targetResourceGroup Specifies the target - * resource group ID to move the jobs to. - * - * @param {array} moveJobsParameters.resources Specifies the list of jobs to - * move to the target resource group. The jobs must be from the current - * resource group from the request URL. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -849,7 +1014,7 @@ export interface Jobs { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ListJobsResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -857,24 +1022,23 @@ export interface Jobs { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ListJobsResponse} [result] - The deserialized result object if an error did not occur. + * See {@link ListJobsResponse} 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. */ - move(resourceGroupName: string, moveJobsParameters: models.MoveJobParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - move(resourceGroupName: string, moveJobsParameters: models.MoveJobParameters, callback: ServiceCallback): void; - move(resourceGroupName: string, moveJobsParameters: models.MoveJobParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listBySubscriptionNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listBySubscriptionNext(nextPageLink: string, callback: ServiceCallback): void; + listBySubscriptionNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists the BitLocker keys for all drives in the specified import/export job. + * Returns all active and completed jobs in a resource group. * - * @param {string} resourceGroupName The resource group name uniquely - * identifies the resource group within the user subscription. - * - * @param {string} jobName The name of the import/export job. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -883,19 +1047,17 @@ export interface Jobs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listBitLockerKeysWithHttpOperationResponse(resourceGroupName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists the BitLocker keys for all drives in the specified import/export job. - * - * @param {string} resourceGroupName The resource group name uniquely - * identifies the resource group within the user subscription. + * Returns all active and completed jobs in a resource group. * - * @param {string} jobName The name of the import/export job. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -909,7 +1071,7 @@ export interface Jobs { * * {Promise} A promise is returned. * - * @resolve {BitLockerKeysListResult} - The deserialized result object. + * @resolve {ListJobsResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -917,24 +1079,34 @@ export interface Jobs { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BitLockerKeysListResult} [result] - The deserialized result object if an error did not occur. - * See {@link BitLockerKeysListResult} for more - * information. + * {ListJobsResponse} [result] - The deserialized result object if an error did not occur. + * See {@link ListJobsResponse} 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. */ - listBitLockerKeys(resourceGroupName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listBitLockerKeys(resourceGroupName: string, jobName: string, callback: ServiceCallback): void; - listBitLockerKeys(resourceGroupName: string, jobName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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; +} + +/** + * @class + * BitLockerKeys + * __NOTE__: An instance of this class is automatically created for an + * instance of the StorageImportExportManagementClient. + */ +export interface BitLockerKeys { /** - * Gets all the active and completed import/export jobs in a subscription. + * Returns the BitLocker Keys for all drives in the specified job. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} jobName The name of the import/export job. + * + * @param {string} resourceGroupName The resource group name uniquely + * identifies the resource group within the user subscription. * * @param {object} [options] Optional Parameters. * @@ -943,17 +1115,19 @@ export interface Jobs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(jobName: string, resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the active and completed import/export jobs in a subscription. + * Returns the BitLocker Keys for all drives in the specified job. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} jobName The name of the import/export job. + * + * @param {string} resourceGroupName The resource group name uniquely + * identifies the resource group within the user subscription. * * @param {object} [options] Optional Parameters. * @@ -967,7 +1141,7 @@ export interface Jobs { * * {Promise} A promise is returned. * - * @resolve {JobListResult} - The deserialized result object. + * @resolve {GetBitLockerKeysResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -975,23 +1149,31 @@ export interface Jobs { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobListResult} [result] - The deserialized result object if an error did not occur. - * See {@link JobListResult} for more information. + * {GetBitLockerKeysResponse} [result] - The deserialized result object if an error did not occur. + * See {@link GetBitLockerKeysResponse} 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; + list(jobName: string, resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(jobName: string, resourceGroupName: string, callback: ServiceCallback): void; + list(jobName: string, resourceGroupName: 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 StorageImportExportManagementClient. + */ +export interface Operations { /** - * Returns all active and completed import/export jobs in a resource group. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * Returns the list of operations supported by the import/export resource + * provider. * * @param {object} [options] Optional Parameters. * @@ -1000,17 +1182,15 @@ export interface Jobs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns all active and completed import/export jobs in a resource group. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * Returns the list of operations supported by the import/export resource + * provider. * * @param {object} [options] Optional Parameters. * @@ -1024,7 +1204,7 @@ export interface Jobs { * * {Promise} A promise is returned. * - * @resolve {JobListResult} - The deserialized result object. + * @resolve {ListOperationsResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1032,14 +1212,15 @@ export interface Jobs { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobListResult} [result] - The deserialized result object if an error did not occur. - * See {@link JobListResult} for more information. + * {ListOperationsResponse} [result] - The deserialized result object if an error did not occur. + * See {@link ListOperationsResponse} 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; + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } diff --git a/lib/services/storageImportExportManagement/lib/operations/index.js b/lib/services/storageImportExportManagement/lib/operations/index.js index 73de320f57..967e5c46d1 100755 --- a/lib/services/storageImportExportManagement/lib/operations/index.js +++ b/lib/services/storageImportExportManagement/lib/operations/index.js @@ -14,4 +14,7 @@ 'use strict'; +exports.Locations = require('./locations'); exports.Jobs = require('./jobs'); +exports.BitLockerKeys = require('./bitLockerKeys'); +exports.Operations = require('./operations'); diff --git a/lib/services/storageImportExportManagement/lib/operations/jobs.js b/lib/services/storageImportExportManagement/lib/operations/jobs.js index 5f828a44b2..1fdc0c13e6 100755 --- a/lib/services/storageImportExportManagement/lib/operations/jobs.js +++ b/lib/services/storageImportExportManagement/lib/operations/jobs.js @@ -15,7 +15,7 @@ const msRestAzure = require('ms-rest-azure'); const WebResource = msRest.WebResource; /** - * Gets all the active and completed import/export jobs in a subscription. + * Returns all active and completed jobs in a subscription. * * @param {object} [options] Optional Parameters. * @@ -23,13 +23,7 @@ const WebResource = msRest.WebResource; * at most should be returned. The value cannot exceed 100. * * @param {string} [options.filter] Can be used to restrict the results to - * certain conditions. The following possible values can be used with $filter: - * 1) $filter=type eq '{type}'; 2) $filter=trackingnumber eq - * '{trackingnumber}'; 3) $filter=state eq '{state}'; 4) Logical and - * combination of the above, for example: $filter=type eq 'Import' and state eq - * 'Transferring'. Valid values for type are Import and Export. Valid values - * for state are Creating, Shipping, Received, Transferring, Packaging, Closed, - * and Completed. + * certain conditions. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -41,13 +35,13 @@ const WebResource = msRest.WebResource; * {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 JobListResult} for more information. + * See {@link ListJobsResponse} 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) { +function _listBySubscription(options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -61,25 +55,18 @@ function _list(options, callback) { let filter = (options && options.filter !== undefined) ? options.filter : undefined; // 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 (top !== null && top !== undefined && typeof top !== 'number') { throw new Error('top must be of type number.'); } - if (top !== null && top !== undefined) { - if (top > 100) - { - throw new Error('"top" should satisfy the constraint - "InclusiveMaximum": 100'); - } - if (top < 1) - { - throw new Error('"top" should satisfy the constraint - "InclusiveMinimum": 1'); - } - } if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { throw new Error('filter 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 (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); } @@ -89,13 +76,13 @@ function _list(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.ImportExport/jobs'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (top !== null && top !== undefined) { queryParameters.push('$top=' + encodeURIComponent(top.toString())); } if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + encodeURIComponent(filter)); } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -163,7 +150,7 @@ function _list(options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['JobListResult']().mapper(); + let resultMapper = new client.models['ListJobsResponse']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -179,7 +166,7 @@ function _list(options, callback) { } /** - * Returns all active and completed import/export jobs in a resource group. + * Returns all active and completed jobs in a resource group. * * @param {string} resourceGroupName The resource group name uniquely * identifies the resource group within the user subscription. @@ -190,13 +177,7 @@ function _list(options, callback) { * at most should be returned. The value cannot exceed 100. * * @param {string} [options.filter] Can be used to restrict the results to - * certain conditions. The following possible values can be used with $filter: - * 1) $filter=type eq '{type}'; 2) $filter=trackingnumber eq - * '{trackingnumber}'; 3) $filter=state eq '{state}'; 4) Logical and - * combination of the above, for example: $filter=type eq 'Import' and state eq - * 'Transferring'. Valid values for type are Import and Export. Valid values - * for state are Creating, Shipping, Received, Transferring, Packaging, Closed, - * and Completed. + * certain conditions. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -208,7 +189,7 @@ function _list(options, callback) { * {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 JobListResult} for more information. + * See {@link ListJobsResponse} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -228,27 +209,20 @@ function _listByResourceGroup(resourceGroupName, options, callback) { let filter = (options && options.filter !== undefined) ? options.filter : undefined; // Validate try { + if (top !== null && top !== undefined && typeof top !== 'number') { + throw new Error('top must be of type number.'); + } + if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (top !== null && top !== undefined && typeof top !== 'number') { - throw new Error('top must be of type number.'); - } - if (top !== null && top !== undefined) { - if (top > 100) - { - throw new Error('"top" should satisfy the constraint - "InclusiveMaximum": 100'); - } - if (top < 1) - { - throw new Error('"top" should satisfy the constraint - "InclusiveMinimum": 1'); - } - } - if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { - throw new Error('filter 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); @@ -260,13 +234,13 @@ function _listByResourceGroup(resourceGroupName, options, callback) { requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (top !== null && top !== undefined) { queryParameters.push('$top=' + encodeURIComponent(top.toString())); } if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + encodeURIComponent(filter)); } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -334,7 +308,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['JobListResult']().mapper(); + let resultMapper = new client.models['ListJobsResponse']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -350,13 +324,13 @@ function _listByResourceGroup(resourceGroupName, options, callback) { } /** - * Gets information about an existing import/export job. + * Gets information about an existing job. + * + * @param {string} jobName The name of the import/export job. * * @param {string} resourceGroupName The resource group name uniquely * identifies the resource group within the user subscription. * - * @param {string} jobName The name of the import/export job. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -369,13 +343,13 @@ function _listByResourceGroup(resourceGroupName, options, callback) { * {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 Job} for more information. + * See {@link JobResponse} 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(resourceGroupName, jobName, options, callback) { +function _get(jobName, resourceGroupName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -387,14 +361,17 @@ function _get(resourceGroupName, jobName, options, callback) { } // Validate try { + if (jobName === null || jobName === undefined || typeof jobName.valueOf() !== 'string') { + throw new Error('jobName cannot be null or undefined and it 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (jobName === null || jobName === undefined || typeof jobName.valueOf() !== 'string') { - throw new Error('jobName 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); @@ -403,9 +380,9 @@ function _get(resourceGroupName, jobName, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}'; + requestUrl = requestUrl.replace('{jobName}', encodeURIComponent(jobName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{jobName}', encodeURIComponent(jobName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { @@ -475,7 +452,7 @@ function _get(resourceGroupName, jobName, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Job']().mapper(); + let resultMapper = new client.models['JobResponse']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -491,88 +468,90 @@ function _get(resourceGroupName, jobName, options, callback) { } /** - * Updates specific properties of the import/export job. You can call this - * operation to notify the Import/Export service that the hard drives - * comprising the import or export job have been shipped to the Microsoft data - * center. It can also be used to cancel an existing job. + * Updates specific properties of a job. You can call this operation to notify + * the Import/Export service that the hard drives comprising the import or + * export job have been shipped to the Microsoft data center. It can also be + * used to cancel an existing job. + * + * @param {string} jobName The name of the import/export job. * * @param {string} resourceGroupName The resource group name uniquely * identifies the resource group within the user subscription. * - * @param {string} jobName The name of the import/export job. - * - * @param {object} jobProperties Import/export job properties that need to be - * updated. + * @param {object} body The parameters to update in the job * - * @param {object} [jobProperties.tags] + * @param {object} [body.tags] Specifies the tags that will be assigned to the + * job * - * @param {boolean} [jobProperties.cancelRequested] If specified, the value - * must be true. The service will attempt to cancel the job. + * @param {boolean} [body.cancelRequested] If specified, the value must be + * true. The service will attempt to cancel the job. * - * @param {string} [jobProperties.state] If specified, the value must be - * Shipping, which tells the Import/Export service that the package for the job - * has been shipped. The ReturnAddress and DeliveryPackage properties must have - * been set either in this request or in a previous request, otherwise the - * request will fail. Possible values include: 'Shipping' + * @param {string} [body.state] If specified, the value must be Shipping, which + * tells the Import/Export service that the package for the job has been + * shipped. The ReturnAddress and DeliveryPackage properties must have been set + * either in this request or in a previous request, otherwise the request will + * fail. * - * @param {object} [jobProperties.returnAddress] Specifies the return address + * @param {object} [body.returnAddress] Specifies the return address * information for the job. * - * @param {string} jobProperties.returnAddress.recipientName The name of the - * recipient who will receive the hard drives when they are returned. + * @param {string} body.returnAddress.recipientName The name of the recipient + * who will receive the hard drives when they are returned. * - * @param {string} jobProperties.returnAddress.streetAddress1 The first line of - * the street address to use when returning the drives. + * @param {string} body.returnAddress.streetAddress1 The first line of the + * street address to use when returning the drives. * - * @param {string} [jobProperties.returnAddress.streetAddress2] The second line - * of the street address to use when returning the drives. + * @param {string} [body.returnAddress.streetAddress2] The second line of the + * street address to use when returning the drives. * - * @param {string} jobProperties.returnAddress.city The city name to use when - * returning the drives. + * @param {string} body.returnAddress.city The city name to use when returning + * the drives. * - * @param {string} [jobProperties.returnAddress.stateOrProvince] The state or - * province to use when returning the drives. + * @param {string} [body.returnAddress.stateOrProvince] The state or province + * to use when returning the drives. + * + * @param {string} body.returnAddress.postalCode The postal code to use when + * returning the drives. * - * @param {string} jobProperties.returnAddress.postalCode The postal code to + * @param {string} body.returnAddress.countryOrRegion The country or region to * use when returning the drives. * - * @param {string} jobProperties.returnAddress.countryOrRegion The country or - * region to use when returning the drives. + * @param {string} body.returnAddress.phone Phone number of the recipient of + * the returned drives. * - * @param {string} jobProperties.returnAddress.phone Phone number of the - * recipient of the returned drives. + * @param {string} body.returnAddress.email Email address of the recipient of + * the returned drives. * - * @param {string} jobProperties.returnAddress.email Email address of the - * recipient of the returned drives. + * @param {object} [body.returnShipping] Specifies the return carrier and + * customer's account with the carrier. * - * @param {object} [jobProperties.returnShipping] Specifies the return carrier - * and customer's account with the carrier. + * @param {string} body.returnShipping.carrierName The carrier's name. * - * @param {string} jobProperties.returnShipping.carrierName The carrier's name. + * @param {string} body.returnShipping.carrierAccountNumber The customer's + * account number with the carrier. * - * @param {string} jobProperties.returnShipping.carrierAccountNumber The - * customer's account number with the carrier. + * @param {object} [body.deliveryPackage] Contains information about the + * package being shipped by the customer to the Microsoft data center. * - * @param {object} [jobProperties.deliveryPackage] Contains information about - * the package being shipped by the customer to the Microsoft data center. + * @param {string} body.deliveryPackage.carrierName The name of the carrier + * that is used to ship the import or export drives. * - * @param {string} jobProperties.deliveryPackage.carrierName The name of the - * carrier that is used to ship the import or export drives. + * @param {string} body.deliveryPackage.trackingNumber The tracking number of + * the package. * - * @param {string} jobProperties.deliveryPackage.trackingNumber The tracking - * number of the package. + * @param {number} body.deliveryPackage.driveCount The number of drives + * included in the package. * - * @param {number} jobProperties.deliveryPackage.driveCount The number of - * drives included in the package. + * @param {string} body.deliveryPackage.shipDate The date when the package is + * shipped. * - * @param {string} jobProperties.deliveryPackage.shipDate The date the package - * is shipped. + * @param {string} [body.logLevel] Indicates whether error logging or verbose + * logging is enabled. * - * @param {string} [jobProperties.logLevel] Indicates whether error logging or - * verbose logging is enabled. + * @param {boolean} [body.backupDriveManifest] Indicates whether the manifest + * files on the drives should be copied to block blobs. * - * @param {boolean} [jobProperties.backupDriveManifest] Indicates whether the - * manifest files on the drives should be copied to block blobs. + * @param {array} [body.driveList] List of drives that comprise the job. * * @param {object} [options] Optional Parameters. * @@ -586,13 +565,13 @@ function _get(resourceGroupName, jobName, options, callback) { * {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 Job} for more information. + * See {@link JobResponse} 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(resourceGroupName, jobName, jobProperties, options, callback) { +function _update(jobName, resourceGroupName, body, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -604,17 +583,20 @@ function _update(resourceGroupName, jobName, jobProperties, options, callback) { } // Validate try { + if (jobName === null || jobName === undefined || typeof jobName.valueOf() !== 'string') { + throw new Error('jobName cannot be null or undefined and it 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (jobName === null || jobName === undefined || typeof jobName.valueOf() !== 'string') { - throw new Error('jobName 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.'); } - if (jobProperties === null || jobProperties === undefined) { - throw new Error('jobProperties cannot be null or undefined.'); + if (body === null || body === undefined) { + throw new Error('body cannot be null or undefined.'); } } catch (error) { return callback(error); @@ -623,9 +605,9 @@ function _update(resourceGroupName, jobName, jobProperties, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}'; + requestUrl = requestUrl.replace('{jobName}', encodeURIComponent(jobName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{jobName}', encodeURIComponent(jobName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { @@ -656,14 +638,14 @@ function _update(resourceGroupName, jobName, jobProperties, options, callback) { let requestContent = null; let requestModel = null; try { - if (jobProperties !== null && jobProperties !== undefined) { - let requestModelMapper = new client.models['MutableJob']().mapper(); - requestModel = client.serialize(requestModelMapper, jobProperties, 'jobProperties'); + if (body !== null && body !== undefined) { + let requestModelMapper = new client.models['UpdateJobParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, body, 'body'); requestContent = JSON.stringify(requestModel); } } catch (error) { let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(jobProperties, null, 2)}.`); + `payload - ${JSON.stringify(body, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -709,7 +691,7 @@ function _update(resourceGroupName, jobName, jobProperties, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Job']().mapper(); + let resultMapper = new client.models['JobResponse']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -725,122 +707,166 @@ function _update(resourceGroupName, jobName, jobProperties, options, callback) { } /** - * Creates a new import/export job or updates an existing import/export job in - * the specified subscription. + * Creates a new job or updates an existing job in the specified subscription. + * + * @param {string} jobName The name of the import/export job. * * @param {string} resourceGroupName The resource group name uniquely * identifies the resource group within the user subscription. * - * @param {string} jobName The name of the import/export job. + * @param {object} body The parameters used for creating the job + * + * @param {string} [body.location] Specifies the supported Azure location where + * the job should be created * - * @param {object} jobProperties Properties of the import/export job that need - * to be specified during creation. + * @param {object} [body.tags] Specifies the tags that will be assigned to the + * job. * - * @param {string} jobProperties.storageAccountId The resource identifier of - * the storage account where data will be imported to or exported from. + * @param {object} [body.properties] Specifies the job properties * - * @param {string} [jobProperties.containerSas] The container shared access - * signature (SAS) to be used to import or export data to or from the storage - * account. + * @param {string} [body.properties.storageAccountId] The resource identifier + * of the storage account where data will be imported to or exported from. * - * @param {string} jobProperties.jobType The type of job: Import or Export. - * Possible values include: 'Import', 'Export' + * @param {string} [body.properties.jobType] The type of job * - * @param {object} jobProperties.returnAddress Specifies the return address + * @param {object} [body.properties.returnAddress] Specifies the return address * information for the job. * - * @param {string} jobProperties.returnAddress.recipientName The name of the + * @param {string} body.properties.returnAddress.recipientName The name of the * recipient who will receive the hard drives when they are returned. * - * @param {string} jobProperties.returnAddress.streetAddress1 The first line of - * the street address to use when returning the drives. - * - * @param {string} [jobProperties.returnAddress.streetAddress2] The second line + * @param {string} body.properties.returnAddress.streetAddress1 The first line * of the street address to use when returning the drives. * - * @param {string} jobProperties.returnAddress.city The city name to use when + * @param {string} [body.properties.returnAddress.streetAddress2] The second + * line of the street address to use when returning the drives. + * + * @param {string} body.properties.returnAddress.city The city name to use when * returning the drives. * - * @param {string} [jobProperties.returnAddress.stateOrProvince] The state or + * @param {string} [body.properties.returnAddress.stateOrProvince] The state or * province to use when returning the drives. * - * @param {string} jobProperties.returnAddress.postalCode The postal code to + * @param {string} body.properties.returnAddress.postalCode The postal code to * use when returning the drives. * - * @param {string} jobProperties.returnAddress.countryOrRegion The country or + * @param {string} body.properties.returnAddress.countryOrRegion The country or * region to use when returning the drives. * - * @param {string} jobProperties.returnAddress.phone Phone number of the + * @param {string} body.properties.returnAddress.phone Phone number of the * recipient of the returned drives. * - * @param {string} jobProperties.returnAddress.email Email address of the + * @param {string} body.properties.returnAddress.email Email address of the * recipient of the returned drives. * - * @param {object} jobProperties.returnShipping Specifies the return carrier - * and customer's account with the carrier. + * @param {object} [body.properties.returnShipping] Specifies the return + * carrier and customer's account with the carrier. * - * @param {string} jobProperties.returnShipping.carrierName The carrier's name. + * @param {string} body.properties.returnShipping.carrierName The carrier's + * name. * - * @param {string} jobProperties.returnShipping.carrierAccountNumber The + * @param {string} body.properties.returnShipping.carrierAccountNumber The * customer's account number with the carrier. * - * @param {object} [jobProperties.deliveryPackage] Contains information about + * @param {object} [body.properties.shippingInformation] Contains information + * about the Microsoft datacenter to which the drives should be shipped. + * + * @param {string} body.properties.shippingInformation.recipientName The name + * of the recipient who will receive the hard drives when they are returned. + * + * @param {string} body.properties.shippingInformation.streetAddress1 The first + * line of the street address to use when returning the drives. + * + * @param {string} [body.properties.shippingInformation.streetAddress2] The + * second line of the street address to use when returning the drives. + * + * @param {string} body.properties.shippingInformation.city The city name to + * use when returning the drives. + * + * @param {string} body.properties.shippingInformation.stateOrProvince The + * state or province to use when returning the drives. + * + * @param {string} body.properties.shippingInformation.postalCode The postal + * code to use when returning the drives. + * + * @param {string} body.properties.shippingInformation.countryOrRegion The + * country or region to use when returning the drives. + * + * @param {string} [body.properties.shippingInformation.phone] Phone number of + * the recipient of the returned drives. + * + * @param {object} [body.properties.deliveryPackage] Contains information about * the package being shipped by the customer to the Microsoft data center. * - * @param {string} jobProperties.deliveryPackage.carrierName The name of the + * @param {object} [body.properties.returnPackage] Contains information about + * the package being shipped from the Microsoft data center to the customer to + * return the drives. The format is the same as the deliveryPackage property + * above. This property is not included if the drives have not yet been + * returned. + * + * @param {string} body.properties.returnPackage.carrierName The name of the * carrier that is used to ship the import or export drives. * - * @param {string} jobProperties.deliveryPackage.trackingNumber The tracking + * @param {string} body.properties.returnPackage.trackingNumber The tracking * number of the package. * - * @param {number} jobProperties.deliveryPackage.driveCount The number of + * @param {number} body.properties.returnPackage.driveCount The number of * drives included in the package. * - * @param {string} jobProperties.deliveryPackage.shipDate The date the package - * is shipped. + * @param {string} body.properties.returnPackage.shipDate The date when the + * package is shipped. + * + * @param {string} [body.properties.diagnosticsPath] The virtual blob directory + * to which the copy logs and backups of drive manifest files (if enabled) will + * be stored. + * + * @param {string} [body.properties.logLevel] Default value is Error. Indicates + * whether error logging or verbose logging will be enabled. + * + * @param {boolean} [body.properties.backupDriveManifest] Default value is + * false. Indicates whether the manifest files on the drives should be copied + * to block blobs. * - * @param {string} jobProperties.diagnosticsPath The virtual blob directory to - * which the copy logs and backups of drive manifest files (if enabled) will be - * stored. + * @param {string} [body.properties.state] Current state of the job. * - * @param {string} [jobProperties.logLevel] Default value is Error. Indicates - * whether error logging or verbose logging will be enabled. Possible values - * include: 'Error', 'Verbose' + * @param {boolean} [body.properties.cancelRequested] Indicates whether a + * request has been submitted to cancel the job. * - * @param {boolean} [jobProperties.backupDriveManifest] Default value is false. - * Indicates whether the manifest files on the drives should be copied to block - * blobs. + * @param {number} [body.properties.percentComplete] Overall percentage + * completed for the job. * - * @param {boolean} [jobProperties.cancelRequested] Indicates whether a request - * has been submitted to cancel the job. + * @param {string} [body.properties.incompleteBlobListUri] A blob path that + * points to a block blob containing a list of blob names that were not + * exported due to insufficient drive space. If all blobs were exported + * successfully, then this element is not included in the response. * - * @param {array} [jobProperties.driveList] List of up to ten drives that + * @param {array} [body.properties.driveList] List of up to ten drives that * comprise the job. The drive list is a required element for an import job; it * is not specified for export jobs. * - * @param {object} [jobProperties.exportProperty] A property containing + * @param {object} [body.properties.exportProperty] A property containing * information about the blobs to be exported for an export job. This property * is included for export jobs only. * - * @param {array} [jobProperties.exportProperty.blobPath] A collection of + * @param {array} [body.properties.exportProperty.blobPath] A collection of * blob-path strings. * - * @param {array} [jobProperties.exportProperty.blobPathPrefix] A collection of - * blob-prefix strings. + * @param {array} [body.properties.exportProperty.blobPathPrefix] A collection + * of blob-prefix strings. * - * @param {string} [jobProperties.exportProperty.blobListblobPath] The relative - * URI to the block blob that contains the list of blob paths or blob path - * prefixes as defined above, beginning with the container name. If the blob is - * in the root container, the URI must begin with $root. + * @param {string} [body.properties.exportProperty.blobListblobPath] The + * relative URI to the block blob that contains the list of blob paths or blob + * path prefixes as defined above, beginning with the container name. If the + * blob is in root container, the URI must begin with $root. * - * @param {string} jobProperties.location Specifies the Azure location where - * the job is created. - * - * @param {object} [jobProperties.tags] Specifies the tags that are assigned to - * the job. + * @param {string} [body.properties.provisioningState] Specifies the + * provisioning state of the job. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.clientTenantId] The tenant ID of the client making + * the request. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -851,13 +877,13 @@ function _update(resourceGroupName, jobName, jobProperties, options, callback) { * {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 Job} for more information. + * See {@link JobResponse} 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(resourceGroupName, jobName, jobProperties, options, callback) { +function _create(jobName, resourceGroupName, body, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -867,19 +893,26 @@ function _createOrUpdate(resourceGroupName, jobName, jobProperties, options, cal if (!callback) { throw new Error('callback cannot be null.'); } + let clientTenantId = (options && options.clientTenantId !== undefined) ? options.clientTenantId : undefined; // Validate try { + if (jobName === null || jobName === undefined || typeof jobName.valueOf() !== 'string') { + throw new Error('jobName cannot be null or undefined and it 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (jobName === null || jobName === undefined || typeof jobName.valueOf() !== 'string') { - throw new Error('jobName 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.'); + } + if (clientTenantId !== null && clientTenantId !== undefined && typeof clientTenantId.valueOf() !== 'string') { + throw new Error('clientTenantId must be of type string.'); } - if (jobProperties === null || jobProperties === undefined) { - throw new Error('jobProperties cannot be null or undefined.'); + if (body === null || body === undefined) { + throw new Error('body cannot be null or undefined.'); } } catch (error) { return callback(error); @@ -888,9 +921,9 @@ function _createOrUpdate(resourceGroupName, jobName, jobProperties, options, cal // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}'; + requestUrl = requestUrl.replace('{jobName}', encodeURIComponent(jobName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{jobName}', encodeURIComponent(jobName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { @@ -910,6 +943,9 @@ function _createOrUpdate(resourceGroupName, jobName, jobProperties, options, cal if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['Accept-Language'] = this.client.acceptLanguage; } + if (clientTenantId !== undefined && clientTenantId !== null) { + httpRequest.headers['x-ms-client-tenant-id'] = clientTenantId; + } if(options) { for(let headerName in options['customHeaders']) { if (options['customHeaders'].hasOwnProperty(headerName)) { @@ -921,14 +957,14 @@ function _createOrUpdate(resourceGroupName, jobName, jobProperties, options, cal let requestContent = null; let requestModel = null; try { - if (jobProperties !== null && jobProperties !== undefined) { - let requestModelMapper = new client.models['Job']().mapper(); - requestModel = client.serialize(requestModelMapper, jobProperties, 'jobProperties'); + if (body !== null && body !== undefined) { + let requestModelMapper = new client.models['PutJobParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, body, 'body'); requestContent = JSON.stringify(requestModel); } } catch (error) { let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(jobProperties, null, 2)}.`); + `payload - ${JSON.stringify(body, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -974,7 +1010,7 @@ function _createOrUpdate(resourceGroupName, jobName, jobProperties, options, cal parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Job']().mapper(); + let resultMapper = new client.models['JobResponse']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -991,7 +1027,7 @@ function _createOrUpdate(resourceGroupName, jobName, jobProperties, options, cal parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Job']().mapper(); + let resultMapper = new client.models['JobResponse']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1007,14 +1043,14 @@ function _createOrUpdate(resourceGroupName, jobName, jobProperties, options, cal } /** - * Deletes an existing import/export job. Only import/export jobs in the - * Creating or Completed states can be deleted. + * Deletes an existing job. Only jobs in the Creating or Completed states can + * be deleted. + * + * @param {string} jobName The name of the import/export job. * * @param {string} resourceGroupName The resource group name uniquely * identifies the resource group within the user subscription. * - * @param {string} jobName The name of the import/export job. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1032,7 +1068,7 @@ function _createOrUpdate(resourceGroupName, jobName, jobProperties, options, cal * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteMethod(resourceGroupName, jobName, options, callback) { +function _deleteMethod(jobName, resourceGroupName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1044,14 +1080,17 @@ function _deleteMethod(resourceGroupName, jobName, options, callback) { } // Validate try { + if (jobName === null || jobName === undefined || typeof jobName.valueOf() !== 'string') { + throw new Error('jobName cannot be null or undefined and it 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (jobName === null || jobName === undefined || typeof jobName.valueOf() !== 'string') { - throw new Error('jobName 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); @@ -1060,9 +1099,9 @@ function _deleteMethod(resourceGroupName, jobName, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}'; + requestUrl = requestUrl.replace('{jobName}', encodeURIComponent(jobName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{jobName}', encodeURIComponent(jobName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { @@ -1131,22 +1170,10 @@ function _deleteMethod(resourceGroupName, jobName, options, callback) { } /** - * Moves the specified import/export jobs from the resource group to a target - * resource group. The target resource group may be in a different - * subscription. - * - * @param {string} resourceGroupName The resource group name uniquely - * identifies the resource group within the user subscription. - * - * @param {object} moveJobsParameters Parameters to be provided to move a job - * from one resource group to another. + * Returns all active and completed jobs in a subscription. * - * @param {string} moveJobsParameters.targetResourceGroup Specifies the target - * resource group ID to move the jobs to. - * - * @param {array} moveJobsParameters.resources Specifies the list of jobs to - * move to the target resource group. The jobs must be from the current - * resource group from the request URL. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -1159,13 +1186,14 @@ function _deleteMethod(resourceGroupName, jobName, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ListJobsResponse} 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 _move(resourceGroupName, moveJobsParameters, options, callback) { +function _listBySubscriptionNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1177,33 +1205,23 @@ function _move(resourceGroupName, moveJobsParameters, options, callback) { } // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + 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 (moveJobsParameters === null || moveJobsParameters === undefined) { - throw new Error('moveJobsParameters 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/{resourceGroupName}/providers/Microsoft.ImportExport/moveResources'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -1221,21 +1239,7 @@ function _move(resourceGroupName, moveJobsParameters, options, callback) { } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (moveJobsParameters !== null && moveJobsParameters !== undefined) { - let requestModelMapper = new client.models['MoveJobParameters']().mapper(); - requestModel = client.serialize(requestModelMapper, moveJobsParameters, 'moveJobsParameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(moveJobsParameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -1271,18 +1275,33 @@ function _move(resourceGroupName, moveJobsParameters, options, callback) { // 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['ListJobsResponse']().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); }); } /** - * Lists the BitLocker keys for all drives in the specified import/export job. - * - * @param {string} resourceGroupName The resource group name uniquely - * identifies the resource group within the user subscription. + * Returns all active and completed jobs in a resource group. * - * @param {string} jobName The name of the import/export job. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -1296,14 +1315,13 @@ function _move(resourceGroupName, moveJobsParameters, options, callback) { * {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 BitLockerKeysListResult} for more - * information. + * See {@link ListJobsResponse} 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 _listBitLockerKeys(resourceGroupName, jobName, options, callback) { +function _listByResourceGroupNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1315,30 +1333,19 @@ function _listBitLockerKeys(resourceGroupName, jobName, options, callback) { } // 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + 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 (jobName === null || jobName === undefined || typeof jobName.valueOf() !== 'string') { - throw new Error('jobName 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/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}/listBitLockerKeys'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{jobName}', encodeURIComponent(jobName)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); // Create HTTP transport objects let httpRequest = new WebResource(); @@ -1403,7 +1410,7 @@ function _listBitLockerKeys(resourceGroupName, jobName, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['BitLockerKeysListResult']().mapper(); + let resultMapper = new client.models['ListJobsResponse']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1418,278 +1425,26 @@ function _listBitLockerKeys(resourceGroupName, jobName, options, callback) { }); } -/** - * Gets all the active and completed import/export jobs 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 JobListResult} 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.'); - } - } 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['ErrorResponse']().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['JobListResult']().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); - }); -} - -/** - * Returns all active and completed import/export jobs 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 JobListResult} 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.'); - } - } 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['ErrorResponse']().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['JobListResult']().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 Jobs. */ -class Jobs { - /** - * Create a Jobs. - * @param {StorageImportExportManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._list = _list; - this._listByResourceGroup = _listByResourceGroup; - this._get = _get; - this._update = _update; - this._createOrUpdate = _createOrUpdate; - this._deleteMethod = _deleteMethod; - this._move = _move; - this._listBitLockerKeys = _listBitLockerKeys; - this._listNext = _listNext; - this._listByResourceGroupNext = _listByResourceGroupNext; +/** Class representing a Jobs. */ +class Jobs { + /** + * Create a Jobs. + * @param {StorageImportExportManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._listBySubscription = _listBySubscription; + this._listByResourceGroup = _listByResourceGroup; + this._get = _get; + this._update = _update; + this._create = _create; + this._deleteMethod = _deleteMethod; + this._listBySubscriptionNext = _listBySubscriptionNext; + this._listByResourceGroupNext = _listByResourceGroupNext; } /** - * Gets all the active and completed import/export jobs in a subscription. + * Returns all active and completed jobs in a subscription. * * @param {object} [options] Optional Parameters. * @@ -1697,28 +1452,22 @@ class Jobs { * at most should be returned. The value cannot exceed 100. * * @param {string} [options.filter] Can be used to restrict the results to - * certain conditions. The following possible values can be used with $filter: - * 1) $filter=type eq '{type}'; 2) $filter=trackingnumber eq - * '{trackingnumber}'; 3) $filter=state eq '{state}'; 4) Logical and - * combination of the above, for example: $filter=type eq 'Import' and state eq - * 'Transferring'. Valid values for type are Import and Export. Valid values - * for state are Creating, Shipping, Received, Transferring, Packaging, Closed, - * and Completed. + * certain conditions. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - listWithHttpOperationResponse(options) { + listBySubscriptionWithHttpOperationResponse(options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._list(options, (err, result, request, response) => { + self._listBySubscription(options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1729,7 +1478,7 @@ class Jobs { } /** - * Gets all the active and completed import/export jobs in a subscription. + * Returns all active and completed jobs in a subscription. * * @param {object} [options] Optional Parameters. * @@ -1737,13 +1486,7 @@ class Jobs { * at most should be returned. The value cannot exceed 100. * * @param {string} [options.filter] Can be used to restrict the results to - * certain conditions. The following possible values can be used with $filter: - * 1) $filter=type eq '{type}'; 2) $filter=trackingnumber eq - * '{trackingnumber}'; 3) $filter=state eq '{state}'; 4) Logical and - * combination of the above, for example: $filter=type eq 'Import' and state eq - * 'Transferring'. Valid values for type are Import and Export. Valid values - * for state are Creating, Shipping, Received, Transferring, Packaging, Closed, - * and Completed. + * certain conditions. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -1755,7 +1498,7 @@ class Jobs { * * {Promise} A promise is returned * - * @resolve {JobListResult} - The deserialized result object. + * @resolve {ListJobsResponse} - The deserialized result object. * * @reject {Error} - The error object. * @@ -1764,13 +1507,13 @@ class Jobs { * {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 JobListResult} for more information. + * See {@link ListJobsResponse} 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) { + listBySubscription(options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1779,19 +1522,19 @@ class Jobs { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._list(options, (err, result, request, response) => { + self._listBySubscription(options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._list(options, optionalCallback); + return self._listBySubscription(options, optionalCallback); } } /** - * Returns all active and completed import/export jobs in a resource group. + * Returns all active and completed jobs in a resource group. * * @param {string} resourceGroupName The resource group name uniquely * identifies the resource group within the user subscription. @@ -1802,20 +1545,14 @@ class Jobs { * at most should be returned. The value cannot exceed 100. * * @param {string} [options.filter] Can be used to restrict the results to - * certain conditions. The following possible values can be used with $filter: - * 1) $filter=type eq '{type}'; 2) $filter=trackingnumber eq - * '{trackingnumber}'; 3) $filter=state eq '{state}'; 4) Logical and - * combination of the above, for example: $filter=type eq 'Import' and state eq - * 'Transferring'. Valid values for type are Import and Export. Valid values - * for state are Creating, Shipping, Received, Transferring, Packaging, Closed, - * and Completed. + * certain conditions. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -1834,7 +1571,7 @@ class Jobs { } /** - * Returns all active and completed import/export jobs in a resource group. + * Returns all active and completed jobs in a resource group. * * @param {string} resourceGroupName The resource group name uniquely * identifies the resource group within the user subscription. @@ -1845,13 +1582,7 @@ class Jobs { * at most should be returned. The value cannot exceed 100. * * @param {string} [options.filter] Can be used to restrict the results to - * certain conditions. The following possible values can be used with $filter: - * 1) $filter=type eq '{type}'; 2) $filter=trackingnumber eq - * '{trackingnumber}'; 3) $filter=state eq '{state}'; 4) Logical and - * combination of the above, for example: $filter=type eq 'Import' and state eq - * 'Transferring'. Valid values for type are Import and Export. Valid values - * for state are Creating, Shipping, Received, Transferring, Packaging, Closed, - * and Completed. + * certain conditions. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -1863,7 +1594,7 @@ class Jobs { * * {Promise} A promise is returned * - * @resolve {JobListResult} - The deserialized result object. + * @resolve {ListJobsResponse} - The deserialized result object. * * @reject {Error} - The error object. * @@ -1872,7 +1603,7 @@ class Jobs { * {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 JobListResult} for more information. + * See {@link ListJobsResponse} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -1899,13 +1630,13 @@ class Jobs { } /** - * Gets information about an existing import/export job. + * Gets information about an existing job. + * + * @param {string} jobName The name of the import/export job. * * @param {string} resourceGroupName The resource group name uniquely * identifies the resource group within the user subscription. * - * @param {string} jobName The name of the import/export job. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1913,15 +1644,15 @@ class Jobs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getWithHttpOperationResponse(resourceGroupName, jobName, options) { + getWithHttpOperationResponse(jobName, resourceGroupName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._get(resourceGroupName, jobName, options, (err, result, request, response) => { + self._get(jobName, resourceGroupName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1932,13 +1663,13 @@ class Jobs { } /** - * Gets information about an existing import/export job. + * Gets information about an existing job. + * + * @param {string} jobName The name of the import/export job. * * @param {string} resourceGroupName The resource group name uniquely * identifies the resource group within the user subscription. * - * @param {string} jobName The name of the import/export job. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1951,7 +1682,7 @@ class Jobs { * * {Promise} A promise is returned * - * @resolve {Job} - The deserialized result object. + * @resolve {JobResponse} - The deserialized result object. * * @reject {Error} - The error object. * @@ -1960,13 +1691,13 @@ class Jobs { * {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 Job} for more information. + * See {@link JobResponse} 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(resourceGroupName, jobName, options, optionalCallback) { + get(jobName, resourceGroupName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1975,100 +1706,102 @@ class Jobs { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._get(resourceGroupName, jobName, options, (err, result, request, response) => { + self._get(jobName, resourceGroupName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._get(resourceGroupName, jobName, options, optionalCallback); + return self._get(jobName, resourceGroupName, options, optionalCallback); } } /** - * Updates specific properties of the import/export job. You can call this - * operation to notify the Import/Export service that the hard drives - * comprising the import or export job have been shipped to the Microsoft data - * center. It can also be used to cancel an existing job. + * Updates specific properties of a job. You can call this operation to notify + * the Import/Export service that the hard drives comprising the import or + * export job have been shipped to the Microsoft data center. It can also be + * used to cancel an existing job. + * + * @param {string} jobName The name of the import/export job. * * @param {string} resourceGroupName The resource group name uniquely * identifies the resource group within the user subscription. * - * @param {string} jobName The name of the import/export job. - * - * @param {object} jobProperties Import/export job properties that need to be - * updated. + * @param {object} body The parameters to update in the job * - * @param {object} [jobProperties.tags] + * @param {object} [body.tags] Specifies the tags that will be assigned to the + * job * - * @param {boolean} [jobProperties.cancelRequested] If specified, the value - * must be true. The service will attempt to cancel the job. + * @param {boolean} [body.cancelRequested] If specified, the value must be + * true. The service will attempt to cancel the job. * - * @param {string} [jobProperties.state] If specified, the value must be - * Shipping, which tells the Import/Export service that the package for the job - * has been shipped. The ReturnAddress and DeliveryPackage properties must have - * been set either in this request or in a previous request, otherwise the - * request will fail. Possible values include: 'Shipping' + * @param {string} [body.state] If specified, the value must be Shipping, which + * tells the Import/Export service that the package for the job has been + * shipped. The ReturnAddress and DeliveryPackage properties must have been set + * either in this request or in a previous request, otherwise the request will + * fail. * - * @param {object} [jobProperties.returnAddress] Specifies the return address + * @param {object} [body.returnAddress] Specifies the return address * information for the job. * - * @param {string} jobProperties.returnAddress.recipientName The name of the - * recipient who will receive the hard drives when they are returned. + * @param {string} body.returnAddress.recipientName The name of the recipient + * who will receive the hard drives when they are returned. * - * @param {string} jobProperties.returnAddress.streetAddress1 The first line of - * the street address to use when returning the drives. + * @param {string} body.returnAddress.streetAddress1 The first line of the + * street address to use when returning the drives. * - * @param {string} [jobProperties.returnAddress.streetAddress2] The second line - * of the street address to use when returning the drives. + * @param {string} [body.returnAddress.streetAddress2] The second line of the + * street address to use when returning the drives. * - * @param {string} jobProperties.returnAddress.city The city name to use when - * returning the drives. + * @param {string} body.returnAddress.city The city name to use when returning + * the drives. * - * @param {string} [jobProperties.returnAddress.stateOrProvince] The state or - * province to use when returning the drives. + * @param {string} [body.returnAddress.stateOrProvince] The state or province + * to use when returning the drives. + * + * @param {string} body.returnAddress.postalCode The postal code to use when + * returning the drives. * - * @param {string} jobProperties.returnAddress.postalCode The postal code to + * @param {string} body.returnAddress.countryOrRegion The country or region to * use when returning the drives. * - * @param {string} jobProperties.returnAddress.countryOrRegion The country or - * region to use when returning the drives. + * @param {string} body.returnAddress.phone Phone number of the recipient of + * the returned drives. * - * @param {string} jobProperties.returnAddress.phone Phone number of the - * recipient of the returned drives. + * @param {string} body.returnAddress.email Email address of the recipient of + * the returned drives. * - * @param {string} jobProperties.returnAddress.email Email address of the - * recipient of the returned drives. + * @param {object} [body.returnShipping] Specifies the return carrier and + * customer's account with the carrier. * - * @param {object} [jobProperties.returnShipping] Specifies the return carrier - * and customer's account with the carrier. + * @param {string} body.returnShipping.carrierName The carrier's name. * - * @param {string} jobProperties.returnShipping.carrierName The carrier's name. + * @param {string} body.returnShipping.carrierAccountNumber The customer's + * account number with the carrier. * - * @param {string} jobProperties.returnShipping.carrierAccountNumber The - * customer's account number with the carrier. + * @param {object} [body.deliveryPackage] Contains information about the + * package being shipped by the customer to the Microsoft data center. * - * @param {object} [jobProperties.deliveryPackage] Contains information about - * the package being shipped by the customer to the Microsoft data center. + * @param {string} body.deliveryPackage.carrierName The name of the carrier + * that is used to ship the import or export drives. * - * @param {string} jobProperties.deliveryPackage.carrierName The name of the - * carrier that is used to ship the import or export drives. + * @param {string} body.deliveryPackage.trackingNumber The tracking number of + * the package. * - * @param {string} jobProperties.deliveryPackage.trackingNumber The tracking - * number of the package. + * @param {number} body.deliveryPackage.driveCount The number of drives + * included in the package. * - * @param {number} jobProperties.deliveryPackage.driveCount The number of - * drives included in the package. + * @param {string} body.deliveryPackage.shipDate The date when the package is + * shipped. * - * @param {string} jobProperties.deliveryPackage.shipDate The date the package - * is shipped. + * @param {string} [body.logLevel] Indicates whether error logging or verbose + * logging is enabled. * - * @param {string} [jobProperties.logLevel] Indicates whether error logging or - * verbose logging is enabled. + * @param {boolean} [body.backupDriveManifest] Indicates whether the manifest + * files on the drives should be copied to block blobs. * - * @param {boolean} [jobProperties.backupDriveManifest] Indicates whether the - * manifest files on the drives should be copied to block blobs. + * @param {array} [body.driveList] List of drives that comprise the job. * * @param {object} [options] Optional Parameters. * @@ -2077,15 +1810,15 @@ class Jobs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName, jobName, jobProperties, options) { + updateWithHttpOperationResponse(jobName, resourceGroupName, body, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._update(resourceGroupName, jobName, jobProperties, options, (err, result, request, response) => { + self._update(jobName, resourceGroupName, body, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -2096,88 +1829,90 @@ class Jobs { } /** - * Updates specific properties of the import/export job. You can call this - * operation to notify the Import/Export service that the hard drives - * comprising the import or export job have been shipped to the Microsoft data - * center. It can also be used to cancel an existing job. + * Updates specific properties of a job. You can call this operation to notify + * the Import/Export service that the hard drives comprising the import or + * export job have been shipped to the Microsoft data center. It can also be + * used to cancel an existing job. + * + * @param {string} jobName The name of the import/export job. * * @param {string} resourceGroupName The resource group name uniquely * identifies the resource group within the user subscription. * - * @param {string} jobName The name of the import/export job. - * - * @param {object} jobProperties Import/export job properties that need to be - * updated. + * @param {object} body The parameters to update in the job * - * @param {object} [jobProperties.tags] + * @param {object} [body.tags] Specifies the tags that will be assigned to the + * job * - * @param {boolean} [jobProperties.cancelRequested] If specified, the value - * must be true. The service will attempt to cancel the job. + * @param {boolean} [body.cancelRequested] If specified, the value must be + * true. The service will attempt to cancel the job. * - * @param {string} [jobProperties.state] If specified, the value must be - * Shipping, which tells the Import/Export service that the package for the job - * has been shipped. The ReturnAddress and DeliveryPackage properties must have - * been set either in this request or in a previous request, otherwise the - * request will fail. Possible values include: 'Shipping' + * @param {string} [body.state] If specified, the value must be Shipping, which + * tells the Import/Export service that the package for the job has been + * shipped. The ReturnAddress and DeliveryPackage properties must have been set + * either in this request or in a previous request, otherwise the request will + * fail. * - * @param {object} [jobProperties.returnAddress] Specifies the return address + * @param {object} [body.returnAddress] Specifies the return address * information for the job. * - * @param {string} jobProperties.returnAddress.recipientName The name of the - * recipient who will receive the hard drives when they are returned. + * @param {string} body.returnAddress.recipientName The name of the recipient + * who will receive the hard drives when they are returned. * - * @param {string} jobProperties.returnAddress.streetAddress1 The first line of - * the street address to use when returning the drives. + * @param {string} body.returnAddress.streetAddress1 The first line of the + * street address to use when returning the drives. * - * @param {string} [jobProperties.returnAddress.streetAddress2] The second line - * of the street address to use when returning the drives. + * @param {string} [body.returnAddress.streetAddress2] The second line of the + * street address to use when returning the drives. * - * @param {string} jobProperties.returnAddress.city The city name to use when - * returning the drives. + * @param {string} body.returnAddress.city The city name to use when returning + * the drives. * - * @param {string} [jobProperties.returnAddress.stateOrProvince] The state or - * province to use when returning the drives. + * @param {string} [body.returnAddress.stateOrProvince] The state or province + * to use when returning the drives. * - * @param {string} jobProperties.returnAddress.postalCode The postal code to + * @param {string} body.returnAddress.postalCode The postal code to use when + * returning the drives. + * + * @param {string} body.returnAddress.countryOrRegion The country or region to * use when returning the drives. * - * @param {string} jobProperties.returnAddress.countryOrRegion The country or - * region to use when returning the drives. + * @param {string} body.returnAddress.phone Phone number of the recipient of + * the returned drives. * - * @param {string} jobProperties.returnAddress.phone Phone number of the - * recipient of the returned drives. + * @param {string} body.returnAddress.email Email address of the recipient of + * the returned drives. * - * @param {string} jobProperties.returnAddress.email Email address of the - * recipient of the returned drives. + * @param {object} [body.returnShipping] Specifies the return carrier and + * customer's account with the carrier. * - * @param {object} [jobProperties.returnShipping] Specifies the return carrier - * and customer's account with the carrier. + * @param {string} body.returnShipping.carrierName The carrier's name. * - * @param {string} jobProperties.returnShipping.carrierName The carrier's name. + * @param {string} body.returnShipping.carrierAccountNumber The customer's + * account number with the carrier. * - * @param {string} jobProperties.returnShipping.carrierAccountNumber The - * customer's account number with the carrier. + * @param {object} [body.deliveryPackage] Contains information about the + * package being shipped by the customer to the Microsoft data center. * - * @param {object} [jobProperties.deliveryPackage] Contains information about - * the package being shipped by the customer to the Microsoft data center. + * @param {string} body.deliveryPackage.carrierName The name of the carrier + * that is used to ship the import or export drives. * - * @param {string} jobProperties.deliveryPackage.carrierName The name of the - * carrier that is used to ship the import or export drives. + * @param {string} body.deliveryPackage.trackingNumber The tracking number of + * the package. * - * @param {string} jobProperties.deliveryPackage.trackingNumber The tracking - * number of the package. + * @param {number} body.deliveryPackage.driveCount The number of drives + * included in the package. * - * @param {number} jobProperties.deliveryPackage.driveCount The number of - * drives included in the package. + * @param {string} body.deliveryPackage.shipDate The date when the package is + * shipped. * - * @param {string} jobProperties.deliveryPackage.shipDate The date the package - * is shipped. + * @param {string} [body.logLevel] Indicates whether error logging or verbose + * logging is enabled. * - * @param {string} [jobProperties.logLevel] Indicates whether error logging or - * verbose logging is enabled. + * @param {boolean} [body.backupDriveManifest] Indicates whether the manifest + * files on the drives should be copied to block blobs. * - * @param {boolean} [jobProperties.backupDriveManifest] Indicates whether the - * manifest files on the drives should be copied to block blobs. + * @param {array} [body.driveList] List of drives that comprise the job. * * @param {object} [options] Optional Parameters. * @@ -2191,7 +1926,7 @@ class Jobs { * * {Promise} A promise is returned * - * @resolve {Job} - The deserialized result object. + * @resolve {JobResponse} - The deserialized result object. * * @reject {Error} - The error object. * @@ -2200,13 +1935,13 @@ class Jobs { * {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 Job} for more information. + * See {@link JobResponse} 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(resourceGroupName, jobName, jobProperties, options, optionalCallback) { + update(jobName, resourceGroupName, body, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -2215,148 +1950,192 @@ class Jobs { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._update(resourceGroupName, jobName, jobProperties, options, (err, result, request, response) => { + self._update(jobName, resourceGroupName, body, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._update(resourceGroupName, jobName, jobProperties, options, optionalCallback); + return self._update(jobName, resourceGroupName, body, options, optionalCallback); } } /** - * Creates a new import/export job or updates an existing import/export job in - * the specified subscription. + * Creates a new job or updates an existing job in the specified subscription. + * + * @param {string} jobName The name of the import/export job. * * @param {string} resourceGroupName The resource group name uniquely * identifies the resource group within the user subscription. * - * @param {string} jobName The name of the import/export job. + * @param {object} body The parameters used for creating the job * - * @param {object} jobProperties Properties of the import/export job that need - * to be specified during creation. + * @param {string} [body.location] Specifies the supported Azure location where + * the job should be created * - * @param {string} jobProperties.storageAccountId The resource identifier of - * the storage account where data will be imported to or exported from. + * @param {object} [body.tags] Specifies the tags that will be assigned to the + * job. * - * @param {string} [jobProperties.containerSas] The container shared access - * signature (SAS) to be used to import or export data to or from the storage - * account. + * @param {object} [body.properties] Specifies the job properties * - * @param {string} jobProperties.jobType The type of job: Import or Export. - * Possible values include: 'Import', 'Export' + * @param {string} [body.properties.storageAccountId] The resource identifier + * of the storage account where data will be imported to or exported from. * - * @param {object} jobProperties.returnAddress Specifies the return address + * @param {string} [body.properties.jobType] The type of job + * + * @param {object} [body.properties.returnAddress] Specifies the return address * information for the job. * - * @param {string} jobProperties.returnAddress.recipientName The name of the + * @param {string} body.properties.returnAddress.recipientName The name of the * recipient who will receive the hard drives when they are returned. * - * @param {string} jobProperties.returnAddress.streetAddress1 The first line of - * the street address to use when returning the drives. - * - * @param {string} [jobProperties.returnAddress.streetAddress2] The second line + * @param {string} body.properties.returnAddress.streetAddress1 The first line * of the street address to use when returning the drives. * - * @param {string} jobProperties.returnAddress.city The city name to use when + * @param {string} [body.properties.returnAddress.streetAddress2] The second + * line of the street address to use when returning the drives. + * + * @param {string} body.properties.returnAddress.city The city name to use when * returning the drives. * - * @param {string} [jobProperties.returnAddress.stateOrProvince] The state or + * @param {string} [body.properties.returnAddress.stateOrProvince] The state or * province to use when returning the drives. * - * @param {string} jobProperties.returnAddress.postalCode The postal code to + * @param {string} body.properties.returnAddress.postalCode The postal code to * use when returning the drives. * - * @param {string} jobProperties.returnAddress.countryOrRegion The country or + * @param {string} body.properties.returnAddress.countryOrRegion The country or * region to use when returning the drives. * - * @param {string} jobProperties.returnAddress.phone Phone number of the + * @param {string} body.properties.returnAddress.phone Phone number of the * recipient of the returned drives. * - * @param {string} jobProperties.returnAddress.email Email address of the + * @param {string} body.properties.returnAddress.email Email address of the * recipient of the returned drives. * - * @param {object} jobProperties.returnShipping Specifies the return carrier - * and customer's account with the carrier. + * @param {object} [body.properties.returnShipping] Specifies the return + * carrier and customer's account with the carrier. * - * @param {string} jobProperties.returnShipping.carrierName The carrier's name. + * @param {string} body.properties.returnShipping.carrierName The carrier's + * name. * - * @param {string} jobProperties.returnShipping.carrierAccountNumber The + * @param {string} body.properties.returnShipping.carrierAccountNumber The * customer's account number with the carrier. * - * @param {object} [jobProperties.deliveryPackage] Contains information about + * @param {object} [body.properties.shippingInformation] Contains information + * about the Microsoft datacenter to which the drives should be shipped. + * + * @param {string} body.properties.shippingInformation.recipientName The name + * of the recipient who will receive the hard drives when they are returned. + * + * @param {string} body.properties.shippingInformation.streetAddress1 The first + * line of the street address to use when returning the drives. + * + * @param {string} [body.properties.shippingInformation.streetAddress2] The + * second line of the street address to use when returning the drives. + * + * @param {string} body.properties.shippingInformation.city The city name to + * use when returning the drives. + * + * @param {string} body.properties.shippingInformation.stateOrProvince The + * state or province to use when returning the drives. + * + * @param {string} body.properties.shippingInformation.postalCode The postal + * code to use when returning the drives. + * + * @param {string} body.properties.shippingInformation.countryOrRegion The + * country or region to use when returning the drives. + * + * @param {string} [body.properties.shippingInformation.phone] Phone number of + * the recipient of the returned drives. + * + * @param {object} [body.properties.deliveryPackage] Contains information about * the package being shipped by the customer to the Microsoft data center. * - * @param {string} jobProperties.deliveryPackage.carrierName The name of the + * @param {object} [body.properties.returnPackage] Contains information about + * the package being shipped from the Microsoft data center to the customer to + * return the drives. The format is the same as the deliveryPackage property + * above. This property is not included if the drives have not yet been + * returned. + * + * @param {string} body.properties.returnPackage.carrierName The name of the * carrier that is used to ship the import or export drives. * - * @param {string} jobProperties.deliveryPackage.trackingNumber The tracking + * @param {string} body.properties.returnPackage.trackingNumber The tracking * number of the package. * - * @param {number} jobProperties.deliveryPackage.driveCount The number of + * @param {number} body.properties.returnPackage.driveCount The number of * drives included in the package. * - * @param {string} jobProperties.deliveryPackage.shipDate The date the package - * is shipped. + * @param {string} body.properties.returnPackage.shipDate The date when the + * package is shipped. + * + * @param {string} [body.properties.diagnosticsPath] The virtual blob directory + * to which the copy logs and backups of drive manifest files (if enabled) will + * be stored. + * + * @param {string} [body.properties.logLevel] Default value is Error. Indicates + * whether error logging or verbose logging will be enabled. * - * @param {string} jobProperties.diagnosticsPath The virtual blob directory to - * which the copy logs and backups of drive manifest files (if enabled) will be - * stored. + * @param {boolean} [body.properties.backupDriveManifest] Default value is + * false. Indicates whether the manifest files on the drives should be copied + * to block blobs. * - * @param {string} [jobProperties.logLevel] Default value is Error. Indicates - * whether error logging or verbose logging will be enabled. Possible values - * include: 'Error', 'Verbose' + * @param {string} [body.properties.state] Current state of the job. * - * @param {boolean} [jobProperties.backupDriveManifest] Default value is false. - * Indicates whether the manifest files on the drives should be copied to block - * blobs. + * @param {boolean} [body.properties.cancelRequested] Indicates whether a + * request has been submitted to cancel the job. * - * @param {boolean} [jobProperties.cancelRequested] Indicates whether a request - * has been submitted to cancel the job. + * @param {number} [body.properties.percentComplete] Overall percentage + * completed for the job. * - * @param {array} [jobProperties.driveList] List of up to ten drives that + * @param {string} [body.properties.incompleteBlobListUri] A blob path that + * points to a block blob containing a list of blob names that were not + * exported due to insufficient drive space. If all blobs were exported + * successfully, then this element is not included in the response. + * + * @param {array} [body.properties.driveList] List of up to ten drives that * comprise the job. The drive list is a required element for an import job; it * is not specified for export jobs. * - * @param {object} [jobProperties.exportProperty] A property containing + * @param {object} [body.properties.exportProperty] A property containing * information about the blobs to be exported for an export job. This property * is included for export jobs only. * - * @param {array} [jobProperties.exportProperty.blobPath] A collection of + * @param {array} [body.properties.exportProperty.blobPath] A collection of * blob-path strings. * - * @param {array} [jobProperties.exportProperty.blobPathPrefix] A collection of - * blob-prefix strings. - * - * @param {string} [jobProperties.exportProperty.blobListblobPath] The relative - * URI to the block blob that contains the list of blob paths or blob path - * prefixes as defined above, beginning with the container name. If the blob is - * in the root container, the URI must begin with $root. + * @param {array} [body.properties.exportProperty.blobPathPrefix] A collection + * of blob-prefix strings. * - * @param {string} jobProperties.location Specifies the Azure location where - * the job is created. + * @param {string} [body.properties.exportProperty.blobListblobPath] The + * relative URI to the block blob that contains the list of blob paths or blob + * path prefixes as defined above, beginning with the container name. If the + * blob is in root container, the URI must begin with $root. * - * @param {object} [jobProperties.tags] Specifies the tags that are assigned to - * the job. + * @param {string} [body.properties.provisioningState] Specifies the + * provisioning state of the job. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.clientTenantId] The tenant ID of the client making + * the request. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, jobName, jobProperties, options) { + createWithHttpOperationResponse(jobName, resourceGroupName, body, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, jobName, jobProperties, options, (err, result, request, response) => { + self._create(jobName, resourceGroupName, body, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -2367,211 +2146,165 @@ class Jobs { } /** - * Creates a new import/export job or updates an existing import/export job in - * the specified subscription. + * Creates a new job or updates an existing job in the specified subscription. + * + * @param {string} jobName The name of the import/export job. * * @param {string} resourceGroupName The resource group name uniquely * identifies the resource group within the user subscription. * - * @param {string} jobName The name of the import/export job. + * @param {object} body The parameters used for creating the job + * + * @param {string} [body.location] Specifies the supported Azure location where + * the job should be created * - * @param {object} jobProperties Properties of the import/export job that need - * to be specified during creation. + * @param {object} [body.tags] Specifies the tags that will be assigned to the + * job. * - * @param {string} jobProperties.storageAccountId The resource identifier of - * the storage account where data will be imported to or exported from. + * @param {object} [body.properties] Specifies the job properties * - * @param {string} [jobProperties.containerSas] The container shared access - * signature (SAS) to be used to import or export data to or from the storage - * account. + * @param {string} [body.properties.storageAccountId] The resource identifier + * of the storage account where data will be imported to or exported from. * - * @param {string} jobProperties.jobType The type of job: Import or Export. - * Possible values include: 'Import', 'Export' + * @param {string} [body.properties.jobType] The type of job * - * @param {object} jobProperties.returnAddress Specifies the return address + * @param {object} [body.properties.returnAddress] Specifies the return address * information for the job. * - * @param {string} jobProperties.returnAddress.recipientName The name of the + * @param {string} body.properties.returnAddress.recipientName The name of the * recipient who will receive the hard drives when they are returned. * - * @param {string} jobProperties.returnAddress.streetAddress1 The first line of - * the street address to use when returning the drives. - * - * @param {string} [jobProperties.returnAddress.streetAddress2] The second line + * @param {string} body.properties.returnAddress.streetAddress1 The first line * of the street address to use when returning the drives. * - * @param {string} jobProperties.returnAddress.city The city name to use when + * @param {string} [body.properties.returnAddress.streetAddress2] The second + * line of the street address to use when returning the drives. + * + * @param {string} body.properties.returnAddress.city The city name to use when * returning the drives. * - * @param {string} [jobProperties.returnAddress.stateOrProvince] The state or + * @param {string} [body.properties.returnAddress.stateOrProvince] The state or * province to use when returning the drives. * - * @param {string} jobProperties.returnAddress.postalCode The postal code to + * @param {string} body.properties.returnAddress.postalCode The postal code to * use when returning the drives. * - * @param {string} jobProperties.returnAddress.countryOrRegion The country or + * @param {string} body.properties.returnAddress.countryOrRegion The country or * region to use when returning the drives. * - * @param {string} jobProperties.returnAddress.phone Phone number of the + * @param {string} body.properties.returnAddress.phone Phone number of the * recipient of the returned drives. * - * @param {string} jobProperties.returnAddress.email Email address of the + * @param {string} body.properties.returnAddress.email Email address of the * recipient of the returned drives. * - * @param {object} jobProperties.returnShipping Specifies the return carrier - * and customer's account with the carrier. + * @param {object} [body.properties.returnShipping] Specifies the return + * carrier and customer's account with the carrier. * - * @param {string} jobProperties.returnShipping.carrierName The carrier's name. + * @param {string} body.properties.returnShipping.carrierName The carrier's + * name. * - * @param {string} jobProperties.returnShipping.carrierAccountNumber The + * @param {string} body.properties.returnShipping.carrierAccountNumber The * customer's account number with the carrier. * - * @param {object} [jobProperties.deliveryPackage] Contains information about - * the package being shipped by the customer to the Microsoft data center. - * - * @param {string} jobProperties.deliveryPackage.carrierName The name of the - * carrier that is used to ship the import or export drives. + * @param {object} [body.properties.shippingInformation] Contains information + * about the Microsoft datacenter to which the drives should be shipped. * - * @param {string} jobProperties.deliveryPackage.trackingNumber The tracking - * number of the package. + * @param {string} body.properties.shippingInformation.recipientName The name + * of the recipient who will receive the hard drives when they are returned. * - * @param {number} jobProperties.deliveryPackage.driveCount The number of - * drives included in the package. + * @param {string} body.properties.shippingInformation.streetAddress1 The first + * line of the street address to use when returning the drives. * - * @param {string} jobProperties.deliveryPackage.shipDate The date the package - * is shipped. + * @param {string} [body.properties.shippingInformation.streetAddress2] The + * second line of the street address to use when returning the drives. * - * @param {string} jobProperties.diagnosticsPath The virtual blob directory to - * which the copy logs and backups of drive manifest files (if enabled) will be - * stored. - * - * @param {string} [jobProperties.logLevel] Default value is Error. Indicates - * whether error logging or verbose logging will be enabled. Possible values - * include: 'Error', 'Verbose' + * @param {string} body.properties.shippingInformation.city The city name to + * use when returning the drives. * - * @param {boolean} [jobProperties.backupDriveManifest] Default value is false. - * Indicates whether the manifest files on the drives should be copied to block - * blobs. + * @param {string} body.properties.shippingInformation.stateOrProvince The + * state or province to use when returning the drives. * - * @param {boolean} [jobProperties.cancelRequested] Indicates whether a request - * has been submitted to cancel the job. + * @param {string} body.properties.shippingInformation.postalCode The postal + * code to use when returning the drives. * - * @param {array} [jobProperties.driveList] List of up to ten drives that - * comprise the job. The drive list is a required element for an import job; it - * is not specified for export jobs. + * @param {string} body.properties.shippingInformation.countryOrRegion The + * country or region to use when returning the drives. * - * @param {object} [jobProperties.exportProperty] A property containing - * information about the blobs to be exported for an export job. This property - * is included for export jobs only. + * @param {string} [body.properties.shippingInformation.phone] Phone number of + * the recipient of the returned drives. * - * @param {array} [jobProperties.exportProperty.blobPath] A collection of - * blob-path strings. + * @param {object} [body.properties.deliveryPackage] Contains information about + * the package being shipped by the customer to the Microsoft data center. * - * @param {array} [jobProperties.exportProperty.blobPathPrefix] A collection of - * blob-prefix strings. + * @param {object} [body.properties.returnPackage] Contains information about + * the package being shipped from the Microsoft data center to the customer to + * return the drives. The format is the same as the deliveryPackage property + * above. This property is not included if the drives have not yet been + * returned. * - * @param {string} [jobProperties.exportProperty.blobListblobPath] The relative - * URI to the block blob that contains the list of blob paths or blob path - * prefixes as defined above, beginning with the container name. If the blob is - * in the root container, the URI must begin with $root. + * @param {string} body.properties.returnPackage.carrierName The name of the + * carrier that is used to ship the import or export drives. * - * @param {string} jobProperties.location Specifies the Azure location where - * the job is created. + * @param {string} body.properties.returnPackage.trackingNumber The tracking + * number of the package. * - * @param {object} [jobProperties.tags] Specifies the tags that are assigned to - * the job. + * @param {number} body.properties.returnPackage.driveCount The number of + * drives included in the package. * - * @param {object} [options] Optional Parameters. + * @param {string} body.properties.returnPackage.shipDate The date when the + * package is shipped. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [body.properties.diagnosticsPath] The virtual blob directory + * to which the copy logs and backups of drive manifest files (if enabled) will + * be stored. * - * @param {function} [optionalCallback] - The optional callback. + * @param {string} [body.properties.logLevel] Default value is Error. Indicates + * whether error logging or verbose logging will be enabled. * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. + * @param {boolean} [body.properties.backupDriveManifest] Default value is + * false. Indicates whether the manifest files on the drives should be copied + * to block blobs. * - * {Promise} A promise is returned + * @param {string} [body.properties.state] Current state of the job. * - * @resolve {Job} - The deserialized result object. + * @param {boolean} [body.properties.cancelRequested] Indicates whether a + * request has been submitted to cancel the job. * - * @reject {Error} - The error object. + * @param {number} [body.properties.percentComplete] Overall percentage + * completed for the job. * - * {function} optionalCallback(err, result, request, response) + * @param {string} [body.properties.incompleteBlobListUri] A blob path that + * points to a block blob containing a list of blob names that were not + * exported due to insufficient drive space. If all blobs were exported + * successfully, then this element is not included in the response. * - * {Error} err - The Error object if an error occurred, null otherwise. + * @param {array} [body.properties.driveList] List of up to ten drives that + * comprise the job. The drive list is a required element for an import job; it + * is not specified for export jobs. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Job} for more information. + * @param {object} [body.properties.exportProperty] A property containing + * information about the blobs to be exported for an export job. This property + * is included for export jobs only. * - * {object} [request] - The HTTP Request object if an error did not occur. + * @param {array} [body.properties.exportProperty.blobPath] A collection of + * blob-path strings. * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - createOrUpdate(resourceGroupName, jobName, jobProperties, 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(resourceGroupName, jobName, jobProperties, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, jobName, jobProperties, options, optionalCallback); - } - } - - /** - * Deletes an existing import/export job. Only import/export jobs in the - * Creating or Completed states can be deleted. + * @param {array} [body.properties.exportProperty.blobPathPrefix] A collection + * of blob-prefix strings. * - * @param {string} resourceGroupName The resource group name uniquely - * identifies the resource group within the user subscription. + * @param {string} [body.properties.exportProperty.blobListblobPath] The + * relative URI to the block blob that contains the list of blob paths or blob + * path prefixes as defined above, beginning with the container name. If the + * blob is in root container, the URI must begin with $root. * - * @param {string} jobName The name of the import/export job. + * @param {string} [body.properties.provisioningState] Specifies the + * provisioning state of the job. * * @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(resourceGroupName, jobName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, jobName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes an existing import/export job. Only import/export jobs in the - * Creating or Completed states can be deleted. - * - * @param {string} resourceGroupName The resource group name uniquely - * identifies the resource group within the user subscription. - * - * @param {string} jobName The name of the import/export job. - * - * @param {object} [options] Optional Parameters. + * @param {string} [options.clientTenantId] The tenant ID of the client making + * the request. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -2583,7 +2316,7 @@ class Jobs { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {JobResponse} - The deserialized result object. * * @reject {Error} - The error object. * @@ -2591,13 +2324,14 @@ class Jobs { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link JobResponse} 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. */ - deleteMethod(resourceGroupName, jobName, options, optionalCallback) { + create(jobName, resourceGroupName, body, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -2606,35 +2340,26 @@ class Jobs { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, jobName, options, (err, result, request, response) => { + self._create(jobName, resourceGroupName, body, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteMethod(resourceGroupName, jobName, options, optionalCallback); + return self._create(jobName, resourceGroupName, body, options, optionalCallback); } } /** - * Moves the specified import/export jobs from the resource group to a target - * resource group. The target resource group may be in a different - * subscription. + * Deletes an existing job. Only jobs in the Creating or Completed states can + * be deleted. + * + * @param {string} jobName The name of the import/export job. * * @param {string} resourceGroupName The resource group name uniquely * identifies the resource group within the user subscription. * - * @param {object} moveJobsParameters Parameters to be provided to move a job - * from one resource group to another. - * - * @param {string} moveJobsParameters.targetResourceGroup Specifies the target - * resource group ID to move the jobs to. - * - * @param {array} moveJobsParameters.resources Specifies the list of jobs to - * move to the target resource group. The jobs must be from the current - * resource group from the request URL. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2646,11 +2371,11 @@ class Jobs { * * @reject {Error} - The error object. */ - moveWithHttpOperationResponse(resourceGroupName, moveJobsParameters, options) { + deleteMethodWithHttpOperationResponse(jobName, resourceGroupName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._move(resourceGroupName, moveJobsParameters, options, (err, result, request, response) => { + self._deleteMethod(jobName, resourceGroupName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -2661,110 +2386,14 @@ class Jobs { } /** - * Moves the specified import/export jobs from the resource group to a target - * resource group. The target resource group may be in a different - * subscription. - * - * @param {string} resourceGroupName The resource group name uniquely - * identifies the resource group within the user subscription. - * - * @param {object} moveJobsParameters Parameters to be provided to move a job - * from one resource group to another. - * - * @param {string} moveJobsParameters.targetResourceGroup Specifies the target - * resource group ID to move the jobs to. - * - * @param {array} moveJobsParameters.resources Specifies the list of jobs to - * move to the target resource group. The jobs must be from the current - * resource group from the request URL. - * - * @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. - */ - move(resourceGroupName, moveJobsParameters, 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._move(resourceGroupName, moveJobsParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._move(resourceGroupName, moveJobsParameters, options, optionalCallback); - } - } - - /** - * Lists the BitLocker keys for all drives in the specified import/export job. - * - * @param {string} resourceGroupName The resource group name uniquely - * identifies the resource group within the user subscription. + * Deletes an existing job. Only jobs in the Creating or Completed states can + * be deleted. * * @param {string} jobName The name of the import/export job. * - * @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. - */ - listBitLockerKeysWithHttpOperationResponse(resourceGroupName, jobName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listBitLockerKeys(resourceGroupName, jobName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists the BitLocker keys for all drives in the specified import/export job. - * * @param {string} resourceGroupName The resource group name uniquely * identifies the resource group within the user subscription. * - * @param {string} jobName The name of the import/export job. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2777,7 +2406,7 @@ class Jobs { * * {Promise} A promise is returned * - * @resolve {BitLockerKeysListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -2785,15 +2414,13 @@ class Jobs { * * {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 BitLockerKeysListResult} for more - * information. + * {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. */ - listBitLockerKeys(resourceGroupName, jobName, options, optionalCallback) { + deleteMethod(jobName, resourceGroupName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -2802,19 +2429,19 @@ class Jobs { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listBitLockerKeys(resourceGroupName, jobName, options, (err, result, request, response) => { + self._deleteMethod(jobName, resourceGroupName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listBitLockerKeys(resourceGroupName, jobName, options, optionalCallback); + return self._deleteMethod(jobName, resourceGroupName, options, optionalCallback); } } /** - * Gets all the active and completed import/export jobs in a subscription. + * Returns all active and completed jobs in a subscription. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -2826,15 +2453,15 @@ class Jobs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink, options) { + listBySubscriptionNextWithHttpOperationResponse(nextPageLink, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listNext(nextPageLink, options, (err, result, request, response) => { + self._listBySubscriptionNext(nextPageLink, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -2845,7 +2472,7 @@ class Jobs { } /** - * Gets all the active and completed import/export jobs in a subscription. + * Returns all active and completed jobs in a subscription. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -2862,7 +2489,7 @@ class Jobs { * * {Promise} A promise is returned * - * @resolve {JobListResult} - The deserialized result object. + * @resolve {ListJobsResponse} - The deserialized result object. * * @reject {Error} - The error object. * @@ -2871,13 +2498,13 @@ class Jobs { * {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 JobListResult} for more information. + * See {@link ListJobsResponse} 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) { + listBySubscriptionNext(nextPageLink, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -2886,19 +2513,19 @@ class Jobs { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listNext(nextPageLink, options, (err, result, request, response) => { + self._listBySubscriptionNext(nextPageLink, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listNext(nextPageLink, options, optionalCallback); + return self._listBySubscriptionNext(nextPageLink, options, optionalCallback); } } /** - * Returns all active and completed import/export jobs in a resource group. + * Returns all active and completed jobs in a resource group. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -2910,7 +2537,7 @@ class Jobs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -2929,7 +2556,7 @@ class Jobs { } /** - * Returns all active and completed import/export jobs in a resource group. + * Returns all active and completed jobs in a resource group. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -2946,7 +2573,7 @@ class Jobs { * * {Promise} A promise is returned * - * @resolve {JobListResult} - The deserialized result object. + * @resolve {ListJobsResponse} - The deserialized result object. * * @reject {Error} - The error object. * @@ -2955,7 +2582,7 @@ class Jobs { * {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 JobListResult} for more information. + * See {@link ListJobsResponse} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * diff --git a/lib/services/storageImportExportManagement/lib/operations/locations.js b/lib/services/storageImportExportManagement/lib/operations/locations.js new file mode 100644 index 0000000000..d2a803f0dd --- /dev/null +++ b/lib/services/storageImportExportManagement/lib/operations/locations.js @@ -0,0 +1,460 @@ +/* + * 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; + +/** + * Returns a list of locations to which you can ship the disks associated with + * an import or export job. A location is a Microsoft data center region. + * + * @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 LocationsResponse} 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.'); + } + // 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.ImportExport/locations'; + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.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['ErrorResponse']().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['LocationsResponse']().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); + }); +} + +/** + * Returns the details about a location to which you can ship the disks + * associated with an import or export job. A location is an Azure region. + * + * @param {string} locationName The name of the location. For example, West US + * or westus. + * + * @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 Location} 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(locationName, 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 (locationName === null || locationName === undefined || typeof locationName.valueOf() !== 'string') { + throw new Error('locationName 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('/') ? '' : '/') + 'providers/Microsoft.ImportExport/locations/{locationName}'; + requestUrl = requestUrl.replace('{locationName}', encodeURIComponent(locationName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.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['ErrorResponse']().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['Location']().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 Locations. */ +class Locations { + /** + * Create a Locations. + * @param {StorageImportExportManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._get = _get; + } + + /** + * Returns a list of locations to which you can ship the disks associated with + * an import or export job. A location is a Microsoft data center region. + * + * @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; + }); + }); + } + + /** + * Returns a list of locations to which you can ship the disks associated with + * an import or export job. A location is a Microsoft data center region. + * + * @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 {LocationsResponse} - 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 LocationsResponse} 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); + } + } + + /** + * Returns the details about a location to which you can ship the disks + * associated with an import or export job. A location is an Azure region. + * + * @param {string} locationName The name of the location. For example, West US + * or westus. + * + * @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(locationName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(locationName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Returns the details about a location to which you can ship the disks + * associated with an import or export job. A location is an Azure region. + * + * @param {string} locationName The name of the location. For example, West US + * or westus. + * + * @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 {Location} - 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 Location} 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(locationName, 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(locationName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(locationName, options, optionalCallback); + } + } + +} + +module.exports = Locations; diff --git a/lib/services/storageImportExportManagement/lib/operations/operations.js b/lib/services/storageImportExportManagement/lib/operations/operations.js new file mode 100644 index 0000000000..60dd145a4f --- /dev/null +++ b/lib/services/storageImportExportManagement/lib/operations/operations.js @@ -0,0 +1,240 @@ +/* + * 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; + +/** + * Returns the list of operations supported by the import/export 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 ListOperationsResponse} 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.'); + } + // 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.ImportExport/operations'; + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.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['ErrorResponse']().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['ListOperationsResponse']().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 {StorageImportExportManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + } + + /** + * Returns the list of operations supported by the import/export 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; + }); + }); + } + + /** + * Returns the list of operations supported by the import/export 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 {ListOperationsResponse} - 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 ListOperationsResponse} 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); + } + } + +} + +module.exports = Operations; diff --git a/lib/services/storageImportExportManagement/lib/storageImportExportManagementClient.d.ts b/lib/services/storageImportExportManagement/lib/storageImportExportManagementClient.d.ts index 1c8e28d4fd..680c2b81a3 100755 --- a/lib/services/storageImportExportManagement/lib/storageImportExportManagementClient.d.ts +++ b/lib/services/storageImportExportManagement/lib/storageImportExportManagementClient.d.ts @@ -8,12 +8,12 @@ * regenerated. */ -import { ServiceClient, ServiceClientOptions, ServiceCallback, HttpOperationResponse, ServiceClientCredentials } from 'ms-rest'; +import { ServiceClientCredentials } from 'ms-rest'; import { AzureServiceClient, AzureServiceClientOptions } from 'ms-rest-azure'; import * as models from "./models"; import * as operations from "./operations"; -declare class StorageImportExportManagementClient extends AzureServiceClient { +export default class StorageImportExportManagementClient extends AzureServiceClient { /** * Initializes a new instance of the StorageImportExportManagementClient class. * @constructor @@ -34,9 +34,11 @@ declare class StorageImportExportManagementClient extends AzureServiceClient { * * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy * - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {string} [options.acceptLanguage] - Specifies the preferred language for the response. * - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @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); @@ -54,173 +56,10 @@ declare class StorageImportExportManagementClient extends AzureServiceClient { generateClientRequestId: boolean; // Operation groups + locations: operations.Locations; jobs: operations.Jobs; - - - /** - * Returns a list of locations to which you can ship the disks associated with - * an import or export job. A location is a Microsoft data center region. - * - * @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. - */ - listLocationsWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Returns a list of locations to which you can ship the disks associated with - * an import or export job. A location is a Microsoft data center region. - * - * @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 {LocationsListResult} - 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. - * - * {LocationsListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LocationsListResult} 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. - */ - listLocations(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listLocations(callback: ServiceCallback): void; - listLocations(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets a location to which you can ship the disks associated with an import or - * export job. A location is an Azure region. - * - * @param {string} locationName The name of the location. For example, 'West - * US' or 'westus'. - * - * @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. - */ - getLocationWithHttpOperationResponse(locationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a location to which you can ship the disks associated with an import or - * export job. A location is an Azure region. - * - * @param {string} locationName The name of the location. For example, 'West - * US' or 'westus'. - * - * @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 {Location} - 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. - * - * {Location} [result] - The deserialized result object if an error did not occur. - * See {@link Location} 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. - */ - getLocation(locationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getLocation(locationName: string, callback: ServiceCallback): void; - getLocation(locationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Returns the list of operations supported by the import/export 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. - */ - listSupportedOperationsWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Returns the list of operations supported by the import/export 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 {SupportedOperationsListResult} - 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. - * - * {SupportedOperationsListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SupportedOperationsListResult} 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. - */ - listSupportedOperations(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listSupportedOperations(callback: ServiceCallback): void; - listSupportedOperations(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + bitLockerKeys: operations.BitLockerKeys; + operations: operations.Operations; } -export = StorageImportExportManagementClient; +export { StorageImportExportManagementClient, models as StorageImportExportManagementModels }; diff --git a/lib/services/storageImportExportManagement/lib/storageImportExportManagementClient.js b/lib/services/storageImportExportManagement/lib/storageImportExportManagementClient.js index a8e787c6b9..7de405c38e 100755 --- a/lib/services/storageImportExportManagement/lib/storageImportExportManagementClient.js +++ b/lib/services/storageImportExportManagement/lib/storageImportExportManagementClient.js @@ -17,385 +17,11 @@ const msRest = require('ms-rest'); const msRestAzure = require('ms-rest-azure'); const ServiceClient = msRestAzure.AzureServiceClient; -const WebResource = msRest.WebResource; const models = require('./models'); const operations = require('./operations'); -/** - * Returns a list of locations to which you can ship the disks associated with - * an import or export job. A location is a Microsoft data center region. - * - * @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 LocationsListResult} 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 _listLocations(options, callback) { - /* jshint validthis: true */ - let client = this; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - - // Construct URL - let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.ImportExport/locations'; - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.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.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { - httpRequest.headers['Accept-Language'] = this.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['ErrorResponse']().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['LocationsListResult']().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); - }); -} - -/** - * Gets a location to which you can ship the disks associated with an import or - * export job. A location is an Azure region. - * - * @param {string} locationName The name of the location. For example, 'West - * US' or 'westus'. - * - * @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 Location} 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 _getLocation(locationName, options, callback) { - /* jshint validthis: true */ - let client = this; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - // Validate - try { - if (locationName === null || locationName === undefined || typeof locationName.valueOf() !== 'string') { - throw new Error('locationName cannot be null or undefined and it must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.ImportExport/locations/{locationName}'; - requestUrl = requestUrl.replace('{locationName}', encodeURIComponent(locationName)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.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.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { - httpRequest.headers['Accept-Language'] = this.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['ErrorResponse']().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['Location']().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); - }); -} - -/** - * Returns the list of operations supported by the import/export 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 SupportedOperationsListResult} 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 _listSupportedOperations(options, callback) { - /* jshint validthis: true */ - let client = this; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - - // Construct URL - let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.ImportExport/operations'; - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.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.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { - httpRequest.headers['Accept-Language'] = this.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['ErrorResponse']().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['SupportedOperationsListResult']().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 StorageImportExportManagementClient. */ class StorageImportExportManagementClient extends ServiceClient { /** @@ -408,8 +34,9 @@ class StorageImportExportManagementClient extends ServiceClient { * @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 {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {string} [options.acceptLanguage] - Specifies 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) { @@ -424,7 +51,6 @@ class StorageImportExportManagementClient extends ServiceClient { super(credentials, options); this.apiVersion = '2016-11-01'; - this.acceptLanguage = 'en-us'; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; this.baseUri = baseUri; @@ -436,267 +62,26 @@ class StorageImportExportManagementClient extends ServiceClient { 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.locations = new operations.Locations(this); this.jobs = new operations.Jobs(this); + this.bitLockerKeys = new operations.BitLockerKeys(this); + this.operations = new operations.Operations(this); this.models = models; - this._listLocations = _listLocations; - this._getLocation = _getLocation; - this._listSupportedOperations = _listSupportedOperations; msRest.addSerializationMixin(this); } - /** - * Returns a list of locations to which you can ship the disks associated with - * an import or export job. A location is a Microsoft data center region. - * - * @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. - */ - listLocationsWithHttpOperationResponse(options) { - let client = this; - let self = this; - return new Promise((resolve, reject) => { - self._listLocations(options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Returns a list of locations to which you can ship the disks associated with - * an import or export job. A location is a Microsoft data center region. - * - * @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 {LocationsListResult} - 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 LocationsListResult} 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. - */ - listLocations(options, optionalCallback) { - let client = this; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listLocations(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listLocations(options, optionalCallback); - } - } - - /** - * Gets a location to which you can ship the disks associated with an import or - * export job. A location is an Azure region. - * - * @param {string} locationName The name of the location. For example, 'West - * US' or 'westus'. - * - * @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. - */ - getLocationWithHttpOperationResponse(locationName, options) { - let client = this; - let self = this; - return new Promise((resolve, reject) => { - self._getLocation(locationName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Gets a location to which you can ship the disks associated with an import or - * export job. A location is an Azure region. - * - * @param {string} locationName The name of the location. For example, 'West - * US' or 'westus'. - * - * @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 {Location} - 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 Location} 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. - */ - getLocation(locationName, options, optionalCallback) { - let client = this; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._getLocation(locationName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getLocation(locationName, options, optionalCallback); - } - } - - /** - * Returns the list of operations supported by the import/export 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. - */ - listSupportedOperationsWithHttpOperationResponse(options) { - let client = this; - let self = this; - return new Promise((resolve, reject) => { - self._listSupportedOperations(options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Returns the list of operations supported by the import/export 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 {SupportedOperationsListResult} - 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 SupportedOperationsListResult} 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. - */ - listSupportedOperations(options, optionalCallback) { - let client = this; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listSupportedOperations(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listSupportedOperations(options, optionalCallback); - } - } - } module.exports = StorageImportExportManagementClient; +module.exports['default'] = StorageImportExportManagementClient; +module.exports.StorageImportExportManagementClient = StorageImportExportManagementClient; +module.exports.StorageImportExportManagementModels = models; diff --git a/lib/services/storageImportExportManagement/package.json b/lib/services/storageImportExportManagement/package.json index eafde92d83..faa515192e 100644 --- a/lib/services/storageImportExportManagement/package.json +++ b/lib/services/storageImportExportManagement/package.json @@ -1,35 +1,25 @@ { "name": "azure-arm-storageimportexport", "author": "Microsoft Corporation", - "contributors": [ - "Shah, Rena " - ], + "description": "StorageImportExportManagementClient Library with typescript type definitions for node", "version": "1.1.0", - "description": "Microsoft Azure SQL Management Client Library for node", - "tags": [ - "azure", - "sdk" - ], + "dependencies": { + "ms-rest": "^2.3.3", + "ms-rest-azure": "^2.5.5" + }, "keywords": [ "node", "azure" ], + "license": "MIT", "main": "./lib/storageImportExportManagementClient.js", "types": "./lib/storageImportExportManagementClient.d.ts", - "license": "MIT", - "dependencies": { - "ms-rest": "^2.2.2", - "ms-rest-azure": "^2.3.3" - }, - "homepage": "http://github.com/Azure/azure-sdk-for-node", + "homepage": "https://github.com/azure/azure-sdk-for-node/tree/master/lib/services/storageImportExportManagement", "repository": { "type": "git", - "url": "git@github.com:Azure/azure-sdk-for-node.git" + "url": "https://github.com/azure/azure-sdk-for-node.git" }, "bugs": { - "url": "http://github.com/Azure/azure-sdk-for-node/issues" - }, - "scripts": { - "test": "npm -s run-script jshint" + "url": "https://github.com/azure/azure-sdk-for-node/issues" } }