diff --git a/lib/services/databox/LICENSE.txt b/lib/services/databox/LICENSE.txt new file mode 100644 index 0000000000..a70e8cf660 --- /dev/null +++ b/lib/services/databox/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/lib/services/databox/README.md b/lib/services/databox/README.md new file mode 100644 index 0000000000..9831fa72e7 --- /dev/null +++ b/lib/services/databox/README.md @@ -0,0 +1,40 @@ +--- +uid: azure-arm-databox +summary: *content + +--- +# Microsoft Azure SDK for Node.js - DataBoxManagementClient +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-databox +``` + +## How to use + +### Authentication, client creation and list operations as an example. + +```javascript +const msRestAzure = require("ms-rest-azure"); +const DataBoxManagementClient = require("azure-arm-databox"); +msRestAzure.interactiveLogin().then((creds) => { + const subscriptionId = ""; + const client = new DataBoxManagementClient(creds, subscriptionId); + return client.operations.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/databox/lib/LICENSE.txt b/lib/services/databox/lib/LICENSE.txt new file mode 100644 index 0000000000..5431ba98b9 --- /dev/null +++ b/lib/services/databox/lib/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/lib/services/databox/lib/dataBoxManagementClient.d.ts b/lib/services/databox/lib/dataBoxManagementClient.d.ts new file mode 100644 index 0000000000..be7c0f4b6c --- /dev/null +++ b/lib/services/databox/lib/dataBoxManagementClient.d.ts @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import { ServiceClientCredentials } from 'ms-rest'; +import { AzureServiceClient, AzureServiceClientOptions } from 'ms-rest-azure'; +import * as models from "./models"; +import * as operations from "./operations"; + +export default class DataBoxManagementClient extends AzureServiceClient { + /** + * Initializes a new instance of the DataBoxManagementClient class. + * @constructor + * + * @class + * @param {credentials} credentials - Credentials needed for the client to connect to Azure. + * + * @param {string} subscriptionId - The Subscription Id + * + * @param {string} [baseUri] - The base URI of the service. + * + * @param {object} [options] - The parameter options + * + * @param {Array} [options.filters] - Filters to be added to the request pipeline + * + * @param {object} [options.requestOptions] - Options for the underlying request object + * {@link https://github.com/request/request#requestoptions-callback Options doc} + * + * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy + * + * @param {string} [options.acceptLanguage] - The preferred language for the response. + * + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + */ + constructor(credentials: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions); + + credentials: ServiceClientCredentials; + + apiVersion: string; + + subscriptionId: string; + + acceptLanguage: string; + + longRunningOperationRetryTimeout: number; + + generateClientRequestId: boolean; + + // Operation groups + operations: operations.Operations; + jobs: operations.Jobs; + service: operations.Service; +} + +export { DataBoxManagementClient, models as DataBoxManagementModels }; diff --git a/lib/services/databox/lib/dataBoxManagementClient.js b/lib/services/databox/lib/dataBoxManagementClient.js new file mode 100644 index 0000000000..0ecbe860ab --- /dev/null +++ b/lib/services/databox/lib/dataBoxManagementClient.js @@ -0,0 +1,87 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +/* jshint latedef:false */ +/* jshint forin:false */ +/* jshint noempty:false */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const ServiceClient = msRestAzure.AzureServiceClient; + +const models = require('./models'); +const operations = require('./operations'); + + +/** Class representing a DataBoxManagementClient. */ +class DataBoxManagementClient extends ServiceClient { + /** + * Create a DataBoxManagementClient. + * @param {credentials} credentials - Credentials needed for the client to connect to Azure. + * @param {string} subscriptionId - The Subscription Id + * @param {string} [baseUri] - The base URI of the service. + * @param {object} [options] - The parameter options + * @param {Array} [options.filters] - Filters to be added to the request pipeline + * @param {object} [options.requestOptions] - Options for the underlying request object + * {@link https://github.com/request/request#requestoptions-callback Options doc} + * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy + * @param {string} [options.acceptLanguage] - The preferred language for the response. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + */ + constructor(credentials, subscriptionId, baseUri, options) { + if (credentials === null || credentials === undefined) { + throw new Error('\'credentials\' cannot be null.'); + } + if (subscriptionId === null || subscriptionId === undefined) { + throw new Error('\'subscriptionId\' cannot be null.'); + } + + if (!options) options = {}; + + super(credentials, options); + + this.apiVersion = '2018-01-01'; + this.acceptLanguage = 'en-US'; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.baseUri = baseUri; + if (!this.baseUri) { + this.baseUri = 'https://management.azure.com'; + } + this.credentials = credentials; + this.subscriptionId = subscriptionId; + + let packageInfo = this.getPackageJsonInfo(__dirname); + this.addUserAgentInfo(`${packageInfo.name}/${packageInfo.version}`); + if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + this.acceptLanguage = options.acceptLanguage; + } + if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; + } + if(options.generateClientRequestId !== null && options.generateClientRequestId !== undefined) { + this.generateClientRequestId = options.generateClientRequestId; + } + this.operations = new operations.Operations(this); + this.jobs = new operations.Jobs(this); + this.service = new operations.Service(this); + this.models = models; + msRest.addSerializationMixin(this); + } + +} + +module.exports = DataBoxManagementClient; +module.exports['default'] = DataBoxManagementClient; +module.exports.DataBoxManagementClient = DataBoxManagementClient; +module.exports.DataBoxManagementModels = models; diff --git a/lib/services/databox/lib/lib/dataBoxManagementClient.d.ts b/lib/services/databox/lib/lib/dataBoxManagementClient.d.ts new file mode 100644 index 0000000000..6be9e15ddf --- /dev/null +++ b/lib/services/databox/lib/lib/dataBoxManagementClient.d.ts @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import { ServiceClientCredentials } from 'ms-rest'; +import { AzureServiceClient, AzureServiceClientOptions } from 'ms-rest-azure'; +import * as models from "./models"; +import * as operations from "./operations"; + +export default class DataBoxManagementClient extends AzureServiceClient { + /** + * Initializes a new instance of the DataBoxManagementClient class. + * @constructor + * + * @class + * @param {credentials} credentials - Credentials needed for the client to connect to Azure. + * + * @param {string} subscriptionId - The Subscription Id + * + * @param {string} [baseUri] - The base URI of the service. + * + * @param {object} [options] - The parameter options + * + * @param {Array} [options.filters] - Filters to be added to the request pipeline + * + * @param {object} [options.requestOptions] - Options for the underlying request object + * {@link https://github.com/request/request#requestoptions-callback Options doc} + * + * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy + * + * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. + * + * @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. + * + */ + constructor(credentials: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions); + + credentials: ServiceClientCredentials; + + apiVersion: string; + + subscriptionId: string; + + acceptLanguage: string; + + longRunningOperationRetryTimeout: number; + + generateClientRequestId: boolean; + + // Operation groups + operations: operations.Operations; + jobs: operations.Jobs; + service: operations.Service; +} + +export { DataBoxManagementClient, models as DataBoxManagementModels }; diff --git a/lib/services/databox/lib/lib/dataBoxManagementClient.js b/lib/services/databox/lib/lib/dataBoxManagementClient.js new file mode 100644 index 0000000000..4b47bc4bca --- /dev/null +++ b/lib/services/databox/lib/lib/dataBoxManagementClient.js @@ -0,0 +1,87 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +/* jshint latedef:false */ +/* jshint forin:false */ +/* jshint noempty:false */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const ServiceClient = msRestAzure.AzureServiceClient; + +const models = require('./models'); +const operations = require('./operations'); + + +/** Class representing a DataBoxManagementClient. */ +class DataBoxManagementClient extends ServiceClient { + /** + * Create a DataBoxManagementClient. + * @param {credentials} credentials - Credentials needed for the client to connect to Azure. + * @param {string} subscriptionId - The Subscription Id + * @param {string} [baseUri] - The base URI of the service. + * @param {object} [options] - The parameter options + * @param {Array} [options.filters] - Filters to be added to the request pipeline + * @param {object} [options.requestOptions] - Options for the underlying request object + * {@link https://github.com/request/request#requestoptions-callback Options doc} + * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy + * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. + * @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. + */ + constructor(credentials, subscriptionId, baseUri, options) { + if (credentials === null || credentials === undefined) { + throw new Error('\'credentials\' cannot be null.'); + } + if (subscriptionId === null || subscriptionId === undefined) { + throw new Error('\'subscriptionId\' cannot be null.'); + } + + if (!options) options = {}; + + super(credentials, options); + + this.apiVersion = '2018-01-01'; + this.acceptLanguage = 'en-US'; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.baseUri = baseUri; + if (!this.baseUri) { + this.baseUri = 'https://management.azure.com'; + } + this.credentials = credentials; + this.subscriptionId = subscriptionId; + + let packageInfo = this.getPackageJsonInfo(__dirname); + this.addUserAgentInfo(`${packageInfo.name}/${packageInfo.version}`); + if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + this.acceptLanguage = options.acceptLanguage; + } + if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; + } + if(options.generateClientRequestId !== null && options.generateClientRequestId !== undefined) { + this.generateClientRequestId = options.generateClientRequestId; + } + this.operations = new operations.Operations(this); + this.jobs = new operations.Jobs(this); + this.service = new operations.Service(this); + this.models = models; + msRest.addSerializationMixin(this); + } + +} + +module.exports = DataBoxManagementClient; +module.exports['default'] = DataBoxManagementClient; +module.exports.DataBoxManagementClient = DataBoxManagementClient; +module.exports.DataBoxManagementModels = models; diff --git a/lib/services/databox/lib/lib/models/accountCopyLogDetails.js b/lib/services/databox/lib/lib/models/accountCopyLogDetails.js new file mode 100644 index 0000000000..dcf96065ff --- /dev/null +++ b/lib/services/databox/lib/lib/models/accountCopyLogDetails.js @@ -0,0 +1,77 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Copy log details for an storage account + * + * @extends models['CopyLogDetails'] + */ +class AccountCopyLogDetails extends models['CopyLogDetails'] { + /** + * Create a AccountCopyLogDetails. + * @member {string} accountName Destination account name. + * @member {string} copyLogLink Link for copy logs. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AccountCopyLogDetails + * + * @returns {object} metadata of AccountCopyLogDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'Pod', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'copyLogDetailsType', + clientName: 'copyLogDetailsType' + }, + uberParent: 'CopyLogDetails', + className: 'AccountCopyLogDetails', + modelProperties: { + copyLogDetailsType: { + required: true, + serializedName: 'copyLogDetailsType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + accountName: { + required: true, + serializedName: 'accountName', + type: { + name: 'String' + } + }, + copyLogLink: { + required: true, + serializedName: 'copyLogLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AccountCopyLogDetails; diff --git a/lib/services/databox/lib/lib/models/accountCredentialDetails.js b/lib/services/databox/lib/lib/models/accountCredentialDetails.js new file mode 100644 index 0000000000..7e61fc5d4e --- /dev/null +++ b/lib/services/databox/lib/lib/models/accountCredentialDetails.js @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Credential details of the account. + * + */ +class AccountCredentialDetails { + /** + * Create a AccountCredentialDetails. + * @member {string} [accountName] Name of the account. + * @member {array} shareCredentialDetails Per share level unencrypted access + * credentials. + */ + constructor() { + } + + /** + * Defines the metadata of AccountCredentialDetails + * + * @returns {object} metadata of AccountCredentialDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'AccountCredentialDetails', + type: { + name: 'Composite', + className: 'AccountCredentialDetails', + modelProperties: { + accountName: { + required: false, + serializedName: 'accountName', + type: { + name: 'String' + } + }, + shareCredentialDetails: { + required: true, + serializedName: 'shareCredentialDetails', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ShareCredentialDetailsElementType', + type: { + name: 'Composite', + className: 'ShareCredentialDetails' + } + } + } + } + } + } + }; + } +} + +module.exports = AccountCredentialDetails; diff --git a/lib/services/databox/lib/lib/models/addressValidationOutput.js b/lib/services/databox/lib/lib/models/addressValidationOutput.js new file mode 100644 index 0000000000..6a714b7a18 --- /dev/null +++ b/lib/services/databox/lib/lib/models/addressValidationOutput.js @@ -0,0 +1,72 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Output of the address validation api. + * + */ +class AddressValidationOutput { + /** + * Create a AddressValidationOutput. + * @member {string} [validationStatus] The address validation status. + * Possible values include: 'Valid', 'Invalid', 'Ambiguous' + * @member {array} [alternateAddresses] List of alternate addresses. + */ + constructor() { + } + + /** + * Defines the metadata of AddressValidationOutput + * + * @returns {object} metadata of AddressValidationOutput + * + */ + mapper() { + return { + required: false, + serializedName: 'AddressValidationOutput', + type: { + name: 'Composite', + className: 'AddressValidationOutput', + modelProperties: { + validationStatus: { + required: false, + serializedName: 'properties.validationStatus', + type: { + name: 'Enum', + allowedValues: [ 'Valid', 'Invalid', 'Ambiguous' ] + } + }, + alternateAddresses: { + required: false, + serializedName: 'properties.alternateAddresses', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ShippingAddressElementType', + type: { + name: 'Composite', + className: 'ShippingAddress' + } + } + } + } + } + } + }; + } +} + +module.exports = AddressValidationOutput; diff --git a/lib/services/databox/lib/lib/models/armBaseObject.js b/lib/services/databox/lib/lib/models/armBaseObject.js new file mode 100644 index 0000000000..a20f3e73cf --- /dev/null +++ b/lib/services/databox/lib/lib/models/armBaseObject.js @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Base class for all objects under resource. + * + */ +class ArmBaseObject { + /** + * Create a ArmBaseObject. + * @member {string} [name] Name of the object. + * @member {string} [id] Id of the object. + * @member {string} [type] Type of the object. + */ + constructor() { + } + + /** + * Defines the metadata of ArmBaseObject + * + * @returns {object} metadata of ArmBaseObject + * + */ + mapper() { + return { + required: false, + serializedName: 'ArmBaseObject', + type: { + name: 'Composite', + className: 'ArmBaseObject', + modelProperties: { + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ArmBaseObject; diff --git a/lib/services/databox/lib/lib/models/availableSkuRequest.js b/lib/services/databox/lib/lib/models/availableSkuRequest.js new file mode 100644 index 0000000000..764639e032 --- /dev/null +++ b/lib/services/databox/lib/lib/models/availableSkuRequest.js @@ -0,0 +1,72 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The filters for showing the available skus. + * + */ +class AvailableSkuRequest { + /** + * Create a AvailableSkuRequest. + * @member {string} country ISO country code. Country for hardware shipment. + * For codes check: + * https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + * @member {string} location Location for data transfer. For locations check: + * https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + */ + constructor() { + } + + /** + * Defines the metadata of AvailableSkuRequest + * + * @returns {object} metadata of AvailableSkuRequest + * + */ + mapper() { + return { + required: false, + serializedName: 'AvailableSkuRequest', + type: { + name: 'Composite', + className: 'AvailableSkuRequest', + modelProperties: { + transferType: { + required: true, + isConstant: true, + serializedName: 'transferType', + defaultValue: 'ImportToAzure', + type: { + name: 'String' + } + }, + country: { + required: true, + serializedName: 'country', + type: { + name: 'String' + } + }, + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AvailableSkuRequest; diff --git a/lib/services/databox/lib/lib/models/availableSkusResult.js b/lib/services/databox/lib/lib/models/availableSkusResult.js new file mode 100644 index 0000000000..30d34e2ab7 --- /dev/null +++ b/lib/services/databox/lib/lib/models/availableSkusResult.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'; + +/** + * The available skus operation response. + */ +class AvailableSkusResult extends Array { + /** + * Create a AvailableSkusResult. + * @member {string} [nextLink] Link for the next set of skus. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AvailableSkusResult + * + * @returns {object} metadata of AvailableSkusResult + * + */ + mapper() { + return { + required: false, + serializedName: 'AvailableSkusResult', + type: { + name: 'Composite', + className: 'AvailableSkusResult', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SkuInformationElementType', + type: { + name: 'Composite', + className: 'SkuInformation' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AvailableSkusResult; diff --git a/lib/services/databox/lib/lib/models/cabinetJobSecrets.js b/lib/services/databox/lib/lib/models/cabinetJobSecrets.js new file mode 100644 index 0000000000..ea5c5f3cf1 --- /dev/null +++ b/lib/services/databox/lib/lib/models/cabinetJobSecrets.js @@ -0,0 +1,78 @@ +/* + * 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'); + +/** + * The secrets related to a cabinet job. + * + * @extends models['JobSecrets'] + */ +class CabinetJobSecrets extends models['JobSecrets'] { + /** + * Create a CabinetJobSecrets. + * @member {array} [cabinetPodSecrets] Contains the list of secret objects + * for a cabinet job. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of CabinetJobSecrets + * + * @returns {object} metadata of CabinetJobSecrets + * + */ + mapper() { + return { + required: false, + serializedName: 'Cabinet', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'jobSecretsType', + clientName: 'jobSecretsType' + }, + uberParent: 'JobSecrets', + className: 'CabinetJobSecrets', + modelProperties: { + jobSecretsType: { + required: true, + serializedName: 'jobSecretsType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + cabinetPodSecrets: { + required: false, + serializedName: 'cabinetPodSecrets', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CabinetPodSecretElementType', + type: { + name: 'Composite', + className: 'CabinetPodSecret' + } + } + } + } + } + } + }; + } +} + +module.exports = CabinetJobSecrets; diff --git a/lib/services/databox/lib/lib/models/cabinetPodSecret.js b/lib/services/databox/lib/lib/models/cabinetPodSecret.js new file mode 100644 index 0000000000..e3750c7098 --- /dev/null +++ b/lib/services/databox/lib/lib/models/cabinetPodSecret.js @@ -0,0 +1,81 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The secrets related to a cabinet pod. + * + */ +class CabinetPodSecret { + /** + * Create a CabinetPodSecret. + * @member {string} [deviceSerialNumber] Serial number of the assigned + * device. + * @member {string} [devicePassword] Password for out of the box experience + * on device. + * @member {array} [accountCredentialDetails] Per account level access + * credentials. + */ + constructor() { + } + + /** + * Defines the metadata of CabinetPodSecret + * + * @returns {object} metadata of CabinetPodSecret + * + */ + mapper() { + return { + required: false, + serializedName: 'CabinetPodSecret', + type: { + name: 'Composite', + className: 'CabinetPodSecret', + modelProperties: { + deviceSerialNumber: { + required: false, + serializedName: 'deviceSerialNumber', + type: { + name: 'String' + } + }, + devicePassword: { + required: false, + serializedName: 'devicePassword', + type: { + name: 'String' + } + }, + accountCredentialDetails: { + required: false, + serializedName: 'accountCredentialDetails', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AccountCredentialDetailsElementType', + type: { + name: 'Composite', + className: 'AccountCredentialDetails' + } + } + } + } + } + } + }; + } +} + +module.exports = CabinetPodSecret; diff --git a/lib/services/databox/lib/lib/models/cancellationReason.js b/lib/services/databox/lib/lib/models/cancellationReason.js new file mode 100644 index 0000000000..ad05bc05e3 --- /dev/null +++ b/lib/services/databox/lib/lib/models/cancellationReason.js @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Reason for cancellation. + * + */ +class CancellationReason { + /** + * Create a CancellationReason. + * @member {string} reason Reason for cancellation. + */ + constructor() { + } + + /** + * Defines the metadata of CancellationReason + * + * @returns {object} metadata of CancellationReason + * + */ + mapper() { + return { + required: false, + serializedName: 'CancellationReason', + type: { + name: 'Composite', + className: 'CancellationReason', + modelProperties: { + reason: { + required: true, + serializedName: 'reason', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CancellationReason; diff --git a/lib/services/databox/lib/lib/models/contactDetails.js b/lib/services/databox/lib/lib/models/contactDetails.js new file mode 100644 index 0000000000..1d5c8bc645 --- /dev/null +++ b/lib/services/databox/lib/lib/models/contactDetails.js @@ -0,0 +1,112 @@ +/* + * 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'); + +/** + * Contact Details. + * + */ +class ContactDetails { + /** + * Create a ContactDetails. + * @member {string} [contactName] Contact name of the person. + * @member {string} phone Phone number of the contact person. + * @member {string} [phoneExtension] Phone extension number of the contact + * person. + * @member {string} [mobile] Mobile number of the contact person. + * @member {array} emailList List of Email-ids to be notified about job + * progress. + * @member {array} [notificationPreference] Notification preference for a job + * stage. + */ + constructor() { + } + + /** + * Defines the metadata of ContactDetails + * + * @returns {object} metadata of ContactDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'ContactDetails', + type: { + name: 'Composite', + className: 'ContactDetails', + modelProperties: { + contactName: { + required: false, + serializedName: 'contactName', + type: { + name: 'String' + } + }, + phone: { + required: true, + serializedName: 'phone', + type: { + name: 'String' + } + }, + phoneExtension: { + required: false, + serializedName: 'phoneExtension', + type: { + name: 'String' + } + }, + mobile: { + required: false, + serializedName: 'mobile', + type: { + name: 'String' + } + }, + emailList: { + required: true, + serializedName: 'emailList', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + notificationPreference: { + required: false, + serializedName: 'notificationPreference', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NotificationPreferenceElementType', + type: { + name: 'Composite', + className: 'NotificationPreference' + } + } + } + } + } + } + }; + } +} + +module.exports = ContactDetails; diff --git a/lib/services/databox/lib/lib/models/copyLogDetails.js b/lib/services/databox/lib/lib/models/copyLogDetails.js new file mode 100644 index 0000000000..0e75a970ff --- /dev/null +++ b/lib/services/databox/lib/lib/models/copyLogDetails.js @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Details for log generated during copy. + * + */ +class CopyLogDetails { + /** + * Create a CopyLogDetails. + * @member {string} copyLogDetailsType Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of CopyLogDetails + * + * @returns {object} metadata of CopyLogDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'CopyLogDetails', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'copyLogDetailsType', + clientName: 'copyLogDetailsType' + }, + uberParent: 'CopyLogDetails', + className: 'CopyLogDetails', + modelProperties: { + copyLogDetailsType: { + required: true, + serializedName: 'copyLogDetailsType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CopyLogDetails; diff --git a/lib/services/databox/lib/lib/models/copyProgress.js b/lib/services/databox/lib/lib/models/copyProgress.js new file mode 100644 index 0000000000..059996be29 --- /dev/null +++ b/lib/services/databox/lib/lib/models/copyProgress.js @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Copy progress. + * + */ +class CopyProgress { + /** + * Create a CopyProgress. + * @member {string} [storageAccountName] Name of the storage account where + * the data needs to be uploaded. + * @member {number} [bytesSentToCloud] Amount of data uploaded by the job as + * of now. + * @member {number} [totalBytesToProcess] Total amount of data to be + * processed by the job. + */ + constructor() { + } + + /** + * Defines the metadata of CopyProgress + * + * @returns {object} metadata of CopyProgress + * + */ + mapper() { + return { + required: false, + serializedName: 'CopyProgress', + type: { + name: 'Composite', + className: 'CopyProgress', + modelProperties: { + storageAccountName: { + required: false, + serializedName: 'storageAccountName', + type: { + name: 'String' + } + }, + bytesSentToCloud: { + required: false, + serializedName: 'bytesSentToCloud', + type: { + name: 'Number' + } + }, + totalBytesToProcess: { + required: false, + serializedName: 'totalBytesToProcess', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = CopyProgress; diff --git a/lib/services/databox/lib/lib/models/destinationAccountDetails.js b/lib/services/databox/lib/lib/models/destinationAccountDetails.js new file mode 100644 index 0000000000..c1a7a7c680 --- /dev/null +++ b/lib/services/databox/lib/lib/models/destinationAccountDetails.js @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Details for the destination account. + * + */ +class DestinationAccountDetails { + /** + * Create a DestinationAccountDetails. + * @member {string} accountId Destination storage account id. + */ + constructor() { + } + + /** + * Defines the metadata of DestinationAccountDetails + * + * @returns {object} metadata of DestinationAccountDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'DestinationAccountDetails', + type: { + name: 'Composite', + className: 'DestinationAccountDetails', + modelProperties: { + accountId: { + required: true, + serializedName: 'accountId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DestinationAccountDetails; diff --git a/lib/services/databox/lib/lib/models/destinationToServiceLocationMap.js b/lib/services/databox/lib/lib/models/destinationToServiceLocationMap.js new file mode 100644 index 0000000000..3cc7439239 --- /dev/null +++ b/lib/services/databox/lib/lib/models/destinationToServiceLocationMap.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'; + +/** + * Map of destination location to service location + * + */ +class DestinationToServiceLocationMap { + /** + * Create a DestinationToServiceLocationMap. + * @member {string} [destinationLocation] Location of the destination. + * @member {string} [serviceLocation] Location of the service. + */ + constructor() { + } + + /** + * Defines the metadata of DestinationToServiceLocationMap + * + * @returns {object} metadata of DestinationToServiceLocationMap + * + */ + mapper() { + return { + required: false, + serializedName: 'DestinationToServiceLocationMap', + type: { + name: 'Composite', + className: 'DestinationToServiceLocationMap', + modelProperties: { + destinationLocation: { + required: false, + serializedName: 'destinationLocation', + type: { + name: 'String' + } + }, + serviceLocation: { + required: false, + serializedName: 'serviceLocation', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DestinationToServiceLocationMap; diff --git a/lib/services/databox/lib/lib/models/diskCopyLogDetails.js b/lib/services/databox/lib/lib/models/diskCopyLogDetails.js new file mode 100644 index 0000000000..cc97df9eb0 --- /dev/null +++ b/lib/services/databox/lib/lib/models/diskCopyLogDetails.js @@ -0,0 +1,85 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Copy Log Details for a disk + * + * @extends models['CopyLogDetails'] + */ +class DiskCopyLogDetails extends models['CopyLogDetails'] { + /** + * Create a DiskCopyLogDetails. + * @member {string} diskSerialNumber Disk Serial Number. + * @member {string} errorLogLink Link for copy error logs. + * @member {string} verboseLogLink Link for copy verbose logs. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DiskCopyLogDetails + * + * @returns {object} metadata of DiskCopyLogDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'Disk', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'copyLogDetailsType', + clientName: 'copyLogDetailsType' + }, + uberParent: 'CopyLogDetails', + className: 'DiskCopyLogDetails', + modelProperties: { + copyLogDetailsType: { + required: true, + serializedName: 'copyLogDetailsType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + diskSerialNumber: { + required: true, + serializedName: 'diskSerialNumber', + type: { + name: 'String' + } + }, + errorLogLink: { + required: true, + serializedName: 'errorLogLink', + type: { + name: 'String' + } + }, + verboseLogLink: { + required: true, + serializedName: 'verboseLogLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DiskCopyLogDetails; diff --git a/lib/services/databox/lib/lib/models/diskCopyProgress.js b/lib/services/databox/lib/lib/models/diskCopyProgress.js new file mode 100644 index 0000000000..00f9fe4e44 --- /dev/null +++ b/lib/services/databox/lib/lib/models/diskCopyProgress.js @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Disk Copy Progress + * + */ +class DiskCopyProgress { + /** + * Create a DiskCopyProgress. + * @member {string} [serialNumber] The serial number of the disk + * @member {number} [percentComplete] Indicates the percentage completed for + * the copy of the disk. + * @member {string} [status] The Status of the copy. Possible values include: + * 'NotStarted', 'InProgress', 'Completed', 'CompletedWithErrors', 'Failed' + */ + constructor() { + } + + /** + * Defines the metadata of DiskCopyProgress + * + * @returns {object} metadata of DiskCopyProgress + * + */ + mapper() { + return { + required: false, + serializedName: 'DiskCopyProgress', + type: { + name: 'Composite', + className: 'DiskCopyProgress', + modelProperties: { + serialNumber: { + required: false, + serializedName: 'serialNumber', + type: { + name: 'String' + } + }, + percentComplete: { + required: false, + serializedName: 'percentComplete', + type: { + name: 'Number' + } + }, + status: { + required: false, + serializedName: 'status', + type: { + name: 'Enum', + allowedValues: [ 'NotStarted', 'InProgress', 'Completed', 'CompletedWithErrors', 'Failed' ] + } + } + } + } + }; + } +} + +module.exports = DiskCopyProgress; diff --git a/lib/services/databox/lib/lib/models/diskJobDetails.js b/lib/services/databox/lib/lib/models/diskJobDetails.js new file mode 100644 index 0000000000..c173737812 --- /dev/null +++ b/lib/services/databox/lib/lib/models/diskJobDetails.js @@ -0,0 +1,165 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Disk Job Details. + * + * @extends models['JobDetails'] + */ +class DiskJobDetails extends models['JobDetails'] { + /** + * Create a DiskJobDetails. + * @member {object} [preferredDisks] User preference on what size disks are + * needed for the job. The map is from the disk size in TB to the count. Eg. + * {2,5} means 5 disks of 2 TB size. Key is string but will be checked + * against an int. + * @member {array} [copyProgress] Copy progress per disk. + * @member {object} [disksAndSizeDetails] Contains the map of disk serial + * number to the disk size being used for the job. Is returned only after the + * disks are shipped to the customer. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DiskJobDetails + * + * @returns {object} metadata of DiskJobDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'Disk', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'jobDetailsType', + clientName: 'jobDetailsType' + }, + uberParent: 'JobDetails', + className: 'DiskJobDetails', + modelProperties: { + expectedDataSizeInTeraBytes: { + required: false, + serializedName: 'expectedDataSizeInTeraBytes', + type: { + name: 'Number' + } + }, + jobStages: { + required: false, + serializedName: 'jobStages', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'JobStagesElementType', + type: { + name: 'Composite', + className: 'JobStages' + } + } + } + }, + contactDetails: { + required: true, + serializedName: 'contactDetails', + type: { + name: 'Composite', + className: 'ContactDetails' + } + }, + shippingAddress: { + required: true, + serializedName: 'shippingAddress', + type: { + name: 'Composite', + className: 'ShippingAddress' + } + }, + errorDetails: { + required: false, + serializedName: 'errorDetails', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'JobErrorDetailsElementType', + type: { + name: 'Composite', + className: 'JobErrorDetails' + } + } + } + }, + jobDetailsType: { + required: true, + serializedName: 'jobDetailsType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + preferredDisks: { + required: false, + serializedName: 'preferredDisks', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'NumberElementType', + type: { + name: 'Number' + } + } + } + }, + copyProgress: { + required: false, + serializedName: 'copyProgress', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DiskCopyProgressElementType', + type: { + name: 'Composite', + className: 'DiskCopyProgress' + } + } + } + }, + disksAndSizeDetails: { + required: false, + serializedName: 'disksAndSizeDetails', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'NumberElementType', + type: { + name: 'Number' + } + } + } + } + } + } + }; + } +} + +module.exports = DiskJobDetails; diff --git a/lib/services/databox/lib/lib/models/diskJobSecrets.js b/lib/services/databox/lib/lib/models/diskJobSecrets.js new file mode 100644 index 0000000000..79a07b08c8 --- /dev/null +++ b/lib/services/databox/lib/lib/models/diskJobSecrets.js @@ -0,0 +1,78 @@ +/* + * 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'); + +/** + * The secrets related to disk job. + * + * @extends models['JobSecrets'] + */ +class DiskJobSecrets extends models['JobSecrets'] { + /** + * Create a DiskJobSecrets. + * @member {array} [diskSecrets] Contains the list of secrets object for that + * device. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DiskJobSecrets + * + * @returns {object} metadata of DiskJobSecrets + * + */ + mapper() { + return { + required: false, + serializedName: 'Disk', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'jobSecretsType', + clientName: 'jobSecretsType' + }, + uberParent: 'JobSecrets', + className: 'DiskJobSecrets', + modelProperties: { + jobSecretsType: { + required: true, + serializedName: 'jobSecretsType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + diskSecrets: { + required: false, + serializedName: 'diskSecrets', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DiskSecretElementType', + type: { + name: 'Composite', + className: 'DiskSecret' + } + } + } + } + } + } + }; + } +} + +module.exports = DiskJobSecrets; diff --git a/lib/services/databox/lib/lib/models/diskSecret.js b/lib/services/databox/lib/lib/models/diskSecret.js new file mode 100644 index 0000000000..be43889867 --- /dev/null +++ b/lib/services/databox/lib/lib/models/diskSecret.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Contains all the secrets of a Disk. + * + */ +class DiskSecret { + /** + * Create a DiskSecret. + * @member {string} [diskSerialNumber] Serial number of the assigned disk. + * @member {string} [bitLockerKey] Bit Locker key of the disk which can be + * used to unlock the disk to copy data. + */ + constructor() { + } + + /** + * Defines the metadata of DiskSecret + * + * @returns {object} metadata of DiskSecret + * + */ + mapper() { + return { + required: false, + serializedName: 'DiskSecret', + type: { + name: 'Composite', + className: 'DiskSecret', + modelProperties: { + diskSerialNumber: { + required: false, + serializedName: 'diskSerialNumber', + type: { + name: 'String' + } + }, + bitLockerKey: { + required: false, + serializedName: 'bitLockerKey', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DiskSecret; diff --git a/lib/services/databox/lib/lib/models/errorModel.js b/lib/services/databox/lib/lib/models/errorModel.js new file mode 100644 index 0000000000..33c142bbd2 --- /dev/null +++ b/lib/services/databox/lib/lib/models/errorModel.js @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Top level error for the job. + * + */ +class ErrorModel { + /** + * Create a ErrorModel. + * @member {string} code Error code that can be used to programmatically + * identify the error. + * @member {string} [message] Describes the error in detail and provides + * debugging information. + */ + constructor() { + } + + /** + * Defines the metadata of ErrorModel + * + * @returns {object} metadata of ErrorModel + * + */ + mapper() { + return { + required: false, + serializedName: 'Error', + type: { + name: 'Composite', + className: 'ErrorModel', + modelProperties: { + code: { + required: true, + serializedName: 'code', + type: { + name: 'String' + } + }, + message: { + required: false, + serializedName: 'message', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ErrorModel; diff --git a/lib/services/databox/lib/lib/models/getCopyLogsUriOutput.js b/lib/services/databox/lib/lib/models/getCopyLogsUriOutput.js new file mode 100644 index 0000000000..ccf6147421 --- /dev/null +++ b/lib/services/databox/lib/lib/models/getCopyLogsUriOutput.js @@ -0,0 +1,75 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Output for the GetCopyLogsUri. + * + */ +class GetCopyLogsUriOutput { + /** + * Create a GetCopyLogsUriOutput. + * @member {string} [logType] Type/Level of the log. + * @member {array} [copyLogDetails] List of copy log details. + */ + constructor() { + } + + /** + * Defines the metadata of GetCopyLogsUriOutput + * + * @returns {object} metadata of GetCopyLogsUriOutput + * + */ + mapper() { + return { + required: false, + serializedName: 'GetCopyLogsUriOutput', + type: { + name: 'Composite', + className: 'GetCopyLogsUriOutput', + modelProperties: { + logType: { + required: false, + serializedName: 'logType', + type: { + name: 'String' + } + }, + copyLogDetails: { + required: false, + serializedName: 'copyLogDetails', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CopyLogDetailsElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'copyLogDetailsType', + clientName: 'copyLogDetailsType' + }, + uberParent: 'CopyLogDetails', + className: 'CopyLogDetails' + } + } + } + } + } + } + }; + } +} + +module.exports = GetCopyLogsUriOutput; diff --git a/lib/services/databox/lib/lib/models/index.d.ts b/lib/services/databox/lib/lib/models/index.d.ts new file mode 100644 index 0000000000..caec5b29de --- /dev/null +++ b/lib/services/databox/lib/lib/models/index.d.ts @@ -0,0 +1,1031 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import { BaseResource } from 'ms-rest-azure'; +import { CloudError } from 'ms-rest-azure'; +import * as moment from 'moment'; + +export { BaseResource } from 'ms-rest-azure'; +export { CloudError } from 'ms-rest-azure'; + + +/** + * @class + * Initializes a new instance of the CopyLogDetails class. + * @constructor + * Details for log generated during copy. + * + * @member {string} copyLogDetailsType Polymorphic Discriminator + */ +export interface CopyLogDetails { + copyLogDetailsType: string; +} + +/** + * @class + * Initializes a new instance of the AccountCopyLogDetails class. + * @constructor + * Copy log details for an storage account + * + * @member {string} accountName Destination account name. + * @member {string} copyLogLink Link for copy logs. + */ +export interface AccountCopyLogDetails extends CopyLogDetails { + accountName: string; + copyLogLink: string; +} + +/** + * @class + * Initializes a new instance of the ShareCredentialDetails class. + * @constructor + * Credential details of the shares in account. + * + * @member {string} [shareName] Name of the share. + * @member {string} [userName] User name for the share. + * @member {string} [password] Password for the share. + */ +export interface ShareCredentialDetails { + shareName?: string; + userName?: string; + password?: string; +} + +/** + * @class + * Initializes a new instance of the AccountCredentialDetails class. + * @constructor + * Credential details of the account. + * + * @member {string} [accountName] Name of the account. + * @member {array} shareCredentialDetails Per share level unencrypted access + * credentials. + */ +export interface AccountCredentialDetails { + accountName?: string; + shareCredentialDetails: ShareCredentialDetails[]; +} + +/** + * @class + * Initializes a new instance of the ShippingAddress class. + * @constructor + * Shipping address where customer wishes to receive the device. + * + * @member {string} streetAddress1 Street Address line 1. + * @member {string} [streetAddress2] Street Address line 2. + * @member {string} [streetAddress3] Street Address line 3. + * @member {string} [city] Name of the City. + * @member {string} [stateOrProvince] Name of the State or Province. + * @member {string} country Name of the Country. + * @member {string} postalCode Postal code. + * @member {string} [zipExtendedCode] Extended Zip Code. + * @member {string} [companyName] Name of the company. + * @member {string} [addressType] Type of address. Possible values include: + * 'None', 'Residential', 'Commercial' + */ +export interface ShippingAddress { + streetAddress1: string; + streetAddress2?: string; + streetAddress3?: string; + city?: string; + stateOrProvince?: string; + country: string; + postalCode: string; + zipExtendedCode?: string; + companyName?: string; + addressType?: string; +} + +/** + * @class + * Initializes a new instance of the AddressValidationOutput class. + * @constructor + * Output of the address validation api. + * + * @member {string} [validationStatus] The address validation status. Possible + * values include: 'Valid', 'Invalid', 'Ambiguous' + * @member {array} [alternateAddresses] List of alternate addresses. + */ +export interface AddressValidationOutput { + validationStatus?: string; + alternateAddresses?: ShippingAddress[]; +} + +/** + * @class + * Initializes a new instance of the ArmBaseObject class. + * @constructor + * Base class for all objects under resource. + * + * @member {string} [name] Name of the object. + * @member {string} [id] Id of the object. + * @member {string} [type] Type of the object. + */ +export interface ArmBaseObject { + readonly name?: string; + readonly id?: string; + readonly type?: string; +} + +/** + * @class + * Initializes a new instance of the AvailableSkuRequest class. + * @constructor + * The filters for showing the available skus. + * + * @member {string} country ISO country code. Country for hardware shipment. + * For codes check: + * https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + * @member {string} location Location for data transfer. For locations check: + * https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + */ +export interface AvailableSkuRequest { + country: string; + location: string; +} + +/** + * @class + * Initializes a new instance of the Sku class. + * @constructor + * The Sku. + * + * @member {string} name The sku name. + * @member {string} [displayName] The display name of the sku. + * @member {string} [family] The sku family. + */ +export interface Sku { + name: string; + displayName?: string; + family?: string; +} + +/** + * @class + * Initializes a new instance of the DestinationToServiceLocationMap class. + * @constructor + * Map of destination location to service location + * + * @member {string} [destinationLocation] Location of the destination. + * @member {string} [serviceLocation] Location of the service. + */ +export interface DestinationToServiceLocationMap { + destinationLocation?: string; + serviceLocation?: string; +} + +/** + * @class + * Initializes a new instance of the SkuCapacity class. + * @constructor + * Capacity of the sku. + * + * @member {string} usable Usable capacity in TB. + * @member {string} maximum Maximum capacity in TB. + */ +export interface SkuCapacity { + usable: string; + maximum: string; +} + +/** + * @class + * Initializes a new instance of the SkuCost class. + * @constructor + * Describes metadata for retrieving price info. + * + * @member {string} meterId Meter id of the Sku. + * @member {string} meterType The type of the meter. + */ +export interface SkuCost { + meterId: string; + meterType: string; +} + +/** + * @class + * Initializes a new instance of the SkuInformation class. + * @constructor + * Information of the sku. + * + * @member {object} sku The Sku. + * @member {string} [sku.name] The sku name. + * @member {string} [sku.displayName] The display name of the sku. + * @member {string} [sku.family] The sku family. + * @member {boolean} enabled The sku is enabled or not. + * @member {array} [destinationToServiceLocationMap] The map of destination + * location to service location. + * @member {object} capacity Capacity of the Sku. + * @member {string} [capacity.usable] Usable capacity in TB. + * @member {string} [capacity.maximum] Maximum capacity in TB. + * @member {array} costs Cost of the Sku. + * @member {array} apiVersions Api versions that support this Sku. + * @member {string} [disabledReason] Reason why the Sku is disabled. + */ +export interface SkuInformation { + sku: Sku; + enabled: boolean; + destinationToServiceLocationMap?: DestinationToServiceLocationMap[]; + capacity: SkuCapacity; + costs: SkuCost[]; + apiVersions: string[]; + disabledReason?: string; +} + +/** + * @class + * Initializes a new instance of the CabinetPodSecret class. + * @constructor + * The secrets related to a cabinet pod. + * + * @member {string} [deviceSerialNumber] Serial number of the assigned device. + * @member {string} [devicePassword] Password for out of the box experience on + * device. + * @member {array} [accountCredentialDetails] Per account level access + * credentials. + */ +export interface CabinetPodSecret { + deviceSerialNumber?: string; + devicePassword?: string; + accountCredentialDetails?: AccountCredentialDetails[]; +} + +/** + * @class + * Initializes a new instance of the JobSecrets class. + * @constructor + * The base class for the secrets + * + * @member {string} jobSecretsType Polymorphic Discriminator + */ +export interface JobSecrets { + jobSecretsType: string; +} + +/** + * @class + * Initializes a new instance of the CabinetJobSecrets class. + * @constructor + * The secrets related to a cabinet job. + * + * @member {array} [cabinetPodSecrets] Contains the list of secret objects for + * a cabinet job. + */ +export interface CabinetJobSecrets extends JobSecrets { + cabinetPodSecrets?: CabinetPodSecret[]; +} + +/** + * @class + * Initializes a new instance of the CancellationReason class. + * @constructor + * Reason for cancellation. + * + * @member {string} reason Reason for cancellation. + */ +export interface CancellationReason { + reason: string; +} + +/** + * @class + * Initializes a new instance of the NotificationPreference class. + * @constructor + * Notification preference for a job stage. + * + * @member {string} stageName Name of the stage. Possible values include: + * 'DevicePrepared', 'Dispatched', 'Delivered', 'PickedUp', 'AtAzureDC', + * 'DataCopy' + * @member {boolean} sendNotification Notification is required or not. + */ +export interface NotificationPreference { + stageName: string; + sendNotification: boolean; +} + +/** + * @class + * Initializes a new instance of the ContactDetails class. + * @constructor + * Contact Details. + * + * @member {string} [contactName] Contact name of the person. + * @member {string} phone Phone number of the contact person. + * @member {string} [phoneExtension] Phone extension number of the contact + * person. + * @member {string} [mobile] Mobile number of the contact person. + * @member {array} emailList List of Email-ids to be notified about job + * progress. + * @member {array} [notificationPreference] Notification preference for a job + * stage. + */ +export interface ContactDetails { + contactName?: string; + phone: string; + phoneExtension?: string; + mobile?: string; + emailList: string[]; + notificationPreference?: NotificationPreference[]; +} + +/** + * @class + * Initializes a new instance of the CopyProgress class. + * @constructor + * Copy progress. + * + * @member {string} [storageAccountName] Name of the storage account where the + * data needs to be uploaded. + * @member {number} [bytesSentToCloud] Amount of data uploaded by the job as of + * now. + * @member {number} [totalBytesToProcess] Total amount of data to be processed + * by the job. + */ +export interface CopyProgress { + storageAccountName?: string; + bytesSentToCloud?: number; + totalBytesToProcess?: number; +} + +/** + * @class + * Initializes a new instance of the DestinationAccountDetails class. + * @constructor + * Details for the destination account. + * + * @member {string} accountId Destination storage account id. + */ +export interface DestinationAccountDetails { + accountId: string; +} + +/** + * @class + * Initializes a new instance of the DiskCopyLogDetails class. + * @constructor + * Copy Log Details for a disk + * + * @member {string} diskSerialNumber Disk Serial Number. + * @member {string} errorLogLink Link for copy error logs. + * @member {string} verboseLogLink Link for copy verbose logs. + */ +export interface DiskCopyLogDetails extends CopyLogDetails { + diskSerialNumber: string; + errorLogLink: string; + verboseLogLink: string; +} + +/** + * @class + * Initializes a new instance of the DiskCopyProgress class. + * @constructor + * Disk Copy Progress + * + * @member {string} [serialNumber] The serial number of the disk + * @member {number} [percentComplete] Indicates the percentage completed for + * the copy of the disk. + * @member {string} [status] The Status of the copy. Possible values include: + * 'NotStarted', 'InProgress', 'Completed', 'CompletedWithErrors', 'Failed' + */ +export interface DiskCopyProgress { + serialNumber?: string; + percentComplete?: number; + status?: string; +} + +/** + * @class + * Initializes a new instance of the JobDetails class. + * @constructor + * Job details. + * + * @member {number} [expectedDataSizeInTeraBytes] The expected size of the + * data, which needs to be transfered in this job, in tera bytes. + * @member {array} [jobStages] List of stages that run in the job. + * @member {object} contactDetails Contact details for notification and + * shipping. + * @member {string} [contactDetails.contactName] Contact name of the person. + * @member {string} [contactDetails.phone] Phone number of the contact person. + * @member {string} [contactDetails.phoneExtension] Phone extension number of + * the contact person. + * @member {string} [contactDetails.mobile] Mobile number of the contact + * person. + * @member {array} [contactDetails.emailList] List of Email-ids to be notified + * about job progress. + * @member {array} [contactDetails.notificationPreference] Notification + * preference for a job stage. + * @member {object} shippingAddress Shipping address of the customer. + * @member {string} [shippingAddress.streetAddress1] Street Address line 1. + * @member {string} [shippingAddress.streetAddress2] Street Address line 2. + * @member {string} [shippingAddress.streetAddress3] Street Address line 3. + * @member {string} [shippingAddress.city] Name of the City. + * @member {string} [shippingAddress.stateOrProvince] Name of the State or + * Province. + * @member {string} [shippingAddress.country] Name of the Country. + * @member {string} [shippingAddress.postalCode] Postal code. + * @member {string} [shippingAddress.zipExtendedCode] Extended Zip Code. + * @member {string} [shippingAddress.companyName] Name of the company. + * @member {string} [shippingAddress.addressType] Type of address. Possible + * values include: 'None', 'Residential', 'Commercial' + * @member {array} [errorDetails] Error details for failure. This is optional. + * @member {string} jobDetailsType Polymorphic Discriminator + */ +export interface JobDetails { + expectedDataSizeInTeraBytes?: number; + jobStages?: JobStages[]; + contactDetails: ContactDetails; + shippingAddress: ShippingAddress; + errorDetails?: JobErrorDetails[]; + jobDetailsType: string; +} + +/** + * @class + * Initializes a new instance of the DiskJobDetails class. + * @constructor + * Disk Job Details. + * + * @member {object} [preferredDisks] User preference on what size disks are + * needed for the job. The map is from the disk size in TB to the count. Eg. + * {2,5} means 5 disks of 2 TB size. Key is string but will be checked against + * an int. + * @member {array} [copyProgress] Copy progress per disk. + * @member {object} [disksAndSizeDetails] Contains the map of disk serial + * number to the disk size being used for the job. Is returned only after the + * disks are shipped to the customer. + */ +export interface DiskJobDetails extends JobDetails { + preferredDisks?: { [propertyName: string]: number }; + copyProgress?: DiskCopyProgress[]; + disksAndSizeDetails?: { [propertyName: string]: number }; +} + +/** + * @class + * Initializes a new instance of the DiskSecret class. + * @constructor + * Contains all the secrets of a Disk. + * + * @member {string} [diskSerialNumber] Serial number of the assigned disk. + * @member {string} [bitLockerKey] Bit Locker key of the disk which can be used + * to unlock the disk to copy data. + */ +export interface DiskSecret { + diskSerialNumber?: string; + bitLockerKey?: string; +} + +/** + * @class + * Initializes a new instance of the DiskJobSecrets class. + * @constructor + * The secrets related to disk job. + * + * @member {array} [diskSecrets] Contains the list of secrets object for that + * device. + */ +export interface DiskJobSecrets extends JobSecrets { + diskSecrets?: DiskSecret[]; +} + +/** + * @class + * Initializes a new instance of the ErrorModel class. + * @constructor + * Top level error for the job. + * + * @member {string} code Error code that can be used to programmatically + * identify the error. + * @member {string} [message] Describes the error in detail and provides + * debugging information. + */ +export interface ErrorModel { + code: string; + message?: string; +} + +/** + * @class + * Initializes a new instance of the GetCopyLogsUriOutput class. + * @constructor + * Output for the GetCopyLogsUri. + * + * @member {string} [logType] Type/Level of the log. + * @member {array} [copyLogDetails] List of copy log details. + */ +export interface GetCopyLogsUriOutput { + logType?: string; + copyLogDetails?: CopyLogDetails[]; +} + +/** + * @class + * Initializes a new instance of the JobErrorDetails class. + * @constructor + * Job Error Details for providing the information and recommended action. + * + * @member {string} [errorMessage] Message for the error. + * @member {number} [errorCode] Code for the error. + * @member {string} [recommendedAction] Recommended action for the error. + * @member {string} [exceptionMessage] Contains the non localized exception + * message + */ +export interface JobErrorDetails { + errorMessage?: string; + errorCode?: number; + recommendedAction?: string; + exceptionMessage?: string; +} + +/** + * @class + * Initializes a new instance of the JobStages class. + * @constructor + * Job stages. + * + * @member {string} stageName Name of the job stage. Possible values include: + * 'DeviceOrdered', 'DevicePrepared', 'Dispatched', 'Delivered', 'PickedUp', + * 'AtAzureDC', 'DataCopy', 'Completed', 'CompletedWithErrors', 'Cancelled', + * 'Failed_IssueReportedAtCustomer', 'Failed_IssueDetectedAtAzureDC', 'Aborted' + * @member {string} [displayName] Display name of the job stage. + * @member {string} stageStatus Status of the job stage. Possible values + * include: 'None', 'InProgress', 'Succeeded', 'Failed', 'Cancelled', + * 'Cancelling', 'SucceededWithErrors' + * @member {date} [stageTime] Time for the job stage in UTC ISO 8601 format. + * @member {object} [jobStageDetails] Job Stage Details + * @member {array} [errorDetails] Error details for the stage. + */ +export interface JobStages { + stageName: string; + displayName?: string; + stageStatus: string; + stageTime?: Date; + jobStageDetails?: any; + errorDetails?: JobErrorDetails[]; +} + +/** + * @class + * Initializes a new instance of the PackageShippingDetails class. + * @constructor + * Shipping details. + * + * @member {string} [carrierName] Name of the carrier. + * @member {string} [trackingId] Tracking Id of shipment. + * @member {string} [trackingUrl] Url where shipment can be tracked. + */ +export interface PackageShippingDetails { + carrierName?: string; + trackingId?: string; + trackingUrl?: string; +} + +/** + * @class + * Initializes a new instance of the Resource class. + * @constructor + * Model of the Resource. + * + * @member {string} location The location of the resource. This will be one of + * the supported and registered Azure Regions (e.g. West US, East US, Southeast + * Asia, etc.). The region of a resource cannot be changed once it is created, + * but if an identical region is specified on update the request will succeed. + * @member {object} [tags] The list of key value pairs that describe the + * resource. These tags can be used in viewing and grouping this resource + * (across resource groups). + * @member {object} sku The sku type. + * @member {string} [sku.name] The sku name. + * @member {string} [sku.displayName] The display name of the sku. + * @member {string} [sku.family] The sku family. + */ +export interface Resource extends BaseResource { + location: string; + tags?: { [propertyName: string]: string }; + sku: Sku; +} + +/** + * @class + * Initializes a new instance of the JobResource class. + * @constructor + * Job Resource. + * + * @member {string} [deviceType] Type of the device to be used for the job. + * Possible values include: 'Pod', 'Disk', 'Cabinet' + * @member {boolean} [isCancellable] Describes whether the job is cancellable + * or not. + * @member {boolean} [isShippingAddressEditable] Describes whether the shipping + * address is editable or not. + * @member {string} [status] Name of the stage which is in progress. Possible + * values include: 'DeviceOrdered', 'DevicePrepared', 'Dispatched', + * 'Delivered', 'PickedUp', 'AtAzureDC', 'DataCopy', 'Completed', + * 'CompletedWithErrors', 'Cancelled', 'Failed_IssueReportedAtCustomer', + * 'Failed_IssueDetectedAtAzureDC', 'Aborted' + * @member {date} [startTime] Time at which the job was started in UTC ISO 8601 + * format. + * @member {object} [error] Top level error for the job. + * @member {string} [error.code] Error code that can be used to + * programmatically identify the error. + * @member {string} [error.message] Describes the error in detail and provides + * debugging information. + * @member {object} [deliveryPackage] Delivery package shipping details. + * @member {string} [deliveryPackage.carrierName] Name of the carrier. + * @member {string} [deliveryPackage.trackingId] Tracking Id of shipment. + * @member {string} [deliveryPackage.trackingUrl] Url where shipment can be + * tracked. + * @member {object} [returnPackage] Return package shipping details. + * @member {string} [returnPackage.carrierName] Name of the carrier. + * @member {string} [returnPackage.trackingId] Tracking Id of shipment. + * @member {string} [returnPackage.trackingUrl] Url where shipment can be + * tracked. + * @member {array} destinationAccountDetails Destination account details. + * @member {object} [details] Details of a job run. This field will only be + * sent for expand details filter. + * @member {number} [details.expectedDataSizeInTeraBytes] The expected size of + * the data, which needs to be transfered in this job, in tera bytes. + * @member {array} [details.jobStages] List of stages that run in the job. + * @member {object} [details.contactDetails] Contact details for notification + * and shipping. + * @member {string} [details.contactDetails.contactName] Contact name of the + * person. + * @member {string} [details.contactDetails.phone] Phone number of the contact + * person. + * @member {string} [details.contactDetails.phoneExtension] Phone extension + * number of the contact person. + * @member {string} [details.contactDetails.mobile] Mobile number of the + * contact person. + * @member {array} [details.contactDetails.emailList] List of Email-ids to be + * notified about job progress. + * @member {array} [details.contactDetails.notificationPreference] Notification + * preference for a job stage. + * @member {object} [details.shippingAddress] Shipping address of the customer. + * @member {string} [details.shippingAddress.streetAddress1] Street Address + * line 1. + * @member {string} [details.shippingAddress.streetAddress2] Street Address + * line 2. + * @member {string} [details.shippingAddress.streetAddress3] Street Address + * line 3. + * @member {string} [details.shippingAddress.city] Name of the City. + * @member {string} [details.shippingAddress.stateOrProvince] Name of the State + * or Province. + * @member {string} [details.shippingAddress.country] Name of the Country. + * @member {string} [details.shippingAddress.postalCode] Postal code. + * @member {string} [details.shippingAddress.zipExtendedCode] Extended Zip + * Code. + * @member {string} [details.shippingAddress.companyName] Name of the company. + * @member {string} [details.shippingAddress.addressType] Type of address. + * Possible values include: 'None', 'Residential', 'Commercial' + * @member {array} [details.errorDetails] Error details for failure. This is + * optional. + * @member {string} [details.jobDetailsType] Polymorphic Discriminator + * @member {string} [cancellationReason] Reason for cancellation. + * @member {string} [name] Name of the object. + * @member {string} [id] Id of the object. + * @member {string} [type] Type of the object. + */ +export interface JobResource extends Resource { + deviceType?: string; + isCancellable?: boolean; + isShippingAddressEditable?: boolean; + status?: string; + startTime?: Date; + error?: ErrorModel; + deliveryPackage?: PackageShippingDetails; + returnPackage?: PackageShippingDetails; + destinationAccountDetails: DestinationAccountDetails[]; + details?: JobDetails; + cancellationReason?: string; + readonly name?: string; + readonly id?: string; + readonly type?: string; +} + +/** + * @class + * Initializes a new instance of the UpdateJobDetails class. + * @constructor + * Job details for update. + * + * @member {object} [contactDetails] Contact details for notification and + * shipping. + * @member {string} [contactDetails.contactName] Contact name of the person. + * @member {string} [contactDetails.phone] Phone number of the contact person. + * @member {string} [contactDetails.phoneExtension] Phone extension number of + * the contact person. + * @member {string} [contactDetails.mobile] Mobile number of the contact + * person. + * @member {array} [contactDetails.emailList] List of Email-ids to be notified + * about job progress. + * @member {array} [contactDetails.notificationPreference] Notification + * preference for a job stage. + * @member {object} [shippingAddress] Shipping address of the customer. + * @member {string} [shippingAddress.streetAddress1] Street Address line 1. + * @member {string} [shippingAddress.streetAddress2] Street Address line 2. + * @member {string} [shippingAddress.streetAddress3] Street Address line 3. + * @member {string} [shippingAddress.city] Name of the City. + * @member {string} [shippingAddress.stateOrProvince] Name of the State or + * Province. + * @member {string} [shippingAddress.country] Name of the Country. + * @member {string} [shippingAddress.postalCode] Postal code. + * @member {string} [shippingAddress.zipExtendedCode] Extended Zip Code. + * @member {string} [shippingAddress.companyName] Name of the company. + * @member {string} [shippingAddress.addressType] Type of address. Possible + * values include: 'None', 'Residential', 'Commercial' + */ +export interface UpdateJobDetails { + contactDetails?: ContactDetails; + shippingAddress?: ShippingAddress; +} + +/** + * @class + * Initializes a new instance of the JobResourceUpdateParameter class. + * @constructor + * The JobResourceUpdateParameter. + * + * @member {object} details Details of a job to be updated. + * @member {object} [details.contactDetails] Contact details for notification + * and shipping. + * @member {string} [details.contactDetails.contactName] Contact name of the + * person. + * @member {string} [details.contactDetails.phone] Phone number of the contact + * person. + * @member {string} [details.contactDetails.phoneExtension] Phone extension + * number of the contact person. + * @member {string} [details.contactDetails.mobile] Mobile number of the + * contact person. + * @member {array} [details.contactDetails.emailList] List of Email-ids to be + * notified about job progress. + * @member {array} [details.contactDetails.notificationPreference] Notification + * preference for a job stage. + * @member {object} [details.shippingAddress] Shipping address of the customer. + * @member {string} [details.shippingAddress.streetAddress1] Street Address + * line 1. + * @member {string} [details.shippingAddress.streetAddress2] Street Address + * line 2. + * @member {string} [details.shippingAddress.streetAddress3] Street Address + * line 3. + * @member {string} [details.shippingAddress.city] Name of the City. + * @member {string} [details.shippingAddress.stateOrProvince] Name of the State + * or Province. + * @member {string} [details.shippingAddress.country] Name of the Country. + * @member {string} [details.shippingAddress.postalCode] Postal code. + * @member {string} [details.shippingAddress.zipExtendedCode] Extended Zip + * Code. + * @member {string} [details.shippingAddress.companyName] Name of the company. + * @member {string} [details.shippingAddress.addressType] Type of address. + * Possible values include: 'None', 'Residential', 'Commercial' + * @member {object} [tags] The list of key value pairs that describe the + * resource. These tags can be used in viewing and grouping this resource + * (across resource groups). + */ +export interface JobResourceUpdateParameter { + details: UpdateJobDetails; + tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the OperationDisplay class. + * @constructor + * Operation display + * + * @member {string} [provider] Provider name. + * @member {string} [resource] Resource name. + * @member {string} [operation] Localized name of the operation for display + * purpose. + * @member {string} [description] Localized description of the operation for + * display purpose. + */ +export interface OperationDisplay { + provider?: string; + resource?: string; + operation?: string; + description?: string; +} + +/** + * @class + * Initializes a new instance of the Operation class. + * @constructor + * Operation entity. + * + * @member {string} name Name of the operation. Format: + * {resourceProviderNamespace}/{resourceType}/{read|write|delete|action} + * @member {object} display Operation display values. + * @member {string} [display.provider] Provider name. + * @member {string} [display.resource] Resource name. + * @member {string} [display.operation] Localized name of the operation for + * display purpose. + * @member {string} [display.description] Localized description of the + * operation for display purpose. + * @member {object} properties Operation properties. + * @member {string} origin Origin of the operation. Can be : + * user|system|user,system + */ +export interface Operation { + name: string; + display: OperationDisplay; + properties: any; + origin: string; +} + +/** + * @class + * Initializes a new instance of the PodJobDetails class. + * @constructor + * Pod Job Details + * + * @member {array} [copyProgress] Copy progress per account. + */ +export interface PodJobDetails extends JobDetails { + copyProgress?: CopyProgress[]; +} + +/** + * @class + * Initializes a new instance of the PodSecret class. + * @constructor + * The secrets related to a Pod. + * + * @member {string} [deviceSerialNumber] Serial number of the assigned device. + * @member {string} [devicePassword] Password for out of the box experience on + * device. + * @member {array} [accountCredentialDetails] Per account level access + * credentials. + */ +export interface PodSecret { + deviceSerialNumber?: string; + devicePassword?: string; + accountCredentialDetails?: AccountCredentialDetails[]; +} + +/** + * @class + * Initializes a new instance of the PodJobSecrets class. + * @constructor + * The secrets related to a pod job. + * + * @member {array} [podSecrets] Contains the list of secret objects for a job. + */ +export interface PodJobSecrets extends JobSecrets { + podSecrets?: PodSecret[]; +} + +/** + * @class + * Initializes a new instance of the ReportIssueDetails class. + * @constructor + * Details of the reported issue. + * + * @member {string} [issueType] Issue Type. Possible values include: + * 'DeviceMismatch', 'ValidationStringMismatch', 'CredentialNotWorking', + * 'DeviceFailure' + * @member {string} [deviceIssueType] Device Issue Type. Only used for Device + * failure issue. Possible values include: 'DeviceTampering', + * 'DeviceNotBootingUp', 'DeviceHealthCheckShowFailures', 'NICsAreNotWorking', + * 'Misc' + */ +export interface ReportIssueDetails { + issueType?: string; + deviceIssueType?: string; +} + +/** + * @class + * Initializes a new instance of the ShipmentPickUpRequest class. + * @constructor + * Shipment pick up request details. + * + * @member {date} [startTime] Minimum date after which the pick up should + * commence, this must be in local time of pick up area. + * @member {date} [endTime] Maximum date before which the pick up should + * commence, this must be in local time of pick up area. + * @member {string} [shipmentLocation] Shipment Location in the pickup place. + * Eg.front desk + */ +export interface ShipmentPickUpRequest { + startTime?: Date; + endTime?: Date; + shipmentLocation?: string; +} + +/** + * @class + * Initializes a new instance of the ShipmentPickUpResponse class. + * @constructor + * Shipment pick up response. + * + * @member {string} [confirmationNumber] Confirmation number for the pick up + * request. + * @member {date} [readyByTime] Time by which shipment should be ready for pick + * up, this is in local time of pick up area. + */ +export interface ShipmentPickUpResponse { + confirmationNumber?: string; + readyByTime?: Date; +} + +/** + * @class + * Initializes a new instance of the ShippingLabelDetails class. + * @constructor + * Details for the shipping label. + * + * @member {string} shippingLabelSasUri Sas uri for accessing the shipping + * label. + */ +export interface ShippingLabelDetails { + shippingLabelSasUri: string; +} + +/** + * @class + * Initializes a new instance of the UnencryptedSecrets class. + * @constructor + * Unencrypted secrets for accessing device. + * + * @member {string} jobName Name of the job. + * @member {string} [deviceType] The Device Type used in the job. Possible + * values include: 'Pod', 'Disk', 'Cabinet' + * @member {object} [jobSecrets] Secrets related to this job. + * @member {string} [jobSecrets.jobSecretsType] Polymorphic Discriminator + */ +export interface UnencryptedSecrets { + jobName: string; + deviceType?: string; + jobSecrets?: JobSecrets; +} + +/** + * @class + * Initializes a new instance of the ValidateAddress class. + * @constructor + * The requirements to validate customer address where the device needs to be + * shipped. + * + * @member {object} [shippingAddress] Shipping address of the customer. + * @member {string} [shippingAddress.streetAddress1] Street Address line 1. + * @member {string} [shippingAddress.streetAddress2] Street Address line 2. + * @member {string} [shippingAddress.streetAddress3] Street Address line 3. + * @member {string} [shippingAddress.city] Name of the City. + * @member {string} [shippingAddress.stateOrProvince] Name of the State or + * Province. + * @member {string} [shippingAddress.country] Name of the Country. + * @member {string} [shippingAddress.postalCode] Postal code. + * @member {string} [shippingAddress.zipExtendedCode] Extended Zip Code. + * @member {string} [shippingAddress.companyName] Name of the company. + * @member {string} [shippingAddress.addressType] Type of address. Possible + * values include: 'None', 'Residential', 'Commercial' + * @member {string} [deviceType] Device type to be used for the job. Possible + * values include: 'Pod', 'Disk', 'Cabinet' + */ +export interface ValidateAddress { + shippingAddress?: ShippingAddress; + deviceType?: string; +} + + +/** + * @class + * Initializes a new instance of the OperationList class. + * @constructor + * Operation Collection. + * + * @member {string} [nextLink] Link for the next set of operations. + */ +export interface OperationList extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the JobResourceList class. + * @constructor + * Job Resource Collection + * + * @member {string} [nextLink] Link for the next set of job resources. + */ +export interface JobResourceList extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the AvailableSkusResult class. + * @constructor + * The available skus operation response. + * + * @member {string} [nextLink] Link for the next set of skus. + */ +export interface AvailableSkusResult extends Array { + nextLink?: string; +} diff --git a/lib/services/databox/lib/lib/models/index.js b/lib/services/databox/lib/lib/models/index.js new file mode 100644 index 0000000000..352303a8e6 --- /dev/null +++ b/lib/services/databox/lib/lib/models/index.js @@ -0,0 +1,82 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +/* jshint latedef:false */ +/* jshint forin:false */ +/* jshint noempty:false */ + +'use strict'; + +var msRestAzure = require('ms-rest-azure'); + +exports.BaseResource = msRestAzure.BaseResource; +exports.CloudError = msRestAzure.CloudError; +exports.CopyLogDetails = require('./copyLogDetails'); +exports.AccountCopyLogDetails = require('./accountCopyLogDetails'); +exports.ShareCredentialDetails = require('./shareCredentialDetails'); +exports.AccountCredentialDetails = require('./accountCredentialDetails'); +exports.ShippingAddress = require('./shippingAddress'); +exports.AddressValidationOutput = require('./addressValidationOutput'); +exports.ArmBaseObject = require('./armBaseObject'); +exports.AvailableSkuRequest = require('./availableSkuRequest'); +exports.Sku = require('./sku'); +exports.DestinationToServiceLocationMap = require('./destinationToServiceLocationMap'); +exports.SkuCapacity = require('./skuCapacity'); +exports.SkuCost = require('./skuCost'); +exports.SkuInformation = require('./skuInformation'); +exports.CabinetPodSecret = require('./cabinetPodSecret'); +exports.JobSecrets = require('./jobSecrets'); +exports.CabinetJobSecrets = require('./cabinetJobSecrets'); +exports.CancellationReason = require('./cancellationReason'); +exports.NotificationPreference = require('./notificationPreference'); +exports.ContactDetails = require('./contactDetails'); +exports.CopyProgress = require('./copyProgress'); +exports.DestinationAccountDetails = require('./destinationAccountDetails'); +exports.DiskCopyLogDetails = require('./diskCopyLogDetails'); +exports.DiskCopyProgress = require('./diskCopyProgress'); +exports.JobDetails = require('./jobDetails'); +exports.DiskJobDetails = require('./diskJobDetails'); +exports.DiskSecret = require('./diskSecret'); +exports.DiskJobSecrets = require('./diskJobSecrets'); +exports.ErrorModel = require('./errorModel'); +exports.GetCopyLogsUriOutput = require('./getCopyLogsUriOutput'); +exports.JobErrorDetails = require('./jobErrorDetails'); +exports.JobStages = require('./jobStages'); +exports.PackageShippingDetails = require('./packageShippingDetails'); +exports.Resource = require('./resource'); +exports.JobResource = require('./jobResource'); +exports.UpdateJobDetails = require('./updateJobDetails'); +exports.JobResourceUpdateParameter = require('./jobResourceUpdateParameter'); +exports.OperationDisplay = require('./operationDisplay'); +exports.Operation = require('./operation'); +exports.PodJobDetails = require('./podJobDetails'); +exports.PodSecret = require('./podSecret'); +exports.PodJobSecrets = require('./podJobSecrets'); +exports.ReportIssueDetails = require('./reportIssueDetails'); +exports.ShipmentPickUpRequest = require('./shipmentPickUpRequest'); +exports.ShipmentPickUpResponse = require('./shipmentPickUpResponse'); +exports.ShippingLabelDetails = require('./shippingLabelDetails'); +exports.UnencryptedSecrets = require('./unencryptedSecrets'); +exports.ValidateAddress = require('./validateAddress'); +exports.OperationList = require('./operationList'); +exports.JobResourceList = require('./jobResourceList'); +exports.AvailableSkusResult = require('./availableSkusResult'); +exports.discriminators = { + 'CopyLogDetails.Pod' : exports.AccountCopyLogDetails, + 'JobSecrets.Cabinet' : exports.CabinetJobSecrets, + 'CopyLogDetails' : exports.CopyLogDetails, + 'CopyLogDetails.Disk' : exports.DiskCopyLogDetails, + 'JobDetails.Disk' : exports.DiskJobDetails, + 'JobSecrets.Disk' : exports.DiskJobSecrets, + 'JobDetails' : exports.JobDetails, + 'JobSecrets' : exports.JobSecrets, + 'JobDetails.Pod' : exports.PodJobDetails, + 'JobSecrets.Pod' : exports.PodJobSecrets +}; diff --git a/lib/services/databox/lib/lib/models/jobDetails.js b/lib/services/databox/lib/lib/models/jobDetails.js new file mode 100644 index 0000000000..7a10967c26 --- /dev/null +++ b/lib/services/databox/lib/lib/models/jobDetails.js @@ -0,0 +1,144 @@ +/* + * 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'); + +/** + * Job details. + * + */ +class JobDetails { + /** + * Create a JobDetails. + * @member {number} [expectedDataSizeInTeraBytes] The expected size of the + * data, which needs to be transfered in this job, in tera bytes. + * @member {array} [jobStages] List of stages that run in the job. + * @member {object} contactDetails Contact details for notification and + * shipping. + * @member {string} [contactDetails.contactName] Contact name of the person. + * @member {string} [contactDetails.phone] Phone number of the contact + * person. + * @member {string} [contactDetails.phoneExtension] Phone extension number of + * the contact person. + * @member {string} [contactDetails.mobile] Mobile number of the contact + * person. + * @member {array} [contactDetails.emailList] List of Email-ids to be + * notified about job progress. + * @member {array} [contactDetails.notificationPreference] Notification + * preference for a job stage. + * @member {object} shippingAddress Shipping address of the customer. + * @member {string} [shippingAddress.streetAddress1] Street Address line 1. + * @member {string} [shippingAddress.streetAddress2] Street Address line 2. + * @member {string} [shippingAddress.streetAddress3] Street Address line 3. + * @member {string} [shippingAddress.city] Name of the City. + * @member {string} [shippingAddress.stateOrProvince] Name of the State or + * Province. + * @member {string} [shippingAddress.country] Name of the Country. + * @member {string} [shippingAddress.postalCode] Postal code. + * @member {string} [shippingAddress.zipExtendedCode] Extended Zip Code. + * @member {string} [shippingAddress.companyName] Name of the company. + * @member {string} [shippingAddress.addressType] Type of address. Possible + * values include: 'None', 'Residential', 'Commercial' + * @member {array} [errorDetails] Error details for failure. This is + * optional. + * @member {string} jobDetailsType Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of JobDetails + * + * @returns {object} metadata of JobDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'JobDetails', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'jobDetailsType', + clientName: 'jobDetailsType' + }, + uberParent: 'JobDetails', + className: 'JobDetails', + modelProperties: { + expectedDataSizeInTeraBytes: { + required: false, + serializedName: 'expectedDataSizeInTeraBytes', + type: { + name: 'Number' + } + }, + jobStages: { + required: false, + serializedName: 'jobStages', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'JobStagesElementType', + type: { + name: 'Composite', + className: 'JobStages' + } + } + } + }, + contactDetails: { + required: true, + serializedName: 'contactDetails', + type: { + name: 'Composite', + className: 'ContactDetails' + } + }, + shippingAddress: { + required: true, + serializedName: 'shippingAddress', + type: { + name: 'Composite', + className: 'ShippingAddress' + } + }, + errorDetails: { + required: false, + serializedName: 'errorDetails', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'JobErrorDetailsElementType', + type: { + name: 'Composite', + className: 'JobErrorDetails' + } + } + } + }, + jobDetailsType: { + required: true, + serializedName: 'jobDetailsType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = JobDetails; diff --git a/lib/services/databox/lib/lib/models/jobErrorDetails.js b/lib/services/databox/lib/lib/models/jobErrorDetails.js new file mode 100644 index 0000000000..5d8dc52d1b --- /dev/null +++ b/lib/services/databox/lib/lib/models/jobErrorDetails.js @@ -0,0 +1,77 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Job Error Details for providing the information and recommended action. + * + */ +class JobErrorDetails { + /** + * Create a JobErrorDetails. + * @member {string} [errorMessage] Message for the error. + * @member {number} [errorCode] Code for the error. + * @member {string} [recommendedAction] Recommended action for the error. + * @member {string} [exceptionMessage] Contains the non localized exception + * message + */ + constructor() { + } + + /** + * Defines the metadata of JobErrorDetails + * + * @returns {object} metadata of JobErrorDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'JobErrorDetails', + type: { + name: 'Composite', + className: 'JobErrorDetails', + modelProperties: { + errorMessage: { + required: false, + serializedName: 'errorMessage', + type: { + name: 'String' + } + }, + errorCode: { + required: false, + serializedName: 'errorCode', + type: { + name: 'Number' + } + }, + recommendedAction: { + required: false, + serializedName: 'recommendedAction', + type: { + name: 'String' + } + }, + exceptionMessage: { + required: false, + serializedName: 'exceptionMessage', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = JobErrorDetails; diff --git a/lib/services/databox/lib/lib/models/jobResource.js b/lib/services/databox/lib/lib/models/jobResource.js new file mode 100644 index 0000000000..cfb1421f8c --- /dev/null +++ b/lib/services/databox/lib/lib/models/jobResource.js @@ -0,0 +1,271 @@ +/* + * 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'); + +/** + * Job Resource. + * + * @extends models['Resource'] + */ +class JobResource extends models['Resource'] { + /** + * Create a JobResource. + * @member {string} [deviceType] Type of the device to be used for the job. + * Possible values include: 'Pod', 'Disk', 'Cabinet' + * @member {boolean} [isCancellable] Describes whether the job is cancellable + * or not. + * @member {boolean} [isShippingAddressEditable] Describes whether the + * shipping address is editable or not. + * @member {string} [status] Name of the stage which is in progress. Possible + * values include: 'DeviceOrdered', 'DevicePrepared', 'Dispatched', + * 'Delivered', 'PickedUp', 'AtAzureDC', 'DataCopy', 'Completed', + * 'CompletedWithErrors', 'Cancelled', 'Failed_IssueReportedAtCustomer', + * 'Failed_IssueDetectedAtAzureDC', 'Aborted' + * @member {date} [startTime] Time at which the job was started in UTC ISO + * 8601 format. + * @member {object} [error] Top level error for the job. + * @member {string} [error.code] Error code that can be used to + * programmatically identify the error. + * @member {string} [error.message] Describes the error in detail and + * provides debugging information. + * @member {object} [deliveryPackage] Delivery package shipping details. + * @member {string} [deliveryPackage.carrierName] Name of the carrier. + * @member {string} [deliveryPackage.trackingId] Tracking Id of shipment. + * @member {string} [deliveryPackage.trackingUrl] Url where shipment can be + * tracked. + * @member {object} [returnPackage] Return package shipping details. + * @member {string} [returnPackage.carrierName] Name of the carrier. + * @member {string} [returnPackage.trackingId] Tracking Id of shipment. + * @member {string} [returnPackage.trackingUrl] Url where shipment can be + * tracked. + * @member {array} destinationAccountDetails Destination account details. + * @member {object} [details] Details of a job run. This field will only be + * sent for expand details filter. + * @member {number} [details.expectedDataSizeInTeraBytes] The expected size + * of the data, which needs to be transfered in this job, in tera bytes. + * @member {array} [details.jobStages] List of stages that run in the job. + * @member {object} [details.contactDetails] Contact details for notification + * and shipping. + * @member {string} [details.contactDetails.contactName] Contact name of the + * person. + * @member {string} [details.contactDetails.phone] Phone number of the + * contact person. + * @member {string} [details.contactDetails.phoneExtension] Phone extension + * number of the contact person. + * @member {string} [details.contactDetails.mobile] Mobile number of the + * contact person. + * @member {array} [details.contactDetails.emailList] List of Email-ids to be + * notified about job progress. + * @member {array} [details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * @member {object} [details.shippingAddress] Shipping address of the + * customer. + * @member {string} [details.shippingAddress.streetAddress1] Street Address + * line 1. + * @member {string} [details.shippingAddress.streetAddress2] Street Address + * line 2. + * @member {string} [details.shippingAddress.streetAddress3] Street Address + * line 3. + * @member {string} [details.shippingAddress.city] Name of the City. + * @member {string} [details.shippingAddress.stateOrProvince] Name of the + * State or Province. + * @member {string} [details.shippingAddress.country] Name of the Country. + * @member {string} [details.shippingAddress.postalCode] Postal code. + * @member {string} [details.shippingAddress.zipExtendedCode] Extended Zip + * Code. + * @member {string} [details.shippingAddress.companyName] Name of the + * company. + * @member {string} [details.shippingAddress.addressType] Type of address. + * Possible values include: 'None', 'Residential', 'Commercial' + * @member {array} [details.errorDetails] Error details for failure. This is + * optional. + * @member {string} [details.jobDetailsType] Polymorphic Discriminator + * @member {string} [cancellationReason] Reason for cancellation. + * @member {string} [name] Name of the object. + * @member {string} [id] Id of the object. + * @member {string} [type] Type of the object. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of JobResource + * + * @returns {object} metadata of JobResource + * + */ + mapper() { + return { + required: false, + serializedName: 'JobResource', + type: { + name: 'Composite', + className: 'JobResource', + modelProperties: { + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + sku: { + required: true, + serializedName: 'sku', + type: { + name: 'Composite', + className: 'Sku' + } + }, + deviceType: { + required: false, + serializedName: 'properties.deviceType', + type: { + name: 'Enum', + allowedValues: [ 'Pod', 'Disk', 'Cabinet' ] + } + }, + isCancellable: { + required: false, + serializedName: 'properties.isCancellable', + type: { + name: 'Boolean' + } + }, + isShippingAddressEditable: { + required: false, + serializedName: 'properties.isShippingAddressEditable', + type: { + name: 'Boolean' + } + }, + status: { + required: false, + serializedName: 'properties.status', + type: { + name: 'Enum', + allowedValues: [ 'DeviceOrdered', 'DevicePrepared', 'Dispatched', 'Delivered', 'PickedUp', 'AtAzureDC', 'DataCopy', 'Completed', 'CompletedWithErrors', 'Cancelled', 'Failed_IssueReportedAtCustomer', 'Failed_IssueDetectedAtAzureDC', 'Aborted' ] + } + }, + startTime: { + required: false, + serializedName: 'properties.startTime', + type: { + name: 'DateTime' + } + }, + error: { + required: false, + serializedName: 'properties.error', + type: { + name: 'Composite', + className: 'ErrorModel' + } + }, + deliveryPackage: { + required: false, + serializedName: 'properties.deliveryPackage', + type: { + name: 'Composite', + className: 'PackageShippingDetails' + } + }, + returnPackage: { + required: false, + serializedName: 'properties.returnPackage', + type: { + name: 'Composite', + className: 'PackageShippingDetails' + } + }, + destinationAccountDetails: { + required: true, + serializedName: 'properties.destinationAccountDetails', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DestinationAccountDetailsElementType', + type: { + name: 'Composite', + className: 'DestinationAccountDetails' + } + } + } + }, + details: { + required: false, + serializedName: 'properties.details', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'jobDetailsType', + clientName: 'jobDetailsType' + }, + uberParent: 'JobDetails', + className: 'JobDetails' + } + }, + cancellationReason: { + required: false, + serializedName: 'properties.cancellationReason', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = JobResource; diff --git a/lib/services/databox/lib/lib/models/jobResourceList.js b/lib/services/databox/lib/lib/models/jobResourceList.js new file mode 100644 index 0000000000..bed4718392 --- /dev/null +++ b/lib/services/databox/lib/lib/models/jobResourceList.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'; + +/** + * Job Resource Collection + */ +class JobResourceList extends Array { + /** + * Create a JobResourceList. + * @member {string} [nextLink] Link for the next set of job resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of JobResourceList + * + * @returns {object} metadata of JobResourceList + * + */ + mapper() { + return { + required: false, + serializedName: 'JobResourceList', + type: { + name: 'Composite', + className: 'JobResourceList', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'JobResourceElementType', + type: { + name: 'Composite', + className: 'JobResource' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = JobResourceList; diff --git a/lib/services/databox/lib/lib/models/jobResourceUpdateParameter.js b/lib/services/databox/lib/lib/models/jobResourceUpdateParameter.js new file mode 100644 index 0000000000..8faf5df59d --- /dev/null +++ b/lib/services/databox/lib/lib/models/jobResourceUpdateParameter.js @@ -0,0 +1,105 @@ +/* + * 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'); + +/** + * The JobResourceUpdateParameter. + * + */ +class JobResourceUpdateParameter { + /** + * Create a JobResourceUpdateParameter. + * @member {object} details Details of a job to be updated. + * @member {object} [details.contactDetails] Contact details for notification + * and shipping. + * @member {string} [details.contactDetails.contactName] Contact name of the + * person. + * @member {string} [details.contactDetails.phone] Phone number of the + * contact person. + * @member {string} [details.contactDetails.phoneExtension] Phone extension + * number of the contact person. + * @member {string} [details.contactDetails.mobile] Mobile number of the + * contact person. + * @member {array} [details.contactDetails.emailList] List of Email-ids to be + * notified about job progress. + * @member {array} [details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * @member {object} [details.shippingAddress] Shipping address of the + * customer. + * @member {string} [details.shippingAddress.streetAddress1] Street Address + * line 1. + * @member {string} [details.shippingAddress.streetAddress2] Street Address + * line 2. + * @member {string} [details.shippingAddress.streetAddress3] Street Address + * line 3. + * @member {string} [details.shippingAddress.city] Name of the City. + * @member {string} [details.shippingAddress.stateOrProvince] Name of the + * State or Province. + * @member {string} [details.shippingAddress.country] Name of the Country. + * @member {string} [details.shippingAddress.postalCode] Postal code. + * @member {string} [details.shippingAddress.zipExtendedCode] Extended Zip + * Code. + * @member {string} [details.shippingAddress.companyName] Name of the + * company. + * @member {string} [details.shippingAddress.addressType] Type of address. + * Possible values include: 'None', 'Residential', 'Commercial' + * @member {object} [tags] The list of key value pairs that describe the + * resource. These tags can be used in viewing and grouping this resource + * (across resource groups). + */ + constructor() { + } + + /** + * Defines the metadata of JobResourceUpdateParameter + * + * @returns {object} metadata of JobResourceUpdateParameter + * + */ + mapper() { + return { + required: false, + serializedName: 'JobResourceUpdateParameter', + type: { + name: 'Composite', + className: 'JobResourceUpdateParameter', + modelProperties: { + details: { + required: true, + serializedName: 'properties.details', + type: { + name: 'Composite', + className: 'UpdateJobDetails' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = JobResourceUpdateParameter; diff --git a/lib/services/databox/lib/lib/models/jobSecrets.js b/lib/services/databox/lib/lib/models/jobSecrets.js new file mode 100644 index 0000000000..9ef614fc2e --- /dev/null +++ b/lib/services/databox/lib/lib/models/jobSecrets.js @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The base class for the secrets + * + */ +class JobSecrets { + /** + * Create a JobSecrets. + * @member {string} jobSecretsType Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of JobSecrets + * + * @returns {object} metadata of JobSecrets + * + */ + mapper() { + return { + required: false, + serializedName: 'JobSecrets', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'jobSecretsType', + clientName: 'jobSecretsType' + }, + uberParent: 'JobSecrets', + className: 'JobSecrets', + modelProperties: { + jobSecretsType: { + required: true, + serializedName: 'jobSecretsType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = JobSecrets; diff --git a/lib/services/databox/lib/lib/models/jobStages.js b/lib/services/databox/lib/lib/models/jobStages.js new file mode 100644 index 0000000000..158a9ba32a --- /dev/null +++ b/lib/services/databox/lib/lib/models/jobStages.js @@ -0,0 +1,110 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Job stages. + * + */ +class JobStages { + /** + * Create a JobStages. + * @member {string} stageName Name of the job stage. Possible values include: + * 'DeviceOrdered', 'DevicePrepared', 'Dispatched', 'Delivered', 'PickedUp', + * 'AtAzureDC', 'DataCopy', 'Completed', 'CompletedWithErrors', 'Cancelled', + * 'Failed_IssueReportedAtCustomer', 'Failed_IssueDetectedAtAzureDC', + * 'Aborted' + * @member {string} [displayName] Display name of the job stage. + * @member {string} stageStatus Status of the job stage. Possible values + * include: 'None', 'InProgress', 'Succeeded', 'Failed', 'Cancelled', + * 'Cancelling', 'SucceededWithErrors' + * @member {date} [stageTime] Time for the job stage in UTC ISO 8601 format. + * @member {object} [jobStageDetails] Job Stage Details + * @member {array} [errorDetails] Error details for the stage. + */ + constructor() { + } + + /** + * Defines the metadata of JobStages + * + * @returns {object} metadata of JobStages + * + */ + mapper() { + return { + required: false, + serializedName: 'JobStages', + type: { + name: 'Composite', + className: 'JobStages', + modelProperties: { + stageName: { + required: true, + serializedName: 'stageName', + type: { + name: 'Enum', + allowedValues: [ 'DeviceOrdered', 'DevicePrepared', 'Dispatched', 'Delivered', 'PickedUp', 'AtAzureDC', 'DataCopy', 'Completed', 'CompletedWithErrors', 'Cancelled', 'Failed_IssueReportedAtCustomer', 'Failed_IssueDetectedAtAzureDC', 'Aborted' ] + } + }, + displayName: { + required: false, + serializedName: 'displayName', + type: { + name: 'String' + } + }, + stageStatus: { + required: true, + serializedName: 'stageStatus', + type: { + name: 'Enum', + allowedValues: [ 'None', 'InProgress', 'Succeeded', 'Failed', 'Cancelled', 'Cancelling', 'SucceededWithErrors' ] + } + }, + stageTime: { + required: false, + serializedName: 'stageTime', + type: { + name: 'DateTime' + } + }, + jobStageDetails: { + required: false, + serializedName: 'jobStageDetails', + type: { + name: 'Object' + } + }, + errorDetails: { + required: false, + serializedName: 'errorDetails', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'JobErrorDetailsElementType', + type: { + name: 'Composite', + className: 'JobErrorDetails' + } + } + } + } + } + } + }; + } +} + +module.exports = JobStages; diff --git a/lib/services/databox/lib/lib/models/notificationPreference.js b/lib/services/databox/lib/lib/models/notificationPreference.js new file mode 100644 index 0000000000..b9dbc4de65 --- /dev/null +++ b/lib/services/databox/lib/lib/models/notificationPreference.js @@ -0,0 +1,63 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Notification preference for a job stage. + * + */ +class NotificationPreference { + /** + * Create a NotificationPreference. + * @member {string} stageName Name of the stage. Possible values include: + * 'DevicePrepared', 'Dispatched', 'Delivered', 'PickedUp', 'AtAzureDC', + * 'DataCopy' + * @member {boolean} sendNotification Notification is required or not. + */ + constructor() { + } + + /** + * Defines the metadata of NotificationPreference + * + * @returns {object} metadata of NotificationPreference + * + */ + mapper() { + return { + required: false, + serializedName: 'NotificationPreference', + type: { + name: 'Composite', + className: 'NotificationPreference', + modelProperties: { + stageName: { + required: true, + serializedName: 'stageName', + type: { + name: 'Enum', + allowedValues: [ 'DevicePrepared', 'Dispatched', 'Delivered', 'PickedUp', 'AtAzureDC', 'DataCopy' ] + } + }, + sendNotification: { + required: true, + serializedName: 'sendNotification', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = NotificationPreference; diff --git a/lib/services/databox/lib/lib/models/operation.js b/lib/services/databox/lib/lib/models/operation.js new file mode 100644 index 0000000000..1983f1ae05 --- /dev/null +++ b/lib/services/databox/lib/lib/models/operation.js @@ -0,0 +1,87 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Operation entity. + * + */ +class Operation { + /** + * Create a Operation. + * @member {string} name Name of the operation. Format: + * {resourceProviderNamespace}/{resourceType}/{read|write|delete|action} + * @member {object} display Operation display values. + * @member {string} [display.provider] Provider name. + * @member {string} [display.resource] Resource name. + * @member {string} [display.operation] Localized name of the operation for + * display purpose. + * @member {string} [display.description] Localized description of the + * operation for display purpose. + * @member {object} properties Operation properties. + * @member {string} origin Origin of the operation. Can be : + * user|system|user,system + */ + constructor() { + } + + /** + * Defines the metadata of Operation + * + * @returns {object} metadata of Operation + * + */ + mapper() { + return { + required: false, + serializedName: 'Operation', + type: { + name: 'Composite', + className: 'Operation', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + display: { + required: true, + serializedName: 'display', + type: { + name: 'Composite', + className: 'OperationDisplay' + } + }, + properties: { + required: true, + serializedName: 'properties', + type: { + name: 'Object' + } + }, + origin: { + required: true, + serializedName: 'origin', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Operation; diff --git a/lib/services/databox/lib/lib/models/operationDisplay.js b/lib/services/databox/lib/lib/models/operationDisplay.js new file mode 100644 index 0000000000..878daf0e9b --- /dev/null +++ b/lib/services/databox/lib/lib/models/operationDisplay.js @@ -0,0 +1,78 @@ +/* + * 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'; + +/** + * Operation display + * + */ +class OperationDisplay { + /** + * Create a OperationDisplay. + * @member {string} [provider] Provider name. + * @member {string} [resource] Resource name. + * @member {string} [operation] Localized name of the operation for display + * purpose. + * @member {string} [description] Localized description of the operation for + * display purpose. + */ + constructor() { + } + + /** + * Defines the metadata of OperationDisplay + * + * @returns {object} metadata of OperationDisplay + * + */ + mapper() { + return { + required: false, + serializedName: 'OperationDisplay', + type: { + name: 'Composite', + className: 'OperationDisplay', + modelProperties: { + provider: { + required: false, + serializedName: 'provider', + type: { + name: 'String' + } + }, + resource: { + required: false, + serializedName: 'resource', + type: { + name: 'String' + } + }, + operation: { + required: false, + serializedName: 'operation', + type: { + name: 'String' + } + }, + description: { + required: false, + serializedName: 'description', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = OperationDisplay; diff --git a/lib/services/databox/lib/lib/models/operationList.js b/lib/services/databox/lib/lib/models/operationList.js new file mode 100644 index 0000000000..31d2a1621d --- /dev/null +++ b/lib/services/databox/lib/lib/models/operationList.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'; + +/** + * Operation Collection. + */ +class OperationList extends Array { + /** + * Create a OperationList. + * @member {string} [nextLink] Link for the next set of operations. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of OperationList + * + * @returns {object} metadata of OperationList + * + */ + mapper() { + return { + required: false, + serializedName: 'OperationList', + type: { + name: 'Composite', + className: 'OperationList', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'OperationElementType', + type: { + name: 'Composite', + className: 'Operation' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = OperationList; diff --git a/lib/services/databox/lib/lib/models/packageShippingDetails.js b/lib/services/databox/lib/lib/models/packageShippingDetails.js new file mode 100644 index 0000000000..471d4e457f --- /dev/null +++ b/lib/services/databox/lib/lib/models/packageShippingDetails.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Shipping details. + * + */ +class PackageShippingDetails { + /** + * Create a PackageShippingDetails. + * @member {string} [carrierName] Name of the carrier. + * @member {string} [trackingId] Tracking Id of shipment. + * @member {string} [trackingUrl] Url where shipment can be tracked. + */ + constructor() { + } + + /** + * Defines the metadata of PackageShippingDetails + * + * @returns {object} metadata of PackageShippingDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'PackageShippingDetails', + type: { + name: 'Composite', + className: 'PackageShippingDetails', + modelProperties: { + carrierName: { + required: false, + serializedName: 'carrierName', + type: { + name: 'String' + } + }, + trackingId: { + required: false, + serializedName: 'trackingId', + type: { + name: 'String' + } + }, + trackingUrl: { + required: false, + serializedName: 'trackingUrl', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PackageShippingDetails; diff --git a/lib/services/databox/lib/lib/models/podJobDetails.js b/lib/services/databox/lib/lib/models/podJobDetails.js new file mode 100644 index 0000000000..6199360298 --- /dev/null +++ b/lib/services/databox/lib/lib/models/podJobDetails.js @@ -0,0 +1,130 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Pod Job Details + * + * @extends models['JobDetails'] + */ +class PodJobDetails extends models['JobDetails'] { + /** + * Create a PodJobDetails. + * @member {array} [copyProgress] Copy progress per account. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of PodJobDetails + * + * @returns {object} metadata of PodJobDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'Pod', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'jobDetailsType', + clientName: 'jobDetailsType' + }, + uberParent: 'JobDetails', + className: 'PodJobDetails', + modelProperties: { + expectedDataSizeInTeraBytes: { + required: false, + serializedName: 'expectedDataSizeInTeraBytes', + type: { + name: 'Number' + } + }, + jobStages: { + required: false, + serializedName: 'jobStages', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'JobStagesElementType', + type: { + name: 'Composite', + className: 'JobStages' + } + } + } + }, + contactDetails: { + required: true, + serializedName: 'contactDetails', + type: { + name: 'Composite', + className: 'ContactDetails' + } + }, + shippingAddress: { + required: true, + serializedName: 'shippingAddress', + type: { + name: 'Composite', + className: 'ShippingAddress' + } + }, + errorDetails: { + required: false, + serializedName: 'errorDetails', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'JobErrorDetailsElementType', + type: { + name: 'Composite', + className: 'JobErrorDetails' + } + } + } + }, + jobDetailsType: { + required: true, + serializedName: 'jobDetailsType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + copyProgress: { + required: false, + serializedName: 'copyProgress', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CopyProgressElementType', + type: { + name: 'Composite', + className: 'CopyProgress' + } + } + } + } + } + } + }; + } +} + +module.exports = PodJobDetails; diff --git a/lib/services/databox/lib/lib/models/podJobSecrets.js b/lib/services/databox/lib/lib/models/podJobSecrets.js new file mode 100644 index 0000000000..502a9a1bea --- /dev/null +++ b/lib/services/databox/lib/lib/models/podJobSecrets.js @@ -0,0 +1,78 @@ +/* + * 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'); + +/** + * The secrets related to a pod job. + * + * @extends models['JobSecrets'] + */ +class PodJobSecrets extends models['JobSecrets'] { + /** + * Create a PodJobSecrets. + * @member {array} [podSecrets] Contains the list of secret objects for a + * job. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of PodJobSecrets + * + * @returns {object} metadata of PodJobSecrets + * + */ + mapper() { + return { + required: false, + serializedName: 'Pod', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'jobSecretsType', + clientName: 'jobSecretsType' + }, + uberParent: 'JobSecrets', + className: 'PodJobSecrets', + modelProperties: { + jobSecretsType: { + required: true, + serializedName: 'jobSecretsType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + podSecrets: { + required: false, + serializedName: 'podSecrets', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'PodSecretElementType', + type: { + name: 'Composite', + className: 'PodSecret' + } + } + } + } + } + } + }; + } +} + +module.exports = PodJobSecrets; diff --git a/lib/services/databox/lib/lib/models/podSecret.js b/lib/services/databox/lib/lib/models/podSecret.js new file mode 100644 index 0000000000..6d5dad55d2 --- /dev/null +++ b/lib/services/databox/lib/lib/models/podSecret.js @@ -0,0 +1,81 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The secrets related to a Pod. + * + */ +class PodSecret { + /** + * Create a PodSecret. + * @member {string} [deviceSerialNumber] Serial number of the assigned + * device. + * @member {string} [devicePassword] Password for out of the box experience + * on device. + * @member {array} [accountCredentialDetails] Per account level access + * credentials. + */ + constructor() { + } + + /** + * Defines the metadata of PodSecret + * + * @returns {object} metadata of PodSecret + * + */ + mapper() { + return { + required: false, + serializedName: 'PodSecret', + type: { + name: 'Composite', + className: 'PodSecret', + modelProperties: { + deviceSerialNumber: { + required: false, + serializedName: 'deviceSerialNumber', + type: { + name: 'String' + } + }, + devicePassword: { + required: false, + serializedName: 'devicePassword', + type: { + name: 'String' + } + }, + accountCredentialDetails: { + required: false, + serializedName: 'accountCredentialDetails', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AccountCredentialDetailsElementType', + type: { + name: 'Composite', + className: 'AccountCredentialDetails' + } + } + } + } + } + } + }; + } +} + +module.exports = PodSecret; diff --git a/lib/services/databox/lib/lib/models/regionAvailabilityInput.js b/lib/services/databox/lib/lib/models/regionAvailabilityInput.js new file mode 100644 index 0000000000..fe37be0d1e --- /dev/null +++ b/lib/services/databox/lib/lib/models/regionAvailabilityInput.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'; + +/** + * Inputs to get list of supported storage regions and service regions for job + * creation. + * + */ +class RegionAvailabilityInput { + /** + * Create a RegionAvailabilityInput. + * @member {string} countryCode Country for which the supported regions are + * requested. Possible values include: 'US', 'NL', 'IE', 'AT', 'IT', 'BE', + * 'LV', 'BG', 'LT', 'HR', 'LU', 'CY', 'MT', 'CZ', 'DK', 'PL', 'EE', 'PT', + * 'FI', 'RO', 'FR', 'SK', 'DE', 'SI', 'GR', 'ES', 'HU', 'SE', 'GB' + * @member {string} deviceType Device type for which the supported regions + * have to be fetched. Possible values include: 'Pod', 'Disk', 'Cabinet' + */ + constructor() { + } + + /** + * Defines the metadata of RegionAvailabilityInput + * + * @returns {object} metadata of RegionAvailabilityInput + * + */ + mapper() { + return { + required: false, + serializedName: 'RegionAvailabilityInput', + type: { + name: 'Composite', + className: 'RegionAvailabilityInput', + modelProperties: { + countryCode: { + required: true, + serializedName: 'countryCode', + type: { + name: 'Enum', + allowedValues: [ 'US', 'NL', 'IE', 'AT', 'IT', 'BE', 'LV', 'BG', 'LT', 'HR', 'LU', 'CY', 'MT', 'CZ', 'DK', 'PL', 'EE', 'PT', 'FI', 'RO', 'FR', 'SK', 'DE', 'SI', 'GR', 'ES', 'HU', 'SE', 'GB' ] + } + }, + deviceType: { + required: true, + serializedName: 'deviceType', + type: { + name: 'Enum', + allowedValues: [ 'Pod', 'Disk', 'Cabinet' ] + } + } + } + } + }; + } +} + +module.exports = RegionAvailabilityInput; diff --git a/lib/services/databox/lib/lib/models/regionAvailabilityResponse.js b/lib/services/databox/lib/lib/models/regionAvailabilityResponse.js new file mode 100644 index 0000000000..9b5a4ae3f3 --- /dev/null +++ b/lib/services/databox/lib/lib/models/regionAvailabilityResponse.js @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * List of service regions and storage regions + * + */ +class RegionAvailabilityResponse { + /** + * Create a RegionAvailabilityResponse. + * @member {array} supportedRegions List of supported region. + */ + constructor() { + } + + /** + * Defines the metadata of RegionAvailabilityResponse + * + * @returns {object} metadata of RegionAvailabilityResponse + * + */ + mapper() { + return { + required: false, + serializedName: 'RegionAvailabilityResponse', + type: { + name: 'Composite', + className: 'RegionAvailabilityResponse', + modelProperties: { + supportedRegions: { + required: true, + serializedName: 'supportedRegions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SupportedRegionsElementType', + type: { + name: 'Composite', + className: 'SupportedRegions' + } + } + } + } + } + } + }; + } +} + +module.exports = RegionAvailabilityResponse; diff --git a/lib/services/databox/lib/lib/models/reportIssueDetails.js b/lib/services/databox/lib/lib/models/reportIssueDetails.js new file mode 100644 index 0000000000..901c0b820e --- /dev/null +++ b/lib/services/databox/lib/lib/models/reportIssueDetails.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'; + +/** + * Details of the reported issue. + * + */ +class ReportIssueDetails { + /** + * Create a ReportIssueDetails. + * @member {string} [issueType] Issue Type. Possible values include: + * 'DeviceMismatch', 'ValidationStringMismatch', 'CredentialNotWorking', + * 'DeviceFailure' + * @member {string} [deviceIssueType] Device Issue Type. Only used for Device + * failure issue. Possible values include: 'DeviceTampering', + * 'DeviceNotBootingUp', 'DeviceHealthCheckShowFailures', + * 'NICsAreNotWorking', 'Misc' + */ + constructor() { + } + + /** + * Defines the metadata of ReportIssueDetails + * + * @returns {object} metadata of ReportIssueDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'ReportIssueDetails', + type: { + name: 'Composite', + className: 'ReportIssueDetails', + modelProperties: { + issueType: { + required: false, + serializedName: 'issueType', + type: { + name: 'Enum', + allowedValues: [ 'DeviceMismatch', 'ValidationStringMismatch', 'CredentialNotWorking', 'DeviceFailure' ] + } + }, + deviceIssueType: { + required: false, + serializedName: 'deviceIssueType', + type: { + name: 'Enum', + allowedValues: [ 'DeviceTampering', 'DeviceNotBootingUp', 'DeviceHealthCheckShowFailures', 'NICsAreNotWorking', 'Misc' ] + } + } + } + } + }; + } +} + +module.exports = ReportIssueDetails; diff --git a/lib/services/databox/lib/lib/models/resource.js b/lib/services/databox/lib/lib/models/resource.js new file mode 100644 index 0000000000..7b4f8e0d45 --- /dev/null +++ b/lib/services/databox/lib/lib/models/resource.js @@ -0,0 +1,89 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Model of the Resource. + * + * @extends models['BaseResource'] + */ +class Resource extends models['BaseResource'] { + /** + * Create a Resource. + * @member {string} location The location of the resource. This will be one + * of the supported and registered Azure Regions (e.g. West US, East US, + * Southeast Asia, etc.). The region of a resource cannot be changed once it + * is created, but if an identical region is specified on update the request + * will succeed. + * @member {object} [tags] The list of key value pairs that describe the + * resource. These tags can be used in viewing and grouping this resource + * (across resource groups). + * @member {object} sku The sku type. + * @member {string} [sku.name] The sku name. + * @member {string} [sku.displayName] The display name of the sku. + * @member {string} [sku.family] The sku family. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of Resource + * + * @returns {object} metadata of Resource + * + */ + mapper() { + return { + required: false, + serializedName: 'Resource', + type: { + name: 'Composite', + className: 'Resource', + modelProperties: { + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + sku: { + required: true, + serializedName: 'sku', + type: { + name: 'Composite', + className: 'Sku' + } + } + } + } + }; + } +} + +module.exports = Resource; diff --git a/lib/services/databox/lib/lib/models/serviceHealthResponse.js b/lib/services/databox/lib/lib/models/serviceHealthResponse.js new file mode 100644 index 0000000000..870c820a11 --- /dev/null +++ b/lib/services/databox/lib/lib/models/serviceHealthResponse.js @@ -0,0 +1,76 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Response of the GetServiceHealth api. + * + */ +class ServiceHealthResponse { + /** + * Create a ServiceHealthResponse. + * @member {string} [connectorType] Name of the connector. + * @member {date} [startTime] Time when the action was triggered. + * @member {date} [endTime] Time when the action got completed. + * @member {boolean} [status] Status of the service. + */ + constructor() { + } + + /** + * Defines the metadata of ServiceHealthResponse + * + * @returns {object} metadata of ServiceHealthResponse + * + */ + mapper() { + return { + required: false, + serializedName: 'ServiceHealthResponse', + type: { + name: 'Composite', + className: 'ServiceHealthResponse', + modelProperties: { + connectorType: { + required: false, + serializedName: 'connectorType', + type: { + name: 'String' + } + }, + startTime: { + required: false, + serializedName: 'startTime', + type: { + name: 'DateTime' + } + }, + endTime: { + required: false, + serializedName: 'endTime', + type: { + name: 'DateTime' + } + }, + status: { + required: false, + serializedName: 'status', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = ServiceHealthResponse; diff --git a/lib/services/databox/lib/lib/models/serviceHealthResponseList.js b/lib/services/databox/lib/lib/models/serviceHealthResponseList.js new file mode 100644 index 0000000000..5621a30ffa --- /dev/null +++ b/lib/services/databox/lib/lib/models/serviceHealthResponseList.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * List of service health response. + * + */ +class ServiceHealthResponseList { + /** + * Create a ServiceHealthResponseList. + * @member {array} [dependencies] List of ServiceHealthResponse. + * @member {string} [serviceVersion] Version of the service. + */ + constructor() { + } + + /** + * Defines the metadata of ServiceHealthResponseList + * + * @returns {object} metadata of ServiceHealthResponseList + * + */ + mapper() { + return { + required: false, + serializedName: 'ServiceHealthResponseList', + type: { + name: 'Composite', + className: 'ServiceHealthResponseList', + modelProperties: { + dependencies: { + required: false, + serializedName: 'dependencies', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ServiceHealthResponseElementType', + type: { + name: 'Composite', + className: 'ServiceHealthResponse' + } + } + } + }, + serviceVersion: { + required: false, + serializedName: 'serviceVersion', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ServiceHealthResponseList; diff --git a/lib/services/databox/lib/lib/models/shareCredentialDetails.js b/lib/services/databox/lib/lib/models/shareCredentialDetails.js new file mode 100644 index 0000000000..762649d305 --- /dev/null +++ b/lib/services/databox/lib/lib/models/shareCredentialDetails.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Credential details of the shares in account. + * + */ +class ShareCredentialDetails { + /** + * Create a ShareCredentialDetails. + * @member {string} [shareName] Name of the share. + * @member {string} [userName] User name for the share. + * @member {string} [password] Password for the share. + */ + constructor() { + } + + /** + * Defines the metadata of ShareCredentialDetails + * + * @returns {object} metadata of ShareCredentialDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'ShareCredentialDetails', + type: { + name: 'Composite', + className: 'ShareCredentialDetails', + modelProperties: { + shareName: { + required: false, + serializedName: 'shareName', + type: { + name: 'String' + } + }, + userName: { + required: false, + serializedName: 'userName', + type: { + name: 'String' + } + }, + password: { + required: false, + serializedName: 'password', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ShareCredentialDetails; diff --git a/lib/services/databox/lib/lib/models/shipmentPickUpRequest.js b/lib/services/databox/lib/lib/models/shipmentPickUpRequest.js new file mode 100644 index 0000000000..30447b9a34 --- /dev/null +++ b/lib/services/databox/lib/lib/models/shipmentPickUpRequest.js @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Shipment pick up request details. + * + */ +class ShipmentPickUpRequest { + /** + * Create a ShipmentPickUpRequest. + * @member {date} [startTime] Minimum date after which the pick up should + * commence, this must be in local time of pick up area. + * @member {date} [endTime] Maximum date before which the pick up should + * commence, this must be in local time of pick up area. + * @member {string} [shipmentLocation] Shipment Location in the pickup place. + * Eg.front desk + */ + constructor() { + } + + /** + * Defines the metadata of ShipmentPickUpRequest + * + * @returns {object} metadata of ShipmentPickUpRequest + * + */ + mapper() { + return { + required: false, + serializedName: 'ShipmentPickUpRequest', + type: { + name: 'Composite', + className: 'ShipmentPickUpRequest', + modelProperties: { + startTime: { + required: false, + serializedName: 'startTime', + type: { + name: 'DateTime' + } + }, + endTime: { + required: false, + serializedName: 'endTime', + type: { + name: 'DateTime' + } + }, + shipmentLocation: { + required: false, + serializedName: 'shipmentLocation', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ShipmentPickUpRequest; diff --git a/lib/services/databox/lib/lib/models/shipmentPickUpResponse.js b/lib/services/databox/lib/lib/models/shipmentPickUpResponse.js new file mode 100644 index 0000000000..58f2014b77 --- /dev/null +++ b/lib/services/databox/lib/lib/models/shipmentPickUpResponse.js @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Shipment pick up response. + * + */ +class ShipmentPickUpResponse { + /** + * Create a ShipmentPickUpResponse. + * @member {string} [confirmationNumber] Confirmation number for the pick up + * request. + * @member {date} [readyByTime] Time by which shipment should be ready for + * pick up, this is in local time of pick up area. + */ + constructor() { + } + + /** + * Defines the metadata of ShipmentPickUpResponse + * + * @returns {object} metadata of ShipmentPickUpResponse + * + */ + mapper() { + return { + required: false, + serializedName: 'ShipmentPickUpResponse', + type: { + name: 'Composite', + className: 'ShipmentPickUpResponse', + modelProperties: { + confirmationNumber: { + required: false, + serializedName: 'confirmationNumber', + type: { + name: 'String' + } + }, + readyByTime: { + required: false, + serializedName: 'readyByTime', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = ShipmentPickUpResponse; diff --git a/lib/services/databox/lib/lib/models/shippingAddress.js b/lib/services/databox/lib/lib/models/shippingAddress.js new file mode 100644 index 0000000000..6c9265af63 --- /dev/null +++ b/lib/services/databox/lib/lib/models/shippingAddress.js @@ -0,0 +1,126 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Shipping address where customer wishes to receive the device. + * + */ +class ShippingAddress { + /** + * Create a ShippingAddress. + * @member {string} streetAddress1 Street Address line 1. + * @member {string} [streetAddress2] Street Address line 2. + * @member {string} [streetAddress3] Street Address line 3. + * @member {string} [city] Name of the City. + * @member {string} [stateOrProvince] Name of the State or Province. + * @member {string} country Name of the Country. + * @member {string} postalCode Postal code. + * @member {string} [zipExtendedCode] Extended Zip Code. + * @member {string} [companyName] Name of the company. + * @member {string} [addressType] Type of address. Possible values include: + * 'None', 'Residential', 'Commercial' + */ + constructor() { + } + + /** + * Defines the metadata of ShippingAddress + * + * @returns {object} metadata of ShippingAddress + * + */ + mapper() { + return { + required: false, + serializedName: 'ShippingAddress', + type: { + name: 'Composite', + className: 'ShippingAddress', + modelProperties: { + streetAddress1: { + required: true, + serializedName: 'streetAddress1', + type: { + name: 'String' + } + }, + streetAddress2: { + required: false, + serializedName: 'streetAddress2', + type: { + name: 'String' + } + }, + streetAddress3: { + required: false, + serializedName: 'streetAddress3', + type: { + name: 'String' + } + }, + city: { + required: false, + serializedName: 'city', + type: { + name: 'String' + } + }, + stateOrProvince: { + required: false, + serializedName: 'stateOrProvince', + type: { + name: 'String' + } + }, + country: { + required: true, + serializedName: 'country', + type: { + name: 'String' + } + }, + postalCode: { + required: true, + serializedName: 'postalCode', + type: { + name: 'String' + } + }, + zipExtendedCode: { + required: false, + serializedName: 'zipExtendedCode', + type: { + name: 'String' + } + }, + companyName: { + required: false, + serializedName: 'companyName', + type: { + name: 'String' + } + }, + addressType: { + required: false, + serializedName: 'addressType', + type: { + name: 'Enum', + allowedValues: [ 'None', 'Residential', 'Commercial' ] + } + } + } + } + }; + } +} + +module.exports = ShippingAddress; diff --git a/lib/services/databox/lib/lib/models/shippingLabelDetails.js b/lib/services/databox/lib/lib/models/shippingLabelDetails.js new file mode 100644 index 0000000000..d97f469f2d --- /dev/null +++ b/lib/services/databox/lib/lib/models/shippingLabelDetails.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Details for the shipping label. + * + */ +class ShippingLabelDetails { + /** + * Create a ShippingLabelDetails. + * @member {string} shippingLabelSasUri Sas uri for accessing the shipping + * label. + */ + constructor() { + } + + /** + * Defines the metadata of ShippingLabelDetails + * + * @returns {object} metadata of ShippingLabelDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'ShippingLabelDetails', + type: { + name: 'Composite', + className: 'ShippingLabelDetails', + modelProperties: { + shippingLabelSasUri: { + required: true, + serializedName: 'shippingLabelSasUri', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ShippingLabelDetails; diff --git a/lib/services/databox/lib/lib/models/sku.js b/lib/services/databox/lib/lib/models/sku.js new file mode 100644 index 0000000000..dbe7a5e5f3 --- /dev/null +++ b/lib/services/databox/lib/lib/models/sku.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The Sku. + * + */ +class Sku { + /** + * Create a Sku. + * @member {string} name The sku name. + * @member {string} [displayName] The display name of the sku. + * @member {string} [family] The sku family. + */ + constructor() { + } + + /** + * Defines the metadata of Sku + * + * @returns {object} metadata of Sku + * + */ + mapper() { + return { + required: false, + serializedName: 'Sku', + type: { + name: 'Composite', + className: 'Sku', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + displayName: { + required: false, + serializedName: 'displayName', + type: { + name: 'String' + } + }, + family: { + required: false, + serializedName: 'family', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Sku; diff --git a/lib/services/databox/lib/lib/models/skuCapacity.js b/lib/services/databox/lib/lib/models/skuCapacity.js new file mode 100644 index 0000000000..1b4e9af335 --- /dev/null +++ b/lib/services/databox/lib/lib/models/skuCapacity.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'; + +/** + * Capacity of the sku. + * + */ +class SkuCapacity { + /** + * Create a SkuCapacity. + * @member {string} usable Usable capacity in TB. + * @member {string} maximum Maximum capacity in TB. + */ + constructor() { + } + + /** + * Defines the metadata of SkuCapacity + * + * @returns {object} metadata of SkuCapacity + * + */ + mapper() { + return { + required: false, + serializedName: 'SkuCapacity', + type: { + name: 'Composite', + className: 'SkuCapacity', + modelProperties: { + usable: { + required: true, + serializedName: 'usable', + type: { + name: 'String' + } + }, + maximum: { + required: true, + serializedName: 'maximum', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SkuCapacity; diff --git a/lib/services/databox/lib/lib/models/skuCost.js b/lib/services/databox/lib/lib/models/skuCost.js new file mode 100644 index 0000000000..5c34e9d1b9 --- /dev/null +++ b/lib/services/databox/lib/lib/models/skuCost.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'; + +/** + * Describes metadata for retrieving price info. + * + */ +class SkuCost { + /** + * Create a SkuCost. + * @member {string} meterId Meter id of the Sku. + * @member {string} meterType The type of the meter. + */ + constructor() { + } + + /** + * Defines the metadata of SkuCost + * + * @returns {object} metadata of SkuCost + * + */ + mapper() { + return { + required: false, + serializedName: 'SkuCost', + type: { + name: 'Composite', + className: 'SkuCost', + modelProperties: { + meterId: { + required: true, + serializedName: 'meterId', + type: { + name: 'String' + } + }, + meterType: { + required: true, + serializedName: 'meterType', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SkuCost; diff --git a/lib/services/databox/lib/lib/models/skuInformation.js b/lib/services/databox/lib/lib/models/skuInformation.js new file mode 100644 index 0000000000..b8b38f5808 --- /dev/null +++ b/lib/services/databox/lib/lib/models/skuInformation.js @@ -0,0 +1,133 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Information of the sku. + * + */ +class SkuInformation { + /** + * Create a SkuInformation. + * @member {object} sku The Sku. + * @member {string} [sku.name] The sku name. + * @member {string} [sku.displayName] The display name of the sku. + * @member {string} [sku.family] The sku family. + * @member {boolean} enabled The sku is enabled or not. + * @member {array} [destinationToServiceLocationMap] The map of destination + * location to service location. + * @member {object} capacity Capacity of the Sku. + * @member {string} [capacity.usable] Usable capacity in TB. + * @member {string} [capacity.maximum] Maximum capacity in TB. + * @member {array} costs Cost of the Sku. + * @member {array} apiVersions Api versions that support this Sku. + * @member {string} [disabledReason] Reason why the Sku is disabled. + */ + constructor() { + } + + /** + * Defines the metadata of SkuInformation + * + * @returns {object} metadata of SkuInformation + * + */ + mapper() { + return { + required: false, + serializedName: 'SkuInformation', + type: { + name: 'Composite', + className: 'SkuInformation', + modelProperties: { + sku: { + required: true, + serializedName: 'sku', + type: { + name: 'Composite', + className: 'Sku' + } + }, + enabled: { + required: true, + serializedName: 'enabled', + type: { + name: 'Boolean' + } + }, + destinationToServiceLocationMap: { + required: false, + serializedName: 'properties.destinationToServiceLocationMap', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DestinationToServiceLocationMapElementType', + type: { + name: 'Composite', + className: 'DestinationToServiceLocationMap' + } + } + } + }, + capacity: { + required: true, + serializedName: 'properties.capacity', + type: { + name: 'Composite', + className: 'SkuCapacity' + } + }, + costs: { + required: true, + serializedName: 'properties.costs', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SkuCostElementType', + type: { + name: 'Composite', + className: 'SkuCost' + } + } + } + }, + apiVersions: { + required: true, + serializedName: 'properties.apiVersions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + disabledReason: { + required: false, + serializedName: 'properties.disabledReason', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SkuInformation; diff --git a/lib/services/databox/lib/lib/models/supportedRegions.js b/lib/services/databox/lib/lib/models/supportedRegions.js new file mode 100644 index 0000000000..b3ecade4e7 --- /dev/null +++ b/lib/services/databox/lib/lib/models/supportedRegions.js @@ -0,0 +1,66 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Storage region and service region mapping + * + */ +class SupportedRegions { + /** + * Create a SupportedRegions. + * @member {string} storageRegion Storage Region. Possible values include: + * 'westus', 'centralus', 'eastus', 'northcentralus', 'southcentralus', + * 'eastus2', 'westus2', 'westcentralus', 'westeurope', 'northeurope', + * 'ukwest', 'uksouth', 'germanycentral', 'germanynortheast' + * @member {string} serviceRegion Service Region. Possible values include: + * 'westus', 'westeurope', 'eastus2euap', 'centraluseuap' + */ + constructor() { + } + + /** + * Defines the metadata of SupportedRegions + * + * @returns {object} metadata of SupportedRegions + * + */ + mapper() { + return { + required: false, + serializedName: 'SupportedRegions', + type: { + name: 'Composite', + className: 'SupportedRegions', + modelProperties: { + storageRegion: { + required: true, + serializedName: 'storageRegion', + type: { + name: 'Enum', + allowedValues: [ 'westus', 'centralus', 'eastus', 'northcentralus', 'southcentralus', 'eastus2', 'westus2', 'westcentralus', 'westeurope', 'northeurope', 'ukwest', 'uksouth', 'germanycentral', 'germanynortheast' ] + } + }, + serviceRegion: { + required: true, + serializedName: 'serviceRegion', + type: { + name: 'Enum', + allowedValues: [ 'westus', 'westeurope', 'eastus2euap', 'centraluseuap' ] + } + } + } + } + }; + } +} + +module.exports = SupportedRegions; diff --git a/lib/services/databox/lib/lib/models/unencryptedSecrets.js b/lib/services/databox/lib/lib/models/unencryptedSecrets.js new file mode 100644 index 0000000000..34c5fdd250 --- /dev/null +++ b/lib/services/databox/lib/lib/models/unencryptedSecrets.js @@ -0,0 +1,79 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Unencrypted secrets for accessing device. + * + */ +class UnencryptedSecrets { + /** + * Create a UnencryptedSecrets. + * @member {string} jobName Name of the job. + * @member {string} [deviceType] The Device Type used in the job. Possible + * values include: 'Pod', 'Disk', 'Cabinet' + * @member {object} [jobSecrets] Secrets related to this job. + * @member {string} [jobSecrets.jobSecretsType] Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of UnencryptedSecrets + * + * @returns {object} metadata of UnencryptedSecrets + * + */ + mapper() { + return { + required: false, + serializedName: 'UnencryptedSecrets', + type: { + name: 'Composite', + className: 'UnencryptedSecrets', + modelProperties: { + jobName: { + required: true, + serializedName: 'jobName', + type: { + name: 'String' + } + }, + deviceType: { + required: false, + serializedName: 'deviceType', + type: { + name: 'Enum', + allowedValues: [ 'Pod', 'Disk', 'Cabinet' ] + } + }, + jobSecrets: { + required: false, + serializedName: 'jobSecrets', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'jobSecretsType', + clientName: 'jobSecretsType' + }, + uberParent: 'JobSecrets', + className: 'JobSecrets' + } + } + } + } + }; + } +} + +module.exports = UnencryptedSecrets; diff --git a/lib/services/databox/lib/lib/models/updateJobDetails.js b/lib/services/databox/lib/lib/models/updateJobDetails.js new file mode 100644 index 0000000000..59ab402886 --- /dev/null +++ b/lib/services/databox/lib/lib/models/updateJobDetails.js @@ -0,0 +1,88 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Job details for update. + * + */ +class UpdateJobDetails { + /** + * Create a UpdateJobDetails. + * @member {object} [contactDetails] Contact details for notification and + * shipping. + * @member {string} [contactDetails.contactName] Contact name of the person. + * @member {string} [contactDetails.phone] Phone number of the contact + * person. + * @member {string} [contactDetails.phoneExtension] Phone extension number of + * the contact person. + * @member {string} [contactDetails.mobile] Mobile number of the contact + * person. + * @member {array} [contactDetails.emailList] List of Email-ids to be + * notified about job progress. + * @member {array} [contactDetails.notificationPreference] Notification + * preference for a job stage. + * @member {object} [shippingAddress] Shipping address of the customer. + * @member {string} [shippingAddress.streetAddress1] Street Address line 1. + * @member {string} [shippingAddress.streetAddress2] Street Address line 2. + * @member {string} [shippingAddress.streetAddress3] Street Address line 3. + * @member {string} [shippingAddress.city] Name of the City. + * @member {string} [shippingAddress.stateOrProvince] Name of the State or + * Province. + * @member {string} [shippingAddress.country] Name of the Country. + * @member {string} [shippingAddress.postalCode] Postal code. + * @member {string} [shippingAddress.zipExtendedCode] Extended Zip Code. + * @member {string} [shippingAddress.companyName] Name of the company. + * @member {string} [shippingAddress.addressType] Type of address. Possible + * values include: 'None', 'Residential', 'Commercial' + */ + constructor() { + } + + /** + * Defines the metadata of UpdateJobDetails + * + * @returns {object} metadata of UpdateJobDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'UpdateJobDetails', + type: { + name: 'Composite', + className: 'UpdateJobDetails', + modelProperties: { + contactDetails: { + required: false, + serializedName: 'contactDetails', + type: { + name: 'Composite', + className: 'ContactDetails' + } + }, + shippingAddress: { + required: false, + serializedName: 'shippingAddress', + type: { + name: 'Composite', + className: 'ShippingAddress' + } + } + } + } + }; + } +} + +module.exports = UpdateJobDetails; diff --git a/lib/services/databox/lib/lib/models/validateAddress.js b/lib/services/databox/lib/lib/models/validateAddress.js new file mode 100644 index 0000000000..2ccf4508e0 --- /dev/null +++ b/lib/services/databox/lib/lib/models/validateAddress.js @@ -0,0 +1,78 @@ +/* + * 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'); + +/** + * The requirements to validate customer address where the device needs to be + * shipped. + * + */ +class ValidateAddress { + /** + * Create a ValidateAddress. + * @member {object} [shippingAddress] Shipping address of the customer. + * @member {string} [shippingAddress.streetAddress1] Street Address line 1. + * @member {string} [shippingAddress.streetAddress2] Street Address line 2. + * @member {string} [shippingAddress.streetAddress3] Street Address line 3. + * @member {string} [shippingAddress.city] Name of the City. + * @member {string} [shippingAddress.stateOrProvince] Name of the State or + * Province. + * @member {string} [shippingAddress.country] Name of the Country. + * @member {string} [shippingAddress.postalCode] Postal code. + * @member {string} [shippingAddress.zipExtendedCode] Extended Zip Code. + * @member {string} [shippingAddress.companyName] Name of the company. + * @member {string} [shippingAddress.addressType] Type of address. Possible + * values include: 'None', 'Residential', 'Commercial' + * @member {string} [deviceType] Device type to be used for the job. Possible + * values include: 'Pod', 'Disk', 'Cabinet' + */ + constructor() { + } + + /** + * Defines the metadata of ValidateAddress + * + * @returns {object} metadata of ValidateAddress + * + */ + mapper() { + return { + required: false, + serializedName: 'ValidateAddress', + type: { + name: 'Composite', + className: 'ValidateAddress', + modelProperties: { + shippingAddress: { + required: false, + serializedName: 'shippingAddress', + type: { + name: 'Composite', + className: 'ShippingAddress' + } + }, + deviceType: { + required: false, + serializedName: 'deviceType', + type: { + name: 'Enum', + allowedValues: [ 'Pod', 'Disk', 'Cabinet' ] + } + } + } + } + }; + } +} + +module.exports = ValidateAddress; diff --git a/lib/services/databox/lib/lib/operations/index.d.ts b/lib/services/databox/lib/lib/operations/index.d.ts new file mode 100644 index 0000000000..9665379ef5 --- /dev/null +++ b/lib/services/databox/lib/lib/operations/index.d.ts @@ -0,0 +1,2296 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. +*/ + +import { ServiceClientOptions, RequestOptions, ServiceCallback, HttpOperationResponse } from 'ms-rest'; +import * as models from '../models'; + + +/** + * @class + * Operations + * __NOTE__: An instance of this class is automatically created for an + * instance of the DataBoxManagementClient. + */ +export interface Operations { + + + /** + * This method gets all the operations. + * + * @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>; + + /** + * This method gets all the operations. + * + * @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 {OperationList} - 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. + * + * {OperationList} [result] - The deserialized result object if an error did not occur. + * See {@link OperationList} 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; + + + /** + * This method gets all the operations. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * This method gets all the operations. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {OperationList} - 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. + * + * {OperationList} [result] - The deserialized result object if an error did not occur. + * See {@link OperationList} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Jobs + * __NOTE__: An instance of this class is automatically created for an + * instance of the DataBoxManagementClient. + */ +export interface Jobs { + + + /** + * Lists all the jobs available under the subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.skipToken] $skipToken is supported on Get list of + * jobs, which provides the next page in the list of jobs. + * + * @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?: { skipToken? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all the jobs available under the subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.skipToken] $skipToken is supported on Get list of + * jobs, which provides the next page in the list of jobs. + * + * @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 {JobResourceList} - 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. + * + * {JobResourceList} [result] - The deserialized result object if an error did not occur. + * See {@link JobResourceList} 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?: { skipToken? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { skipToken? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all the jobs available under the given resource group. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.skipToken] $skipToken is supported on Get list of + * jobs, which provides the next page in the list of jobs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { skipToken? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all the jobs available under the given resource group. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.skipToken] $skipToken is supported on Get list of + * jobs, which provides the next page in the list of jobs. + * + * @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 {JobResourceList} - 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. + * + * {JobResourceList} [result] - The deserialized result object if an error did not occur. + * See {@link JobResourceList} 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?: { skipToken? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options: { skipToken? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets information about the specified job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] $expand is supported on details parameter + * for job, which provides details on the job stages. + * + * @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(resourceGroupName: string, jobName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets information about the specified job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] $expand is supported on details parameter + * for job, which provides details on the job stages. + * + * @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 {JobResource} - 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. + * + * {JobResource} [result] - The deserialized result object if an error did not occur. + * See {@link JobResource} 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?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, jobName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, jobName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates a new job with the specified parameters. Existing job cannot be + * updated with this API and should instead be updated with the Update job API. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} jobResource Job details from request body. + * + * @param {string} [jobResource.deviceType] Type of the device to be used for + * the job. Possible values include: 'Pod', 'Disk', 'Cabinet' + * + * @param {boolean} [jobResource.isCancellable] Describes whether the job is + * cancellable or not. + * + * @param {boolean} [jobResource.isShippingAddressEditable] Describes whether + * the shipping address is editable or not. + * + * @param {string} [jobResource.status] Name of the stage which is in progress. + * Possible values include: 'DeviceOrdered', 'DevicePrepared', 'Dispatched', + * 'Delivered', 'PickedUp', 'AtAzureDC', 'DataCopy', 'Completed', + * 'CompletedWithErrors', 'Cancelled', 'Failed_IssueReportedAtCustomer', + * 'Failed_IssueDetectedAtAzureDC', 'Aborted' + * + * @param {date} [jobResource.startTime] Time at which the job was started in + * UTC ISO 8601 format. + * + * @param {object} [jobResource.error] Top level error for the job. + * + * @param {string} jobResource.error.code Error code that can be used to + * programmatically identify the error. + * + * @param {string} [jobResource.error.message] Describes the error in detail + * and provides debugging information. + * + * @param {object} [jobResource.deliveryPackage] Delivery package shipping + * details. + * + * @param {object} [jobResource.returnPackage] Return package shipping details. + * + * @param {string} [jobResource.returnPackage.carrierName] Name of the carrier. + * + * @param {string} [jobResource.returnPackage.trackingId] Tracking Id of + * shipment. + * + * @param {string} [jobResource.returnPackage.trackingUrl] Url where shipment + * can be tracked. + * + * @param {array} jobResource.destinationAccountDetails Destination account + * details. + * + * @param {object} [jobResource.details] Details of a job run. This field will + * only be sent for expand details filter. + * + * @param {number} [jobResource.details.expectedDataSizeInTeraBytes] The + * expected size of the data, which needs to be transfered in this job, in tera + * bytes. + * + * @param {array} [jobResource.details.jobStages] List of stages that run in + * the job. + * + * @param {object} jobResource.details.contactDetails Contact details for + * notification and shipping. + * + * @param {string} [jobResource.details.contactDetails.contactName] Contact + * name of the person. + * + * @param {string} jobResource.details.contactDetails.phone Phone number of the + * contact person. + * + * @param {string} [jobResource.details.contactDetails.phoneExtension] Phone + * extension number of the contact person. + * + * @param {string} [jobResource.details.contactDetails.mobile] Mobile number of + * the contact person. + * + * @param {array} jobResource.details.contactDetails.emailList List of + * Email-ids to be notified about job progress. + * + * @param {array} [jobResource.details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * + * @param {object} jobResource.details.shippingAddress Shipping address of the + * customer. + * + * @param {string} jobResource.details.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} [jobResource.details.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} [jobResource.details.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [jobResource.details.shippingAddress.city] Name of the City. + * + * @param {string} [jobResource.details.shippingAddress.stateOrProvince] Name + * of the State or Province. + * + * @param {string} jobResource.details.shippingAddress.country Name of the + * Country. + * + * @param {string} jobResource.details.shippingAddress.postalCode Postal code. + * + * @param {string} [jobResource.details.shippingAddress.zipExtendedCode] + * Extended Zip Code. + * + * @param {string} [jobResource.details.shippingAddress.companyName] Name of + * the company. + * + * @param {string} [jobResource.details.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {array} [jobResource.details.errorDetails] Error details for failure. + * This is optional. + * + * @param {string} jobResource.details.jobDetailsType Polymorphic Discriminator + * + * @param {string} [jobResource.cancellationReason] Reason for cancellation. + * + * @param {string} jobResource.location The location of the resource. This will + * be one of the supported and registered Azure Regions (e.g. West US, East US, + * Southeast Asia, etc.). The region of a resource cannot be changed once it is + * created, but if an identical region is specified on update the request will + * succeed. + * + * @param {object} [jobResource.tags] The list of key value pairs that describe + * the resource. These tags can be used in viewing and grouping this resource + * (across resource groups). + * + * @param {object} jobResource.sku The sku type. + * + * @param {string} jobResource.sku.name The sku name. + * + * @param {string} [jobResource.sku.displayName] The display name of the sku. + * + * @param {string} [jobResource.sku.family] The sku family. + * + * @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. + */ + createWithHttpOperationResponse(resourceGroupName: string, jobName: string, jobResource: models.JobResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates a new job with the specified parameters. Existing job cannot be + * updated with this API and should instead be updated with the Update job API. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} jobResource Job details from request body. + * + * @param {string} [jobResource.deviceType] Type of the device to be used for + * the job. Possible values include: 'Pod', 'Disk', 'Cabinet' + * + * @param {boolean} [jobResource.isCancellable] Describes whether the job is + * cancellable or not. + * + * @param {boolean} [jobResource.isShippingAddressEditable] Describes whether + * the shipping address is editable or not. + * + * @param {string} [jobResource.status] Name of the stage which is in progress. + * Possible values include: 'DeviceOrdered', 'DevicePrepared', 'Dispatched', + * 'Delivered', 'PickedUp', 'AtAzureDC', 'DataCopy', 'Completed', + * 'CompletedWithErrors', 'Cancelled', 'Failed_IssueReportedAtCustomer', + * 'Failed_IssueDetectedAtAzureDC', 'Aborted' + * + * @param {date} [jobResource.startTime] Time at which the job was started in + * UTC ISO 8601 format. + * + * @param {object} [jobResource.error] Top level error for the job. + * + * @param {string} jobResource.error.code Error code that can be used to + * programmatically identify the error. + * + * @param {string} [jobResource.error.message] Describes the error in detail + * and provides debugging information. + * + * @param {object} [jobResource.deliveryPackage] Delivery package shipping + * details. + * + * @param {object} [jobResource.returnPackage] Return package shipping details. + * + * @param {string} [jobResource.returnPackage.carrierName] Name of the carrier. + * + * @param {string} [jobResource.returnPackage.trackingId] Tracking Id of + * shipment. + * + * @param {string} [jobResource.returnPackage.trackingUrl] Url where shipment + * can be tracked. + * + * @param {array} jobResource.destinationAccountDetails Destination account + * details. + * + * @param {object} [jobResource.details] Details of a job run. This field will + * only be sent for expand details filter. + * + * @param {number} [jobResource.details.expectedDataSizeInTeraBytes] The + * expected size of the data, which needs to be transfered in this job, in tera + * bytes. + * + * @param {array} [jobResource.details.jobStages] List of stages that run in + * the job. + * + * @param {object} jobResource.details.contactDetails Contact details for + * notification and shipping. + * + * @param {string} [jobResource.details.contactDetails.contactName] Contact + * name of the person. + * + * @param {string} jobResource.details.contactDetails.phone Phone number of the + * contact person. + * + * @param {string} [jobResource.details.contactDetails.phoneExtension] Phone + * extension number of the contact person. + * + * @param {string} [jobResource.details.contactDetails.mobile] Mobile number of + * the contact person. + * + * @param {array} jobResource.details.contactDetails.emailList List of + * Email-ids to be notified about job progress. + * + * @param {array} [jobResource.details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * + * @param {object} jobResource.details.shippingAddress Shipping address of the + * customer. + * + * @param {string} jobResource.details.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} [jobResource.details.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} [jobResource.details.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [jobResource.details.shippingAddress.city] Name of the City. + * + * @param {string} [jobResource.details.shippingAddress.stateOrProvince] Name + * of the State or Province. + * + * @param {string} jobResource.details.shippingAddress.country Name of the + * Country. + * + * @param {string} jobResource.details.shippingAddress.postalCode Postal code. + * + * @param {string} [jobResource.details.shippingAddress.zipExtendedCode] + * Extended Zip Code. + * + * @param {string} [jobResource.details.shippingAddress.companyName] Name of + * the company. + * + * @param {string} [jobResource.details.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {array} [jobResource.details.errorDetails] Error details for failure. + * This is optional. + * + * @param {string} jobResource.details.jobDetailsType Polymorphic Discriminator + * + * @param {string} [jobResource.cancellationReason] Reason for cancellation. + * + * @param {string} jobResource.location The location of the resource. This will + * be one of the supported and registered Azure Regions (e.g. West US, East US, + * Southeast Asia, etc.). The region of a resource cannot be changed once it is + * created, but if an identical region is specified on update the request will + * succeed. + * + * @param {object} [jobResource.tags] The list of key value pairs that describe + * the resource. These tags can be used in viewing and grouping this resource + * (across resource groups). + * + * @param {object} jobResource.sku The sku type. + * + * @param {string} jobResource.sku.name The sku name. + * + * @param {string} [jobResource.sku.displayName] The display name of the sku. + * + * @param {string} [jobResource.sku.family] The sku family. + * + * @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 {JobResource} - 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. + * + * {JobResource} [result] - The deserialized result object if an error did not occur. + * See {@link JobResource} 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. + */ + create(resourceGroupName: string, jobName: string, jobResource: models.JobResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + create(resourceGroupName: string, jobName: string, jobResource: models.JobResource, callback: ServiceCallback): void; + create(resourceGroupName: string, jobName: string, jobResource: models.JobResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes a job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes a job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(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; + + + /** + * Updates the properties of an existing job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} jobResourceUpdateParameter Job update parameters from + * request body. + * + * @param {object} jobResourceUpdateParameter.details Details of a job to be + * updated. + * + * @param {object} [jobResourceUpdateParameter.details.contactDetails] Contact + * details for notification and shipping. + * + * @param {string} + * [jobResourceUpdateParameter.details.contactDetails.contactName] Contact name + * of the person. + * + * @param {string} jobResourceUpdateParameter.details.contactDetails.phone + * Phone number of the contact person. + * + * @param {string} + * [jobResourceUpdateParameter.details.contactDetails.phoneExtension] Phone + * extension number of the contact person. + * + * @param {string} [jobResourceUpdateParameter.details.contactDetails.mobile] + * Mobile number of the contact person. + * + * @param {array} jobResourceUpdateParameter.details.contactDetails.emailList + * List of Email-ids to be notified about job progress. + * + * @param {array} + * [jobResourceUpdateParameter.details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * + * @param {object} [jobResourceUpdateParameter.details.shippingAddress] + * Shipping address of the customer. + * + * @param {string} + * jobResourceUpdateParameter.details.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [jobResourceUpdateParameter.details.shippingAddress.city] + * Name of the City. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.stateOrProvince] Name of + * the State or Province. + * + * @param {string} jobResourceUpdateParameter.details.shippingAddress.country + * Name of the Country. + * + * @param {string} + * jobResourceUpdateParameter.details.shippingAddress.postalCode Postal code. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.zipExtendedCode] + * Extended Zip Code. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.companyName] Name of the + * company. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {object} [jobResourceUpdateParameter.tags] The list of key value + * pairs that describe the resource. These tags can be used in viewing and + * grouping this resource (across resource groups). + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.ifMatch] Defines the If-Match condition. The patch + * will be performed only if the ETag of the job on the server matches this + * value. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName: string, jobName: string, jobResourceUpdateParameter: models.JobResourceUpdateParameter, options?: { ifMatch? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates the properties of an existing job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} jobResourceUpdateParameter Job update parameters from + * request body. + * + * @param {object} jobResourceUpdateParameter.details Details of a job to be + * updated. + * + * @param {object} [jobResourceUpdateParameter.details.contactDetails] Contact + * details for notification and shipping. + * + * @param {string} + * [jobResourceUpdateParameter.details.contactDetails.contactName] Contact name + * of the person. + * + * @param {string} jobResourceUpdateParameter.details.contactDetails.phone + * Phone number of the contact person. + * + * @param {string} + * [jobResourceUpdateParameter.details.contactDetails.phoneExtension] Phone + * extension number of the contact person. + * + * @param {string} [jobResourceUpdateParameter.details.contactDetails.mobile] + * Mobile number of the contact person. + * + * @param {array} jobResourceUpdateParameter.details.contactDetails.emailList + * List of Email-ids to be notified about job progress. + * + * @param {array} + * [jobResourceUpdateParameter.details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * + * @param {object} [jobResourceUpdateParameter.details.shippingAddress] + * Shipping address of the customer. + * + * @param {string} + * jobResourceUpdateParameter.details.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [jobResourceUpdateParameter.details.shippingAddress.city] + * Name of the City. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.stateOrProvince] Name of + * the State or Province. + * + * @param {string} jobResourceUpdateParameter.details.shippingAddress.country + * Name of the Country. + * + * @param {string} + * jobResourceUpdateParameter.details.shippingAddress.postalCode Postal code. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.zipExtendedCode] + * Extended Zip Code. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.companyName] Name of the + * company. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {object} [jobResourceUpdateParameter.tags] The list of key value + * pairs that describe the resource. These tags can be used in viewing and + * grouping this resource (across resource groups). + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.ifMatch] Defines the If-Match condition. The patch + * will be performed only if the ETag of the job on the server matches this + * value. + * + * @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 {JobResource} - 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. + * + * {JobResource} [result] - The deserialized result object if an error did not occur. + * See {@link JobResource} 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, jobResourceUpdateParameter: models.JobResourceUpdateParameter, options?: { ifMatch? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, jobName: string, jobResourceUpdateParameter: models.JobResourceUpdateParameter, callback: ServiceCallback): void; + update(resourceGroupName: string, jobName: string, jobResourceUpdateParameter: models.JobResourceUpdateParameter, options: { ifMatch? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Book shipment pick up. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} shipmentPickUpRequest Details of shipment pick up request. + * + * @param {date} [shipmentPickUpRequest.startTime] Minimum date after which the + * pick up should commence, this must be in local time of pick up area. + * + * @param {date} [shipmentPickUpRequest.endTime] Maximum date before which the + * pick up should commence, this must be in local time of pick up area. + * + * @param {string} [shipmentPickUpRequest.shipmentLocation] Shipment Location + * in the pickup place. Eg.front desk + * + * @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. + */ + bookShipmentPickUpWithHttpOperationResponse(resourceGroupName: string, jobName: string, shipmentPickUpRequest: models.ShipmentPickUpRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Book shipment pick up. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} shipmentPickUpRequest Details of shipment pick up request. + * + * @param {date} [shipmentPickUpRequest.startTime] Minimum date after which the + * pick up should commence, this must be in local time of pick up area. + * + * @param {date} [shipmentPickUpRequest.endTime] Maximum date before which the + * pick up should commence, this must be in local time of pick up area. + * + * @param {string} [shipmentPickUpRequest.shipmentLocation] Shipment Location + * in the pickup place. Eg.front desk + * + * @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 {ShipmentPickUpResponse} - 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. + * + * {ShipmentPickUpResponse} [result] - The deserialized result object if an error did not occur. + * See {@link ShipmentPickUpResponse} 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. + */ + bookShipmentPickUp(resourceGroupName: string, jobName: string, shipmentPickUpRequest: models.ShipmentPickUpRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + bookShipmentPickUp(resourceGroupName: string, jobName: string, shipmentPickUpRequest: models.ShipmentPickUpRequest, callback: ServiceCallback): void; + bookShipmentPickUp(resourceGroupName: string, jobName: string, shipmentPickUpRequest: models.ShipmentPickUpRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * CancelJob. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} cancellationReason Reason for cancellation. + * + * @param {string} cancellationReason.reason Reason for cancellation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + cancelWithHttpOperationResponse(resourceGroupName: string, jobName: string, cancellationReason: models.CancellationReason, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * CancelJob. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} cancellationReason Reason for cancellation. + * + * @param {string} cancellationReason.reason Reason for cancellation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + cancel(resourceGroupName: string, jobName: string, cancellationReason: models.CancellationReason, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + cancel(resourceGroupName: string, jobName: string, cancellationReason: models.CancellationReason, callback: ServiceCallback): void; + cancel(resourceGroupName: string, jobName: string, cancellationReason: models.CancellationReason, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Provides list of copy logs uri. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @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. + */ + getCopyLogsUriWithHttpOperationResponse(resourceGroupName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Provides list of copy logs uri. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @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 {GetCopyLogsUriOutput} - 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. + * + * {GetCopyLogsUriOutput} [result] - The deserialized result object if an error did not occur. + * See {@link GetCopyLogsUriOutput} 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. + */ + getCopyLogsUri(resourceGroupName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getCopyLogsUri(resourceGroupName: string, jobName: string, callback: ServiceCallback): void; + getCopyLogsUri(resourceGroupName: string, jobName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Get shipping label sas uri. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @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. + */ + downloadShippingLabelUriWithHttpOperationResponse(resourceGroupName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Get shipping label sas uri. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @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 {ShippingLabelDetails} - 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. + * + * {ShippingLabelDetails} [result] - The deserialized result object if an error did not occur. + * See {@link ShippingLabelDetails} 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. + */ + downloadShippingLabelUri(resourceGroupName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + downloadShippingLabelUri(resourceGroupName: string, jobName: string, callback: ServiceCallback): void; + downloadShippingLabelUri(resourceGroupName: string, jobName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * This method gets the unencrypted secrets related to the job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @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. + */ + listSecretsWithHttpOperationResponse(resourceGroupName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * This method gets the unencrypted secrets related to the job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @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 {UnencryptedSecrets} - 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. + * + * {UnencryptedSecrets} [result] - The deserialized result object if an error did not occur. + * See {@link UnencryptedSecrets} 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. + */ + listSecrets(resourceGroupName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSecrets(resourceGroupName: string, jobName: string, callback: ServiceCallback): void; + listSecrets(resourceGroupName: string, jobName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Reports an issue. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} reportIssueDetails Details of reported issue. + * + * @param {string} [reportIssueDetails.issueType] Issue Type. Possible values + * include: 'DeviceMismatch', 'ValidationStringMismatch', + * 'CredentialNotWorking', 'DeviceFailure' + * + * @param {string} [reportIssueDetails.deviceIssueType] Device Issue Type. Only + * used for Device failure issue. Possible values include: 'DeviceTampering', + * 'DeviceNotBootingUp', 'DeviceHealthCheckShowFailures', 'NICsAreNotWorking', + * 'Misc' + * + * @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. + */ + reportIssueWithHttpOperationResponse(resourceGroupName: string, jobName: string, reportIssueDetails: models.ReportIssueDetails, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Reports an issue. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} reportIssueDetails Details of reported issue. + * + * @param {string} [reportIssueDetails.issueType] Issue Type. Possible values + * include: 'DeviceMismatch', 'ValidationStringMismatch', + * 'CredentialNotWorking', 'DeviceFailure' + * + * @param {string} [reportIssueDetails.deviceIssueType] Device Issue Type. Only + * used for Device failure issue. Possible values include: 'DeviceTampering', + * 'DeviceNotBootingUp', 'DeviceHealthCheckShowFailures', 'NICsAreNotWorking', + * 'Misc' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + reportIssue(resourceGroupName: string, jobName: string, reportIssueDetails: models.ReportIssueDetails, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + reportIssue(resourceGroupName: string, jobName: string, reportIssueDetails: models.ReportIssueDetails, callback: ServiceCallback): void; + reportIssue(resourceGroupName: string, jobName: string, reportIssueDetails: models.ReportIssueDetails, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates a new job with the specified parameters. Existing job cannot be + * updated with this API and should instead be updated with the Update job API. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} jobResource Job details from request body. + * + * @param {string} [jobResource.deviceType] Type of the device to be used for + * the job. Possible values include: 'Pod', 'Disk', 'Cabinet' + * + * @param {boolean} [jobResource.isCancellable] Describes whether the job is + * cancellable or not. + * + * @param {boolean} [jobResource.isShippingAddressEditable] Describes whether + * the shipping address is editable or not. + * + * @param {string} [jobResource.status] Name of the stage which is in progress. + * Possible values include: 'DeviceOrdered', 'DevicePrepared', 'Dispatched', + * 'Delivered', 'PickedUp', 'AtAzureDC', 'DataCopy', 'Completed', + * 'CompletedWithErrors', 'Cancelled', 'Failed_IssueReportedAtCustomer', + * 'Failed_IssueDetectedAtAzureDC', 'Aborted' + * + * @param {date} [jobResource.startTime] Time at which the job was started in + * UTC ISO 8601 format. + * + * @param {object} [jobResource.error] Top level error for the job. + * + * @param {string} jobResource.error.code Error code that can be used to + * programmatically identify the error. + * + * @param {string} [jobResource.error.message] Describes the error in detail + * and provides debugging information. + * + * @param {object} [jobResource.deliveryPackage] Delivery package shipping + * details. + * + * @param {object} [jobResource.returnPackage] Return package shipping details. + * + * @param {string} [jobResource.returnPackage.carrierName] Name of the carrier. + * + * @param {string} [jobResource.returnPackage.trackingId] Tracking Id of + * shipment. + * + * @param {string} [jobResource.returnPackage.trackingUrl] Url where shipment + * can be tracked. + * + * @param {array} jobResource.destinationAccountDetails Destination account + * details. + * + * @param {object} [jobResource.details] Details of a job run. This field will + * only be sent for expand details filter. + * + * @param {number} [jobResource.details.expectedDataSizeInTeraBytes] The + * expected size of the data, which needs to be transfered in this job, in tera + * bytes. + * + * @param {array} [jobResource.details.jobStages] List of stages that run in + * the job. + * + * @param {object} jobResource.details.contactDetails Contact details for + * notification and shipping. + * + * @param {string} [jobResource.details.contactDetails.contactName] Contact + * name of the person. + * + * @param {string} jobResource.details.contactDetails.phone Phone number of the + * contact person. + * + * @param {string} [jobResource.details.contactDetails.phoneExtension] Phone + * extension number of the contact person. + * + * @param {string} [jobResource.details.contactDetails.mobile] Mobile number of + * the contact person. + * + * @param {array} jobResource.details.contactDetails.emailList List of + * Email-ids to be notified about job progress. + * + * @param {array} [jobResource.details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * + * @param {object} jobResource.details.shippingAddress Shipping address of the + * customer. + * + * @param {string} jobResource.details.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} [jobResource.details.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} [jobResource.details.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [jobResource.details.shippingAddress.city] Name of the City. + * + * @param {string} [jobResource.details.shippingAddress.stateOrProvince] Name + * of the State or Province. + * + * @param {string} jobResource.details.shippingAddress.country Name of the + * Country. + * + * @param {string} jobResource.details.shippingAddress.postalCode Postal code. + * + * @param {string} [jobResource.details.shippingAddress.zipExtendedCode] + * Extended Zip Code. + * + * @param {string} [jobResource.details.shippingAddress.companyName] Name of + * the company. + * + * @param {string} [jobResource.details.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {array} [jobResource.details.errorDetails] Error details for failure. + * This is optional. + * + * @param {string} jobResource.details.jobDetailsType Polymorphic Discriminator + * + * @param {string} [jobResource.cancellationReason] Reason for cancellation. + * + * @param {string} jobResource.location The location of the resource. This will + * be one of the supported and registered Azure Regions (e.g. West US, East US, + * Southeast Asia, etc.). The region of a resource cannot be changed once it is + * created, but if an identical region is specified on update the request will + * succeed. + * + * @param {object} [jobResource.tags] The list of key value pairs that describe + * the resource. These tags can be used in viewing and grouping this resource + * (across resource groups). + * + * @param {object} jobResource.sku The sku type. + * + * @param {string} jobResource.sku.name The sku name. + * + * @param {string} [jobResource.sku.displayName] The display name of the sku. + * + * @param {string} [jobResource.sku.family] The sku family. + * + * @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. + */ + beginCreateWithHttpOperationResponse(resourceGroupName: string, jobName: string, jobResource: models.JobResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates a new job with the specified parameters. Existing job cannot be + * updated with this API and should instead be updated with the Update job API. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} jobResource Job details from request body. + * + * @param {string} [jobResource.deviceType] Type of the device to be used for + * the job. Possible values include: 'Pod', 'Disk', 'Cabinet' + * + * @param {boolean} [jobResource.isCancellable] Describes whether the job is + * cancellable or not. + * + * @param {boolean} [jobResource.isShippingAddressEditable] Describes whether + * the shipping address is editable or not. + * + * @param {string} [jobResource.status] Name of the stage which is in progress. + * Possible values include: 'DeviceOrdered', 'DevicePrepared', 'Dispatched', + * 'Delivered', 'PickedUp', 'AtAzureDC', 'DataCopy', 'Completed', + * 'CompletedWithErrors', 'Cancelled', 'Failed_IssueReportedAtCustomer', + * 'Failed_IssueDetectedAtAzureDC', 'Aborted' + * + * @param {date} [jobResource.startTime] Time at which the job was started in + * UTC ISO 8601 format. + * + * @param {object} [jobResource.error] Top level error for the job. + * + * @param {string} jobResource.error.code Error code that can be used to + * programmatically identify the error. + * + * @param {string} [jobResource.error.message] Describes the error in detail + * and provides debugging information. + * + * @param {object} [jobResource.deliveryPackage] Delivery package shipping + * details. + * + * @param {object} [jobResource.returnPackage] Return package shipping details. + * + * @param {string} [jobResource.returnPackage.carrierName] Name of the carrier. + * + * @param {string} [jobResource.returnPackage.trackingId] Tracking Id of + * shipment. + * + * @param {string} [jobResource.returnPackage.trackingUrl] Url where shipment + * can be tracked. + * + * @param {array} jobResource.destinationAccountDetails Destination account + * details. + * + * @param {object} [jobResource.details] Details of a job run. This field will + * only be sent for expand details filter. + * + * @param {number} [jobResource.details.expectedDataSizeInTeraBytes] The + * expected size of the data, which needs to be transfered in this job, in tera + * bytes. + * + * @param {array} [jobResource.details.jobStages] List of stages that run in + * the job. + * + * @param {object} jobResource.details.contactDetails Contact details for + * notification and shipping. + * + * @param {string} [jobResource.details.contactDetails.contactName] Contact + * name of the person. + * + * @param {string} jobResource.details.contactDetails.phone Phone number of the + * contact person. + * + * @param {string} [jobResource.details.contactDetails.phoneExtension] Phone + * extension number of the contact person. + * + * @param {string} [jobResource.details.contactDetails.mobile] Mobile number of + * the contact person. + * + * @param {array} jobResource.details.contactDetails.emailList List of + * Email-ids to be notified about job progress. + * + * @param {array} [jobResource.details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * + * @param {object} jobResource.details.shippingAddress Shipping address of the + * customer. + * + * @param {string} jobResource.details.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} [jobResource.details.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} [jobResource.details.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [jobResource.details.shippingAddress.city] Name of the City. + * + * @param {string} [jobResource.details.shippingAddress.stateOrProvince] Name + * of the State or Province. + * + * @param {string} jobResource.details.shippingAddress.country Name of the + * Country. + * + * @param {string} jobResource.details.shippingAddress.postalCode Postal code. + * + * @param {string} [jobResource.details.shippingAddress.zipExtendedCode] + * Extended Zip Code. + * + * @param {string} [jobResource.details.shippingAddress.companyName] Name of + * the company. + * + * @param {string} [jobResource.details.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {array} [jobResource.details.errorDetails] Error details for failure. + * This is optional. + * + * @param {string} jobResource.details.jobDetailsType Polymorphic Discriminator + * + * @param {string} [jobResource.cancellationReason] Reason for cancellation. + * + * @param {string} jobResource.location The location of the resource. This will + * be one of the supported and registered Azure Regions (e.g. West US, East US, + * Southeast Asia, etc.). The region of a resource cannot be changed once it is + * created, but if an identical region is specified on update the request will + * succeed. + * + * @param {object} [jobResource.tags] The list of key value pairs that describe + * the resource. These tags can be used in viewing and grouping this resource + * (across resource groups). + * + * @param {object} jobResource.sku The sku type. + * + * @param {string} jobResource.sku.name The sku name. + * + * @param {string} [jobResource.sku.displayName] The display name of the sku. + * + * @param {string} [jobResource.sku.family] The sku family. + * + * @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 {JobResource} - 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. + * + * {JobResource} [result] - The deserialized result object if an error did not occur. + * See {@link JobResource} 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. + */ + beginCreate(resourceGroupName: string, jobName: string, jobResource: models.JobResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreate(resourceGroupName: string, jobName: string, jobResource: models.JobResource, callback: ServiceCallback): void; + beginCreate(resourceGroupName: string, jobName: string, jobResource: models.JobResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates the properties of an existing job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} jobResourceUpdateParameter Job update parameters from + * request body. + * + * @param {object} jobResourceUpdateParameter.details Details of a job to be + * updated. + * + * @param {object} [jobResourceUpdateParameter.details.contactDetails] Contact + * details for notification and shipping. + * + * @param {string} + * [jobResourceUpdateParameter.details.contactDetails.contactName] Contact name + * of the person. + * + * @param {string} jobResourceUpdateParameter.details.contactDetails.phone + * Phone number of the contact person. + * + * @param {string} + * [jobResourceUpdateParameter.details.contactDetails.phoneExtension] Phone + * extension number of the contact person. + * + * @param {string} [jobResourceUpdateParameter.details.contactDetails.mobile] + * Mobile number of the contact person. + * + * @param {array} jobResourceUpdateParameter.details.contactDetails.emailList + * List of Email-ids to be notified about job progress. + * + * @param {array} + * [jobResourceUpdateParameter.details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * + * @param {object} [jobResourceUpdateParameter.details.shippingAddress] + * Shipping address of the customer. + * + * @param {string} + * jobResourceUpdateParameter.details.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [jobResourceUpdateParameter.details.shippingAddress.city] + * Name of the City. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.stateOrProvince] Name of + * the State or Province. + * + * @param {string} jobResourceUpdateParameter.details.shippingAddress.country + * Name of the Country. + * + * @param {string} + * jobResourceUpdateParameter.details.shippingAddress.postalCode Postal code. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.zipExtendedCode] + * Extended Zip Code. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.companyName] Name of the + * company. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {object} [jobResourceUpdateParameter.tags] The list of key value + * pairs that describe the resource. These tags can be used in viewing and + * grouping this resource (across resource groups). + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.ifMatch] Defines the If-Match condition. The patch + * will be performed only if the ETag of the job on the server matches this + * value. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginUpdateWithHttpOperationResponse(resourceGroupName: string, jobName: string, jobResourceUpdateParameter: models.JobResourceUpdateParameter, options?: { ifMatch? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates the properties of an existing job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} jobResourceUpdateParameter Job update parameters from + * request body. + * + * @param {object} jobResourceUpdateParameter.details Details of a job to be + * updated. + * + * @param {object} [jobResourceUpdateParameter.details.contactDetails] Contact + * details for notification and shipping. + * + * @param {string} + * [jobResourceUpdateParameter.details.contactDetails.contactName] Contact name + * of the person. + * + * @param {string} jobResourceUpdateParameter.details.contactDetails.phone + * Phone number of the contact person. + * + * @param {string} + * [jobResourceUpdateParameter.details.contactDetails.phoneExtension] Phone + * extension number of the contact person. + * + * @param {string} [jobResourceUpdateParameter.details.contactDetails.mobile] + * Mobile number of the contact person. + * + * @param {array} jobResourceUpdateParameter.details.contactDetails.emailList + * List of Email-ids to be notified about job progress. + * + * @param {array} + * [jobResourceUpdateParameter.details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * + * @param {object} [jobResourceUpdateParameter.details.shippingAddress] + * Shipping address of the customer. + * + * @param {string} + * jobResourceUpdateParameter.details.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [jobResourceUpdateParameter.details.shippingAddress.city] + * Name of the City. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.stateOrProvince] Name of + * the State or Province. + * + * @param {string} jobResourceUpdateParameter.details.shippingAddress.country + * Name of the Country. + * + * @param {string} + * jobResourceUpdateParameter.details.shippingAddress.postalCode Postal code. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.zipExtendedCode] + * Extended Zip Code. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.companyName] Name of the + * company. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {object} [jobResourceUpdateParameter.tags] The list of key value + * pairs that describe the resource. These tags can be used in viewing and + * grouping this resource (across resource groups). + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.ifMatch] Defines the If-Match condition. The patch + * will be performed only if the ETag of the job on the server matches this + * value. + * + * @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 {JobResource} - 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. + * + * {JobResource} [result] - The deserialized result object if an error did not occur. + * See {@link JobResource} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdate(resourceGroupName: string, jobName: string, jobResourceUpdateParameter: models.JobResourceUpdateParameter, options?: { ifMatch? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, jobName: string, jobResourceUpdateParameter: models.JobResourceUpdateParameter, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, jobName: string, jobResourceUpdateParameter: models.JobResourceUpdateParameter, options: { ifMatch? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all the jobs available under the subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all the jobs available under the subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {JobResourceList} - 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. + * + * {JobResourceList} [result] - The deserialized result object if an error did not occur. + * See {@link JobResourceList} 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; + + + /** + * Lists all the jobs available under the given resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all the jobs available under the given resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {JobResourceList} - 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. + * + * {JobResourceList} [result] - The deserialized result object if an error did not occur. + * See {@link JobResourceList} 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; +} + +/** + * @class + * Service + * __NOTE__: An instance of this class is automatically created for an + * instance of the DataBoxManagementClient. + */ +export interface Service { + + + /** + * This method provides the list of available skus for the given subscription + * and location. + * + * @param {string} location The location of the resource + * + * @param {object} availableSkuRequest Filters for showing the available skus. + * + * @param {string} availableSkuRequest.country ISO country code. Country for + * hardware shipment. For codes check: + * https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + * + * @param {string} availableSkuRequest.location Location for data transfer. For + * locations check: + * https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + * + * @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. + */ + listAvailableSkusWithHttpOperationResponse(location: string, availableSkuRequest: models.AvailableSkuRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * This method provides the list of available skus for the given subscription + * and location. + * + * @param {string} location The location of the resource + * + * @param {object} availableSkuRequest Filters for showing the available skus. + * + * @param {string} availableSkuRequest.country ISO country code. Country for + * hardware shipment. For codes check: + * https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + * + * @param {string} availableSkuRequest.location Location for data transfer. For + * locations check: + * https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + * + * @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 {AvailableSkusResult} - 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. + * + * {AvailableSkusResult} [result] - The deserialized result object if an error did not occur. + * See {@link AvailableSkusResult} 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. + */ + listAvailableSkus(location: string, availableSkuRequest: models.AvailableSkuRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAvailableSkus(location: string, availableSkuRequest: models.AvailableSkuRequest, callback: ServiceCallback): void; + listAvailableSkus(location: string, availableSkuRequest: models.AvailableSkuRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * This method validates the customer shipping address and provide alternate + * addresses if any. + * + * @param {string} location The location of the resource + * + * @param {object} validateAddress Shipping address of the customer. + * + * @param {object} [validateAddress.shippingAddress] Shipping address of the + * customer. + * + * @param {string} validateAddress.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} [validateAddress.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} [validateAddress.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [validateAddress.shippingAddress.city] Name of the City. + * + * @param {string} [validateAddress.shippingAddress.stateOrProvince] Name of + * the State or Province. + * + * @param {string} validateAddress.shippingAddress.country Name of the Country. + * + * @param {string} validateAddress.shippingAddress.postalCode Postal code. + * + * @param {string} [validateAddress.shippingAddress.zipExtendedCode] Extended + * Zip Code. + * + * @param {string} [validateAddress.shippingAddress.companyName] Name of the + * company. + * + * @param {string} [validateAddress.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {string} [validateAddress.deviceType] Device type to be used for the + * job. Possible values include: 'Pod', 'Disk', 'Cabinet' + * + * @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. + */ + validateAddressMethodWithHttpOperationResponse(location: string, validateAddress: models.ValidateAddress, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * This method validates the customer shipping address and provide alternate + * addresses if any. + * + * @param {string} location The location of the resource + * + * @param {object} validateAddress Shipping address of the customer. + * + * @param {object} [validateAddress.shippingAddress] Shipping address of the + * customer. + * + * @param {string} validateAddress.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} [validateAddress.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} [validateAddress.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [validateAddress.shippingAddress.city] Name of the City. + * + * @param {string} [validateAddress.shippingAddress.stateOrProvince] Name of + * the State or Province. + * + * @param {string} validateAddress.shippingAddress.country Name of the Country. + * + * @param {string} validateAddress.shippingAddress.postalCode Postal code. + * + * @param {string} [validateAddress.shippingAddress.zipExtendedCode] Extended + * Zip Code. + * + * @param {string} [validateAddress.shippingAddress.companyName] Name of the + * company. + * + * @param {string} [validateAddress.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {string} [validateAddress.deviceType] Device type to be used for the + * job. Possible values include: 'Pod', 'Disk', 'Cabinet' + * + * @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 {AddressValidationOutput} - 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. + * + * {AddressValidationOutput} [result] - The deserialized result object if an error did not occur. + * See {@link AddressValidationOutput} 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. + */ + validateAddressMethod(location: string, validateAddress: models.ValidateAddress, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + validateAddressMethod(location: string, validateAddress: models.ValidateAddress, callback: ServiceCallback): void; + validateAddressMethod(location: string, validateAddress: models.ValidateAddress, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * This method provides the list of available skus for the given subscription + * and location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listAvailableSkusNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * This method provides the list of available skus for the given subscription + * and location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {AvailableSkusResult} - 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. + * + * {AvailableSkusResult} [result] - The deserialized result object if an error did not occur. + * See {@link AvailableSkusResult} 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. + */ + listAvailableSkusNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAvailableSkusNext(nextPageLink: string, callback: ServiceCallback): void; + listAvailableSkusNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} diff --git a/lib/services/databox/lib/lib/operations/index.js b/lib/services/databox/lib/lib/operations/index.js new file mode 100644 index 0000000000..9ece56c7e9 --- /dev/null +++ b/lib/services/databox/lib/lib/operations/index.js @@ -0,0 +1,19 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +/* jshint latedef:false */ +/* jshint forin:false */ +/* jshint noempty:false */ + +'use strict'; + +exports.Operations = require('./operations'); +exports.Jobs = require('./jobs'); +exports.Service = require('./service'); diff --git a/lib/services/databox/lib/lib/operations/jobs.js b/lib/services/databox/lib/lib/operations/jobs.js new file mode 100644 index 0000000000..ec67d62513 --- /dev/null +++ b/lib/services/databox/lib/lib/operations/jobs.js @@ -0,0 +1,5172 @@ +/* + * 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; + +/** + * Lists all the jobs available under the subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.skipToken] $skipToken is supported on Get list of + * jobs, which provides the next page in the list of jobs. + * + * @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 JobResourceList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let skipToken = (options && options.skipToken !== undefined) ? options.skipToken : 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (skipToken !== null && skipToken !== undefined && typeof skipToken.valueOf() !== 'string') { + throw new Error('skipToken must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (skipToken !== null && skipToken !== undefined) { + queryParameters.push('$skipToken=' + encodeURIComponent(skipToken)); + } + 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().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['JobResourceList']().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 all the jobs available under the given resource group. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.skipToken] $skipToken is supported on Get list of + * jobs, which provides the next page in the list of jobs. + * + * @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 JobResourceList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByResourceGroup(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.'); + } + let skipToken = (options && options.skipToken !== undefined) ? options.skipToken : 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 (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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (skipToken !== null && skipToken !== undefined && typeof skipToken.valueOf() !== 'string') { + throw new Error('skipToken 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.DataBox/jobs'; + 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 (skipToken !== null && skipToken !== undefined) { + queryParameters.push('$skipToken=' + encodeURIComponent(skipToken)); + } + 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().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['JobResourceList']().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 information about the specified job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] $expand is supported on details parameter + * for job, which provides details on the job stages. + * + * @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 JobResource} 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) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let expand = (options && options.expand !== undefined) ? options.expand : undefined; + // 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 (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 (jobName !== null && jobName !== undefined) { + if (jobName.length > 24) + { + throw new Error('"jobName" should satisfy the constraint - "MaxLength": 24'); + } + if (jobName.length < 3) + { + throw new Error('"jobName" should satisfy the constraint - "MinLength": 3'); + } + if (jobName.match(/^[-\w\.]+$/) === null) + { + throw new Error('"jobName" should satisfy the constraint - "Pattern": /^[-\w\.]+$/'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { + throw new Error('expand 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.DataBox/jobs/{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 (expand !== null && expand !== undefined) { + queryParameters.push('$expand=' + encodeURIComponent(expand)); + } + 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().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['JobResource']().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); + }); +} + + +/** + * Creates a new job with the specified parameters. Existing job cannot be + * updated with this API and should instead be updated with the Update job API. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} jobResource Job details from request body. + * + * @param {string} [jobResource.deviceType] Type of the device to be used for + * the job. Possible values include: 'Pod', 'Disk', 'Cabinet' + * + * @param {boolean} [jobResource.isCancellable] Describes whether the job is + * cancellable or not. + * + * @param {boolean} [jobResource.isShippingAddressEditable] Describes whether + * the shipping address is editable or not. + * + * @param {string} [jobResource.status] Name of the stage which is in progress. + * Possible values include: 'DeviceOrdered', 'DevicePrepared', 'Dispatched', + * 'Delivered', 'PickedUp', 'AtAzureDC', 'DataCopy', 'Completed', + * 'CompletedWithErrors', 'Cancelled', 'Failed_IssueReportedAtCustomer', + * 'Failed_IssueDetectedAtAzureDC', 'Aborted' + * + * @param {date} [jobResource.startTime] Time at which the job was started in + * UTC ISO 8601 format. + * + * @param {object} [jobResource.error] Top level error for the job. + * + * @param {string} jobResource.error.code Error code that can be used to + * programmatically identify the error. + * + * @param {string} [jobResource.error.message] Describes the error in detail + * and provides debugging information. + * + * @param {object} [jobResource.deliveryPackage] Delivery package shipping + * details. + * + * @param {object} [jobResource.returnPackage] Return package shipping details. + * + * @param {string} [jobResource.returnPackage.carrierName] Name of the carrier. + * + * @param {string} [jobResource.returnPackage.trackingId] Tracking Id of + * shipment. + * + * @param {string} [jobResource.returnPackage.trackingUrl] Url where shipment + * can be tracked. + * + * @param {array} jobResource.destinationAccountDetails Destination account + * details. + * + * @param {object} [jobResource.details] Details of a job run. This field will + * only be sent for expand details filter. + * + * @param {number} [jobResource.details.expectedDataSizeInTeraBytes] The + * expected size of the data, which needs to be transfered in this job, in tera + * bytes. + * + * @param {array} [jobResource.details.jobStages] List of stages that run in + * the job. + * + * @param {object} jobResource.details.contactDetails Contact details for + * notification and shipping. + * + * @param {string} [jobResource.details.contactDetails.contactName] Contact + * name of the person. + * + * @param {string} jobResource.details.contactDetails.phone Phone number of the + * contact person. + * + * @param {string} [jobResource.details.contactDetails.phoneExtension] Phone + * extension number of the contact person. + * + * @param {string} [jobResource.details.contactDetails.mobile] Mobile number of + * the contact person. + * + * @param {array} jobResource.details.contactDetails.emailList List of + * Email-ids to be notified about job progress. + * + * @param {array} [jobResource.details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * + * @param {object} jobResource.details.shippingAddress Shipping address of the + * customer. + * + * @param {string} jobResource.details.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} [jobResource.details.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} [jobResource.details.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [jobResource.details.shippingAddress.city] Name of the City. + * + * @param {string} [jobResource.details.shippingAddress.stateOrProvince] Name + * of the State or Province. + * + * @param {string} jobResource.details.shippingAddress.country Name of the + * Country. + * + * @param {string} jobResource.details.shippingAddress.postalCode Postal code. + * + * @param {string} [jobResource.details.shippingAddress.zipExtendedCode] + * Extended Zip Code. + * + * @param {string} [jobResource.details.shippingAddress.companyName] Name of + * the company. + * + * @param {string} [jobResource.details.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {array} [jobResource.details.errorDetails] Error details for failure. + * This is optional. + * + * @param {string} jobResource.details.jobDetailsType Polymorphic Discriminator + * + * @param {string} [jobResource.cancellationReason] Reason for cancellation. + * + * @param {string} jobResource.location The location of the resource. This will + * be one of the supported and registered Azure Regions (e.g. West US, East US, + * Southeast Asia, etc.). The region of a resource cannot be changed once it is + * created, but if an identical region is specified on update the request will + * succeed. + * + * @param {object} [jobResource.tags] The list of key value pairs that describe + * the resource. These tags can be used in viewing and grouping this resource + * (across resource groups). + * + * @param {object} jobResource.sku The sku type. + * + * @param {string} jobResource.sku.name The sku name. + * + * @param {string} [jobResource.sku.displayName] The display name of the sku. + * + * @param {string} [jobResource.sku.family] The sku family. + * + * @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 JobResource} 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 _create(resourceGroupName, jobName, jobResource, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreate(resourceGroupName, jobName, jobResource, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['JobResource']().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); + }); + }); +} + +/** + * Deletes a job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(resourceGroupName, jobName, 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.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 (jobName !== null && jobName !== undefined) { + if (jobName.length > 24) + { + throw new Error('"jobName" should satisfy the constraint - "MaxLength": 24'); + } + if (jobName.length < 3) + { + throw new Error('"jobName" should satisfy the constraint - "MinLength": 3'); + } + if (jobName.match(/^[-\w\.]+$/) === null) + { + throw new Error('"jobName" should satisfy the constraint - "Pattern": /^[-\w\.]+$/'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion 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.DataBox/jobs/{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) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Updates the properties of an existing job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} jobResourceUpdateParameter Job update parameters from + * request body. + * + * @param {object} jobResourceUpdateParameter.details Details of a job to be + * updated. + * + * @param {object} [jobResourceUpdateParameter.details.contactDetails] Contact + * details for notification and shipping. + * + * @param {string} + * [jobResourceUpdateParameter.details.contactDetails.contactName] Contact name + * of the person. + * + * @param {string} jobResourceUpdateParameter.details.contactDetails.phone + * Phone number of the contact person. + * + * @param {string} + * [jobResourceUpdateParameter.details.contactDetails.phoneExtension] Phone + * extension number of the contact person. + * + * @param {string} [jobResourceUpdateParameter.details.contactDetails.mobile] + * Mobile number of the contact person. + * + * @param {array} jobResourceUpdateParameter.details.contactDetails.emailList + * List of Email-ids to be notified about job progress. + * + * @param {array} + * [jobResourceUpdateParameter.details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * + * @param {object} [jobResourceUpdateParameter.details.shippingAddress] + * Shipping address of the customer. + * + * @param {string} + * jobResourceUpdateParameter.details.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [jobResourceUpdateParameter.details.shippingAddress.city] + * Name of the City. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.stateOrProvince] Name of + * the State or Province. + * + * @param {string} jobResourceUpdateParameter.details.shippingAddress.country + * Name of the Country. + * + * @param {string} + * jobResourceUpdateParameter.details.shippingAddress.postalCode Postal code. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.zipExtendedCode] + * Extended Zip Code. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.companyName] Name of the + * company. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {object} [jobResourceUpdateParameter.tags] The list of key value + * pairs that describe the resource. These tags can be used in viewing and + * grouping this resource (across resource groups). + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.ifMatch] Defines the If-Match condition. The patch + * will be performed only if the ETag of the job on the server matches this + * value. + * + * @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 JobResource} 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, jobResourceUpdateParameter, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginUpdate(resourceGroupName, jobName, jobResourceUpdateParameter, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['JobResource']().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); + }); + }); +} + +/** + * Book shipment pick up. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} shipmentPickUpRequest Details of shipment pick up request. + * + * @param {date} [shipmentPickUpRequest.startTime] Minimum date after which the + * pick up should commence, this must be in local time of pick up area. + * + * @param {date} [shipmentPickUpRequest.endTime] Maximum date before which the + * pick up should commence, this must be in local time of pick up area. + * + * @param {string} [shipmentPickUpRequest.shipmentLocation] Shipment Location + * in the pickup place. Eg.front desk + * + * @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 ShipmentPickUpResponse} 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 _bookShipmentPickUp(resourceGroupName, jobName, shipmentPickUpRequest, 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.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 (jobName !== null && jobName !== undefined) { + if (jobName.length > 24) + { + throw new Error('"jobName" should satisfy the constraint - "MaxLength": 24'); + } + if (jobName.length < 3) + { + throw new Error('"jobName" should satisfy the constraint - "MinLength": 3'); + } + if (jobName.match(/^[-\w\.]+$/) === null) + { + throw new Error('"jobName" should satisfy the constraint - "Pattern": /^[-\w\.]+$/'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (shipmentPickUpRequest === null || shipmentPickUpRequest === undefined) { + throw new Error('shipmentPickUpRequest 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.DataBox/jobs/{jobName}/bookShipmentPickUp'; + 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('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (shipmentPickUpRequest !== null && shipmentPickUpRequest !== undefined) { + let requestModelMapper = new client.models['ShipmentPickUpRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, shipmentPickUpRequest, 'shipmentPickUpRequest'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(shipmentPickUpRequest, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().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['ShipmentPickUpResponse']().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); + }); +} + +/** + * CancelJob. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} cancellationReason Reason for cancellation. + * + * @param {string} cancellationReason.reason Reason for cancellation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _cancel(resourceGroupName, jobName, cancellationReason, 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.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 (jobName !== null && jobName !== undefined) { + if (jobName.length > 24) + { + throw new Error('"jobName" should satisfy the constraint - "MaxLength": 24'); + } + if (jobName.length < 3) + { + throw new Error('"jobName" should satisfy the constraint - "MinLength": 3'); + } + if (jobName.match(/^[-\w\.]+$/) === null) + { + throw new Error('"jobName" should satisfy the constraint - "Pattern": /^[-\w\.]+$/'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (cancellationReason === null || cancellationReason === undefined) { + throw new Error('cancellationReason 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.DataBox/jobs/{jobName}/cancel'; + 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('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (cancellationReason !== null && cancellationReason !== undefined) { + let requestModelMapper = new client.models['CancellationReason']().mapper(); + requestModel = client.serialize(requestModelMapper, cancellationReason, 'cancellationReason'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(cancellationReason, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Provides list of copy logs uri. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @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 GetCopyLogsUriOutput} 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 _getCopyLogsUri(resourceGroupName, jobName, 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.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 (jobName !== null && jobName !== undefined) { + if (jobName.length > 24) + { + throw new Error('"jobName" should satisfy the constraint - "MaxLength": 24'); + } + if (jobName.length < 3) + { + throw new Error('"jobName" should satisfy the constraint - "MinLength": 3'); + } + if (jobName.match(/^[-\w\.]+$/) === null) + { + throw new Error('"jobName" should satisfy the constraint - "Pattern": /^[-\w\.]+$/'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion 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.DataBox/jobs/{jobName}/copyLogsUri'; + 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('&'); + } + + // 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().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['GetCopyLogsUriOutput']().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); + }); +} + +/** + * Get shipping label sas uri. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @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 ShippingLabelDetails} 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 _downloadShippingLabelUri(resourceGroupName, jobName, 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.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 (jobName !== null && jobName !== undefined) { + if (jobName.length > 24) + { + throw new Error('"jobName" should satisfy the constraint - "MaxLength": 24'); + } + if (jobName.length < 3) + { + throw new Error('"jobName" should satisfy the constraint - "MinLength": 3'); + } + if (jobName.match(/^[-\w\.]+$/) === null) + { + throw new Error('"jobName" should satisfy the constraint - "Pattern": /^[-\w\.]+$/'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion 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.DataBox/jobs/{jobName}/downloadShippingLabel'; + 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('&'); + } + + // 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().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['ShippingLabelDetails']().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); + }); +} + +/** + * This method gets the unencrypted secrets related to the job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @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 UnencryptedSecrets} 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 _listSecrets(resourceGroupName, jobName, 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.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 (jobName !== null && jobName !== undefined) { + if (jobName.length > 24) + { + throw new Error('"jobName" should satisfy the constraint - "MaxLength": 24'); + } + if (jobName.length < 3) + { + throw new Error('"jobName" should satisfy the constraint - "MinLength": 3'); + } + if (jobName.match(/^[-\w\.]+$/) === null) + { + throw new Error('"jobName" should satisfy the constraint - "Pattern": /^[-\w\.]+$/'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion 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.DataBox/jobs/{jobName}/listSecrets'; + 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('&'); + } + + // 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().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['UnencryptedSecrets']().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); + }); +} + +/** + * Reports an issue. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} reportIssueDetails Details of reported issue. + * + * @param {string} [reportIssueDetails.issueType] Issue Type. Possible values + * include: 'DeviceMismatch', 'ValidationStringMismatch', + * 'CredentialNotWorking', 'DeviceFailure' + * + * @param {string} [reportIssueDetails.deviceIssueType] Device Issue Type. Only + * used for Device failure issue. Possible values include: 'DeviceTampering', + * 'DeviceNotBootingUp', 'DeviceHealthCheckShowFailures', 'NICsAreNotWorking', + * 'Misc' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _reportIssue(resourceGroupName, jobName, reportIssueDetails, 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.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 (jobName !== null && jobName !== undefined) { + if (jobName.length > 24) + { + throw new Error('"jobName" should satisfy the constraint - "MaxLength": 24'); + } + if (jobName.length < 3) + { + throw new Error('"jobName" should satisfy the constraint - "MinLength": 3'); + } + if (jobName.match(/^[-\w\.]+$/) === null) + { + throw new Error('"jobName" should satisfy the constraint - "Pattern": /^[-\w\.]+$/'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (reportIssueDetails === null || reportIssueDetails === undefined) { + throw new Error('reportIssueDetails 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.DataBox/jobs/{jobName}/reportIssue'; + 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('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (reportIssueDetails !== null && reportIssueDetails !== undefined) { + let requestModelMapper = new client.models['ReportIssueDetails']().mapper(); + requestModel = client.serialize(requestModelMapper, reportIssueDetails, 'reportIssueDetails'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(reportIssueDetails, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Creates a new job with the specified parameters. Existing job cannot be + * updated with this API and should instead be updated with the Update job API. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} jobResource Job details from request body. + * + * @param {string} [jobResource.deviceType] Type of the device to be used for + * the job. Possible values include: 'Pod', 'Disk', 'Cabinet' + * + * @param {boolean} [jobResource.isCancellable] Describes whether the job is + * cancellable or not. + * + * @param {boolean} [jobResource.isShippingAddressEditable] Describes whether + * the shipping address is editable or not. + * + * @param {string} [jobResource.status] Name of the stage which is in progress. + * Possible values include: 'DeviceOrdered', 'DevicePrepared', 'Dispatched', + * 'Delivered', 'PickedUp', 'AtAzureDC', 'DataCopy', 'Completed', + * 'CompletedWithErrors', 'Cancelled', 'Failed_IssueReportedAtCustomer', + * 'Failed_IssueDetectedAtAzureDC', 'Aborted' + * + * @param {date} [jobResource.startTime] Time at which the job was started in + * UTC ISO 8601 format. + * + * @param {object} [jobResource.error] Top level error for the job. + * + * @param {string} jobResource.error.code Error code that can be used to + * programmatically identify the error. + * + * @param {string} [jobResource.error.message] Describes the error in detail + * and provides debugging information. + * + * @param {object} [jobResource.deliveryPackage] Delivery package shipping + * details. + * + * @param {object} [jobResource.returnPackage] Return package shipping details. + * + * @param {string} [jobResource.returnPackage.carrierName] Name of the carrier. + * + * @param {string} [jobResource.returnPackage.trackingId] Tracking Id of + * shipment. + * + * @param {string} [jobResource.returnPackage.trackingUrl] Url where shipment + * can be tracked. + * + * @param {array} jobResource.destinationAccountDetails Destination account + * details. + * + * @param {object} [jobResource.details] Details of a job run. This field will + * only be sent for expand details filter. + * + * @param {number} [jobResource.details.expectedDataSizeInTeraBytes] The + * expected size of the data, which needs to be transfered in this job, in tera + * bytes. + * + * @param {array} [jobResource.details.jobStages] List of stages that run in + * the job. + * + * @param {object} jobResource.details.contactDetails Contact details for + * notification and shipping. + * + * @param {string} [jobResource.details.contactDetails.contactName] Contact + * name of the person. + * + * @param {string} jobResource.details.contactDetails.phone Phone number of the + * contact person. + * + * @param {string} [jobResource.details.contactDetails.phoneExtension] Phone + * extension number of the contact person. + * + * @param {string} [jobResource.details.contactDetails.mobile] Mobile number of + * the contact person. + * + * @param {array} jobResource.details.contactDetails.emailList List of + * Email-ids to be notified about job progress. + * + * @param {array} [jobResource.details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * + * @param {object} jobResource.details.shippingAddress Shipping address of the + * customer. + * + * @param {string} jobResource.details.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} [jobResource.details.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} [jobResource.details.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [jobResource.details.shippingAddress.city] Name of the City. + * + * @param {string} [jobResource.details.shippingAddress.stateOrProvince] Name + * of the State or Province. + * + * @param {string} jobResource.details.shippingAddress.country Name of the + * Country. + * + * @param {string} jobResource.details.shippingAddress.postalCode Postal code. + * + * @param {string} [jobResource.details.shippingAddress.zipExtendedCode] + * Extended Zip Code. + * + * @param {string} [jobResource.details.shippingAddress.companyName] Name of + * the company. + * + * @param {string} [jobResource.details.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {array} [jobResource.details.errorDetails] Error details for failure. + * This is optional. + * + * @param {string} jobResource.details.jobDetailsType Polymorphic Discriminator + * + * @param {string} [jobResource.cancellationReason] Reason for cancellation. + * + * @param {string} jobResource.location The location of the resource. This will + * be one of the supported and registered Azure Regions (e.g. West US, East US, + * Southeast Asia, etc.). The region of a resource cannot be changed once it is + * created, but if an identical region is specified on update the request will + * succeed. + * + * @param {object} [jobResource.tags] The list of key value pairs that describe + * the resource. These tags can be used in viewing and grouping this resource + * (across resource groups). + * + * @param {object} jobResource.sku The sku type. + * + * @param {string} jobResource.sku.name The sku name. + * + * @param {string} [jobResource.sku.displayName] The display name of the sku. + * + * @param {string} [jobResource.sku.family] The sku family. + * + * @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 JobResource} 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 _beginCreate(resourceGroupName, jobName, jobResource, 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.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 (jobName !== null && jobName !== undefined) { + if (jobName.length > 24) + { + throw new Error('"jobName" should satisfy the constraint - "MaxLength": 24'); + } + if (jobName.length < 3) + { + throw new Error('"jobName" should satisfy the constraint - "MinLength": 3'); + } + if (jobName.match(/^[-\w\.]+$/) === null) + { + throw new Error('"jobName" should satisfy the constraint - "Pattern": /^[-\w\.]+$/'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (jobResource === null || jobResource === undefined) { + throw new Error('jobResource 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.DataBox/jobs/{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) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (jobResource !== null && jobResource !== undefined) { + let requestModelMapper = new client.models['JobResource']().mapper(); + requestModel = client.serialize(requestModelMapper, jobResource, 'jobResource'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(jobResource, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().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['JobResource']().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); + }); +} + +/** + * Updates the properties of an existing job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} jobResourceUpdateParameter Job update parameters from + * request body. + * + * @param {object} jobResourceUpdateParameter.details Details of a job to be + * updated. + * + * @param {object} [jobResourceUpdateParameter.details.contactDetails] Contact + * details for notification and shipping. + * + * @param {string} + * [jobResourceUpdateParameter.details.contactDetails.contactName] Contact name + * of the person. + * + * @param {string} jobResourceUpdateParameter.details.contactDetails.phone + * Phone number of the contact person. + * + * @param {string} + * [jobResourceUpdateParameter.details.contactDetails.phoneExtension] Phone + * extension number of the contact person. + * + * @param {string} [jobResourceUpdateParameter.details.contactDetails.mobile] + * Mobile number of the contact person. + * + * @param {array} jobResourceUpdateParameter.details.contactDetails.emailList + * List of Email-ids to be notified about job progress. + * + * @param {array} + * [jobResourceUpdateParameter.details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * + * @param {object} [jobResourceUpdateParameter.details.shippingAddress] + * Shipping address of the customer. + * + * @param {string} + * jobResourceUpdateParameter.details.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [jobResourceUpdateParameter.details.shippingAddress.city] + * Name of the City. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.stateOrProvince] Name of + * the State or Province. + * + * @param {string} jobResourceUpdateParameter.details.shippingAddress.country + * Name of the Country. + * + * @param {string} + * jobResourceUpdateParameter.details.shippingAddress.postalCode Postal code. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.zipExtendedCode] + * Extended Zip Code. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.companyName] Name of the + * company. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {object} [jobResourceUpdateParameter.tags] The list of key value + * pairs that describe the resource. These tags can be used in viewing and + * grouping this resource (across resource groups). + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.ifMatch] Defines the If-Match condition. The patch + * will be performed only if the ETag of the job on the server matches this + * value. + * + * @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 JobResource} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginUpdate(resourceGroupName, jobName, jobResourceUpdateParameter, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let ifMatch = (options && options.ifMatch !== undefined) ? options.ifMatch : 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 (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 (jobName !== null && jobName !== undefined) { + if (jobName.length > 24) + { + throw new Error('"jobName" should satisfy the constraint - "MaxLength": 24'); + } + if (jobName.length < 3) + { + throw new Error('"jobName" should satisfy the constraint - "MinLength": 3'); + } + if (jobName.match(/^[-\w\.]+$/) === null) + { + throw new Error('"jobName" should satisfy the constraint - "Pattern": /^[-\w\.]+$/'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (ifMatch !== null && ifMatch !== undefined && typeof ifMatch.valueOf() !== 'string') { + throw new Error('ifMatch must be of type string.'); + } + if (jobResourceUpdateParameter === null || jobResourceUpdateParameter === undefined) { + throw new Error('jobResourceUpdateParameter 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.DataBox/jobs/{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) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (ifMatch !== undefined && ifMatch !== null) { + httpRequest.headers['If-Match'] = ifMatch; + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (jobResourceUpdateParameter !== null && jobResourceUpdateParameter !== undefined) { + let requestModelMapper = new client.models['JobResourceUpdateParameter']().mapper(); + requestModel = client.serialize(requestModelMapper, jobResourceUpdateParameter, 'jobResourceUpdateParameter'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(jobResourceUpdateParameter, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().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['JobResource']().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 all the jobs available under the 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 JobResourceList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().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['JobResourceList']().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 all the jobs available under the given 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 JobResourceList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByResourceGroupNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().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['JobResourceList']().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 {DataBoxManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._listByResourceGroup = _listByResourceGroup; + this._get = _get; + this._create = _create; + this._deleteMethod = _deleteMethod; + this._update = _update; + this._bookShipmentPickUp = _bookShipmentPickUp; + this._cancel = _cancel; + this._getCopyLogsUri = _getCopyLogsUri; + this._downloadShippingLabelUri = _downloadShippingLabelUri; + this._listSecrets = _listSecrets; + this._reportIssue = _reportIssue; + this._beginCreate = _beginCreate; + this._beginUpdate = _beginUpdate; + this._listNext = _listNext; + this._listByResourceGroupNext = _listByResourceGroupNext; + } + + /** + * Lists all the jobs available under the subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.skipToken] $skipToken is supported on Get list of + * jobs, which provides the next page in the list of jobs. + * + * @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; + }); + }); + } + + /** + * Lists all the jobs available under the subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.skipToken] $skipToken is supported on Get list of + * jobs, which provides the next page in the list of jobs. + * + * @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 {JobResourceList} - 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 JobResourceList} 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); + } + } + + /** + * Lists all the jobs available under the given resource group. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.skipToken] $skipToken is supported on Get list of + * jobs, which provides the next page in the list of jobs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all the jobs available under the given resource group. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.skipToken] $skipToken is supported on Get list of + * jobs, which provides the next page in the list of jobs. + * + * @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 {JobResourceList} - 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 JobResourceList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroup(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._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroup(resourceGroupName, options, optionalCallback); + } + } + + /** + * Gets information about the specified job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] $expand is supported on details parameter + * for job, which provides details on the job stages. + * + * @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(resourceGroupName, jobName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(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; + }); + }); + } + + /** + * Gets information about the specified job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] $expand is supported on details parameter + * for job, which provides details on the job stages. + * + * @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 {JobResource} - 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 JobResource} 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) { + 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(resourceGroupName, jobName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, jobName, options, optionalCallback); + } + } + + /** + * Creates a new job with the specified parameters. Existing job cannot be + * updated with this API and should instead be updated with the Update job API. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} jobResource Job details from request body. + * + * @param {string} [jobResource.deviceType] Type of the device to be used for + * the job. Possible values include: 'Pod', 'Disk', 'Cabinet' + * + * @param {boolean} [jobResource.isCancellable] Describes whether the job is + * cancellable or not. + * + * @param {boolean} [jobResource.isShippingAddressEditable] Describes whether + * the shipping address is editable or not. + * + * @param {string} [jobResource.status] Name of the stage which is in progress. + * Possible values include: 'DeviceOrdered', 'DevicePrepared', 'Dispatched', + * 'Delivered', 'PickedUp', 'AtAzureDC', 'DataCopy', 'Completed', + * 'CompletedWithErrors', 'Cancelled', 'Failed_IssueReportedAtCustomer', + * 'Failed_IssueDetectedAtAzureDC', 'Aborted' + * + * @param {date} [jobResource.startTime] Time at which the job was started in + * UTC ISO 8601 format. + * + * @param {object} [jobResource.error] Top level error for the job. + * + * @param {string} jobResource.error.code Error code that can be used to + * programmatically identify the error. + * + * @param {string} [jobResource.error.message] Describes the error in detail + * and provides debugging information. + * + * @param {object} [jobResource.deliveryPackage] Delivery package shipping + * details. + * + * @param {object} [jobResource.returnPackage] Return package shipping details. + * + * @param {string} [jobResource.returnPackage.carrierName] Name of the carrier. + * + * @param {string} [jobResource.returnPackage.trackingId] Tracking Id of + * shipment. + * + * @param {string} [jobResource.returnPackage.trackingUrl] Url where shipment + * can be tracked. + * + * @param {array} jobResource.destinationAccountDetails Destination account + * details. + * + * @param {object} [jobResource.details] Details of a job run. This field will + * only be sent for expand details filter. + * + * @param {number} [jobResource.details.expectedDataSizeInTeraBytes] The + * expected size of the data, which needs to be transfered in this job, in tera + * bytes. + * + * @param {array} [jobResource.details.jobStages] List of stages that run in + * the job. + * + * @param {object} jobResource.details.contactDetails Contact details for + * notification and shipping. + * + * @param {string} [jobResource.details.contactDetails.contactName] Contact + * name of the person. + * + * @param {string} jobResource.details.contactDetails.phone Phone number of the + * contact person. + * + * @param {string} [jobResource.details.contactDetails.phoneExtension] Phone + * extension number of the contact person. + * + * @param {string} [jobResource.details.contactDetails.mobile] Mobile number of + * the contact person. + * + * @param {array} jobResource.details.contactDetails.emailList List of + * Email-ids to be notified about job progress. + * + * @param {array} [jobResource.details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * + * @param {object} jobResource.details.shippingAddress Shipping address of the + * customer. + * + * @param {string} jobResource.details.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} [jobResource.details.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} [jobResource.details.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [jobResource.details.shippingAddress.city] Name of the City. + * + * @param {string} [jobResource.details.shippingAddress.stateOrProvince] Name + * of the State or Province. + * + * @param {string} jobResource.details.shippingAddress.country Name of the + * Country. + * + * @param {string} jobResource.details.shippingAddress.postalCode Postal code. + * + * @param {string} [jobResource.details.shippingAddress.zipExtendedCode] + * Extended Zip Code. + * + * @param {string} [jobResource.details.shippingAddress.companyName] Name of + * the company. + * + * @param {string} [jobResource.details.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {array} [jobResource.details.errorDetails] Error details for failure. + * This is optional. + * + * @param {string} jobResource.details.jobDetailsType Polymorphic Discriminator + * + * @param {string} [jobResource.cancellationReason] Reason for cancellation. + * + * @param {string} jobResource.location The location of the resource. This will + * be one of the supported and registered Azure Regions (e.g. West US, East US, + * Southeast Asia, etc.). The region of a resource cannot be changed once it is + * created, but if an identical region is specified on update the request will + * succeed. + * + * @param {object} [jobResource.tags] The list of key value pairs that describe + * the resource. These tags can be used in viewing and grouping this resource + * (across resource groups). + * + * @param {object} jobResource.sku The sku type. + * + * @param {string} jobResource.sku.name The sku name. + * + * @param {string} [jobResource.sku.displayName] The display name of the sku. + * + * @param {string} [jobResource.sku.family] The sku family. + * + * @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. + */ + createWithHttpOperationResponse(resourceGroupName, jobName, jobResource, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._create(resourceGroupName, jobName, jobResource, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a new job with the specified parameters. Existing job cannot be + * updated with this API and should instead be updated with the Update job API. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} jobResource Job details from request body. + * + * @param {string} [jobResource.deviceType] Type of the device to be used for + * the job. Possible values include: 'Pod', 'Disk', 'Cabinet' + * + * @param {boolean} [jobResource.isCancellable] Describes whether the job is + * cancellable or not. + * + * @param {boolean} [jobResource.isShippingAddressEditable] Describes whether + * the shipping address is editable or not. + * + * @param {string} [jobResource.status] Name of the stage which is in progress. + * Possible values include: 'DeviceOrdered', 'DevicePrepared', 'Dispatched', + * 'Delivered', 'PickedUp', 'AtAzureDC', 'DataCopy', 'Completed', + * 'CompletedWithErrors', 'Cancelled', 'Failed_IssueReportedAtCustomer', + * 'Failed_IssueDetectedAtAzureDC', 'Aborted' + * + * @param {date} [jobResource.startTime] Time at which the job was started in + * UTC ISO 8601 format. + * + * @param {object} [jobResource.error] Top level error for the job. + * + * @param {string} jobResource.error.code Error code that can be used to + * programmatically identify the error. + * + * @param {string} [jobResource.error.message] Describes the error in detail + * and provides debugging information. + * + * @param {object} [jobResource.deliveryPackage] Delivery package shipping + * details. + * + * @param {object} [jobResource.returnPackage] Return package shipping details. + * + * @param {string} [jobResource.returnPackage.carrierName] Name of the carrier. + * + * @param {string} [jobResource.returnPackage.trackingId] Tracking Id of + * shipment. + * + * @param {string} [jobResource.returnPackage.trackingUrl] Url where shipment + * can be tracked. + * + * @param {array} jobResource.destinationAccountDetails Destination account + * details. + * + * @param {object} [jobResource.details] Details of a job run. This field will + * only be sent for expand details filter. + * + * @param {number} [jobResource.details.expectedDataSizeInTeraBytes] The + * expected size of the data, which needs to be transfered in this job, in tera + * bytes. + * + * @param {array} [jobResource.details.jobStages] List of stages that run in + * the job. + * + * @param {object} jobResource.details.contactDetails Contact details for + * notification and shipping. + * + * @param {string} [jobResource.details.contactDetails.contactName] Contact + * name of the person. + * + * @param {string} jobResource.details.contactDetails.phone Phone number of the + * contact person. + * + * @param {string} [jobResource.details.contactDetails.phoneExtension] Phone + * extension number of the contact person. + * + * @param {string} [jobResource.details.contactDetails.mobile] Mobile number of + * the contact person. + * + * @param {array} jobResource.details.contactDetails.emailList List of + * Email-ids to be notified about job progress. + * + * @param {array} [jobResource.details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * + * @param {object} jobResource.details.shippingAddress Shipping address of the + * customer. + * + * @param {string} jobResource.details.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} [jobResource.details.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} [jobResource.details.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [jobResource.details.shippingAddress.city] Name of the City. + * + * @param {string} [jobResource.details.shippingAddress.stateOrProvince] Name + * of the State or Province. + * + * @param {string} jobResource.details.shippingAddress.country Name of the + * Country. + * + * @param {string} jobResource.details.shippingAddress.postalCode Postal code. + * + * @param {string} [jobResource.details.shippingAddress.zipExtendedCode] + * Extended Zip Code. + * + * @param {string} [jobResource.details.shippingAddress.companyName] Name of + * the company. + * + * @param {string} [jobResource.details.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {array} [jobResource.details.errorDetails] Error details for failure. + * This is optional. + * + * @param {string} jobResource.details.jobDetailsType Polymorphic Discriminator + * + * @param {string} [jobResource.cancellationReason] Reason for cancellation. + * + * @param {string} jobResource.location The location of the resource. This will + * be one of the supported and registered Azure Regions (e.g. West US, East US, + * Southeast Asia, etc.). The region of a resource cannot be changed once it is + * created, but if an identical region is specified on update the request will + * succeed. + * + * @param {object} [jobResource.tags] The list of key value pairs that describe + * the resource. These tags can be used in viewing and grouping this resource + * (across resource groups). + * + * @param {object} jobResource.sku The sku type. + * + * @param {string} jobResource.sku.name The sku name. + * + * @param {string} [jobResource.sku.displayName] The display name of the sku. + * + * @param {string} [jobResource.sku.family] The sku family. + * + * @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 {JobResource} - 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 JobResource} 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. + */ + create(resourceGroupName, jobName, jobResource, 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._create(resourceGroupName, jobName, jobResource, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._create(resourceGroupName, jobName, jobResource, options, optionalCallback); + } + } + + /** + * Deletes a job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @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 a job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName, jobName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, jobName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, jobName, options, optionalCallback); + } + } + + /** + * Updates the properties of an existing job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} jobResourceUpdateParameter Job update parameters from + * request body. + * + * @param {object} jobResourceUpdateParameter.details Details of a job to be + * updated. + * + * @param {object} [jobResourceUpdateParameter.details.contactDetails] Contact + * details for notification and shipping. + * + * @param {string} + * [jobResourceUpdateParameter.details.contactDetails.contactName] Contact name + * of the person. + * + * @param {string} jobResourceUpdateParameter.details.contactDetails.phone + * Phone number of the contact person. + * + * @param {string} + * [jobResourceUpdateParameter.details.contactDetails.phoneExtension] Phone + * extension number of the contact person. + * + * @param {string} [jobResourceUpdateParameter.details.contactDetails.mobile] + * Mobile number of the contact person. + * + * @param {array} jobResourceUpdateParameter.details.contactDetails.emailList + * List of Email-ids to be notified about job progress. + * + * @param {array} + * [jobResourceUpdateParameter.details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * + * @param {object} [jobResourceUpdateParameter.details.shippingAddress] + * Shipping address of the customer. + * + * @param {string} + * jobResourceUpdateParameter.details.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [jobResourceUpdateParameter.details.shippingAddress.city] + * Name of the City. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.stateOrProvince] Name of + * the State or Province. + * + * @param {string} jobResourceUpdateParameter.details.shippingAddress.country + * Name of the Country. + * + * @param {string} + * jobResourceUpdateParameter.details.shippingAddress.postalCode Postal code. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.zipExtendedCode] + * Extended Zip Code. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.companyName] Name of the + * company. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {object} [jobResourceUpdateParameter.tags] The list of key value + * pairs that describe the resource. These tags can be used in viewing and + * grouping this resource (across resource groups). + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.ifMatch] Defines the If-Match condition. The patch + * will be performed only if the ETag of the job on the server matches this + * value. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName, jobName, jobResourceUpdateParameter, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, jobName, jobResourceUpdateParameter, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates the properties of an existing job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} jobResourceUpdateParameter Job update parameters from + * request body. + * + * @param {object} jobResourceUpdateParameter.details Details of a job to be + * updated. + * + * @param {object} [jobResourceUpdateParameter.details.contactDetails] Contact + * details for notification and shipping. + * + * @param {string} + * [jobResourceUpdateParameter.details.contactDetails.contactName] Contact name + * of the person. + * + * @param {string} jobResourceUpdateParameter.details.contactDetails.phone + * Phone number of the contact person. + * + * @param {string} + * [jobResourceUpdateParameter.details.contactDetails.phoneExtension] Phone + * extension number of the contact person. + * + * @param {string} [jobResourceUpdateParameter.details.contactDetails.mobile] + * Mobile number of the contact person. + * + * @param {array} jobResourceUpdateParameter.details.contactDetails.emailList + * List of Email-ids to be notified about job progress. + * + * @param {array} + * [jobResourceUpdateParameter.details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * + * @param {object} [jobResourceUpdateParameter.details.shippingAddress] + * Shipping address of the customer. + * + * @param {string} + * jobResourceUpdateParameter.details.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [jobResourceUpdateParameter.details.shippingAddress.city] + * Name of the City. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.stateOrProvince] Name of + * the State or Province. + * + * @param {string} jobResourceUpdateParameter.details.shippingAddress.country + * Name of the Country. + * + * @param {string} + * jobResourceUpdateParameter.details.shippingAddress.postalCode Postal code. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.zipExtendedCode] + * Extended Zip Code. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.companyName] Name of the + * company. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {object} [jobResourceUpdateParameter.tags] The list of key value + * pairs that describe the resource. These tags can be used in viewing and + * grouping this resource (across resource groups). + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.ifMatch] Defines the If-Match condition. The patch + * will be performed only if the ETag of the job on the server matches this + * value. + * + * @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 {JobResource} - 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 JobResource} 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, jobResourceUpdateParameter, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._update(resourceGroupName, jobName, jobResourceUpdateParameter, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, jobName, jobResourceUpdateParameter, options, optionalCallback); + } + } + + /** + * Book shipment pick up. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} shipmentPickUpRequest Details of shipment pick up request. + * + * @param {date} [shipmentPickUpRequest.startTime] Minimum date after which the + * pick up should commence, this must be in local time of pick up area. + * + * @param {date} [shipmentPickUpRequest.endTime] Maximum date before which the + * pick up should commence, this must be in local time of pick up area. + * + * @param {string} [shipmentPickUpRequest.shipmentLocation] Shipment Location + * in the pickup place. Eg.front desk + * + * @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. + */ + bookShipmentPickUpWithHttpOperationResponse(resourceGroupName, jobName, shipmentPickUpRequest, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._bookShipmentPickUp(resourceGroupName, jobName, shipmentPickUpRequest, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Book shipment pick up. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} shipmentPickUpRequest Details of shipment pick up request. + * + * @param {date} [shipmentPickUpRequest.startTime] Minimum date after which the + * pick up should commence, this must be in local time of pick up area. + * + * @param {date} [shipmentPickUpRequest.endTime] Maximum date before which the + * pick up should commence, this must be in local time of pick up area. + * + * @param {string} [shipmentPickUpRequest.shipmentLocation] Shipment Location + * in the pickup place. Eg.front desk + * + * @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 {ShipmentPickUpResponse} - 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 ShipmentPickUpResponse} 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. + */ + bookShipmentPickUp(resourceGroupName, jobName, shipmentPickUpRequest, 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._bookShipmentPickUp(resourceGroupName, jobName, shipmentPickUpRequest, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._bookShipmentPickUp(resourceGroupName, jobName, shipmentPickUpRequest, options, optionalCallback); + } + } + + /** + * CancelJob. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} cancellationReason Reason for cancellation. + * + * @param {string} cancellationReason.reason Reason for cancellation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + cancelWithHttpOperationResponse(resourceGroupName, jobName, cancellationReason, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._cancel(resourceGroupName, jobName, cancellationReason, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * CancelJob. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} cancellationReason Reason for cancellation. + * + * @param {string} cancellationReason.reason Reason for cancellation. + * + * @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. + */ + cancel(resourceGroupName, jobName, cancellationReason, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._cancel(resourceGroupName, jobName, cancellationReason, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._cancel(resourceGroupName, jobName, cancellationReason, options, optionalCallback); + } + } + + /** + * Provides list of copy logs uri. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @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. + */ + getCopyLogsUriWithHttpOperationResponse(resourceGroupName, jobName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getCopyLogsUri(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; + }); + }); + } + + /** + * Provides list of copy logs uri. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @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 {GetCopyLogsUriOutput} - 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 GetCopyLogsUriOutput} 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. + */ + getCopyLogsUri(resourceGroupName, jobName, 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._getCopyLogsUri(resourceGroupName, jobName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getCopyLogsUri(resourceGroupName, jobName, options, optionalCallback); + } + } + + /** + * Get shipping label sas uri. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @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. + */ + downloadShippingLabelUriWithHttpOperationResponse(resourceGroupName, jobName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._downloadShippingLabelUri(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; + }); + }); + } + + /** + * Get shipping label sas uri. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @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 {ShippingLabelDetails} - 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 ShippingLabelDetails} 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. + */ + downloadShippingLabelUri(resourceGroupName, jobName, 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._downloadShippingLabelUri(resourceGroupName, jobName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._downloadShippingLabelUri(resourceGroupName, jobName, options, optionalCallback); + } + } + + /** + * This method gets the unencrypted secrets related to the job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @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. + */ + listSecretsWithHttpOperationResponse(resourceGroupName, jobName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSecrets(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; + }); + }); + } + + /** + * This method gets the unencrypted secrets related to the job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @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 {UnencryptedSecrets} - 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 UnencryptedSecrets} 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. + */ + listSecrets(resourceGroupName, jobName, 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._listSecrets(resourceGroupName, jobName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSecrets(resourceGroupName, jobName, options, optionalCallback); + } + } + + /** + * Reports an issue. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} reportIssueDetails Details of reported issue. + * + * @param {string} [reportIssueDetails.issueType] Issue Type. Possible values + * include: 'DeviceMismatch', 'ValidationStringMismatch', + * 'CredentialNotWorking', 'DeviceFailure' + * + * @param {string} [reportIssueDetails.deviceIssueType] Device Issue Type. Only + * used for Device failure issue. Possible values include: 'DeviceTampering', + * 'DeviceNotBootingUp', 'DeviceHealthCheckShowFailures', 'NICsAreNotWorking', + * 'Misc' + * + * @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. + */ + reportIssueWithHttpOperationResponse(resourceGroupName, jobName, reportIssueDetails, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._reportIssue(resourceGroupName, jobName, reportIssueDetails, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Reports an issue. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} reportIssueDetails Details of reported issue. + * + * @param {string} [reportIssueDetails.issueType] Issue Type. Possible values + * include: 'DeviceMismatch', 'ValidationStringMismatch', + * 'CredentialNotWorking', 'DeviceFailure' + * + * @param {string} [reportIssueDetails.deviceIssueType] Device Issue Type. Only + * used for Device failure issue. Possible values include: 'DeviceTampering', + * 'DeviceNotBootingUp', 'DeviceHealthCheckShowFailures', 'NICsAreNotWorking', + * 'Misc' + * + * @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. + */ + reportIssue(resourceGroupName, jobName, reportIssueDetails, 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._reportIssue(resourceGroupName, jobName, reportIssueDetails, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._reportIssue(resourceGroupName, jobName, reportIssueDetails, options, optionalCallback); + } + } + + /** + * Creates a new job with the specified parameters. Existing job cannot be + * updated with this API and should instead be updated with the Update job API. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} jobResource Job details from request body. + * + * @param {string} [jobResource.deviceType] Type of the device to be used for + * the job. Possible values include: 'Pod', 'Disk', 'Cabinet' + * + * @param {boolean} [jobResource.isCancellable] Describes whether the job is + * cancellable or not. + * + * @param {boolean} [jobResource.isShippingAddressEditable] Describes whether + * the shipping address is editable or not. + * + * @param {string} [jobResource.status] Name of the stage which is in progress. + * Possible values include: 'DeviceOrdered', 'DevicePrepared', 'Dispatched', + * 'Delivered', 'PickedUp', 'AtAzureDC', 'DataCopy', 'Completed', + * 'CompletedWithErrors', 'Cancelled', 'Failed_IssueReportedAtCustomer', + * 'Failed_IssueDetectedAtAzureDC', 'Aborted' + * + * @param {date} [jobResource.startTime] Time at which the job was started in + * UTC ISO 8601 format. + * + * @param {object} [jobResource.error] Top level error for the job. + * + * @param {string} jobResource.error.code Error code that can be used to + * programmatically identify the error. + * + * @param {string} [jobResource.error.message] Describes the error in detail + * and provides debugging information. + * + * @param {object} [jobResource.deliveryPackage] Delivery package shipping + * details. + * + * @param {object} [jobResource.returnPackage] Return package shipping details. + * + * @param {string} [jobResource.returnPackage.carrierName] Name of the carrier. + * + * @param {string} [jobResource.returnPackage.trackingId] Tracking Id of + * shipment. + * + * @param {string} [jobResource.returnPackage.trackingUrl] Url where shipment + * can be tracked. + * + * @param {array} jobResource.destinationAccountDetails Destination account + * details. + * + * @param {object} [jobResource.details] Details of a job run. This field will + * only be sent for expand details filter. + * + * @param {number} [jobResource.details.expectedDataSizeInTeraBytes] The + * expected size of the data, which needs to be transfered in this job, in tera + * bytes. + * + * @param {array} [jobResource.details.jobStages] List of stages that run in + * the job. + * + * @param {object} jobResource.details.contactDetails Contact details for + * notification and shipping. + * + * @param {string} [jobResource.details.contactDetails.contactName] Contact + * name of the person. + * + * @param {string} jobResource.details.contactDetails.phone Phone number of the + * contact person. + * + * @param {string} [jobResource.details.contactDetails.phoneExtension] Phone + * extension number of the contact person. + * + * @param {string} [jobResource.details.contactDetails.mobile] Mobile number of + * the contact person. + * + * @param {array} jobResource.details.contactDetails.emailList List of + * Email-ids to be notified about job progress. + * + * @param {array} [jobResource.details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * + * @param {object} jobResource.details.shippingAddress Shipping address of the + * customer. + * + * @param {string} jobResource.details.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} [jobResource.details.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} [jobResource.details.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [jobResource.details.shippingAddress.city] Name of the City. + * + * @param {string} [jobResource.details.shippingAddress.stateOrProvince] Name + * of the State or Province. + * + * @param {string} jobResource.details.shippingAddress.country Name of the + * Country. + * + * @param {string} jobResource.details.shippingAddress.postalCode Postal code. + * + * @param {string} [jobResource.details.shippingAddress.zipExtendedCode] + * Extended Zip Code. + * + * @param {string} [jobResource.details.shippingAddress.companyName] Name of + * the company. + * + * @param {string} [jobResource.details.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {array} [jobResource.details.errorDetails] Error details for failure. + * This is optional. + * + * @param {string} jobResource.details.jobDetailsType Polymorphic Discriminator + * + * @param {string} [jobResource.cancellationReason] Reason for cancellation. + * + * @param {string} jobResource.location The location of the resource. This will + * be one of the supported and registered Azure Regions (e.g. West US, East US, + * Southeast Asia, etc.). The region of a resource cannot be changed once it is + * created, but if an identical region is specified on update the request will + * succeed. + * + * @param {object} [jobResource.tags] The list of key value pairs that describe + * the resource. These tags can be used in viewing and grouping this resource + * (across resource groups). + * + * @param {object} jobResource.sku The sku type. + * + * @param {string} jobResource.sku.name The sku name. + * + * @param {string} [jobResource.sku.displayName] The display name of the sku. + * + * @param {string} [jobResource.sku.family] The sku family. + * + * @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. + */ + beginCreateWithHttpOperationResponse(resourceGroupName, jobName, jobResource, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreate(resourceGroupName, jobName, jobResource, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a new job with the specified parameters. Existing job cannot be + * updated with this API and should instead be updated with the Update job API. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} jobResource Job details from request body. + * + * @param {string} [jobResource.deviceType] Type of the device to be used for + * the job. Possible values include: 'Pod', 'Disk', 'Cabinet' + * + * @param {boolean} [jobResource.isCancellable] Describes whether the job is + * cancellable or not. + * + * @param {boolean} [jobResource.isShippingAddressEditable] Describes whether + * the shipping address is editable or not. + * + * @param {string} [jobResource.status] Name of the stage which is in progress. + * Possible values include: 'DeviceOrdered', 'DevicePrepared', 'Dispatched', + * 'Delivered', 'PickedUp', 'AtAzureDC', 'DataCopy', 'Completed', + * 'CompletedWithErrors', 'Cancelled', 'Failed_IssueReportedAtCustomer', + * 'Failed_IssueDetectedAtAzureDC', 'Aborted' + * + * @param {date} [jobResource.startTime] Time at which the job was started in + * UTC ISO 8601 format. + * + * @param {object} [jobResource.error] Top level error for the job. + * + * @param {string} jobResource.error.code Error code that can be used to + * programmatically identify the error. + * + * @param {string} [jobResource.error.message] Describes the error in detail + * and provides debugging information. + * + * @param {object} [jobResource.deliveryPackage] Delivery package shipping + * details. + * + * @param {object} [jobResource.returnPackage] Return package shipping details. + * + * @param {string} [jobResource.returnPackage.carrierName] Name of the carrier. + * + * @param {string} [jobResource.returnPackage.trackingId] Tracking Id of + * shipment. + * + * @param {string} [jobResource.returnPackage.trackingUrl] Url where shipment + * can be tracked. + * + * @param {array} jobResource.destinationAccountDetails Destination account + * details. + * + * @param {object} [jobResource.details] Details of a job run. This field will + * only be sent for expand details filter. + * + * @param {number} [jobResource.details.expectedDataSizeInTeraBytes] The + * expected size of the data, which needs to be transfered in this job, in tera + * bytes. + * + * @param {array} [jobResource.details.jobStages] List of stages that run in + * the job. + * + * @param {object} jobResource.details.contactDetails Contact details for + * notification and shipping. + * + * @param {string} [jobResource.details.contactDetails.contactName] Contact + * name of the person. + * + * @param {string} jobResource.details.contactDetails.phone Phone number of the + * contact person. + * + * @param {string} [jobResource.details.contactDetails.phoneExtension] Phone + * extension number of the contact person. + * + * @param {string} [jobResource.details.contactDetails.mobile] Mobile number of + * the contact person. + * + * @param {array} jobResource.details.contactDetails.emailList List of + * Email-ids to be notified about job progress. + * + * @param {array} [jobResource.details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * + * @param {object} jobResource.details.shippingAddress Shipping address of the + * customer. + * + * @param {string} jobResource.details.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} [jobResource.details.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} [jobResource.details.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [jobResource.details.shippingAddress.city] Name of the City. + * + * @param {string} [jobResource.details.shippingAddress.stateOrProvince] Name + * of the State or Province. + * + * @param {string} jobResource.details.shippingAddress.country Name of the + * Country. + * + * @param {string} jobResource.details.shippingAddress.postalCode Postal code. + * + * @param {string} [jobResource.details.shippingAddress.zipExtendedCode] + * Extended Zip Code. + * + * @param {string} [jobResource.details.shippingAddress.companyName] Name of + * the company. + * + * @param {string} [jobResource.details.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {array} [jobResource.details.errorDetails] Error details for failure. + * This is optional. + * + * @param {string} jobResource.details.jobDetailsType Polymorphic Discriminator + * + * @param {string} [jobResource.cancellationReason] Reason for cancellation. + * + * @param {string} jobResource.location The location of the resource. This will + * be one of the supported and registered Azure Regions (e.g. West US, East US, + * Southeast Asia, etc.). The region of a resource cannot be changed once it is + * created, but if an identical region is specified on update the request will + * succeed. + * + * @param {object} [jobResource.tags] The list of key value pairs that describe + * the resource. These tags can be used in viewing and grouping this resource + * (across resource groups). + * + * @param {object} jobResource.sku The sku type. + * + * @param {string} jobResource.sku.name The sku name. + * + * @param {string} [jobResource.sku.displayName] The display name of the sku. + * + * @param {string} [jobResource.sku.family] The sku family. + * + * @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 {JobResource} - 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 JobResource} 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. + */ + beginCreate(resourceGroupName, jobName, jobResource, 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._beginCreate(resourceGroupName, jobName, jobResource, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreate(resourceGroupName, jobName, jobResource, options, optionalCallback); + } + } + + /** + * Updates the properties of an existing job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} jobResourceUpdateParameter Job update parameters from + * request body. + * + * @param {object} jobResourceUpdateParameter.details Details of a job to be + * updated. + * + * @param {object} [jobResourceUpdateParameter.details.contactDetails] Contact + * details for notification and shipping. + * + * @param {string} + * [jobResourceUpdateParameter.details.contactDetails.contactName] Contact name + * of the person. + * + * @param {string} jobResourceUpdateParameter.details.contactDetails.phone + * Phone number of the contact person. + * + * @param {string} + * [jobResourceUpdateParameter.details.contactDetails.phoneExtension] Phone + * extension number of the contact person. + * + * @param {string} [jobResourceUpdateParameter.details.contactDetails.mobile] + * Mobile number of the contact person. + * + * @param {array} jobResourceUpdateParameter.details.contactDetails.emailList + * List of Email-ids to be notified about job progress. + * + * @param {array} + * [jobResourceUpdateParameter.details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * + * @param {object} [jobResourceUpdateParameter.details.shippingAddress] + * Shipping address of the customer. + * + * @param {string} + * jobResourceUpdateParameter.details.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [jobResourceUpdateParameter.details.shippingAddress.city] + * Name of the City. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.stateOrProvince] Name of + * the State or Province. + * + * @param {string} jobResourceUpdateParameter.details.shippingAddress.country + * Name of the Country. + * + * @param {string} + * jobResourceUpdateParameter.details.shippingAddress.postalCode Postal code. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.zipExtendedCode] + * Extended Zip Code. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.companyName] Name of the + * company. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {object} [jobResourceUpdateParameter.tags] The list of key value + * pairs that describe the resource. These tags can be used in viewing and + * grouping this resource (across resource groups). + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.ifMatch] Defines the If-Match condition. The patch + * will be performed only if the ETag of the job on the server matches this + * value. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginUpdateWithHttpOperationResponse(resourceGroupName, jobName, jobResourceUpdateParameter, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdate(resourceGroupName, jobName, jobResourceUpdateParameter, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates the properties of an existing job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} jobResourceUpdateParameter Job update parameters from + * request body. + * + * @param {object} jobResourceUpdateParameter.details Details of a job to be + * updated. + * + * @param {object} [jobResourceUpdateParameter.details.contactDetails] Contact + * details for notification and shipping. + * + * @param {string} + * [jobResourceUpdateParameter.details.contactDetails.contactName] Contact name + * of the person. + * + * @param {string} jobResourceUpdateParameter.details.contactDetails.phone + * Phone number of the contact person. + * + * @param {string} + * [jobResourceUpdateParameter.details.contactDetails.phoneExtension] Phone + * extension number of the contact person. + * + * @param {string} [jobResourceUpdateParameter.details.contactDetails.mobile] + * Mobile number of the contact person. + * + * @param {array} jobResourceUpdateParameter.details.contactDetails.emailList + * List of Email-ids to be notified about job progress. + * + * @param {array} + * [jobResourceUpdateParameter.details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * + * @param {object} [jobResourceUpdateParameter.details.shippingAddress] + * Shipping address of the customer. + * + * @param {string} + * jobResourceUpdateParameter.details.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [jobResourceUpdateParameter.details.shippingAddress.city] + * Name of the City. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.stateOrProvince] Name of + * the State or Province. + * + * @param {string} jobResourceUpdateParameter.details.shippingAddress.country + * Name of the Country. + * + * @param {string} + * jobResourceUpdateParameter.details.shippingAddress.postalCode Postal code. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.zipExtendedCode] + * Extended Zip Code. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.companyName] Name of the + * company. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {object} [jobResourceUpdateParameter.tags] The list of key value + * pairs that describe the resource. These tags can be used in viewing and + * grouping this resource (across resource groups). + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.ifMatch] Defines the If-Match condition. The patch + * will be performed only if the ETag of the job on the server matches this + * value. + * + * @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 {JobResource} - 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 JobResource} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdate(resourceGroupName, jobName, jobResourceUpdateParameter, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginUpdate(resourceGroupName, jobName, jobResourceUpdateParameter, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdate(resourceGroupName, jobName, jobResourceUpdateParameter, options, optionalCallback); + } + } + + /** + * Lists all the jobs available under the subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all the jobs available under the subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {JobResourceList} - 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 JobResourceList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Lists all the jobs available under the given resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all the jobs available under the given resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {JobResourceList} - 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 JobResourceList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroupNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = Jobs; diff --git a/lib/services/databox/lib/lib/operations/listSecrets.js b/lib/services/databox/lib/lib/operations/listSecrets.js new file mode 100644 index 0000000000..17726dd56b --- /dev/null +++ b/lib/services/databox/lib/lib/operations/listSecrets.js @@ -0,0 +1,281 @@ +/* + * 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; + +/** + * This method gets the unencrypted secrets related to the job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @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 UnencryptedSecrets} 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 _listByJobs(resourceGroupName, jobName, 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.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 (jobName !== null && jobName !== undefined) { + if (jobName.length > 24) + { + throw new Error('"jobName" should satisfy the constraint - "MaxLength": 24'); + } + if (jobName.length < 3) + { + throw new Error('"jobName" should satisfy the constraint - "MinLength": 3'); + } + if (jobName.match(/^[-\w\.]+$/) === null) + { + throw new Error('"jobName" should satisfy the constraint - "Pattern": /^[-\w\.]+$/'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion 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.DataBox/jobs/{jobName}/listSecrets'; + 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('&'); + } + + // 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().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['UnencryptedSecrets']().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 ListSecrets. */ +class ListSecrets { + /** + * Create a ListSecrets. + * @param {DataBoxManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._listByJobs = _listByJobs; + } + + /** + * This method gets the unencrypted secrets related to the job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @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. + */ + listByJobsWithHttpOperationResponse(resourceGroupName, jobName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByJobs(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; + }); + }); + } + + /** + * This method gets the unencrypted secrets related to the job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @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 {UnencryptedSecrets} - 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 UnencryptedSecrets} 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. + */ + listByJobs(resourceGroupName, jobName, 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._listByJobs(resourceGroupName, jobName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByJobs(resourceGroupName, jobName, options, optionalCallback); + } + } + +} + +module.exports = ListSecrets; diff --git a/lib/services/databox/lib/lib/operations/operations.js b/lib/services/databox/lib/lib/operations/operations.js new file mode 100644 index 0000000000..a9780b8d99 --- /dev/null +++ b/lib/services/databox/lib/lib/operations/operations.js @@ -0,0 +1,449 @@ +/* + * 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; + +/** + * This method gets all the operations. + * + * @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 OperationList} 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion 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.DataBox/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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().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['OperationList']().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); + }); +} + +/** + * This method gets all the operations. + * + * @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 OperationList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().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['OperationList']().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 {DataBoxManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._listNext = _listNext; + } + + /** + * This method gets all the operations. + * + * @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; + }); + }); + } + + /** + * This method gets all the operations. + * + * @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 {OperationList} - 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 OperationList} 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); + } + } + + /** + * This method gets all the operations. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * This method gets all the operations. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {OperationList} - 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 OperationList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = Operations; diff --git a/lib/services/databox/lib/lib/operations/service.js b/lib/services/databox/lib/lib/operations/service.js new file mode 100644 index 0000000000..c833ed4327 --- /dev/null +++ b/lib/services/databox/lib/lib/operations/service.js @@ -0,0 +1,869 @@ +/* + * 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; + +/** + * This method provides the list of available skus for the given subscription + * and location. + * + * @param {string} location The location of the resource + * + * @param {object} availableSkuRequest Filters for showing the available skus. + * + * @param {string} availableSkuRequest.country ISO country code. Country for + * hardware shipment. For codes check: + * https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + * + * @param {string} availableSkuRequest.location Location for data transfer. For + * locations check: + * https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + * + * @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 AvailableSkusResult} 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 _listAvailableSkus(location, availableSkuRequest, 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.'); + } + if (availableSkuRequest === null || availableSkuRequest === undefined) + { + availableSkuRequest = {}; + } + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (location === null || location === undefined || typeof location.valueOf() !== 'string') { + throw new Error('location cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (availableSkuRequest === null || availableSkuRequest === undefined) { + throw new Error('availableSkuRequest cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/availableSkus'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{location}', encodeURIComponent(location)); + 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]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (availableSkuRequest !== null && availableSkuRequest !== undefined) { + let requestModelMapper = new client.models['AvailableSkuRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, availableSkuRequest, 'availableSkuRequest'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(availableSkuRequest, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().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['AvailableSkusResult']().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); + }); +} + +/** + * This method validates the customer shipping address and provide alternate + * addresses if any. + * + * @param {string} location The location of the resource + * + * @param {object} validateAddress Shipping address of the customer. + * + * @param {object} [validateAddress.shippingAddress] Shipping address of the + * customer. + * + * @param {string} validateAddress.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} [validateAddress.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} [validateAddress.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [validateAddress.shippingAddress.city] Name of the City. + * + * @param {string} [validateAddress.shippingAddress.stateOrProvince] Name of + * the State or Province. + * + * @param {string} validateAddress.shippingAddress.country Name of the Country. + * + * @param {string} validateAddress.shippingAddress.postalCode Postal code. + * + * @param {string} [validateAddress.shippingAddress.zipExtendedCode] Extended + * Zip Code. + * + * @param {string} [validateAddress.shippingAddress.companyName] Name of the + * company. + * + * @param {string} [validateAddress.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {string} [validateAddress.deviceType] Device type to be used for the + * job. Possible values include: 'Pod', 'Disk', 'Cabinet' + * + * @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 AddressValidationOutput} 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 _validateAddressMethod(location, validateAddress, 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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (location === null || location === undefined || typeof location.valueOf() !== 'string') { + throw new Error('location cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (validateAddress === null || validateAddress === undefined) { + throw new Error('validateAddress cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{location}', encodeURIComponent(location)); + 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]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (validateAddress !== null && validateAddress !== undefined) { + let requestModelMapper = new client.models['ValidateAddress']().mapper(); + requestModel = client.serialize(requestModelMapper, validateAddress, 'validateAddress'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(validateAddress, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().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['AddressValidationOutput']().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); + }); +} + +/** + * This method provides the list of available skus for the given subscription + * and location. + * + * @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 AvailableSkusResult} 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 _listAvailableSkusNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = '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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().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['AvailableSkusResult']().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 Service. */ +class Service { + /** + * Create a Service. + * @param {DataBoxManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._listAvailableSkus = _listAvailableSkus; + this._validateAddressMethod = _validateAddressMethod; + this._listAvailableSkusNext = _listAvailableSkusNext; + } + + /** + * This method provides the list of available skus for the given subscription + * and location. + * + * @param {string} location The location of the resource + * + * @param {object} availableSkuRequest Filters for showing the available skus. + * + * @param {string} availableSkuRequest.country ISO country code. Country for + * hardware shipment. For codes check: + * https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + * + * @param {string} availableSkuRequest.location Location for data transfer. For + * locations check: + * https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + * + * @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. + */ + listAvailableSkusWithHttpOperationResponse(location, availableSkuRequest, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAvailableSkus(location, availableSkuRequest, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * This method provides the list of available skus for the given subscription + * and location. + * + * @param {string} location The location of the resource + * + * @param {object} availableSkuRequest Filters for showing the available skus. + * + * @param {string} availableSkuRequest.country ISO country code. Country for + * hardware shipment. For codes check: + * https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + * + * @param {string} availableSkuRequest.location Location for data transfer. For + * locations check: + * https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + * + * @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 {AvailableSkusResult} - 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 AvailableSkusResult} 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. + */ + listAvailableSkus(location, availableSkuRequest, 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._listAvailableSkus(location, availableSkuRequest, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAvailableSkus(location, availableSkuRequest, options, optionalCallback); + } + } + + /** + * This method validates the customer shipping address and provide alternate + * addresses if any. + * + * @param {string} location The location of the resource + * + * @param {object} validateAddress Shipping address of the customer. + * + * @param {object} [validateAddress.shippingAddress] Shipping address of the + * customer. + * + * @param {string} validateAddress.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} [validateAddress.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} [validateAddress.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [validateAddress.shippingAddress.city] Name of the City. + * + * @param {string} [validateAddress.shippingAddress.stateOrProvince] Name of + * the State or Province. + * + * @param {string} validateAddress.shippingAddress.country Name of the Country. + * + * @param {string} validateAddress.shippingAddress.postalCode Postal code. + * + * @param {string} [validateAddress.shippingAddress.zipExtendedCode] Extended + * Zip Code. + * + * @param {string} [validateAddress.shippingAddress.companyName] Name of the + * company. + * + * @param {string} [validateAddress.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {string} [validateAddress.deviceType] Device type to be used for the + * job. Possible values include: 'Pod', 'Disk', 'Cabinet' + * + * @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. + */ + validateAddressMethodWithHttpOperationResponse(location, validateAddress, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._validateAddressMethod(location, validateAddress, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * This method validates the customer shipping address and provide alternate + * addresses if any. + * + * @param {string} location The location of the resource + * + * @param {object} validateAddress Shipping address of the customer. + * + * @param {object} [validateAddress.shippingAddress] Shipping address of the + * customer. + * + * @param {string} validateAddress.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} [validateAddress.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} [validateAddress.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [validateAddress.shippingAddress.city] Name of the City. + * + * @param {string} [validateAddress.shippingAddress.stateOrProvince] Name of + * the State or Province. + * + * @param {string} validateAddress.shippingAddress.country Name of the Country. + * + * @param {string} validateAddress.shippingAddress.postalCode Postal code. + * + * @param {string} [validateAddress.shippingAddress.zipExtendedCode] Extended + * Zip Code. + * + * @param {string} [validateAddress.shippingAddress.companyName] Name of the + * company. + * + * @param {string} [validateAddress.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {string} [validateAddress.deviceType] Device type to be used for the + * job. Possible values include: 'Pod', 'Disk', 'Cabinet' + * + * @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 {AddressValidationOutput} - 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 AddressValidationOutput} 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. + */ + validateAddressMethod(location, validateAddress, 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._validateAddressMethod(location, validateAddress, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._validateAddressMethod(location, validateAddress, options, optionalCallback); + } + } + + /** + * This method provides the list of available skus for the given subscription + * and location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listAvailableSkusNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAvailableSkusNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * This method provides the list of available skus for the given subscription + * and location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {AvailableSkusResult} - 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 AvailableSkusResult} 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. + */ + listAvailableSkusNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listAvailableSkusNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAvailableSkusNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = Service; diff --git a/lib/services/databox/lib/models/accountCopyLogDetails.js b/lib/services/databox/lib/models/accountCopyLogDetails.js new file mode 100644 index 0000000000..dcf96065ff --- /dev/null +++ b/lib/services/databox/lib/models/accountCopyLogDetails.js @@ -0,0 +1,77 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Copy log details for an storage account + * + * @extends models['CopyLogDetails'] + */ +class AccountCopyLogDetails extends models['CopyLogDetails'] { + /** + * Create a AccountCopyLogDetails. + * @member {string} accountName Destination account name. + * @member {string} copyLogLink Link for copy logs. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AccountCopyLogDetails + * + * @returns {object} metadata of AccountCopyLogDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'Pod', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'copyLogDetailsType', + clientName: 'copyLogDetailsType' + }, + uberParent: 'CopyLogDetails', + className: 'AccountCopyLogDetails', + modelProperties: { + copyLogDetailsType: { + required: true, + serializedName: 'copyLogDetailsType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + accountName: { + required: true, + serializedName: 'accountName', + type: { + name: 'String' + } + }, + copyLogLink: { + required: true, + serializedName: 'copyLogLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AccountCopyLogDetails; diff --git a/lib/services/databox/lib/models/accountCredentialDetails.js b/lib/services/databox/lib/models/accountCredentialDetails.js new file mode 100644 index 0000000000..7e61fc5d4e --- /dev/null +++ b/lib/services/databox/lib/models/accountCredentialDetails.js @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Credential details of the account. + * + */ +class AccountCredentialDetails { + /** + * Create a AccountCredentialDetails. + * @member {string} [accountName] Name of the account. + * @member {array} shareCredentialDetails Per share level unencrypted access + * credentials. + */ + constructor() { + } + + /** + * Defines the metadata of AccountCredentialDetails + * + * @returns {object} metadata of AccountCredentialDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'AccountCredentialDetails', + type: { + name: 'Composite', + className: 'AccountCredentialDetails', + modelProperties: { + accountName: { + required: false, + serializedName: 'accountName', + type: { + name: 'String' + } + }, + shareCredentialDetails: { + required: true, + serializedName: 'shareCredentialDetails', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ShareCredentialDetailsElementType', + type: { + name: 'Composite', + className: 'ShareCredentialDetails' + } + } + } + } + } + } + }; + } +} + +module.exports = AccountCredentialDetails; diff --git a/lib/services/databox/lib/models/addressValidationOutput.js b/lib/services/databox/lib/models/addressValidationOutput.js new file mode 100644 index 0000000000..6a714b7a18 --- /dev/null +++ b/lib/services/databox/lib/models/addressValidationOutput.js @@ -0,0 +1,72 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Output of the address validation api. + * + */ +class AddressValidationOutput { + /** + * Create a AddressValidationOutput. + * @member {string} [validationStatus] The address validation status. + * Possible values include: 'Valid', 'Invalid', 'Ambiguous' + * @member {array} [alternateAddresses] List of alternate addresses. + */ + constructor() { + } + + /** + * Defines the metadata of AddressValidationOutput + * + * @returns {object} metadata of AddressValidationOutput + * + */ + mapper() { + return { + required: false, + serializedName: 'AddressValidationOutput', + type: { + name: 'Composite', + className: 'AddressValidationOutput', + modelProperties: { + validationStatus: { + required: false, + serializedName: 'properties.validationStatus', + type: { + name: 'Enum', + allowedValues: [ 'Valid', 'Invalid', 'Ambiguous' ] + } + }, + alternateAddresses: { + required: false, + serializedName: 'properties.alternateAddresses', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ShippingAddressElementType', + type: { + name: 'Composite', + className: 'ShippingAddress' + } + } + } + } + } + } + }; + } +} + +module.exports = AddressValidationOutput; diff --git a/lib/services/databox/lib/models/armBaseObject.js b/lib/services/databox/lib/models/armBaseObject.js new file mode 100644 index 0000000000..a20f3e73cf --- /dev/null +++ b/lib/services/databox/lib/models/armBaseObject.js @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Base class for all objects under resource. + * + */ +class ArmBaseObject { + /** + * Create a ArmBaseObject. + * @member {string} [name] Name of the object. + * @member {string} [id] Id of the object. + * @member {string} [type] Type of the object. + */ + constructor() { + } + + /** + * Defines the metadata of ArmBaseObject + * + * @returns {object} metadata of ArmBaseObject + * + */ + mapper() { + return { + required: false, + serializedName: 'ArmBaseObject', + type: { + name: 'Composite', + className: 'ArmBaseObject', + modelProperties: { + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ArmBaseObject; diff --git a/lib/services/databox/lib/models/availableSkuRequest.js b/lib/services/databox/lib/models/availableSkuRequest.js new file mode 100644 index 0000000000..764639e032 --- /dev/null +++ b/lib/services/databox/lib/models/availableSkuRequest.js @@ -0,0 +1,72 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The filters for showing the available skus. + * + */ +class AvailableSkuRequest { + /** + * Create a AvailableSkuRequest. + * @member {string} country ISO country code. Country for hardware shipment. + * For codes check: + * https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + * @member {string} location Location for data transfer. For locations check: + * https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + */ + constructor() { + } + + /** + * Defines the metadata of AvailableSkuRequest + * + * @returns {object} metadata of AvailableSkuRequest + * + */ + mapper() { + return { + required: false, + serializedName: 'AvailableSkuRequest', + type: { + name: 'Composite', + className: 'AvailableSkuRequest', + modelProperties: { + transferType: { + required: true, + isConstant: true, + serializedName: 'transferType', + defaultValue: 'ImportToAzure', + type: { + name: 'String' + } + }, + country: { + required: true, + serializedName: 'country', + type: { + name: 'String' + } + }, + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AvailableSkuRequest; diff --git a/lib/services/databox/lib/models/availableSkusResult.js b/lib/services/databox/lib/models/availableSkusResult.js new file mode 100644 index 0000000000..30d34e2ab7 --- /dev/null +++ b/lib/services/databox/lib/models/availableSkusResult.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'; + +/** + * The available skus operation response. + */ +class AvailableSkusResult extends Array { + /** + * Create a AvailableSkusResult. + * @member {string} [nextLink] Link for the next set of skus. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AvailableSkusResult + * + * @returns {object} metadata of AvailableSkusResult + * + */ + mapper() { + return { + required: false, + serializedName: 'AvailableSkusResult', + type: { + name: 'Composite', + className: 'AvailableSkusResult', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SkuInformationElementType', + type: { + name: 'Composite', + className: 'SkuInformation' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AvailableSkusResult; diff --git a/lib/services/databox/lib/models/cabinetJobSecrets.js b/lib/services/databox/lib/models/cabinetJobSecrets.js new file mode 100644 index 0000000000..ea5c5f3cf1 --- /dev/null +++ b/lib/services/databox/lib/models/cabinetJobSecrets.js @@ -0,0 +1,78 @@ +/* + * 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'); + +/** + * The secrets related to a cabinet job. + * + * @extends models['JobSecrets'] + */ +class CabinetJobSecrets extends models['JobSecrets'] { + /** + * Create a CabinetJobSecrets. + * @member {array} [cabinetPodSecrets] Contains the list of secret objects + * for a cabinet job. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of CabinetJobSecrets + * + * @returns {object} metadata of CabinetJobSecrets + * + */ + mapper() { + return { + required: false, + serializedName: 'Cabinet', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'jobSecretsType', + clientName: 'jobSecretsType' + }, + uberParent: 'JobSecrets', + className: 'CabinetJobSecrets', + modelProperties: { + jobSecretsType: { + required: true, + serializedName: 'jobSecretsType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + cabinetPodSecrets: { + required: false, + serializedName: 'cabinetPodSecrets', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CabinetPodSecretElementType', + type: { + name: 'Composite', + className: 'CabinetPodSecret' + } + } + } + } + } + } + }; + } +} + +module.exports = CabinetJobSecrets; diff --git a/lib/services/databox/lib/models/cabinetPodSecret.js b/lib/services/databox/lib/models/cabinetPodSecret.js new file mode 100644 index 0000000000..e3750c7098 --- /dev/null +++ b/lib/services/databox/lib/models/cabinetPodSecret.js @@ -0,0 +1,81 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The secrets related to a cabinet pod. + * + */ +class CabinetPodSecret { + /** + * Create a CabinetPodSecret. + * @member {string} [deviceSerialNumber] Serial number of the assigned + * device. + * @member {string} [devicePassword] Password for out of the box experience + * on device. + * @member {array} [accountCredentialDetails] Per account level access + * credentials. + */ + constructor() { + } + + /** + * Defines the metadata of CabinetPodSecret + * + * @returns {object} metadata of CabinetPodSecret + * + */ + mapper() { + return { + required: false, + serializedName: 'CabinetPodSecret', + type: { + name: 'Composite', + className: 'CabinetPodSecret', + modelProperties: { + deviceSerialNumber: { + required: false, + serializedName: 'deviceSerialNumber', + type: { + name: 'String' + } + }, + devicePassword: { + required: false, + serializedName: 'devicePassword', + type: { + name: 'String' + } + }, + accountCredentialDetails: { + required: false, + serializedName: 'accountCredentialDetails', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AccountCredentialDetailsElementType', + type: { + name: 'Composite', + className: 'AccountCredentialDetails' + } + } + } + } + } + } + }; + } +} + +module.exports = CabinetPodSecret; diff --git a/lib/services/databox/lib/models/cancellationReason.js b/lib/services/databox/lib/models/cancellationReason.js new file mode 100644 index 0000000000..ad05bc05e3 --- /dev/null +++ b/lib/services/databox/lib/models/cancellationReason.js @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Reason for cancellation. + * + */ +class CancellationReason { + /** + * Create a CancellationReason. + * @member {string} reason Reason for cancellation. + */ + constructor() { + } + + /** + * Defines the metadata of CancellationReason + * + * @returns {object} metadata of CancellationReason + * + */ + mapper() { + return { + required: false, + serializedName: 'CancellationReason', + type: { + name: 'Composite', + className: 'CancellationReason', + modelProperties: { + reason: { + required: true, + serializedName: 'reason', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CancellationReason; diff --git a/lib/services/databox/lib/models/contactDetails.js b/lib/services/databox/lib/models/contactDetails.js new file mode 100644 index 0000000000..1d5c8bc645 --- /dev/null +++ b/lib/services/databox/lib/models/contactDetails.js @@ -0,0 +1,112 @@ +/* + * 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'); + +/** + * Contact Details. + * + */ +class ContactDetails { + /** + * Create a ContactDetails. + * @member {string} [contactName] Contact name of the person. + * @member {string} phone Phone number of the contact person. + * @member {string} [phoneExtension] Phone extension number of the contact + * person. + * @member {string} [mobile] Mobile number of the contact person. + * @member {array} emailList List of Email-ids to be notified about job + * progress. + * @member {array} [notificationPreference] Notification preference for a job + * stage. + */ + constructor() { + } + + /** + * Defines the metadata of ContactDetails + * + * @returns {object} metadata of ContactDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'ContactDetails', + type: { + name: 'Composite', + className: 'ContactDetails', + modelProperties: { + contactName: { + required: false, + serializedName: 'contactName', + type: { + name: 'String' + } + }, + phone: { + required: true, + serializedName: 'phone', + type: { + name: 'String' + } + }, + phoneExtension: { + required: false, + serializedName: 'phoneExtension', + type: { + name: 'String' + } + }, + mobile: { + required: false, + serializedName: 'mobile', + type: { + name: 'String' + } + }, + emailList: { + required: true, + serializedName: 'emailList', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + notificationPreference: { + required: false, + serializedName: 'notificationPreference', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NotificationPreferenceElementType', + type: { + name: 'Composite', + className: 'NotificationPreference' + } + } + } + } + } + } + }; + } +} + +module.exports = ContactDetails; diff --git a/lib/services/databox/lib/models/copyLogDetails.js b/lib/services/databox/lib/models/copyLogDetails.js new file mode 100644 index 0000000000..0e75a970ff --- /dev/null +++ b/lib/services/databox/lib/models/copyLogDetails.js @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Details for log generated during copy. + * + */ +class CopyLogDetails { + /** + * Create a CopyLogDetails. + * @member {string} copyLogDetailsType Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of CopyLogDetails + * + * @returns {object} metadata of CopyLogDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'CopyLogDetails', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'copyLogDetailsType', + clientName: 'copyLogDetailsType' + }, + uberParent: 'CopyLogDetails', + className: 'CopyLogDetails', + modelProperties: { + copyLogDetailsType: { + required: true, + serializedName: 'copyLogDetailsType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CopyLogDetails; diff --git a/lib/services/databox/lib/models/copyProgress.js b/lib/services/databox/lib/models/copyProgress.js new file mode 100644 index 0000000000..059996be29 --- /dev/null +++ b/lib/services/databox/lib/models/copyProgress.js @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Copy progress. + * + */ +class CopyProgress { + /** + * Create a CopyProgress. + * @member {string} [storageAccountName] Name of the storage account where + * the data needs to be uploaded. + * @member {number} [bytesSentToCloud] Amount of data uploaded by the job as + * of now. + * @member {number} [totalBytesToProcess] Total amount of data to be + * processed by the job. + */ + constructor() { + } + + /** + * Defines the metadata of CopyProgress + * + * @returns {object} metadata of CopyProgress + * + */ + mapper() { + return { + required: false, + serializedName: 'CopyProgress', + type: { + name: 'Composite', + className: 'CopyProgress', + modelProperties: { + storageAccountName: { + required: false, + serializedName: 'storageAccountName', + type: { + name: 'String' + } + }, + bytesSentToCloud: { + required: false, + serializedName: 'bytesSentToCloud', + type: { + name: 'Number' + } + }, + totalBytesToProcess: { + required: false, + serializedName: 'totalBytesToProcess', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = CopyProgress; diff --git a/lib/services/databox/lib/models/destinationAccountDetails.js b/lib/services/databox/lib/models/destinationAccountDetails.js new file mode 100644 index 0000000000..c1a7a7c680 --- /dev/null +++ b/lib/services/databox/lib/models/destinationAccountDetails.js @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Details for the destination account. + * + */ +class DestinationAccountDetails { + /** + * Create a DestinationAccountDetails. + * @member {string} accountId Destination storage account id. + */ + constructor() { + } + + /** + * Defines the metadata of DestinationAccountDetails + * + * @returns {object} metadata of DestinationAccountDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'DestinationAccountDetails', + type: { + name: 'Composite', + className: 'DestinationAccountDetails', + modelProperties: { + accountId: { + required: true, + serializedName: 'accountId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DestinationAccountDetails; diff --git a/lib/services/databox/lib/models/destinationToServiceLocationMap.js b/lib/services/databox/lib/models/destinationToServiceLocationMap.js new file mode 100644 index 0000000000..3cc7439239 --- /dev/null +++ b/lib/services/databox/lib/models/destinationToServiceLocationMap.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'; + +/** + * Map of destination location to service location + * + */ +class DestinationToServiceLocationMap { + /** + * Create a DestinationToServiceLocationMap. + * @member {string} [destinationLocation] Location of the destination. + * @member {string} [serviceLocation] Location of the service. + */ + constructor() { + } + + /** + * Defines the metadata of DestinationToServiceLocationMap + * + * @returns {object} metadata of DestinationToServiceLocationMap + * + */ + mapper() { + return { + required: false, + serializedName: 'DestinationToServiceLocationMap', + type: { + name: 'Composite', + className: 'DestinationToServiceLocationMap', + modelProperties: { + destinationLocation: { + required: false, + serializedName: 'destinationLocation', + type: { + name: 'String' + } + }, + serviceLocation: { + required: false, + serializedName: 'serviceLocation', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DestinationToServiceLocationMap; diff --git a/lib/services/databox/lib/models/diskCopyLogDetails.js b/lib/services/databox/lib/models/diskCopyLogDetails.js new file mode 100644 index 0000000000..cc97df9eb0 --- /dev/null +++ b/lib/services/databox/lib/models/diskCopyLogDetails.js @@ -0,0 +1,85 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Copy Log Details for a disk + * + * @extends models['CopyLogDetails'] + */ +class DiskCopyLogDetails extends models['CopyLogDetails'] { + /** + * Create a DiskCopyLogDetails. + * @member {string} diskSerialNumber Disk Serial Number. + * @member {string} errorLogLink Link for copy error logs. + * @member {string} verboseLogLink Link for copy verbose logs. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DiskCopyLogDetails + * + * @returns {object} metadata of DiskCopyLogDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'Disk', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'copyLogDetailsType', + clientName: 'copyLogDetailsType' + }, + uberParent: 'CopyLogDetails', + className: 'DiskCopyLogDetails', + modelProperties: { + copyLogDetailsType: { + required: true, + serializedName: 'copyLogDetailsType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + diskSerialNumber: { + required: true, + serializedName: 'diskSerialNumber', + type: { + name: 'String' + } + }, + errorLogLink: { + required: true, + serializedName: 'errorLogLink', + type: { + name: 'String' + } + }, + verboseLogLink: { + required: true, + serializedName: 'verboseLogLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DiskCopyLogDetails; diff --git a/lib/services/databox/lib/models/diskCopyProgress.js b/lib/services/databox/lib/models/diskCopyProgress.js new file mode 100644 index 0000000000..00f9fe4e44 --- /dev/null +++ b/lib/services/databox/lib/models/diskCopyProgress.js @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Disk Copy Progress + * + */ +class DiskCopyProgress { + /** + * Create a DiskCopyProgress. + * @member {string} [serialNumber] The serial number of the disk + * @member {number} [percentComplete] Indicates the percentage completed for + * the copy of the disk. + * @member {string} [status] The Status of the copy. Possible values include: + * 'NotStarted', 'InProgress', 'Completed', 'CompletedWithErrors', 'Failed' + */ + constructor() { + } + + /** + * Defines the metadata of DiskCopyProgress + * + * @returns {object} metadata of DiskCopyProgress + * + */ + mapper() { + return { + required: false, + serializedName: 'DiskCopyProgress', + type: { + name: 'Composite', + className: 'DiskCopyProgress', + modelProperties: { + serialNumber: { + required: false, + serializedName: 'serialNumber', + type: { + name: 'String' + } + }, + percentComplete: { + required: false, + serializedName: 'percentComplete', + type: { + name: 'Number' + } + }, + status: { + required: false, + serializedName: 'status', + type: { + name: 'Enum', + allowedValues: [ 'NotStarted', 'InProgress', 'Completed', 'CompletedWithErrors', 'Failed' ] + } + } + } + } + }; + } +} + +module.exports = DiskCopyProgress; diff --git a/lib/services/databox/lib/models/diskJobDetails.js b/lib/services/databox/lib/models/diskJobDetails.js new file mode 100644 index 0000000000..c173737812 --- /dev/null +++ b/lib/services/databox/lib/models/diskJobDetails.js @@ -0,0 +1,165 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Disk Job Details. + * + * @extends models['JobDetails'] + */ +class DiskJobDetails extends models['JobDetails'] { + /** + * Create a DiskJobDetails. + * @member {object} [preferredDisks] User preference on what size disks are + * needed for the job. The map is from the disk size in TB to the count. Eg. + * {2,5} means 5 disks of 2 TB size. Key is string but will be checked + * against an int. + * @member {array} [copyProgress] Copy progress per disk. + * @member {object} [disksAndSizeDetails] Contains the map of disk serial + * number to the disk size being used for the job. Is returned only after the + * disks are shipped to the customer. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DiskJobDetails + * + * @returns {object} metadata of DiskJobDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'Disk', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'jobDetailsType', + clientName: 'jobDetailsType' + }, + uberParent: 'JobDetails', + className: 'DiskJobDetails', + modelProperties: { + expectedDataSizeInTeraBytes: { + required: false, + serializedName: 'expectedDataSizeInTeraBytes', + type: { + name: 'Number' + } + }, + jobStages: { + required: false, + serializedName: 'jobStages', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'JobStagesElementType', + type: { + name: 'Composite', + className: 'JobStages' + } + } + } + }, + contactDetails: { + required: true, + serializedName: 'contactDetails', + type: { + name: 'Composite', + className: 'ContactDetails' + } + }, + shippingAddress: { + required: true, + serializedName: 'shippingAddress', + type: { + name: 'Composite', + className: 'ShippingAddress' + } + }, + errorDetails: { + required: false, + serializedName: 'errorDetails', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'JobErrorDetailsElementType', + type: { + name: 'Composite', + className: 'JobErrorDetails' + } + } + } + }, + jobDetailsType: { + required: true, + serializedName: 'jobDetailsType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + preferredDisks: { + required: false, + serializedName: 'preferredDisks', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'NumberElementType', + type: { + name: 'Number' + } + } + } + }, + copyProgress: { + required: false, + serializedName: 'copyProgress', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DiskCopyProgressElementType', + type: { + name: 'Composite', + className: 'DiskCopyProgress' + } + } + } + }, + disksAndSizeDetails: { + required: false, + serializedName: 'disksAndSizeDetails', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'NumberElementType', + type: { + name: 'Number' + } + } + } + } + } + } + }; + } +} + +module.exports = DiskJobDetails; diff --git a/lib/services/databox/lib/models/diskJobSecrets.js b/lib/services/databox/lib/models/diskJobSecrets.js new file mode 100644 index 0000000000..79a07b08c8 --- /dev/null +++ b/lib/services/databox/lib/models/diskJobSecrets.js @@ -0,0 +1,78 @@ +/* + * 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'); + +/** + * The secrets related to disk job. + * + * @extends models['JobSecrets'] + */ +class DiskJobSecrets extends models['JobSecrets'] { + /** + * Create a DiskJobSecrets. + * @member {array} [diskSecrets] Contains the list of secrets object for that + * device. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DiskJobSecrets + * + * @returns {object} metadata of DiskJobSecrets + * + */ + mapper() { + return { + required: false, + serializedName: 'Disk', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'jobSecretsType', + clientName: 'jobSecretsType' + }, + uberParent: 'JobSecrets', + className: 'DiskJobSecrets', + modelProperties: { + jobSecretsType: { + required: true, + serializedName: 'jobSecretsType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + diskSecrets: { + required: false, + serializedName: 'diskSecrets', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DiskSecretElementType', + type: { + name: 'Composite', + className: 'DiskSecret' + } + } + } + } + } + } + }; + } +} + +module.exports = DiskJobSecrets; diff --git a/lib/services/databox/lib/models/diskSecret.js b/lib/services/databox/lib/models/diskSecret.js new file mode 100644 index 0000000000..be43889867 --- /dev/null +++ b/lib/services/databox/lib/models/diskSecret.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Contains all the secrets of a Disk. + * + */ +class DiskSecret { + /** + * Create a DiskSecret. + * @member {string} [diskSerialNumber] Serial number of the assigned disk. + * @member {string} [bitLockerKey] Bit Locker key of the disk which can be + * used to unlock the disk to copy data. + */ + constructor() { + } + + /** + * Defines the metadata of DiskSecret + * + * @returns {object} metadata of DiskSecret + * + */ + mapper() { + return { + required: false, + serializedName: 'DiskSecret', + type: { + name: 'Composite', + className: 'DiskSecret', + modelProperties: { + diskSerialNumber: { + required: false, + serializedName: 'diskSerialNumber', + type: { + name: 'String' + } + }, + bitLockerKey: { + required: false, + serializedName: 'bitLockerKey', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DiskSecret; diff --git a/lib/services/databox/lib/models/errorModel.js b/lib/services/databox/lib/models/errorModel.js new file mode 100644 index 0000000000..33c142bbd2 --- /dev/null +++ b/lib/services/databox/lib/models/errorModel.js @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Top level error for the job. + * + */ +class ErrorModel { + /** + * Create a ErrorModel. + * @member {string} code Error code that can be used to programmatically + * identify the error. + * @member {string} [message] Describes the error in detail and provides + * debugging information. + */ + constructor() { + } + + /** + * Defines the metadata of ErrorModel + * + * @returns {object} metadata of ErrorModel + * + */ + mapper() { + return { + required: false, + serializedName: 'Error', + type: { + name: 'Composite', + className: 'ErrorModel', + modelProperties: { + code: { + required: true, + serializedName: 'code', + type: { + name: 'String' + } + }, + message: { + required: false, + serializedName: 'message', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ErrorModel; diff --git a/lib/services/databox/lib/models/getCopyLogsUriOutput.js b/lib/services/databox/lib/models/getCopyLogsUriOutput.js new file mode 100644 index 0000000000..ccf6147421 --- /dev/null +++ b/lib/services/databox/lib/models/getCopyLogsUriOutput.js @@ -0,0 +1,75 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Output for the GetCopyLogsUri. + * + */ +class GetCopyLogsUriOutput { + /** + * Create a GetCopyLogsUriOutput. + * @member {string} [logType] Type/Level of the log. + * @member {array} [copyLogDetails] List of copy log details. + */ + constructor() { + } + + /** + * Defines the metadata of GetCopyLogsUriOutput + * + * @returns {object} metadata of GetCopyLogsUriOutput + * + */ + mapper() { + return { + required: false, + serializedName: 'GetCopyLogsUriOutput', + type: { + name: 'Composite', + className: 'GetCopyLogsUriOutput', + modelProperties: { + logType: { + required: false, + serializedName: 'logType', + type: { + name: 'String' + } + }, + copyLogDetails: { + required: false, + serializedName: 'copyLogDetails', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CopyLogDetailsElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'copyLogDetailsType', + clientName: 'copyLogDetailsType' + }, + uberParent: 'CopyLogDetails', + className: 'CopyLogDetails' + } + } + } + } + } + } + }; + } +} + +module.exports = GetCopyLogsUriOutput; diff --git a/lib/services/databox/lib/models/index.d.ts b/lib/services/databox/lib/models/index.d.ts new file mode 100644 index 0000000000..caec5b29de --- /dev/null +++ b/lib/services/databox/lib/models/index.d.ts @@ -0,0 +1,1031 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import { BaseResource } from 'ms-rest-azure'; +import { CloudError } from 'ms-rest-azure'; +import * as moment from 'moment'; + +export { BaseResource } from 'ms-rest-azure'; +export { CloudError } from 'ms-rest-azure'; + + +/** + * @class + * Initializes a new instance of the CopyLogDetails class. + * @constructor + * Details for log generated during copy. + * + * @member {string} copyLogDetailsType Polymorphic Discriminator + */ +export interface CopyLogDetails { + copyLogDetailsType: string; +} + +/** + * @class + * Initializes a new instance of the AccountCopyLogDetails class. + * @constructor + * Copy log details for an storage account + * + * @member {string} accountName Destination account name. + * @member {string} copyLogLink Link for copy logs. + */ +export interface AccountCopyLogDetails extends CopyLogDetails { + accountName: string; + copyLogLink: string; +} + +/** + * @class + * Initializes a new instance of the ShareCredentialDetails class. + * @constructor + * Credential details of the shares in account. + * + * @member {string} [shareName] Name of the share. + * @member {string} [userName] User name for the share. + * @member {string} [password] Password for the share. + */ +export interface ShareCredentialDetails { + shareName?: string; + userName?: string; + password?: string; +} + +/** + * @class + * Initializes a new instance of the AccountCredentialDetails class. + * @constructor + * Credential details of the account. + * + * @member {string} [accountName] Name of the account. + * @member {array} shareCredentialDetails Per share level unencrypted access + * credentials. + */ +export interface AccountCredentialDetails { + accountName?: string; + shareCredentialDetails: ShareCredentialDetails[]; +} + +/** + * @class + * Initializes a new instance of the ShippingAddress class. + * @constructor + * Shipping address where customer wishes to receive the device. + * + * @member {string} streetAddress1 Street Address line 1. + * @member {string} [streetAddress2] Street Address line 2. + * @member {string} [streetAddress3] Street Address line 3. + * @member {string} [city] Name of the City. + * @member {string} [stateOrProvince] Name of the State or Province. + * @member {string} country Name of the Country. + * @member {string} postalCode Postal code. + * @member {string} [zipExtendedCode] Extended Zip Code. + * @member {string} [companyName] Name of the company. + * @member {string} [addressType] Type of address. Possible values include: + * 'None', 'Residential', 'Commercial' + */ +export interface ShippingAddress { + streetAddress1: string; + streetAddress2?: string; + streetAddress3?: string; + city?: string; + stateOrProvince?: string; + country: string; + postalCode: string; + zipExtendedCode?: string; + companyName?: string; + addressType?: string; +} + +/** + * @class + * Initializes a new instance of the AddressValidationOutput class. + * @constructor + * Output of the address validation api. + * + * @member {string} [validationStatus] The address validation status. Possible + * values include: 'Valid', 'Invalid', 'Ambiguous' + * @member {array} [alternateAddresses] List of alternate addresses. + */ +export interface AddressValidationOutput { + validationStatus?: string; + alternateAddresses?: ShippingAddress[]; +} + +/** + * @class + * Initializes a new instance of the ArmBaseObject class. + * @constructor + * Base class for all objects under resource. + * + * @member {string} [name] Name of the object. + * @member {string} [id] Id of the object. + * @member {string} [type] Type of the object. + */ +export interface ArmBaseObject { + readonly name?: string; + readonly id?: string; + readonly type?: string; +} + +/** + * @class + * Initializes a new instance of the AvailableSkuRequest class. + * @constructor + * The filters for showing the available skus. + * + * @member {string} country ISO country code. Country for hardware shipment. + * For codes check: + * https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + * @member {string} location Location for data transfer. For locations check: + * https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + */ +export interface AvailableSkuRequest { + country: string; + location: string; +} + +/** + * @class + * Initializes a new instance of the Sku class. + * @constructor + * The Sku. + * + * @member {string} name The sku name. + * @member {string} [displayName] The display name of the sku. + * @member {string} [family] The sku family. + */ +export interface Sku { + name: string; + displayName?: string; + family?: string; +} + +/** + * @class + * Initializes a new instance of the DestinationToServiceLocationMap class. + * @constructor + * Map of destination location to service location + * + * @member {string} [destinationLocation] Location of the destination. + * @member {string} [serviceLocation] Location of the service. + */ +export interface DestinationToServiceLocationMap { + destinationLocation?: string; + serviceLocation?: string; +} + +/** + * @class + * Initializes a new instance of the SkuCapacity class. + * @constructor + * Capacity of the sku. + * + * @member {string} usable Usable capacity in TB. + * @member {string} maximum Maximum capacity in TB. + */ +export interface SkuCapacity { + usable: string; + maximum: string; +} + +/** + * @class + * Initializes a new instance of the SkuCost class. + * @constructor + * Describes metadata for retrieving price info. + * + * @member {string} meterId Meter id of the Sku. + * @member {string} meterType The type of the meter. + */ +export interface SkuCost { + meterId: string; + meterType: string; +} + +/** + * @class + * Initializes a new instance of the SkuInformation class. + * @constructor + * Information of the sku. + * + * @member {object} sku The Sku. + * @member {string} [sku.name] The sku name. + * @member {string} [sku.displayName] The display name of the sku. + * @member {string} [sku.family] The sku family. + * @member {boolean} enabled The sku is enabled or not. + * @member {array} [destinationToServiceLocationMap] The map of destination + * location to service location. + * @member {object} capacity Capacity of the Sku. + * @member {string} [capacity.usable] Usable capacity in TB. + * @member {string} [capacity.maximum] Maximum capacity in TB. + * @member {array} costs Cost of the Sku. + * @member {array} apiVersions Api versions that support this Sku. + * @member {string} [disabledReason] Reason why the Sku is disabled. + */ +export interface SkuInformation { + sku: Sku; + enabled: boolean; + destinationToServiceLocationMap?: DestinationToServiceLocationMap[]; + capacity: SkuCapacity; + costs: SkuCost[]; + apiVersions: string[]; + disabledReason?: string; +} + +/** + * @class + * Initializes a new instance of the CabinetPodSecret class. + * @constructor + * The secrets related to a cabinet pod. + * + * @member {string} [deviceSerialNumber] Serial number of the assigned device. + * @member {string} [devicePassword] Password for out of the box experience on + * device. + * @member {array} [accountCredentialDetails] Per account level access + * credentials. + */ +export interface CabinetPodSecret { + deviceSerialNumber?: string; + devicePassword?: string; + accountCredentialDetails?: AccountCredentialDetails[]; +} + +/** + * @class + * Initializes a new instance of the JobSecrets class. + * @constructor + * The base class for the secrets + * + * @member {string} jobSecretsType Polymorphic Discriminator + */ +export interface JobSecrets { + jobSecretsType: string; +} + +/** + * @class + * Initializes a new instance of the CabinetJobSecrets class. + * @constructor + * The secrets related to a cabinet job. + * + * @member {array} [cabinetPodSecrets] Contains the list of secret objects for + * a cabinet job. + */ +export interface CabinetJobSecrets extends JobSecrets { + cabinetPodSecrets?: CabinetPodSecret[]; +} + +/** + * @class + * Initializes a new instance of the CancellationReason class. + * @constructor + * Reason for cancellation. + * + * @member {string} reason Reason for cancellation. + */ +export interface CancellationReason { + reason: string; +} + +/** + * @class + * Initializes a new instance of the NotificationPreference class. + * @constructor + * Notification preference for a job stage. + * + * @member {string} stageName Name of the stage. Possible values include: + * 'DevicePrepared', 'Dispatched', 'Delivered', 'PickedUp', 'AtAzureDC', + * 'DataCopy' + * @member {boolean} sendNotification Notification is required or not. + */ +export interface NotificationPreference { + stageName: string; + sendNotification: boolean; +} + +/** + * @class + * Initializes a new instance of the ContactDetails class. + * @constructor + * Contact Details. + * + * @member {string} [contactName] Contact name of the person. + * @member {string} phone Phone number of the contact person. + * @member {string} [phoneExtension] Phone extension number of the contact + * person. + * @member {string} [mobile] Mobile number of the contact person. + * @member {array} emailList List of Email-ids to be notified about job + * progress. + * @member {array} [notificationPreference] Notification preference for a job + * stage. + */ +export interface ContactDetails { + contactName?: string; + phone: string; + phoneExtension?: string; + mobile?: string; + emailList: string[]; + notificationPreference?: NotificationPreference[]; +} + +/** + * @class + * Initializes a new instance of the CopyProgress class. + * @constructor + * Copy progress. + * + * @member {string} [storageAccountName] Name of the storage account where the + * data needs to be uploaded. + * @member {number} [bytesSentToCloud] Amount of data uploaded by the job as of + * now. + * @member {number} [totalBytesToProcess] Total amount of data to be processed + * by the job. + */ +export interface CopyProgress { + storageAccountName?: string; + bytesSentToCloud?: number; + totalBytesToProcess?: number; +} + +/** + * @class + * Initializes a new instance of the DestinationAccountDetails class. + * @constructor + * Details for the destination account. + * + * @member {string} accountId Destination storage account id. + */ +export interface DestinationAccountDetails { + accountId: string; +} + +/** + * @class + * Initializes a new instance of the DiskCopyLogDetails class. + * @constructor + * Copy Log Details for a disk + * + * @member {string} diskSerialNumber Disk Serial Number. + * @member {string} errorLogLink Link for copy error logs. + * @member {string} verboseLogLink Link for copy verbose logs. + */ +export interface DiskCopyLogDetails extends CopyLogDetails { + diskSerialNumber: string; + errorLogLink: string; + verboseLogLink: string; +} + +/** + * @class + * Initializes a new instance of the DiskCopyProgress class. + * @constructor + * Disk Copy Progress + * + * @member {string} [serialNumber] The serial number of the disk + * @member {number} [percentComplete] Indicates the percentage completed for + * the copy of the disk. + * @member {string} [status] The Status of the copy. Possible values include: + * 'NotStarted', 'InProgress', 'Completed', 'CompletedWithErrors', 'Failed' + */ +export interface DiskCopyProgress { + serialNumber?: string; + percentComplete?: number; + status?: string; +} + +/** + * @class + * Initializes a new instance of the JobDetails class. + * @constructor + * Job details. + * + * @member {number} [expectedDataSizeInTeraBytes] The expected size of the + * data, which needs to be transfered in this job, in tera bytes. + * @member {array} [jobStages] List of stages that run in the job. + * @member {object} contactDetails Contact details for notification and + * shipping. + * @member {string} [contactDetails.contactName] Contact name of the person. + * @member {string} [contactDetails.phone] Phone number of the contact person. + * @member {string} [contactDetails.phoneExtension] Phone extension number of + * the contact person. + * @member {string} [contactDetails.mobile] Mobile number of the contact + * person. + * @member {array} [contactDetails.emailList] List of Email-ids to be notified + * about job progress. + * @member {array} [contactDetails.notificationPreference] Notification + * preference for a job stage. + * @member {object} shippingAddress Shipping address of the customer. + * @member {string} [shippingAddress.streetAddress1] Street Address line 1. + * @member {string} [shippingAddress.streetAddress2] Street Address line 2. + * @member {string} [shippingAddress.streetAddress3] Street Address line 3. + * @member {string} [shippingAddress.city] Name of the City. + * @member {string} [shippingAddress.stateOrProvince] Name of the State or + * Province. + * @member {string} [shippingAddress.country] Name of the Country. + * @member {string} [shippingAddress.postalCode] Postal code. + * @member {string} [shippingAddress.zipExtendedCode] Extended Zip Code. + * @member {string} [shippingAddress.companyName] Name of the company. + * @member {string} [shippingAddress.addressType] Type of address. Possible + * values include: 'None', 'Residential', 'Commercial' + * @member {array} [errorDetails] Error details for failure. This is optional. + * @member {string} jobDetailsType Polymorphic Discriminator + */ +export interface JobDetails { + expectedDataSizeInTeraBytes?: number; + jobStages?: JobStages[]; + contactDetails: ContactDetails; + shippingAddress: ShippingAddress; + errorDetails?: JobErrorDetails[]; + jobDetailsType: string; +} + +/** + * @class + * Initializes a new instance of the DiskJobDetails class. + * @constructor + * Disk Job Details. + * + * @member {object} [preferredDisks] User preference on what size disks are + * needed for the job. The map is from the disk size in TB to the count. Eg. + * {2,5} means 5 disks of 2 TB size. Key is string but will be checked against + * an int. + * @member {array} [copyProgress] Copy progress per disk. + * @member {object} [disksAndSizeDetails] Contains the map of disk serial + * number to the disk size being used for the job. Is returned only after the + * disks are shipped to the customer. + */ +export interface DiskJobDetails extends JobDetails { + preferredDisks?: { [propertyName: string]: number }; + copyProgress?: DiskCopyProgress[]; + disksAndSizeDetails?: { [propertyName: string]: number }; +} + +/** + * @class + * Initializes a new instance of the DiskSecret class. + * @constructor + * Contains all the secrets of a Disk. + * + * @member {string} [diskSerialNumber] Serial number of the assigned disk. + * @member {string} [bitLockerKey] Bit Locker key of the disk which can be used + * to unlock the disk to copy data. + */ +export interface DiskSecret { + diskSerialNumber?: string; + bitLockerKey?: string; +} + +/** + * @class + * Initializes a new instance of the DiskJobSecrets class. + * @constructor + * The secrets related to disk job. + * + * @member {array} [diskSecrets] Contains the list of secrets object for that + * device. + */ +export interface DiskJobSecrets extends JobSecrets { + diskSecrets?: DiskSecret[]; +} + +/** + * @class + * Initializes a new instance of the ErrorModel class. + * @constructor + * Top level error for the job. + * + * @member {string} code Error code that can be used to programmatically + * identify the error. + * @member {string} [message] Describes the error in detail and provides + * debugging information. + */ +export interface ErrorModel { + code: string; + message?: string; +} + +/** + * @class + * Initializes a new instance of the GetCopyLogsUriOutput class. + * @constructor + * Output for the GetCopyLogsUri. + * + * @member {string} [logType] Type/Level of the log. + * @member {array} [copyLogDetails] List of copy log details. + */ +export interface GetCopyLogsUriOutput { + logType?: string; + copyLogDetails?: CopyLogDetails[]; +} + +/** + * @class + * Initializes a new instance of the JobErrorDetails class. + * @constructor + * Job Error Details for providing the information and recommended action. + * + * @member {string} [errorMessage] Message for the error. + * @member {number} [errorCode] Code for the error. + * @member {string} [recommendedAction] Recommended action for the error. + * @member {string} [exceptionMessage] Contains the non localized exception + * message + */ +export interface JobErrorDetails { + errorMessage?: string; + errorCode?: number; + recommendedAction?: string; + exceptionMessage?: string; +} + +/** + * @class + * Initializes a new instance of the JobStages class. + * @constructor + * Job stages. + * + * @member {string} stageName Name of the job stage. Possible values include: + * 'DeviceOrdered', 'DevicePrepared', 'Dispatched', 'Delivered', 'PickedUp', + * 'AtAzureDC', 'DataCopy', 'Completed', 'CompletedWithErrors', 'Cancelled', + * 'Failed_IssueReportedAtCustomer', 'Failed_IssueDetectedAtAzureDC', 'Aborted' + * @member {string} [displayName] Display name of the job stage. + * @member {string} stageStatus Status of the job stage. Possible values + * include: 'None', 'InProgress', 'Succeeded', 'Failed', 'Cancelled', + * 'Cancelling', 'SucceededWithErrors' + * @member {date} [stageTime] Time for the job stage in UTC ISO 8601 format. + * @member {object} [jobStageDetails] Job Stage Details + * @member {array} [errorDetails] Error details for the stage. + */ +export interface JobStages { + stageName: string; + displayName?: string; + stageStatus: string; + stageTime?: Date; + jobStageDetails?: any; + errorDetails?: JobErrorDetails[]; +} + +/** + * @class + * Initializes a new instance of the PackageShippingDetails class. + * @constructor + * Shipping details. + * + * @member {string} [carrierName] Name of the carrier. + * @member {string} [trackingId] Tracking Id of shipment. + * @member {string} [trackingUrl] Url where shipment can be tracked. + */ +export interface PackageShippingDetails { + carrierName?: string; + trackingId?: string; + trackingUrl?: string; +} + +/** + * @class + * Initializes a new instance of the Resource class. + * @constructor + * Model of the Resource. + * + * @member {string} location The location of the resource. This will be one of + * the supported and registered Azure Regions (e.g. West US, East US, Southeast + * Asia, etc.). The region of a resource cannot be changed once it is created, + * but if an identical region is specified on update the request will succeed. + * @member {object} [tags] The list of key value pairs that describe the + * resource. These tags can be used in viewing and grouping this resource + * (across resource groups). + * @member {object} sku The sku type. + * @member {string} [sku.name] The sku name. + * @member {string} [sku.displayName] The display name of the sku. + * @member {string} [sku.family] The sku family. + */ +export interface Resource extends BaseResource { + location: string; + tags?: { [propertyName: string]: string }; + sku: Sku; +} + +/** + * @class + * Initializes a new instance of the JobResource class. + * @constructor + * Job Resource. + * + * @member {string} [deviceType] Type of the device to be used for the job. + * Possible values include: 'Pod', 'Disk', 'Cabinet' + * @member {boolean} [isCancellable] Describes whether the job is cancellable + * or not. + * @member {boolean} [isShippingAddressEditable] Describes whether the shipping + * address is editable or not. + * @member {string} [status] Name of the stage which is in progress. Possible + * values include: 'DeviceOrdered', 'DevicePrepared', 'Dispatched', + * 'Delivered', 'PickedUp', 'AtAzureDC', 'DataCopy', 'Completed', + * 'CompletedWithErrors', 'Cancelled', 'Failed_IssueReportedAtCustomer', + * 'Failed_IssueDetectedAtAzureDC', 'Aborted' + * @member {date} [startTime] Time at which the job was started in UTC ISO 8601 + * format. + * @member {object} [error] Top level error for the job. + * @member {string} [error.code] Error code that can be used to + * programmatically identify the error. + * @member {string} [error.message] Describes the error in detail and provides + * debugging information. + * @member {object} [deliveryPackage] Delivery package shipping details. + * @member {string} [deliveryPackage.carrierName] Name of the carrier. + * @member {string} [deliveryPackage.trackingId] Tracking Id of shipment. + * @member {string} [deliveryPackage.trackingUrl] Url where shipment can be + * tracked. + * @member {object} [returnPackage] Return package shipping details. + * @member {string} [returnPackage.carrierName] Name of the carrier. + * @member {string} [returnPackage.trackingId] Tracking Id of shipment. + * @member {string} [returnPackage.trackingUrl] Url where shipment can be + * tracked. + * @member {array} destinationAccountDetails Destination account details. + * @member {object} [details] Details of a job run. This field will only be + * sent for expand details filter. + * @member {number} [details.expectedDataSizeInTeraBytes] The expected size of + * the data, which needs to be transfered in this job, in tera bytes. + * @member {array} [details.jobStages] List of stages that run in the job. + * @member {object} [details.contactDetails] Contact details for notification + * and shipping. + * @member {string} [details.contactDetails.contactName] Contact name of the + * person. + * @member {string} [details.contactDetails.phone] Phone number of the contact + * person. + * @member {string} [details.contactDetails.phoneExtension] Phone extension + * number of the contact person. + * @member {string} [details.contactDetails.mobile] Mobile number of the + * contact person. + * @member {array} [details.contactDetails.emailList] List of Email-ids to be + * notified about job progress. + * @member {array} [details.contactDetails.notificationPreference] Notification + * preference for a job stage. + * @member {object} [details.shippingAddress] Shipping address of the customer. + * @member {string} [details.shippingAddress.streetAddress1] Street Address + * line 1. + * @member {string} [details.shippingAddress.streetAddress2] Street Address + * line 2. + * @member {string} [details.shippingAddress.streetAddress3] Street Address + * line 3. + * @member {string} [details.shippingAddress.city] Name of the City. + * @member {string} [details.shippingAddress.stateOrProvince] Name of the State + * or Province. + * @member {string} [details.shippingAddress.country] Name of the Country. + * @member {string} [details.shippingAddress.postalCode] Postal code. + * @member {string} [details.shippingAddress.zipExtendedCode] Extended Zip + * Code. + * @member {string} [details.shippingAddress.companyName] Name of the company. + * @member {string} [details.shippingAddress.addressType] Type of address. + * Possible values include: 'None', 'Residential', 'Commercial' + * @member {array} [details.errorDetails] Error details for failure. This is + * optional. + * @member {string} [details.jobDetailsType] Polymorphic Discriminator + * @member {string} [cancellationReason] Reason for cancellation. + * @member {string} [name] Name of the object. + * @member {string} [id] Id of the object. + * @member {string} [type] Type of the object. + */ +export interface JobResource extends Resource { + deviceType?: string; + isCancellable?: boolean; + isShippingAddressEditable?: boolean; + status?: string; + startTime?: Date; + error?: ErrorModel; + deliveryPackage?: PackageShippingDetails; + returnPackage?: PackageShippingDetails; + destinationAccountDetails: DestinationAccountDetails[]; + details?: JobDetails; + cancellationReason?: string; + readonly name?: string; + readonly id?: string; + readonly type?: string; +} + +/** + * @class + * Initializes a new instance of the UpdateJobDetails class. + * @constructor + * Job details for update. + * + * @member {object} [contactDetails] Contact details for notification and + * shipping. + * @member {string} [contactDetails.contactName] Contact name of the person. + * @member {string} [contactDetails.phone] Phone number of the contact person. + * @member {string} [contactDetails.phoneExtension] Phone extension number of + * the contact person. + * @member {string} [contactDetails.mobile] Mobile number of the contact + * person. + * @member {array} [contactDetails.emailList] List of Email-ids to be notified + * about job progress. + * @member {array} [contactDetails.notificationPreference] Notification + * preference for a job stage. + * @member {object} [shippingAddress] Shipping address of the customer. + * @member {string} [shippingAddress.streetAddress1] Street Address line 1. + * @member {string} [shippingAddress.streetAddress2] Street Address line 2. + * @member {string} [shippingAddress.streetAddress3] Street Address line 3. + * @member {string} [shippingAddress.city] Name of the City. + * @member {string} [shippingAddress.stateOrProvince] Name of the State or + * Province. + * @member {string} [shippingAddress.country] Name of the Country. + * @member {string} [shippingAddress.postalCode] Postal code. + * @member {string} [shippingAddress.zipExtendedCode] Extended Zip Code. + * @member {string} [shippingAddress.companyName] Name of the company. + * @member {string} [shippingAddress.addressType] Type of address. Possible + * values include: 'None', 'Residential', 'Commercial' + */ +export interface UpdateJobDetails { + contactDetails?: ContactDetails; + shippingAddress?: ShippingAddress; +} + +/** + * @class + * Initializes a new instance of the JobResourceUpdateParameter class. + * @constructor + * The JobResourceUpdateParameter. + * + * @member {object} details Details of a job to be updated. + * @member {object} [details.contactDetails] Contact details for notification + * and shipping. + * @member {string} [details.contactDetails.contactName] Contact name of the + * person. + * @member {string} [details.contactDetails.phone] Phone number of the contact + * person. + * @member {string} [details.contactDetails.phoneExtension] Phone extension + * number of the contact person. + * @member {string} [details.contactDetails.mobile] Mobile number of the + * contact person. + * @member {array} [details.contactDetails.emailList] List of Email-ids to be + * notified about job progress. + * @member {array} [details.contactDetails.notificationPreference] Notification + * preference for a job stage. + * @member {object} [details.shippingAddress] Shipping address of the customer. + * @member {string} [details.shippingAddress.streetAddress1] Street Address + * line 1. + * @member {string} [details.shippingAddress.streetAddress2] Street Address + * line 2. + * @member {string} [details.shippingAddress.streetAddress3] Street Address + * line 3. + * @member {string} [details.shippingAddress.city] Name of the City. + * @member {string} [details.shippingAddress.stateOrProvince] Name of the State + * or Province. + * @member {string} [details.shippingAddress.country] Name of the Country. + * @member {string} [details.shippingAddress.postalCode] Postal code. + * @member {string} [details.shippingAddress.zipExtendedCode] Extended Zip + * Code. + * @member {string} [details.shippingAddress.companyName] Name of the company. + * @member {string} [details.shippingAddress.addressType] Type of address. + * Possible values include: 'None', 'Residential', 'Commercial' + * @member {object} [tags] The list of key value pairs that describe the + * resource. These tags can be used in viewing and grouping this resource + * (across resource groups). + */ +export interface JobResourceUpdateParameter { + details: UpdateJobDetails; + tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the OperationDisplay class. + * @constructor + * Operation display + * + * @member {string} [provider] Provider name. + * @member {string} [resource] Resource name. + * @member {string} [operation] Localized name of the operation for display + * purpose. + * @member {string} [description] Localized description of the operation for + * display purpose. + */ +export interface OperationDisplay { + provider?: string; + resource?: string; + operation?: string; + description?: string; +} + +/** + * @class + * Initializes a new instance of the Operation class. + * @constructor + * Operation entity. + * + * @member {string} name Name of the operation. Format: + * {resourceProviderNamespace}/{resourceType}/{read|write|delete|action} + * @member {object} display Operation display values. + * @member {string} [display.provider] Provider name. + * @member {string} [display.resource] Resource name. + * @member {string} [display.operation] Localized name of the operation for + * display purpose. + * @member {string} [display.description] Localized description of the + * operation for display purpose. + * @member {object} properties Operation properties. + * @member {string} origin Origin of the operation. Can be : + * user|system|user,system + */ +export interface Operation { + name: string; + display: OperationDisplay; + properties: any; + origin: string; +} + +/** + * @class + * Initializes a new instance of the PodJobDetails class. + * @constructor + * Pod Job Details + * + * @member {array} [copyProgress] Copy progress per account. + */ +export interface PodJobDetails extends JobDetails { + copyProgress?: CopyProgress[]; +} + +/** + * @class + * Initializes a new instance of the PodSecret class. + * @constructor + * The secrets related to a Pod. + * + * @member {string} [deviceSerialNumber] Serial number of the assigned device. + * @member {string} [devicePassword] Password for out of the box experience on + * device. + * @member {array} [accountCredentialDetails] Per account level access + * credentials. + */ +export interface PodSecret { + deviceSerialNumber?: string; + devicePassword?: string; + accountCredentialDetails?: AccountCredentialDetails[]; +} + +/** + * @class + * Initializes a new instance of the PodJobSecrets class. + * @constructor + * The secrets related to a pod job. + * + * @member {array} [podSecrets] Contains the list of secret objects for a job. + */ +export interface PodJobSecrets extends JobSecrets { + podSecrets?: PodSecret[]; +} + +/** + * @class + * Initializes a new instance of the ReportIssueDetails class. + * @constructor + * Details of the reported issue. + * + * @member {string} [issueType] Issue Type. Possible values include: + * 'DeviceMismatch', 'ValidationStringMismatch', 'CredentialNotWorking', + * 'DeviceFailure' + * @member {string} [deviceIssueType] Device Issue Type. Only used for Device + * failure issue. Possible values include: 'DeviceTampering', + * 'DeviceNotBootingUp', 'DeviceHealthCheckShowFailures', 'NICsAreNotWorking', + * 'Misc' + */ +export interface ReportIssueDetails { + issueType?: string; + deviceIssueType?: string; +} + +/** + * @class + * Initializes a new instance of the ShipmentPickUpRequest class. + * @constructor + * Shipment pick up request details. + * + * @member {date} [startTime] Minimum date after which the pick up should + * commence, this must be in local time of pick up area. + * @member {date} [endTime] Maximum date before which the pick up should + * commence, this must be in local time of pick up area. + * @member {string} [shipmentLocation] Shipment Location in the pickup place. + * Eg.front desk + */ +export interface ShipmentPickUpRequest { + startTime?: Date; + endTime?: Date; + shipmentLocation?: string; +} + +/** + * @class + * Initializes a new instance of the ShipmentPickUpResponse class. + * @constructor + * Shipment pick up response. + * + * @member {string} [confirmationNumber] Confirmation number for the pick up + * request. + * @member {date} [readyByTime] Time by which shipment should be ready for pick + * up, this is in local time of pick up area. + */ +export interface ShipmentPickUpResponse { + confirmationNumber?: string; + readyByTime?: Date; +} + +/** + * @class + * Initializes a new instance of the ShippingLabelDetails class. + * @constructor + * Details for the shipping label. + * + * @member {string} shippingLabelSasUri Sas uri for accessing the shipping + * label. + */ +export interface ShippingLabelDetails { + shippingLabelSasUri: string; +} + +/** + * @class + * Initializes a new instance of the UnencryptedSecrets class. + * @constructor + * Unencrypted secrets for accessing device. + * + * @member {string} jobName Name of the job. + * @member {string} [deviceType] The Device Type used in the job. Possible + * values include: 'Pod', 'Disk', 'Cabinet' + * @member {object} [jobSecrets] Secrets related to this job. + * @member {string} [jobSecrets.jobSecretsType] Polymorphic Discriminator + */ +export interface UnencryptedSecrets { + jobName: string; + deviceType?: string; + jobSecrets?: JobSecrets; +} + +/** + * @class + * Initializes a new instance of the ValidateAddress class. + * @constructor + * The requirements to validate customer address where the device needs to be + * shipped. + * + * @member {object} [shippingAddress] Shipping address of the customer. + * @member {string} [shippingAddress.streetAddress1] Street Address line 1. + * @member {string} [shippingAddress.streetAddress2] Street Address line 2. + * @member {string} [shippingAddress.streetAddress3] Street Address line 3. + * @member {string} [shippingAddress.city] Name of the City. + * @member {string} [shippingAddress.stateOrProvince] Name of the State or + * Province. + * @member {string} [shippingAddress.country] Name of the Country. + * @member {string} [shippingAddress.postalCode] Postal code. + * @member {string} [shippingAddress.zipExtendedCode] Extended Zip Code. + * @member {string} [shippingAddress.companyName] Name of the company. + * @member {string} [shippingAddress.addressType] Type of address. Possible + * values include: 'None', 'Residential', 'Commercial' + * @member {string} [deviceType] Device type to be used for the job. Possible + * values include: 'Pod', 'Disk', 'Cabinet' + */ +export interface ValidateAddress { + shippingAddress?: ShippingAddress; + deviceType?: string; +} + + +/** + * @class + * Initializes a new instance of the OperationList class. + * @constructor + * Operation Collection. + * + * @member {string} [nextLink] Link for the next set of operations. + */ +export interface OperationList extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the JobResourceList class. + * @constructor + * Job Resource Collection + * + * @member {string} [nextLink] Link for the next set of job resources. + */ +export interface JobResourceList extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the AvailableSkusResult class. + * @constructor + * The available skus operation response. + * + * @member {string} [nextLink] Link for the next set of skus. + */ +export interface AvailableSkusResult extends Array { + nextLink?: string; +} diff --git a/lib/services/databox/lib/models/index.js b/lib/services/databox/lib/models/index.js new file mode 100644 index 0000000000..352303a8e6 --- /dev/null +++ b/lib/services/databox/lib/models/index.js @@ -0,0 +1,82 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +/* jshint latedef:false */ +/* jshint forin:false */ +/* jshint noempty:false */ + +'use strict'; + +var msRestAzure = require('ms-rest-azure'); + +exports.BaseResource = msRestAzure.BaseResource; +exports.CloudError = msRestAzure.CloudError; +exports.CopyLogDetails = require('./copyLogDetails'); +exports.AccountCopyLogDetails = require('./accountCopyLogDetails'); +exports.ShareCredentialDetails = require('./shareCredentialDetails'); +exports.AccountCredentialDetails = require('./accountCredentialDetails'); +exports.ShippingAddress = require('./shippingAddress'); +exports.AddressValidationOutput = require('./addressValidationOutput'); +exports.ArmBaseObject = require('./armBaseObject'); +exports.AvailableSkuRequest = require('./availableSkuRequest'); +exports.Sku = require('./sku'); +exports.DestinationToServiceLocationMap = require('./destinationToServiceLocationMap'); +exports.SkuCapacity = require('./skuCapacity'); +exports.SkuCost = require('./skuCost'); +exports.SkuInformation = require('./skuInformation'); +exports.CabinetPodSecret = require('./cabinetPodSecret'); +exports.JobSecrets = require('./jobSecrets'); +exports.CabinetJobSecrets = require('./cabinetJobSecrets'); +exports.CancellationReason = require('./cancellationReason'); +exports.NotificationPreference = require('./notificationPreference'); +exports.ContactDetails = require('./contactDetails'); +exports.CopyProgress = require('./copyProgress'); +exports.DestinationAccountDetails = require('./destinationAccountDetails'); +exports.DiskCopyLogDetails = require('./diskCopyLogDetails'); +exports.DiskCopyProgress = require('./diskCopyProgress'); +exports.JobDetails = require('./jobDetails'); +exports.DiskJobDetails = require('./diskJobDetails'); +exports.DiskSecret = require('./diskSecret'); +exports.DiskJobSecrets = require('./diskJobSecrets'); +exports.ErrorModel = require('./errorModel'); +exports.GetCopyLogsUriOutput = require('./getCopyLogsUriOutput'); +exports.JobErrorDetails = require('./jobErrorDetails'); +exports.JobStages = require('./jobStages'); +exports.PackageShippingDetails = require('./packageShippingDetails'); +exports.Resource = require('./resource'); +exports.JobResource = require('./jobResource'); +exports.UpdateJobDetails = require('./updateJobDetails'); +exports.JobResourceUpdateParameter = require('./jobResourceUpdateParameter'); +exports.OperationDisplay = require('./operationDisplay'); +exports.Operation = require('./operation'); +exports.PodJobDetails = require('./podJobDetails'); +exports.PodSecret = require('./podSecret'); +exports.PodJobSecrets = require('./podJobSecrets'); +exports.ReportIssueDetails = require('./reportIssueDetails'); +exports.ShipmentPickUpRequest = require('./shipmentPickUpRequest'); +exports.ShipmentPickUpResponse = require('./shipmentPickUpResponse'); +exports.ShippingLabelDetails = require('./shippingLabelDetails'); +exports.UnencryptedSecrets = require('./unencryptedSecrets'); +exports.ValidateAddress = require('./validateAddress'); +exports.OperationList = require('./operationList'); +exports.JobResourceList = require('./jobResourceList'); +exports.AvailableSkusResult = require('./availableSkusResult'); +exports.discriminators = { + 'CopyLogDetails.Pod' : exports.AccountCopyLogDetails, + 'JobSecrets.Cabinet' : exports.CabinetJobSecrets, + 'CopyLogDetails' : exports.CopyLogDetails, + 'CopyLogDetails.Disk' : exports.DiskCopyLogDetails, + 'JobDetails.Disk' : exports.DiskJobDetails, + 'JobSecrets.Disk' : exports.DiskJobSecrets, + 'JobDetails' : exports.JobDetails, + 'JobSecrets' : exports.JobSecrets, + 'JobDetails.Pod' : exports.PodJobDetails, + 'JobSecrets.Pod' : exports.PodJobSecrets +}; diff --git a/lib/services/databox/lib/models/jobDetails.js b/lib/services/databox/lib/models/jobDetails.js new file mode 100644 index 0000000000..7a10967c26 --- /dev/null +++ b/lib/services/databox/lib/models/jobDetails.js @@ -0,0 +1,144 @@ +/* + * 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'); + +/** + * Job details. + * + */ +class JobDetails { + /** + * Create a JobDetails. + * @member {number} [expectedDataSizeInTeraBytes] The expected size of the + * data, which needs to be transfered in this job, in tera bytes. + * @member {array} [jobStages] List of stages that run in the job. + * @member {object} contactDetails Contact details for notification and + * shipping. + * @member {string} [contactDetails.contactName] Contact name of the person. + * @member {string} [contactDetails.phone] Phone number of the contact + * person. + * @member {string} [contactDetails.phoneExtension] Phone extension number of + * the contact person. + * @member {string} [contactDetails.mobile] Mobile number of the contact + * person. + * @member {array} [contactDetails.emailList] List of Email-ids to be + * notified about job progress. + * @member {array} [contactDetails.notificationPreference] Notification + * preference for a job stage. + * @member {object} shippingAddress Shipping address of the customer. + * @member {string} [shippingAddress.streetAddress1] Street Address line 1. + * @member {string} [shippingAddress.streetAddress2] Street Address line 2. + * @member {string} [shippingAddress.streetAddress3] Street Address line 3. + * @member {string} [shippingAddress.city] Name of the City. + * @member {string} [shippingAddress.stateOrProvince] Name of the State or + * Province. + * @member {string} [shippingAddress.country] Name of the Country. + * @member {string} [shippingAddress.postalCode] Postal code. + * @member {string} [shippingAddress.zipExtendedCode] Extended Zip Code. + * @member {string} [shippingAddress.companyName] Name of the company. + * @member {string} [shippingAddress.addressType] Type of address. Possible + * values include: 'None', 'Residential', 'Commercial' + * @member {array} [errorDetails] Error details for failure. This is + * optional. + * @member {string} jobDetailsType Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of JobDetails + * + * @returns {object} metadata of JobDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'JobDetails', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'jobDetailsType', + clientName: 'jobDetailsType' + }, + uberParent: 'JobDetails', + className: 'JobDetails', + modelProperties: { + expectedDataSizeInTeraBytes: { + required: false, + serializedName: 'expectedDataSizeInTeraBytes', + type: { + name: 'Number' + } + }, + jobStages: { + required: false, + serializedName: 'jobStages', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'JobStagesElementType', + type: { + name: 'Composite', + className: 'JobStages' + } + } + } + }, + contactDetails: { + required: true, + serializedName: 'contactDetails', + type: { + name: 'Composite', + className: 'ContactDetails' + } + }, + shippingAddress: { + required: true, + serializedName: 'shippingAddress', + type: { + name: 'Composite', + className: 'ShippingAddress' + } + }, + errorDetails: { + required: false, + serializedName: 'errorDetails', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'JobErrorDetailsElementType', + type: { + name: 'Composite', + className: 'JobErrorDetails' + } + } + } + }, + jobDetailsType: { + required: true, + serializedName: 'jobDetailsType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = JobDetails; diff --git a/lib/services/databox/lib/models/jobErrorDetails.js b/lib/services/databox/lib/models/jobErrorDetails.js new file mode 100644 index 0000000000..5d8dc52d1b --- /dev/null +++ b/lib/services/databox/lib/models/jobErrorDetails.js @@ -0,0 +1,77 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Job Error Details for providing the information and recommended action. + * + */ +class JobErrorDetails { + /** + * Create a JobErrorDetails. + * @member {string} [errorMessage] Message for the error. + * @member {number} [errorCode] Code for the error. + * @member {string} [recommendedAction] Recommended action for the error. + * @member {string} [exceptionMessage] Contains the non localized exception + * message + */ + constructor() { + } + + /** + * Defines the metadata of JobErrorDetails + * + * @returns {object} metadata of JobErrorDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'JobErrorDetails', + type: { + name: 'Composite', + className: 'JobErrorDetails', + modelProperties: { + errorMessage: { + required: false, + serializedName: 'errorMessage', + type: { + name: 'String' + } + }, + errorCode: { + required: false, + serializedName: 'errorCode', + type: { + name: 'Number' + } + }, + recommendedAction: { + required: false, + serializedName: 'recommendedAction', + type: { + name: 'String' + } + }, + exceptionMessage: { + required: false, + serializedName: 'exceptionMessage', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = JobErrorDetails; diff --git a/lib/services/databox/lib/models/jobResource.js b/lib/services/databox/lib/models/jobResource.js new file mode 100644 index 0000000000..cfb1421f8c --- /dev/null +++ b/lib/services/databox/lib/models/jobResource.js @@ -0,0 +1,271 @@ +/* + * 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'); + +/** + * Job Resource. + * + * @extends models['Resource'] + */ +class JobResource extends models['Resource'] { + /** + * Create a JobResource. + * @member {string} [deviceType] Type of the device to be used for the job. + * Possible values include: 'Pod', 'Disk', 'Cabinet' + * @member {boolean} [isCancellable] Describes whether the job is cancellable + * or not. + * @member {boolean} [isShippingAddressEditable] Describes whether the + * shipping address is editable or not. + * @member {string} [status] Name of the stage which is in progress. Possible + * values include: 'DeviceOrdered', 'DevicePrepared', 'Dispatched', + * 'Delivered', 'PickedUp', 'AtAzureDC', 'DataCopy', 'Completed', + * 'CompletedWithErrors', 'Cancelled', 'Failed_IssueReportedAtCustomer', + * 'Failed_IssueDetectedAtAzureDC', 'Aborted' + * @member {date} [startTime] Time at which the job was started in UTC ISO + * 8601 format. + * @member {object} [error] Top level error for the job. + * @member {string} [error.code] Error code that can be used to + * programmatically identify the error. + * @member {string} [error.message] Describes the error in detail and + * provides debugging information. + * @member {object} [deliveryPackage] Delivery package shipping details. + * @member {string} [deliveryPackage.carrierName] Name of the carrier. + * @member {string} [deliveryPackage.trackingId] Tracking Id of shipment. + * @member {string} [deliveryPackage.trackingUrl] Url where shipment can be + * tracked. + * @member {object} [returnPackage] Return package shipping details. + * @member {string} [returnPackage.carrierName] Name of the carrier. + * @member {string} [returnPackage.trackingId] Tracking Id of shipment. + * @member {string} [returnPackage.trackingUrl] Url where shipment can be + * tracked. + * @member {array} destinationAccountDetails Destination account details. + * @member {object} [details] Details of a job run. This field will only be + * sent for expand details filter. + * @member {number} [details.expectedDataSizeInTeraBytes] The expected size + * of the data, which needs to be transfered in this job, in tera bytes. + * @member {array} [details.jobStages] List of stages that run in the job. + * @member {object} [details.contactDetails] Contact details for notification + * and shipping. + * @member {string} [details.contactDetails.contactName] Contact name of the + * person. + * @member {string} [details.contactDetails.phone] Phone number of the + * contact person. + * @member {string} [details.contactDetails.phoneExtension] Phone extension + * number of the contact person. + * @member {string} [details.contactDetails.mobile] Mobile number of the + * contact person. + * @member {array} [details.contactDetails.emailList] List of Email-ids to be + * notified about job progress. + * @member {array} [details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * @member {object} [details.shippingAddress] Shipping address of the + * customer. + * @member {string} [details.shippingAddress.streetAddress1] Street Address + * line 1. + * @member {string} [details.shippingAddress.streetAddress2] Street Address + * line 2. + * @member {string} [details.shippingAddress.streetAddress3] Street Address + * line 3. + * @member {string} [details.shippingAddress.city] Name of the City. + * @member {string} [details.shippingAddress.stateOrProvince] Name of the + * State or Province. + * @member {string} [details.shippingAddress.country] Name of the Country. + * @member {string} [details.shippingAddress.postalCode] Postal code. + * @member {string} [details.shippingAddress.zipExtendedCode] Extended Zip + * Code. + * @member {string} [details.shippingAddress.companyName] Name of the + * company. + * @member {string} [details.shippingAddress.addressType] Type of address. + * Possible values include: 'None', 'Residential', 'Commercial' + * @member {array} [details.errorDetails] Error details for failure. This is + * optional. + * @member {string} [details.jobDetailsType] Polymorphic Discriminator + * @member {string} [cancellationReason] Reason for cancellation. + * @member {string} [name] Name of the object. + * @member {string} [id] Id of the object. + * @member {string} [type] Type of the object. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of JobResource + * + * @returns {object} metadata of JobResource + * + */ + mapper() { + return { + required: false, + serializedName: 'JobResource', + type: { + name: 'Composite', + className: 'JobResource', + modelProperties: { + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + sku: { + required: true, + serializedName: 'sku', + type: { + name: 'Composite', + className: 'Sku' + } + }, + deviceType: { + required: false, + serializedName: 'properties.deviceType', + type: { + name: 'Enum', + allowedValues: [ 'Pod', 'Disk', 'Cabinet' ] + } + }, + isCancellable: { + required: false, + serializedName: 'properties.isCancellable', + type: { + name: 'Boolean' + } + }, + isShippingAddressEditable: { + required: false, + serializedName: 'properties.isShippingAddressEditable', + type: { + name: 'Boolean' + } + }, + status: { + required: false, + serializedName: 'properties.status', + type: { + name: 'Enum', + allowedValues: [ 'DeviceOrdered', 'DevicePrepared', 'Dispatched', 'Delivered', 'PickedUp', 'AtAzureDC', 'DataCopy', 'Completed', 'CompletedWithErrors', 'Cancelled', 'Failed_IssueReportedAtCustomer', 'Failed_IssueDetectedAtAzureDC', 'Aborted' ] + } + }, + startTime: { + required: false, + serializedName: 'properties.startTime', + type: { + name: 'DateTime' + } + }, + error: { + required: false, + serializedName: 'properties.error', + type: { + name: 'Composite', + className: 'ErrorModel' + } + }, + deliveryPackage: { + required: false, + serializedName: 'properties.deliveryPackage', + type: { + name: 'Composite', + className: 'PackageShippingDetails' + } + }, + returnPackage: { + required: false, + serializedName: 'properties.returnPackage', + type: { + name: 'Composite', + className: 'PackageShippingDetails' + } + }, + destinationAccountDetails: { + required: true, + serializedName: 'properties.destinationAccountDetails', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DestinationAccountDetailsElementType', + type: { + name: 'Composite', + className: 'DestinationAccountDetails' + } + } + } + }, + details: { + required: false, + serializedName: 'properties.details', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'jobDetailsType', + clientName: 'jobDetailsType' + }, + uberParent: 'JobDetails', + className: 'JobDetails' + } + }, + cancellationReason: { + required: false, + serializedName: 'properties.cancellationReason', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = JobResource; diff --git a/lib/services/databox/lib/models/jobResourceList.js b/lib/services/databox/lib/models/jobResourceList.js new file mode 100644 index 0000000000..bed4718392 --- /dev/null +++ b/lib/services/databox/lib/models/jobResourceList.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'; + +/** + * Job Resource Collection + */ +class JobResourceList extends Array { + /** + * Create a JobResourceList. + * @member {string} [nextLink] Link for the next set of job resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of JobResourceList + * + * @returns {object} metadata of JobResourceList + * + */ + mapper() { + return { + required: false, + serializedName: 'JobResourceList', + type: { + name: 'Composite', + className: 'JobResourceList', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'JobResourceElementType', + type: { + name: 'Composite', + className: 'JobResource' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = JobResourceList; diff --git a/lib/services/databox/lib/models/jobResourceUpdateParameter.js b/lib/services/databox/lib/models/jobResourceUpdateParameter.js new file mode 100644 index 0000000000..8faf5df59d --- /dev/null +++ b/lib/services/databox/lib/models/jobResourceUpdateParameter.js @@ -0,0 +1,105 @@ +/* + * 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'); + +/** + * The JobResourceUpdateParameter. + * + */ +class JobResourceUpdateParameter { + /** + * Create a JobResourceUpdateParameter. + * @member {object} details Details of a job to be updated. + * @member {object} [details.contactDetails] Contact details for notification + * and shipping. + * @member {string} [details.contactDetails.contactName] Contact name of the + * person. + * @member {string} [details.contactDetails.phone] Phone number of the + * contact person. + * @member {string} [details.contactDetails.phoneExtension] Phone extension + * number of the contact person. + * @member {string} [details.contactDetails.mobile] Mobile number of the + * contact person. + * @member {array} [details.contactDetails.emailList] List of Email-ids to be + * notified about job progress. + * @member {array} [details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * @member {object} [details.shippingAddress] Shipping address of the + * customer. + * @member {string} [details.shippingAddress.streetAddress1] Street Address + * line 1. + * @member {string} [details.shippingAddress.streetAddress2] Street Address + * line 2. + * @member {string} [details.shippingAddress.streetAddress3] Street Address + * line 3. + * @member {string} [details.shippingAddress.city] Name of the City. + * @member {string} [details.shippingAddress.stateOrProvince] Name of the + * State or Province. + * @member {string} [details.shippingAddress.country] Name of the Country. + * @member {string} [details.shippingAddress.postalCode] Postal code. + * @member {string} [details.shippingAddress.zipExtendedCode] Extended Zip + * Code. + * @member {string} [details.shippingAddress.companyName] Name of the + * company. + * @member {string} [details.shippingAddress.addressType] Type of address. + * Possible values include: 'None', 'Residential', 'Commercial' + * @member {object} [tags] The list of key value pairs that describe the + * resource. These tags can be used in viewing and grouping this resource + * (across resource groups). + */ + constructor() { + } + + /** + * Defines the metadata of JobResourceUpdateParameter + * + * @returns {object} metadata of JobResourceUpdateParameter + * + */ + mapper() { + return { + required: false, + serializedName: 'JobResourceUpdateParameter', + type: { + name: 'Composite', + className: 'JobResourceUpdateParameter', + modelProperties: { + details: { + required: true, + serializedName: 'properties.details', + type: { + name: 'Composite', + className: 'UpdateJobDetails' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = JobResourceUpdateParameter; diff --git a/lib/services/databox/lib/models/jobSecrets.js b/lib/services/databox/lib/models/jobSecrets.js new file mode 100644 index 0000000000..9ef614fc2e --- /dev/null +++ b/lib/services/databox/lib/models/jobSecrets.js @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The base class for the secrets + * + */ +class JobSecrets { + /** + * Create a JobSecrets. + * @member {string} jobSecretsType Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of JobSecrets + * + * @returns {object} metadata of JobSecrets + * + */ + mapper() { + return { + required: false, + serializedName: 'JobSecrets', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'jobSecretsType', + clientName: 'jobSecretsType' + }, + uberParent: 'JobSecrets', + className: 'JobSecrets', + modelProperties: { + jobSecretsType: { + required: true, + serializedName: 'jobSecretsType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = JobSecrets; diff --git a/lib/services/databox/lib/models/jobStages.js b/lib/services/databox/lib/models/jobStages.js new file mode 100644 index 0000000000..158a9ba32a --- /dev/null +++ b/lib/services/databox/lib/models/jobStages.js @@ -0,0 +1,110 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Job stages. + * + */ +class JobStages { + /** + * Create a JobStages. + * @member {string} stageName Name of the job stage. Possible values include: + * 'DeviceOrdered', 'DevicePrepared', 'Dispatched', 'Delivered', 'PickedUp', + * 'AtAzureDC', 'DataCopy', 'Completed', 'CompletedWithErrors', 'Cancelled', + * 'Failed_IssueReportedAtCustomer', 'Failed_IssueDetectedAtAzureDC', + * 'Aborted' + * @member {string} [displayName] Display name of the job stage. + * @member {string} stageStatus Status of the job stage. Possible values + * include: 'None', 'InProgress', 'Succeeded', 'Failed', 'Cancelled', + * 'Cancelling', 'SucceededWithErrors' + * @member {date} [stageTime] Time for the job stage in UTC ISO 8601 format. + * @member {object} [jobStageDetails] Job Stage Details + * @member {array} [errorDetails] Error details for the stage. + */ + constructor() { + } + + /** + * Defines the metadata of JobStages + * + * @returns {object} metadata of JobStages + * + */ + mapper() { + return { + required: false, + serializedName: 'JobStages', + type: { + name: 'Composite', + className: 'JobStages', + modelProperties: { + stageName: { + required: true, + serializedName: 'stageName', + type: { + name: 'Enum', + allowedValues: [ 'DeviceOrdered', 'DevicePrepared', 'Dispatched', 'Delivered', 'PickedUp', 'AtAzureDC', 'DataCopy', 'Completed', 'CompletedWithErrors', 'Cancelled', 'Failed_IssueReportedAtCustomer', 'Failed_IssueDetectedAtAzureDC', 'Aborted' ] + } + }, + displayName: { + required: false, + serializedName: 'displayName', + type: { + name: 'String' + } + }, + stageStatus: { + required: true, + serializedName: 'stageStatus', + type: { + name: 'Enum', + allowedValues: [ 'None', 'InProgress', 'Succeeded', 'Failed', 'Cancelled', 'Cancelling', 'SucceededWithErrors' ] + } + }, + stageTime: { + required: false, + serializedName: 'stageTime', + type: { + name: 'DateTime' + } + }, + jobStageDetails: { + required: false, + serializedName: 'jobStageDetails', + type: { + name: 'Object' + } + }, + errorDetails: { + required: false, + serializedName: 'errorDetails', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'JobErrorDetailsElementType', + type: { + name: 'Composite', + className: 'JobErrorDetails' + } + } + } + } + } + } + }; + } +} + +module.exports = JobStages; diff --git a/lib/services/databox/lib/models/notificationPreference.js b/lib/services/databox/lib/models/notificationPreference.js new file mode 100644 index 0000000000..b9dbc4de65 --- /dev/null +++ b/lib/services/databox/lib/models/notificationPreference.js @@ -0,0 +1,63 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Notification preference for a job stage. + * + */ +class NotificationPreference { + /** + * Create a NotificationPreference. + * @member {string} stageName Name of the stage. Possible values include: + * 'DevicePrepared', 'Dispatched', 'Delivered', 'PickedUp', 'AtAzureDC', + * 'DataCopy' + * @member {boolean} sendNotification Notification is required or not. + */ + constructor() { + } + + /** + * Defines the metadata of NotificationPreference + * + * @returns {object} metadata of NotificationPreference + * + */ + mapper() { + return { + required: false, + serializedName: 'NotificationPreference', + type: { + name: 'Composite', + className: 'NotificationPreference', + modelProperties: { + stageName: { + required: true, + serializedName: 'stageName', + type: { + name: 'Enum', + allowedValues: [ 'DevicePrepared', 'Dispatched', 'Delivered', 'PickedUp', 'AtAzureDC', 'DataCopy' ] + } + }, + sendNotification: { + required: true, + serializedName: 'sendNotification', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = NotificationPreference; diff --git a/lib/services/databox/lib/models/operation.js b/lib/services/databox/lib/models/operation.js new file mode 100644 index 0000000000..1983f1ae05 --- /dev/null +++ b/lib/services/databox/lib/models/operation.js @@ -0,0 +1,87 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Operation entity. + * + */ +class Operation { + /** + * Create a Operation. + * @member {string} name Name of the operation. Format: + * {resourceProviderNamespace}/{resourceType}/{read|write|delete|action} + * @member {object} display Operation display values. + * @member {string} [display.provider] Provider name. + * @member {string} [display.resource] Resource name. + * @member {string} [display.operation] Localized name of the operation for + * display purpose. + * @member {string} [display.description] Localized description of the + * operation for display purpose. + * @member {object} properties Operation properties. + * @member {string} origin Origin of the operation. Can be : + * user|system|user,system + */ + constructor() { + } + + /** + * Defines the metadata of Operation + * + * @returns {object} metadata of Operation + * + */ + mapper() { + return { + required: false, + serializedName: 'Operation', + type: { + name: 'Composite', + className: 'Operation', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + display: { + required: true, + serializedName: 'display', + type: { + name: 'Composite', + className: 'OperationDisplay' + } + }, + properties: { + required: true, + serializedName: 'properties', + type: { + name: 'Object' + } + }, + origin: { + required: true, + serializedName: 'origin', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Operation; diff --git a/lib/services/databox/lib/models/operationDisplay.js b/lib/services/databox/lib/models/operationDisplay.js new file mode 100644 index 0000000000..878daf0e9b --- /dev/null +++ b/lib/services/databox/lib/models/operationDisplay.js @@ -0,0 +1,78 @@ +/* + * 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'; + +/** + * Operation display + * + */ +class OperationDisplay { + /** + * Create a OperationDisplay. + * @member {string} [provider] Provider name. + * @member {string} [resource] Resource name. + * @member {string} [operation] Localized name of the operation for display + * purpose. + * @member {string} [description] Localized description of the operation for + * display purpose. + */ + constructor() { + } + + /** + * Defines the metadata of OperationDisplay + * + * @returns {object} metadata of OperationDisplay + * + */ + mapper() { + return { + required: false, + serializedName: 'OperationDisplay', + type: { + name: 'Composite', + className: 'OperationDisplay', + modelProperties: { + provider: { + required: false, + serializedName: 'provider', + type: { + name: 'String' + } + }, + resource: { + required: false, + serializedName: 'resource', + type: { + name: 'String' + } + }, + operation: { + required: false, + serializedName: 'operation', + type: { + name: 'String' + } + }, + description: { + required: false, + serializedName: 'description', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = OperationDisplay; diff --git a/lib/services/databox/lib/models/operationList.js b/lib/services/databox/lib/models/operationList.js new file mode 100644 index 0000000000..31d2a1621d --- /dev/null +++ b/lib/services/databox/lib/models/operationList.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'; + +/** + * Operation Collection. + */ +class OperationList extends Array { + /** + * Create a OperationList. + * @member {string} [nextLink] Link for the next set of operations. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of OperationList + * + * @returns {object} metadata of OperationList + * + */ + mapper() { + return { + required: false, + serializedName: 'OperationList', + type: { + name: 'Composite', + className: 'OperationList', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'OperationElementType', + type: { + name: 'Composite', + className: 'Operation' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = OperationList; diff --git a/lib/services/databox/lib/models/packageShippingDetails.js b/lib/services/databox/lib/models/packageShippingDetails.js new file mode 100644 index 0000000000..471d4e457f --- /dev/null +++ b/lib/services/databox/lib/models/packageShippingDetails.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Shipping details. + * + */ +class PackageShippingDetails { + /** + * Create a PackageShippingDetails. + * @member {string} [carrierName] Name of the carrier. + * @member {string} [trackingId] Tracking Id of shipment. + * @member {string} [trackingUrl] Url where shipment can be tracked. + */ + constructor() { + } + + /** + * Defines the metadata of PackageShippingDetails + * + * @returns {object} metadata of PackageShippingDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'PackageShippingDetails', + type: { + name: 'Composite', + className: 'PackageShippingDetails', + modelProperties: { + carrierName: { + required: false, + serializedName: 'carrierName', + type: { + name: 'String' + } + }, + trackingId: { + required: false, + serializedName: 'trackingId', + type: { + name: 'String' + } + }, + trackingUrl: { + required: false, + serializedName: 'trackingUrl', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PackageShippingDetails; diff --git a/lib/services/databox/lib/models/podJobDetails.js b/lib/services/databox/lib/models/podJobDetails.js new file mode 100644 index 0000000000..6199360298 --- /dev/null +++ b/lib/services/databox/lib/models/podJobDetails.js @@ -0,0 +1,130 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Pod Job Details + * + * @extends models['JobDetails'] + */ +class PodJobDetails extends models['JobDetails'] { + /** + * Create a PodJobDetails. + * @member {array} [copyProgress] Copy progress per account. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of PodJobDetails + * + * @returns {object} metadata of PodJobDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'Pod', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'jobDetailsType', + clientName: 'jobDetailsType' + }, + uberParent: 'JobDetails', + className: 'PodJobDetails', + modelProperties: { + expectedDataSizeInTeraBytes: { + required: false, + serializedName: 'expectedDataSizeInTeraBytes', + type: { + name: 'Number' + } + }, + jobStages: { + required: false, + serializedName: 'jobStages', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'JobStagesElementType', + type: { + name: 'Composite', + className: 'JobStages' + } + } + } + }, + contactDetails: { + required: true, + serializedName: 'contactDetails', + type: { + name: 'Composite', + className: 'ContactDetails' + } + }, + shippingAddress: { + required: true, + serializedName: 'shippingAddress', + type: { + name: 'Composite', + className: 'ShippingAddress' + } + }, + errorDetails: { + required: false, + serializedName: 'errorDetails', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'JobErrorDetailsElementType', + type: { + name: 'Composite', + className: 'JobErrorDetails' + } + } + } + }, + jobDetailsType: { + required: true, + serializedName: 'jobDetailsType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + copyProgress: { + required: false, + serializedName: 'copyProgress', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CopyProgressElementType', + type: { + name: 'Composite', + className: 'CopyProgress' + } + } + } + } + } + } + }; + } +} + +module.exports = PodJobDetails; diff --git a/lib/services/databox/lib/models/podJobSecrets.js b/lib/services/databox/lib/models/podJobSecrets.js new file mode 100644 index 0000000000..502a9a1bea --- /dev/null +++ b/lib/services/databox/lib/models/podJobSecrets.js @@ -0,0 +1,78 @@ +/* + * 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'); + +/** + * The secrets related to a pod job. + * + * @extends models['JobSecrets'] + */ +class PodJobSecrets extends models['JobSecrets'] { + /** + * Create a PodJobSecrets. + * @member {array} [podSecrets] Contains the list of secret objects for a + * job. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of PodJobSecrets + * + * @returns {object} metadata of PodJobSecrets + * + */ + mapper() { + return { + required: false, + serializedName: 'Pod', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'jobSecretsType', + clientName: 'jobSecretsType' + }, + uberParent: 'JobSecrets', + className: 'PodJobSecrets', + modelProperties: { + jobSecretsType: { + required: true, + serializedName: 'jobSecretsType', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + podSecrets: { + required: false, + serializedName: 'podSecrets', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'PodSecretElementType', + type: { + name: 'Composite', + className: 'PodSecret' + } + } + } + } + } + } + }; + } +} + +module.exports = PodJobSecrets; diff --git a/lib/services/databox/lib/models/podSecret.js b/lib/services/databox/lib/models/podSecret.js new file mode 100644 index 0000000000..6d5dad55d2 --- /dev/null +++ b/lib/services/databox/lib/models/podSecret.js @@ -0,0 +1,81 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The secrets related to a Pod. + * + */ +class PodSecret { + /** + * Create a PodSecret. + * @member {string} [deviceSerialNumber] Serial number of the assigned + * device. + * @member {string} [devicePassword] Password for out of the box experience + * on device. + * @member {array} [accountCredentialDetails] Per account level access + * credentials. + */ + constructor() { + } + + /** + * Defines the metadata of PodSecret + * + * @returns {object} metadata of PodSecret + * + */ + mapper() { + return { + required: false, + serializedName: 'PodSecret', + type: { + name: 'Composite', + className: 'PodSecret', + modelProperties: { + deviceSerialNumber: { + required: false, + serializedName: 'deviceSerialNumber', + type: { + name: 'String' + } + }, + devicePassword: { + required: false, + serializedName: 'devicePassword', + type: { + name: 'String' + } + }, + accountCredentialDetails: { + required: false, + serializedName: 'accountCredentialDetails', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AccountCredentialDetailsElementType', + type: { + name: 'Composite', + className: 'AccountCredentialDetails' + } + } + } + } + } + } + }; + } +} + +module.exports = PodSecret; diff --git a/lib/services/databox/lib/models/regionAvailabilityInput.js b/lib/services/databox/lib/models/regionAvailabilityInput.js new file mode 100644 index 0000000000..fe37be0d1e --- /dev/null +++ b/lib/services/databox/lib/models/regionAvailabilityInput.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'; + +/** + * Inputs to get list of supported storage regions and service regions for job + * creation. + * + */ +class RegionAvailabilityInput { + /** + * Create a RegionAvailabilityInput. + * @member {string} countryCode Country for which the supported regions are + * requested. Possible values include: 'US', 'NL', 'IE', 'AT', 'IT', 'BE', + * 'LV', 'BG', 'LT', 'HR', 'LU', 'CY', 'MT', 'CZ', 'DK', 'PL', 'EE', 'PT', + * 'FI', 'RO', 'FR', 'SK', 'DE', 'SI', 'GR', 'ES', 'HU', 'SE', 'GB' + * @member {string} deviceType Device type for which the supported regions + * have to be fetched. Possible values include: 'Pod', 'Disk', 'Cabinet' + */ + constructor() { + } + + /** + * Defines the metadata of RegionAvailabilityInput + * + * @returns {object} metadata of RegionAvailabilityInput + * + */ + mapper() { + return { + required: false, + serializedName: 'RegionAvailabilityInput', + type: { + name: 'Composite', + className: 'RegionAvailabilityInput', + modelProperties: { + countryCode: { + required: true, + serializedName: 'countryCode', + type: { + name: 'Enum', + allowedValues: [ 'US', 'NL', 'IE', 'AT', 'IT', 'BE', 'LV', 'BG', 'LT', 'HR', 'LU', 'CY', 'MT', 'CZ', 'DK', 'PL', 'EE', 'PT', 'FI', 'RO', 'FR', 'SK', 'DE', 'SI', 'GR', 'ES', 'HU', 'SE', 'GB' ] + } + }, + deviceType: { + required: true, + serializedName: 'deviceType', + type: { + name: 'Enum', + allowedValues: [ 'Pod', 'Disk', 'Cabinet' ] + } + } + } + } + }; + } +} + +module.exports = RegionAvailabilityInput; diff --git a/lib/services/databox/lib/models/regionAvailabilityResponse.js b/lib/services/databox/lib/models/regionAvailabilityResponse.js new file mode 100644 index 0000000000..9b5a4ae3f3 --- /dev/null +++ b/lib/services/databox/lib/models/regionAvailabilityResponse.js @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * List of service regions and storage regions + * + */ +class RegionAvailabilityResponse { + /** + * Create a RegionAvailabilityResponse. + * @member {array} supportedRegions List of supported region. + */ + constructor() { + } + + /** + * Defines the metadata of RegionAvailabilityResponse + * + * @returns {object} metadata of RegionAvailabilityResponse + * + */ + mapper() { + return { + required: false, + serializedName: 'RegionAvailabilityResponse', + type: { + name: 'Composite', + className: 'RegionAvailabilityResponse', + modelProperties: { + supportedRegions: { + required: true, + serializedName: 'supportedRegions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SupportedRegionsElementType', + type: { + name: 'Composite', + className: 'SupportedRegions' + } + } + } + } + } + } + }; + } +} + +module.exports = RegionAvailabilityResponse; diff --git a/lib/services/databox/lib/models/reportIssueDetails.js b/lib/services/databox/lib/models/reportIssueDetails.js new file mode 100644 index 0000000000..901c0b820e --- /dev/null +++ b/lib/services/databox/lib/models/reportIssueDetails.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'; + +/** + * Details of the reported issue. + * + */ +class ReportIssueDetails { + /** + * Create a ReportIssueDetails. + * @member {string} [issueType] Issue Type. Possible values include: + * 'DeviceMismatch', 'ValidationStringMismatch', 'CredentialNotWorking', + * 'DeviceFailure' + * @member {string} [deviceIssueType] Device Issue Type. Only used for Device + * failure issue. Possible values include: 'DeviceTampering', + * 'DeviceNotBootingUp', 'DeviceHealthCheckShowFailures', + * 'NICsAreNotWorking', 'Misc' + */ + constructor() { + } + + /** + * Defines the metadata of ReportIssueDetails + * + * @returns {object} metadata of ReportIssueDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'ReportIssueDetails', + type: { + name: 'Composite', + className: 'ReportIssueDetails', + modelProperties: { + issueType: { + required: false, + serializedName: 'issueType', + type: { + name: 'Enum', + allowedValues: [ 'DeviceMismatch', 'ValidationStringMismatch', 'CredentialNotWorking', 'DeviceFailure' ] + } + }, + deviceIssueType: { + required: false, + serializedName: 'deviceIssueType', + type: { + name: 'Enum', + allowedValues: [ 'DeviceTampering', 'DeviceNotBootingUp', 'DeviceHealthCheckShowFailures', 'NICsAreNotWorking', 'Misc' ] + } + } + } + } + }; + } +} + +module.exports = ReportIssueDetails; diff --git a/lib/services/databox/lib/models/resource.js b/lib/services/databox/lib/models/resource.js new file mode 100644 index 0000000000..7b4f8e0d45 --- /dev/null +++ b/lib/services/databox/lib/models/resource.js @@ -0,0 +1,89 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Model of the Resource. + * + * @extends models['BaseResource'] + */ +class Resource extends models['BaseResource'] { + /** + * Create a Resource. + * @member {string} location The location of the resource. This will be one + * of the supported and registered Azure Regions (e.g. West US, East US, + * Southeast Asia, etc.). The region of a resource cannot be changed once it + * is created, but if an identical region is specified on update the request + * will succeed. + * @member {object} [tags] The list of key value pairs that describe the + * resource. These tags can be used in viewing and grouping this resource + * (across resource groups). + * @member {object} sku The sku type. + * @member {string} [sku.name] The sku name. + * @member {string} [sku.displayName] The display name of the sku. + * @member {string} [sku.family] The sku family. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of Resource + * + * @returns {object} metadata of Resource + * + */ + mapper() { + return { + required: false, + serializedName: 'Resource', + type: { + name: 'Composite', + className: 'Resource', + modelProperties: { + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + sku: { + required: true, + serializedName: 'sku', + type: { + name: 'Composite', + className: 'Sku' + } + } + } + } + }; + } +} + +module.exports = Resource; diff --git a/lib/services/databox/lib/models/serviceHealthResponse.js b/lib/services/databox/lib/models/serviceHealthResponse.js new file mode 100644 index 0000000000..c4e9015089 --- /dev/null +++ b/lib/services/databox/lib/models/serviceHealthResponse.js @@ -0,0 +1,76 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Response of the GetServiceHealth api. + * + */ +class ServiceHealthResponse { + /** + * Create a ServiceHealthResponse. + * @member {string} [connectorType] + * @member {date} [startTime] + * @member {date} [endTime] + * @member {boolean} [status] + */ + constructor() { + } + + /** + * Defines the metadata of ServiceHealthResponse + * + * @returns {object} metadata of ServiceHealthResponse + * + */ + mapper() { + return { + required: false, + serializedName: 'ServiceHealthResponse', + type: { + name: 'Composite', + className: 'ServiceHealthResponse', + modelProperties: { + connectorType: { + required: false, + serializedName: 'connectorType', + type: { + name: 'String' + } + }, + startTime: { + required: false, + serializedName: 'startTime', + type: { + name: 'DateTime' + } + }, + endTime: { + required: false, + serializedName: 'endTime', + type: { + name: 'DateTime' + } + }, + status: { + required: false, + serializedName: 'status', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = ServiceHealthResponse; diff --git a/lib/services/databox/lib/models/serviceHealthResponseList.js b/lib/services/databox/lib/models/serviceHealthResponseList.js new file mode 100644 index 0000000000..939618f117 --- /dev/null +++ b/lib/services/databox/lib/models/serviceHealthResponseList.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * List of service health response. + * + */ +class ServiceHealthResponseList { + /** + * Create a ServiceHealthResponseList. + * @member {string} [serviceVersion] + * @member {array} [dependencies] List of ServiceHealthResponse. + */ + constructor() { + } + + /** + * Defines the metadata of ServiceHealthResponseList + * + * @returns {object} metadata of ServiceHealthResponseList + * + */ + mapper() { + return { + required: false, + serializedName: 'ServiceHealthResponseList', + type: { + name: 'Composite', + className: 'ServiceHealthResponseList', + modelProperties: { + serviceVersion: { + required: false, + serializedName: 'serviceVersion', + type: { + name: 'String' + } + }, + dependencies: { + required: false, + serializedName: 'dependencies', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ServiceHealthResponseElementType', + type: { + name: 'Composite', + className: 'ServiceHealthResponse' + } + } + } + } + } + } + }; + } +} + +module.exports = ServiceHealthResponseList; diff --git a/lib/services/databox/lib/models/shareCredentialDetails.js b/lib/services/databox/lib/models/shareCredentialDetails.js new file mode 100644 index 0000000000..762649d305 --- /dev/null +++ b/lib/services/databox/lib/models/shareCredentialDetails.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Credential details of the shares in account. + * + */ +class ShareCredentialDetails { + /** + * Create a ShareCredentialDetails. + * @member {string} [shareName] Name of the share. + * @member {string} [userName] User name for the share. + * @member {string} [password] Password for the share. + */ + constructor() { + } + + /** + * Defines the metadata of ShareCredentialDetails + * + * @returns {object} metadata of ShareCredentialDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'ShareCredentialDetails', + type: { + name: 'Composite', + className: 'ShareCredentialDetails', + modelProperties: { + shareName: { + required: false, + serializedName: 'shareName', + type: { + name: 'String' + } + }, + userName: { + required: false, + serializedName: 'userName', + type: { + name: 'String' + } + }, + password: { + required: false, + serializedName: 'password', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ShareCredentialDetails; diff --git a/lib/services/databox/lib/models/shipmentPickUpRequest.js b/lib/services/databox/lib/models/shipmentPickUpRequest.js new file mode 100644 index 0000000000..30447b9a34 --- /dev/null +++ b/lib/services/databox/lib/models/shipmentPickUpRequest.js @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Shipment pick up request details. + * + */ +class ShipmentPickUpRequest { + /** + * Create a ShipmentPickUpRequest. + * @member {date} [startTime] Minimum date after which the pick up should + * commence, this must be in local time of pick up area. + * @member {date} [endTime] Maximum date before which the pick up should + * commence, this must be in local time of pick up area. + * @member {string} [shipmentLocation] Shipment Location in the pickup place. + * Eg.front desk + */ + constructor() { + } + + /** + * Defines the metadata of ShipmentPickUpRequest + * + * @returns {object} metadata of ShipmentPickUpRequest + * + */ + mapper() { + return { + required: false, + serializedName: 'ShipmentPickUpRequest', + type: { + name: 'Composite', + className: 'ShipmentPickUpRequest', + modelProperties: { + startTime: { + required: false, + serializedName: 'startTime', + type: { + name: 'DateTime' + } + }, + endTime: { + required: false, + serializedName: 'endTime', + type: { + name: 'DateTime' + } + }, + shipmentLocation: { + required: false, + serializedName: 'shipmentLocation', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ShipmentPickUpRequest; diff --git a/lib/services/databox/lib/models/shipmentPickUpResponse.js b/lib/services/databox/lib/models/shipmentPickUpResponse.js new file mode 100644 index 0000000000..58f2014b77 --- /dev/null +++ b/lib/services/databox/lib/models/shipmentPickUpResponse.js @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Shipment pick up response. + * + */ +class ShipmentPickUpResponse { + /** + * Create a ShipmentPickUpResponse. + * @member {string} [confirmationNumber] Confirmation number for the pick up + * request. + * @member {date} [readyByTime] Time by which shipment should be ready for + * pick up, this is in local time of pick up area. + */ + constructor() { + } + + /** + * Defines the metadata of ShipmentPickUpResponse + * + * @returns {object} metadata of ShipmentPickUpResponse + * + */ + mapper() { + return { + required: false, + serializedName: 'ShipmentPickUpResponse', + type: { + name: 'Composite', + className: 'ShipmentPickUpResponse', + modelProperties: { + confirmationNumber: { + required: false, + serializedName: 'confirmationNumber', + type: { + name: 'String' + } + }, + readyByTime: { + required: false, + serializedName: 'readyByTime', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = ShipmentPickUpResponse; diff --git a/lib/services/databox/lib/models/shippingAddress.js b/lib/services/databox/lib/models/shippingAddress.js new file mode 100644 index 0000000000..6c9265af63 --- /dev/null +++ b/lib/services/databox/lib/models/shippingAddress.js @@ -0,0 +1,126 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Shipping address where customer wishes to receive the device. + * + */ +class ShippingAddress { + /** + * Create a ShippingAddress. + * @member {string} streetAddress1 Street Address line 1. + * @member {string} [streetAddress2] Street Address line 2. + * @member {string} [streetAddress3] Street Address line 3. + * @member {string} [city] Name of the City. + * @member {string} [stateOrProvince] Name of the State or Province. + * @member {string} country Name of the Country. + * @member {string} postalCode Postal code. + * @member {string} [zipExtendedCode] Extended Zip Code. + * @member {string} [companyName] Name of the company. + * @member {string} [addressType] Type of address. Possible values include: + * 'None', 'Residential', 'Commercial' + */ + constructor() { + } + + /** + * Defines the metadata of ShippingAddress + * + * @returns {object} metadata of ShippingAddress + * + */ + mapper() { + return { + required: false, + serializedName: 'ShippingAddress', + type: { + name: 'Composite', + className: 'ShippingAddress', + modelProperties: { + streetAddress1: { + required: true, + serializedName: 'streetAddress1', + type: { + name: 'String' + } + }, + streetAddress2: { + required: false, + serializedName: 'streetAddress2', + type: { + name: 'String' + } + }, + streetAddress3: { + required: false, + serializedName: 'streetAddress3', + type: { + name: 'String' + } + }, + city: { + required: false, + serializedName: 'city', + type: { + name: 'String' + } + }, + stateOrProvince: { + required: false, + serializedName: 'stateOrProvince', + type: { + name: 'String' + } + }, + country: { + required: true, + serializedName: 'country', + type: { + name: 'String' + } + }, + postalCode: { + required: true, + serializedName: 'postalCode', + type: { + name: 'String' + } + }, + zipExtendedCode: { + required: false, + serializedName: 'zipExtendedCode', + type: { + name: 'String' + } + }, + companyName: { + required: false, + serializedName: 'companyName', + type: { + name: 'String' + } + }, + addressType: { + required: false, + serializedName: 'addressType', + type: { + name: 'Enum', + allowedValues: [ 'None', 'Residential', 'Commercial' ] + } + } + } + } + }; + } +} + +module.exports = ShippingAddress; diff --git a/lib/services/databox/lib/models/shippingLabelDetails.js b/lib/services/databox/lib/models/shippingLabelDetails.js new file mode 100644 index 0000000000..d97f469f2d --- /dev/null +++ b/lib/services/databox/lib/models/shippingLabelDetails.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Details for the shipping label. + * + */ +class ShippingLabelDetails { + /** + * Create a ShippingLabelDetails. + * @member {string} shippingLabelSasUri Sas uri for accessing the shipping + * label. + */ + constructor() { + } + + /** + * Defines the metadata of ShippingLabelDetails + * + * @returns {object} metadata of ShippingLabelDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'ShippingLabelDetails', + type: { + name: 'Composite', + className: 'ShippingLabelDetails', + modelProperties: { + shippingLabelSasUri: { + required: true, + serializedName: 'shippingLabelSasUri', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ShippingLabelDetails; diff --git a/lib/services/databox/lib/models/sku.js b/lib/services/databox/lib/models/sku.js new file mode 100644 index 0000000000..dbe7a5e5f3 --- /dev/null +++ b/lib/services/databox/lib/models/sku.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The Sku. + * + */ +class Sku { + /** + * Create a Sku. + * @member {string} name The sku name. + * @member {string} [displayName] The display name of the sku. + * @member {string} [family] The sku family. + */ + constructor() { + } + + /** + * Defines the metadata of Sku + * + * @returns {object} metadata of Sku + * + */ + mapper() { + return { + required: false, + serializedName: 'Sku', + type: { + name: 'Composite', + className: 'Sku', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + displayName: { + required: false, + serializedName: 'displayName', + type: { + name: 'String' + } + }, + family: { + required: false, + serializedName: 'family', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Sku; diff --git a/lib/services/databox/lib/models/skuCapacity.js b/lib/services/databox/lib/models/skuCapacity.js new file mode 100644 index 0000000000..1b4e9af335 --- /dev/null +++ b/lib/services/databox/lib/models/skuCapacity.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'; + +/** + * Capacity of the sku. + * + */ +class SkuCapacity { + /** + * Create a SkuCapacity. + * @member {string} usable Usable capacity in TB. + * @member {string} maximum Maximum capacity in TB. + */ + constructor() { + } + + /** + * Defines the metadata of SkuCapacity + * + * @returns {object} metadata of SkuCapacity + * + */ + mapper() { + return { + required: false, + serializedName: 'SkuCapacity', + type: { + name: 'Composite', + className: 'SkuCapacity', + modelProperties: { + usable: { + required: true, + serializedName: 'usable', + type: { + name: 'String' + } + }, + maximum: { + required: true, + serializedName: 'maximum', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SkuCapacity; diff --git a/lib/services/databox/lib/models/skuCost.js b/lib/services/databox/lib/models/skuCost.js new file mode 100644 index 0000000000..5c34e9d1b9 --- /dev/null +++ b/lib/services/databox/lib/models/skuCost.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'; + +/** + * Describes metadata for retrieving price info. + * + */ +class SkuCost { + /** + * Create a SkuCost. + * @member {string} meterId Meter id of the Sku. + * @member {string} meterType The type of the meter. + */ + constructor() { + } + + /** + * Defines the metadata of SkuCost + * + * @returns {object} metadata of SkuCost + * + */ + mapper() { + return { + required: false, + serializedName: 'SkuCost', + type: { + name: 'Composite', + className: 'SkuCost', + modelProperties: { + meterId: { + required: true, + serializedName: 'meterId', + type: { + name: 'String' + } + }, + meterType: { + required: true, + serializedName: 'meterType', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SkuCost; diff --git a/lib/services/databox/lib/models/skuInformation.js b/lib/services/databox/lib/models/skuInformation.js new file mode 100644 index 0000000000..b8b38f5808 --- /dev/null +++ b/lib/services/databox/lib/models/skuInformation.js @@ -0,0 +1,133 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Information of the sku. + * + */ +class SkuInformation { + /** + * Create a SkuInformation. + * @member {object} sku The Sku. + * @member {string} [sku.name] The sku name. + * @member {string} [sku.displayName] The display name of the sku. + * @member {string} [sku.family] The sku family. + * @member {boolean} enabled The sku is enabled or not. + * @member {array} [destinationToServiceLocationMap] The map of destination + * location to service location. + * @member {object} capacity Capacity of the Sku. + * @member {string} [capacity.usable] Usable capacity in TB. + * @member {string} [capacity.maximum] Maximum capacity in TB. + * @member {array} costs Cost of the Sku. + * @member {array} apiVersions Api versions that support this Sku. + * @member {string} [disabledReason] Reason why the Sku is disabled. + */ + constructor() { + } + + /** + * Defines the metadata of SkuInformation + * + * @returns {object} metadata of SkuInformation + * + */ + mapper() { + return { + required: false, + serializedName: 'SkuInformation', + type: { + name: 'Composite', + className: 'SkuInformation', + modelProperties: { + sku: { + required: true, + serializedName: 'sku', + type: { + name: 'Composite', + className: 'Sku' + } + }, + enabled: { + required: true, + serializedName: 'enabled', + type: { + name: 'Boolean' + } + }, + destinationToServiceLocationMap: { + required: false, + serializedName: 'properties.destinationToServiceLocationMap', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DestinationToServiceLocationMapElementType', + type: { + name: 'Composite', + className: 'DestinationToServiceLocationMap' + } + } + } + }, + capacity: { + required: true, + serializedName: 'properties.capacity', + type: { + name: 'Composite', + className: 'SkuCapacity' + } + }, + costs: { + required: true, + serializedName: 'properties.costs', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SkuCostElementType', + type: { + name: 'Composite', + className: 'SkuCost' + } + } + } + }, + apiVersions: { + required: true, + serializedName: 'properties.apiVersions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + disabledReason: { + required: false, + serializedName: 'properties.disabledReason', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SkuInformation; diff --git a/lib/services/databox/lib/models/supportedRegions.js b/lib/services/databox/lib/models/supportedRegions.js new file mode 100644 index 0000000000..b3ecade4e7 --- /dev/null +++ b/lib/services/databox/lib/models/supportedRegions.js @@ -0,0 +1,66 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Storage region and service region mapping + * + */ +class SupportedRegions { + /** + * Create a SupportedRegions. + * @member {string} storageRegion Storage Region. Possible values include: + * 'westus', 'centralus', 'eastus', 'northcentralus', 'southcentralus', + * 'eastus2', 'westus2', 'westcentralus', 'westeurope', 'northeurope', + * 'ukwest', 'uksouth', 'germanycentral', 'germanynortheast' + * @member {string} serviceRegion Service Region. Possible values include: + * 'westus', 'westeurope', 'eastus2euap', 'centraluseuap' + */ + constructor() { + } + + /** + * Defines the metadata of SupportedRegions + * + * @returns {object} metadata of SupportedRegions + * + */ + mapper() { + return { + required: false, + serializedName: 'SupportedRegions', + type: { + name: 'Composite', + className: 'SupportedRegions', + modelProperties: { + storageRegion: { + required: true, + serializedName: 'storageRegion', + type: { + name: 'Enum', + allowedValues: [ 'westus', 'centralus', 'eastus', 'northcentralus', 'southcentralus', 'eastus2', 'westus2', 'westcentralus', 'westeurope', 'northeurope', 'ukwest', 'uksouth', 'germanycentral', 'germanynortheast' ] + } + }, + serviceRegion: { + required: true, + serializedName: 'serviceRegion', + type: { + name: 'Enum', + allowedValues: [ 'westus', 'westeurope', 'eastus2euap', 'centraluseuap' ] + } + } + } + } + }; + } +} + +module.exports = SupportedRegions; diff --git a/lib/services/databox/lib/models/unencryptedSecrets.js b/lib/services/databox/lib/models/unencryptedSecrets.js new file mode 100644 index 0000000000..34c5fdd250 --- /dev/null +++ b/lib/services/databox/lib/models/unencryptedSecrets.js @@ -0,0 +1,79 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Unencrypted secrets for accessing device. + * + */ +class UnencryptedSecrets { + /** + * Create a UnencryptedSecrets. + * @member {string} jobName Name of the job. + * @member {string} [deviceType] The Device Type used in the job. Possible + * values include: 'Pod', 'Disk', 'Cabinet' + * @member {object} [jobSecrets] Secrets related to this job. + * @member {string} [jobSecrets.jobSecretsType] Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of UnencryptedSecrets + * + * @returns {object} metadata of UnencryptedSecrets + * + */ + mapper() { + return { + required: false, + serializedName: 'UnencryptedSecrets', + type: { + name: 'Composite', + className: 'UnencryptedSecrets', + modelProperties: { + jobName: { + required: true, + serializedName: 'jobName', + type: { + name: 'String' + } + }, + deviceType: { + required: false, + serializedName: 'deviceType', + type: { + name: 'Enum', + allowedValues: [ 'Pod', 'Disk', 'Cabinet' ] + } + }, + jobSecrets: { + required: false, + serializedName: 'jobSecrets', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'jobSecretsType', + clientName: 'jobSecretsType' + }, + uberParent: 'JobSecrets', + className: 'JobSecrets' + } + } + } + } + }; + } +} + +module.exports = UnencryptedSecrets; diff --git a/lib/services/databox/lib/models/updateJobDetails.js b/lib/services/databox/lib/models/updateJobDetails.js new file mode 100644 index 0000000000..59ab402886 --- /dev/null +++ b/lib/services/databox/lib/models/updateJobDetails.js @@ -0,0 +1,88 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Job details for update. + * + */ +class UpdateJobDetails { + /** + * Create a UpdateJobDetails. + * @member {object} [contactDetails] Contact details for notification and + * shipping. + * @member {string} [contactDetails.contactName] Contact name of the person. + * @member {string} [contactDetails.phone] Phone number of the contact + * person. + * @member {string} [contactDetails.phoneExtension] Phone extension number of + * the contact person. + * @member {string} [contactDetails.mobile] Mobile number of the contact + * person. + * @member {array} [contactDetails.emailList] List of Email-ids to be + * notified about job progress. + * @member {array} [contactDetails.notificationPreference] Notification + * preference for a job stage. + * @member {object} [shippingAddress] Shipping address of the customer. + * @member {string} [shippingAddress.streetAddress1] Street Address line 1. + * @member {string} [shippingAddress.streetAddress2] Street Address line 2. + * @member {string} [shippingAddress.streetAddress3] Street Address line 3. + * @member {string} [shippingAddress.city] Name of the City. + * @member {string} [shippingAddress.stateOrProvince] Name of the State or + * Province. + * @member {string} [shippingAddress.country] Name of the Country. + * @member {string} [shippingAddress.postalCode] Postal code. + * @member {string} [shippingAddress.zipExtendedCode] Extended Zip Code. + * @member {string} [shippingAddress.companyName] Name of the company. + * @member {string} [shippingAddress.addressType] Type of address. Possible + * values include: 'None', 'Residential', 'Commercial' + */ + constructor() { + } + + /** + * Defines the metadata of UpdateJobDetails + * + * @returns {object} metadata of UpdateJobDetails + * + */ + mapper() { + return { + required: false, + serializedName: 'UpdateJobDetails', + type: { + name: 'Composite', + className: 'UpdateJobDetails', + modelProperties: { + contactDetails: { + required: false, + serializedName: 'contactDetails', + type: { + name: 'Composite', + className: 'ContactDetails' + } + }, + shippingAddress: { + required: false, + serializedName: 'shippingAddress', + type: { + name: 'Composite', + className: 'ShippingAddress' + } + } + } + } + }; + } +} + +module.exports = UpdateJobDetails; diff --git a/lib/services/databox/lib/models/validateAddress.js b/lib/services/databox/lib/models/validateAddress.js new file mode 100644 index 0000000000..2ccf4508e0 --- /dev/null +++ b/lib/services/databox/lib/models/validateAddress.js @@ -0,0 +1,78 @@ +/* + * 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'); + +/** + * The requirements to validate customer address where the device needs to be + * shipped. + * + */ +class ValidateAddress { + /** + * Create a ValidateAddress. + * @member {object} [shippingAddress] Shipping address of the customer. + * @member {string} [shippingAddress.streetAddress1] Street Address line 1. + * @member {string} [shippingAddress.streetAddress2] Street Address line 2. + * @member {string} [shippingAddress.streetAddress3] Street Address line 3. + * @member {string} [shippingAddress.city] Name of the City. + * @member {string} [shippingAddress.stateOrProvince] Name of the State or + * Province. + * @member {string} [shippingAddress.country] Name of the Country. + * @member {string} [shippingAddress.postalCode] Postal code. + * @member {string} [shippingAddress.zipExtendedCode] Extended Zip Code. + * @member {string} [shippingAddress.companyName] Name of the company. + * @member {string} [shippingAddress.addressType] Type of address. Possible + * values include: 'None', 'Residential', 'Commercial' + * @member {string} [deviceType] Device type to be used for the job. Possible + * values include: 'Pod', 'Disk', 'Cabinet' + */ + constructor() { + } + + /** + * Defines the metadata of ValidateAddress + * + * @returns {object} metadata of ValidateAddress + * + */ + mapper() { + return { + required: false, + serializedName: 'ValidateAddress', + type: { + name: 'Composite', + className: 'ValidateAddress', + modelProperties: { + shippingAddress: { + required: false, + serializedName: 'shippingAddress', + type: { + name: 'Composite', + className: 'ShippingAddress' + } + }, + deviceType: { + required: false, + serializedName: 'deviceType', + type: { + name: 'Enum', + allowedValues: [ 'Pod', 'Disk', 'Cabinet' ] + } + } + } + } + }; + } +} + +module.exports = ValidateAddress; diff --git a/lib/services/databox/lib/operations/index.d.ts b/lib/services/databox/lib/operations/index.d.ts new file mode 100644 index 0000000000..9665379ef5 --- /dev/null +++ b/lib/services/databox/lib/operations/index.d.ts @@ -0,0 +1,2296 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. +*/ + +import { ServiceClientOptions, RequestOptions, ServiceCallback, HttpOperationResponse } from 'ms-rest'; +import * as models from '../models'; + + +/** + * @class + * Operations + * __NOTE__: An instance of this class is automatically created for an + * instance of the DataBoxManagementClient. + */ +export interface Operations { + + + /** + * This method gets all the operations. + * + * @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>; + + /** + * This method gets all the operations. + * + * @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 {OperationList} - 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. + * + * {OperationList} [result] - The deserialized result object if an error did not occur. + * See {@link OperationList} 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; + + + /** + * This method gets all the operations. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * This method gets all the operations. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {OperationList} - 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. + * + * {OperationList} [result] - The deserialized result object if an error did not occur. + * See {@link OperationList} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Jobs + * __NOTE__: An instance of this class is automatically created for an + * instance of the DataBoxManagementClient. + */ +export interface Jobs { + + + /** + * Lists all the jobs available under the subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.skipToken] $skipToken is supported on Get list of + * jobs, which provides the next page in the list of jobs. + * + * @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?: { skipToken? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all the jobs available under the subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.skipToken] $skipToken is supported on Get list of + * jobs, which provides the next page in the list of jobs. + * + * @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 {JobResourceList} - 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. + * + * {JobResourceList} [result] - The deserialized result object if an error did not occur. + * See {@link JobResourceList} 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?: { skipToken? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { skipToken? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all the jobs available under the given resource group. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.skipToken] $skipToken is supported on Get list of + * jobs, which provides the next page in the list of jobs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { skipToken? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all the jobs available under the given resource group. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.skipToken] $skipToken is supported on Get list of + * jobs, which provides the next page in the list of jobs. + * + * @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 {JobResourceList} - 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. + * + * {JobResourceList} [result] - The deserialized result object if an error did not occur. + * See {@link JobResourceList} 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?: { skipToken? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options: { skipToken? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets information about the specified job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] $expand is supported on details parameter + * for job, which provides details on the job stages. + * + * @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(resourceGroupName: string, jobName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets information about the specified job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] $expand is supported on details parameter + * for job, which provides details on the job stages. + * + * @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 {JobResource} - 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. + * + * {JobResource} [result] - The deserialized result object if an error did not occur. + * See {@link JobResource} 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?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, jobName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, jobName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates a new job with the specified parameters. Existing job cannot be + * updated with this API and should instead be updated with the Update job API. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} jobResource Job details from request body. + * + * @param {string} [jobResource.deviceType] Type of the device to be used for + * the job. Possible values include: 'Pod', 'Disk', 'Cabinet' + * + * @param {boolean} [jobResource.isCancellable] Describes whether the job is + * cancellable or not. + * + * @param {boolean} [jobResource.isShippingAddressEditable] Describes whether + * the shipping address is editable or not. + * + * @param {string} [jobResource.status] Name of the stage which is in progress. + * Possible values include: 'DeviceOrdered', 'DevicePrepared', 'Dispatched', + * 'Delivered', 'PickedUp', 'AtAzureDC', 'DataCopy', 'Completed', + * 'CompletedWithErrors', 'Cancelled', 'Failed_IssueReportedAtCustomer', + * 'Failed_IssueDetectedAtAzureDC', 'Aborted' + * + * @param {date} [jobResource.startTime] Time at which the job was started in + * UTC ISO 8601 format. + * + * @param {object} [jobResource.error] Top level error for the job. + * + * @param {string} jobResource.error.code Error code that can be used to + * programmatically identify the error. + * + * @param {string} [jobResource.error.message] Describes the error in detail + * and provides debugging information. + * + * @param {object} [jobResource.deliveryPackage] Delivery package shipping + * details. + * + * @param {object} [jobResource.returnPackage] Return package shipping details. + * + * @param {string} [jobResource.returnPackage.carrierName] Name of the carrier. + * + * @param {string} [jobResource.returnPackage.trackingId] Tracking Id of + * shipment. + * + * @param {string} [jobResource.returnPackage.trackingUrl] Url where shipment + * can be tracked. + * + * @param {array} jobResource.destinationAccountDetails Destination account + * details. + * + * @param {object} [jobResource.details] Details of a job run. This field will + * only be sent for expand details filter. + * + * @param {number} [jobResource.details.expectedDataSizeInTeraBytes] The + * expected size of the data, which needs to be transfered in this job, in tera + * bytes. + * + * @param {array} [jobResource.details.jobStages] List of stages that run in + * the job. + * + * @param {object} jobResource.details.contactDetails Contact details for + * notification and shipping. + * + * @param {string} [jobResource.details.contactDetails.contactName] Contact + * name of the person. + * + * @param {string} jobResource.details.contactDetails.phone Phone number of the + * contact person. + * + * @param {string} [jobResource.details.contactDetails.phoneExtension] Phone + * extension number of the contact person. + * + * @param {string} [jobResource.details.contactDetails.mobile] Mobile number of + * the contact person. + * + * @param {array} jobResource.details.contactDetails.emailList List of + * Email-ids to be notified about job progress. + * + * @param {array} [jobResource.details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * + * @param {object} jobResource.details.shippingAddress Shipping address of the + * customer. + * + * @param {string} jobResource.details.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} [jobResource.details.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} [jobResource.details.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [jobResource.details.shippingAddress.city] Name of the City. + * + * @param {string} [jobResource.details.shippingAddress.stateOrProvince] Name + * of the State or Province. + * + * @param {string} jobResource.details.shippingAddress.country Name of the + * Country. + * + * @param {string} jobResource.details.shippingAddress.postalCode Postal code. + * + * @param {string} [jobResource.details.shippingAddress.zipExtendedCode] + * Extended Zip Code. + * + * @param {string} [jobResource.details.shippingAddress.companyName] Name of + * the company. + * + * @param {string} [jobResource.details.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {array} [jobResource.details.errorDetails] Error details for failure. + * This is optional. + * + * @param {string} jobResource.details.jobDetailsType Polymorphic Discriminator + * + * @param {string} [jobResource.cancellationReason] Reason for cancellation. + * + * @param {string} jobResource.location The location of the resource. This will + * be one of the supported and registered Azure Regions (e.g. West US, East US, + * Southeast Asia, etc.). The region of a resource cannot be changed once it is + * created, but if an identical region is specified on update the request will + * succeed. + * + * @param {object} [jobResource.tags] The list of key value pairs that describe + * the resource. These tags can be used in viewing and grouping this resource + * (across resource groups). + * + * @param {object} jobResource.sku The sku type. + * + * @param {string} jobResource.sku.name The sku name. + * + * @param {string} [jobResource.sku.displayName] The display name of the sku. + * + * @param {string} [jobResource.sku.family] The sku family. + * + * @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. + */ + createWithHttpOperationResponse(resourceGroupName: string, jobName: string, jobResource: models.JobResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates a new job with the specified parameters. Existing job cannot be + * updated with this API and should instead be updated with the Update job API. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} jobResource Job details from request body. + * + * @param {string} [jobResource.deviceType] Type of the device to be used for + * the job. Possible values include: 'Pod', 'Disk', 'Cabinet' + * + * @param {boolean} [jobResource.isCancellable] Describes whether the job is + * cancellable or not. + * + * @param {boolean} [jobResource.isShippingAddressEditable] Describes whether + * the shipping address is editable or not. + * + * @param {string} [jobResource.status] Name of the stage which is in progress. + * Possible values include: 'DeviceOrdered', 'DevicePrepared', 'Dispatched', + * 'Delivered', 'PickedUp', 'AtAzureDC', 'DataCopy', 'Completed', + * 'CompletedWithErrors', 'Cancelled', 'Failed_IssueReportedAtCustomer', + * 'Failed_IssueDetectedAtAzureDC', 'Aborted' + * + * @param {date} [jobResource.startTime] Time at which the job was started in + * UTC ISO 8601 format. + * + * @param {object} [jobResource.error] Top level error for the job. + * + * @param {string} jobResource.error.code Error code that can be used to + * programmatically identify the error. + * + * @param {string} [jobResource.error.message] Describes the error in detail + * and provides debugging information. + * + * @param {object} [jobResource.deliveryPackage] Delivery package shipping + * details. + * + * @param {object} [jobResource.returnPackage] Return package shipping details. + * + * @param {string} [jobResource.returnPackage.carrierName] Name of the carrier. + * + * @param {string} [jobResource.returnPackage.trackingId] Tracking Id of + * shipment. + * + * @param {string} [jobResource.returnPackage.trackingUrl] Url where shipment + * can be tracked. + * + * @param {array} jobResource.destinationAccountDetails Destination account + * details. + * + * @param {object} [jobResource.details] Details of a job run. This field will + * only be sent for expand details filter. + * + * @param {number} [jobResource.details.expectedDataSizeInTeraBytes] The + * expected size of the data, which needs to be transfered in this job, in tera + * bytes. + * + * @param {array} [jobResource.details.jobStages] List of stages that run in + * the job. + * + * @param {object} jobResource.details.contactDetails Contact details for + * notification and shipping. + * + * @param {string} [jobResource.details.contactDetails.contactName] Contact + * name of the person. + * + * @param {string} jobResource.details.contactDetails.phone Phone number of the + * contact person. + * + * @param {string} [jobResource.details.contactDetails.phoneExtension] Phone + * extension number of the contact person. + * + * @param {string} [jobResource.details.contactDetails.mobile] Mobile number of + * the contact person. + * + * @param {array} jobResource.details.contactDetails.emailList List of + * Email-ids to be notified about job progress. + * + * @param {array} [jobResource.details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * + * @param {object} jobResource.details.shippingAddress Shipping address of the + * customer. + * + * @param {string} jobResource.details.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} [jobResource.details.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} [jobResource.details.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [jobResource.details.shippingAddress.city] Name of the City. + * + * @param {string} [jobResource.details.shippingAddress.stateOrProvince] Name + * of the State or Province. + * + * @param {string} jobResource.details.shippingAddress.country Name of the + * Country. + * + * @param {string} jobResource.details.shippingAddress.postalCode Postal code. + * + * @param {string} [jobResource.details.shippingAddress.zipExtendedCode] + * Extended Zip Code. + * + * @param {string} [jobResource.details.shippingAddress.companyName] Name of + * the company. + * + * @param {string} [jobResource.details.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {array} [jobResource.details.errorDetails] Error details for failure. + * This is optional. + * + * @param {string} jobResource.details.jobDetailsType Polymorphic Discriminator + * + * @param {string} [jobResource.cancellationReason] Reason for cancellation. + * + * @param {string} jobResource.location The location of the resource. This will + * be one of the supported and registered Azure Regions (e.g. West US, East US, + * Southeast Asia, etc.). The region of a resource cannot be changed once it is + * created, but if an identical region is specified on update the request will + * succeed. + * + * @param {object} [jobResource.tags] The list of key value pairs that describe + * the resource. These tags can be used in viewing and grouping this resource + * (across resource groups). + * + * @param {object} jobResource.sku The sku type. + * + * @param {string} jobResource.sku.name The sku name. + * + * @param {string} [jobResource.sku.displayName] The display name of the sku. + * + * @param {string} [jobResource.sku.family] The sku family. + * + * @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 {JobResource} - 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. + * + * {JobResource} [result] - The deserialized result object if an error did not occur. + * See {@link JobResource} 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. + */ + create(resourceGroupName: string, jobName: string, jobResource: models.JobResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + create(resourceGroupName: string, jobName: string, jobResource: models.JobResource, callback: ServiceCallback): void; + create(resourceGroupName: string, jobName: string, jobResource: models.JobResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes a job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes a job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(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; + + + /** + * Updates the properties of an existing job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} jobResourceUpdateParameter Job update parameters from + * request body. + * + * @param {object} jobResourceUpdateParameter.details Details of a job to be + * updated. + * + * @param {object} [jobResourceUpdateParameter.details.contactDetails] Contact + * details for notification and shipping. + * + * @param {string} + * [jobResourceUpdateParameter.details.contactDetails.contactName] Contact name + * of the person. + * + * @param {string} jobResourceUpdateParameter.details.contactDetails.phone + * Phone number of the contact person. + * + * @param {string} + * [jobResourceUpdateParameter.details.contactDetails.phoneExtension] Phone + * extension number of the contact person. + * + * @param {string} [jobResourceUpdateParameter.details.contactDetails.mobile] + * Mobile number of the contact person. + * + * @param {array} jobResourceUpdateParameter.details.contactDetails.emailList + * List of Email-ids to be notified about job progress. + * + * @param {array} + * [jobResourceUpdateParameter.details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * + * @param {object} [jobResourceUpdateParameter.details.shippingAddress] + * Shipping address of the customer. + * + * @param {string} + * jobResourceUpdateParameter.details.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [jobResourceUpdateParameter.details.shippingAddress.city] + * Name of the City. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.stateOrProvince] Name of + * the State or Province. + * + * @param {string} jobResourceUpdateParameter.details.shippingAddress.country + * Name of the Country. + * + * @param {string} + * jobResourceUpdateParameter.details.shippingAddress.postalCode Postal code. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.zipExtendedCode] + * Extended Zip Code. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.companyName] Name of the + * company. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {object} [jobResourceUpdateParameter.tags] The list of key value + * pairs that describe the resource. These tags can be used in viewing and + * grouping this resource (across resource groups). + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.ifMatch] Defines the If-Match condition. The patch + * will be performed only if the ETag of the job on the server matches this + * value. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName: string, jobName: string, jobResourceUpdateParameter: models.JobResourceUpdateParameter, options?: { ifMatch? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates the properties of an existing job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} jobResourceUpdateParameter Job update parameters from + * request body. + * + * @param {object} jobResourceUpdateParameter.details Details of a job to be + * updated. + * + * @param {object} [jobResourceUpdateParameter.details.contactDetails] Contact + * details for notification and shipping. + * + * @param {string} + * [jobResourceUpdateParameter.details.contactDetails.contactName] Contact name + * of the person. + * + * @param {string} jobResourceUpdateParameter.details.contactDetails.phone + * Phone number of the contact person. + * + * @param {string} + * [jobResourceUpdateParameter.details.contactDetails.phoneExtension] Phone + * extension number of the contact person. + * + * @param {string} [jobResourceUpdateParameter.details.contactDetails.mobile] + * Mobile number of the contact person. + * + * @param {array} jobResourceUpdateParameter.details.contactDetails.emailList + * List of Email-ids to be notified about job progress. + * + * @param {array} + * [jobResourceUpdateParameter.details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * + * @param {object} [jobResourceUpdateParameter.details.shippingAddress] + * Shipping address of the customer. + * + * @param {string} + * jobResourceUpdateParameter.details.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [jobResourceUpdateParameter.details.shippingAddress.city] + * Name of the City. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.stateOrProvince] Name of + * the State or Province. + * + * @param {string} jobResourceUpdateParameter.details.shippingAddress.country + * Name of the Country. + * + * @param {string} + * jobResourceUpdateParameter.details.shippingAddress.postalCode Postal code. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.zipExtendedCode] + * Extended Zip Code. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.companyName] Name of the + * company. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {object} [jobResourceUpdateParameter.tags] The list of key value + * pairs that describe the resource. These tags can be used in viewing and + * grouping this resource (across resource groups). + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.ifMatch] Defines the If-Match condition. The patch + * will be performed only if the ETag of the job on the server matches this + * value. + * + * @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 {JobResource} - 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. + * + * {JobResource} [result] - The deserialized result object if an error did not occur. + * See {@link JobResource} 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, jobResourceUpdateParameter: models.JobResourceUpdateParameter, options?: { ifMatch? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, jobName: string, jobResourceUpdateParameter: models.JobResourceUpdateParameter, callback: ServiceCallback): void; + update(resourceGroupName: string, jobName: string, jobResourceUpdateParameter: models.JobResourceUpdateParameter, options: { ifMatch? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Book shipment pick up. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} shipmentPickUpRequest Details of shipment pick up request. + * + * @param {date} [shipmentPickUpRequest.startTime] Minimum date after which the + * pick up should commence, this must be in local time of pick up area. + * + * @param {date} [shipmentPickUpRequest.endTime] Maximum date before which the + * pick up should commence, this must be in local time of pick up area. + * + * @param {string} [shipmentPickUpRequest.shipmentLocation] Shipment Location + * in the pickup place. Eg.front desk + * + * @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. + */ + bookShipmentPickUpWithHttpOperationResponse(resourceGroupName: string, jobName: string, shipmentPickUpRequest: models.ShipmentPickUpRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Book shipment pick up. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} shipmentPickUpRequest Details of shipment pick up request. + * + * @param {date} [shipmentPickUpRequest.startTime] Minimum date after which the + * pick up should commence, this must be in local time of pick up area. + * + * @param {date} [shipmentPickUpRequest.endTime] Maximum date before which the + * pick up should commence, this must be in local time of pick up area. + * + * @param {string} [shipmentPickUpRequest.shipmentLocation] Shipment Location + * in the pickup place. Eg.front desk + * + * @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 {ShipmentPickUpResponse} - 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. + * + * {ShipmentPickUpResponse} [result] - The deserialized result object if an error did not occur. + * See {@link ShipmentPickUpResponse} 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. + */ + bookShipmentPickUp(resourceGroupName: string, jobName: string, shipmentPickUpRequest: models.ShipmentPickUpRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + bookShipmentPickUp(resourceGroupName: string, jobName: string, shipmentPickUpRequest: models.ShipmentPickUpRequest, callback: ServiceCallback): void; + bookShipmentPickUp(resourceGroupName: string, jobName: string, shipmentPickUpRequest: models.ShipmentPickUpRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * CancelJob. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} cancellationReason Reason for cancellation. + * + * @param {string} cancellationReason.reason Reason for cancellation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + cancelWithHttpOperationResponse(resourceGroupName: string, jobName: string, cancellationReason: models.CancellationReason, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * CancelJob. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} cancellationReason Reason for cancellation. + * + * @param {string} cancellationReason.reason Reason for cancellation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + cancel(resourceGroupName: string, jobName: string, cancellationReason: models.CancellationReason, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + cancel(resourceGroupName: string, jobName: string, cancellationReason: models.CancellationReason, callback: ServiceCallback): void; + cancel(resourceGroupName: string, jobName: string, cancellationReason: models.CancellationReason, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Provides list of copy logs uri. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @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. + */ + getCopyLogsUriWithHttpOperationResponse(resourceGroupName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Provides list of copy logs uri. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @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 {GetCopyLogsUriOutput} - 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. + * + * {GetCopyLogsUriOutput} [result] - The deserialized result object if an error did not occur. + * See {@link GetCopyLogsUriOutput} 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. + */ + getCopyLogsUri(resourceGroupName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getCopyLogsUri(resourceGroupName: string, jobName: string, callback: ServiceCallback): void; + getCopyLogsUri(resourceGroupName: string, jobName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Get shipping label sas uri. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @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. + */ + downloadShippingLabelUriWithHttpOperationResponse(resourceGroupName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Get shipping label sas uri. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @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 {ShippingLabelDetails} - 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. + * + * {ShippingLabelDetails} [result] - The deserialized result object if an error did not occur. + * See {@link ShippingLabelDetails} 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. + */ + downloadShippingLabelUri(resourceGroupName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + downloadShippingLabelUri(resourceGroupName: string, jobName: string, callback: ServiceCallback): void; + downloadShippingLabelUri(resourceGroupName: string, jobName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * This method gets the unencrypted secrets related to the job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @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. + */ + listSecretsWithHttpOperationResponse(resourceGroupName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * This method gets the unencrypted secrets related to the job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @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 {UnencryptedSecrets} - 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. + * + * {UnencryptedSecrets} [result] - The deserialized result object if an error did not occur. + * See {@link UnencryptedSecrets} 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. + */ + listSecrets(resourceGroupName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSecrets(resourceGroupName: string, jobName: string, callback: ServiceCallback): void; + listSecrets(resourceGroupName: string, jobName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Reports an issue. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} reportIssueDetails Details of reported issue. + * + * @param {string} [reportIssueDetails.issueType] Issue Type. Possible values + * include: 'DeviceMismatch', 'ValidationStringMismatch', + * 'CredentialNotWorking', 'DeviceFailure' + * + * @param {string} [reportIssueDetails.deviceIssueType] Device Issue Type. Only + * used for Device failure issue. Possible values include: 'DeviceTampering', + * 'DeviceNotBootingUp', 'DeviceHealthCheckShowFailures', 'NICsAreNotWorking', + * 'Misc' + * + * @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. + */ + reportIssueWithHttpOperationResponse(resourceGroupName: string, jobName: string, reportIssueDetails: models.ReportIssueDetails, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Reports an issue. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} reportIssueDetails Details of reported issue. + * + * @param {string} [reportIssueDetails.issueType] Issue Type. Possible values + * include: 'DeviceMismatch', 'ValidationStringMismatch', + * 'CredentialNotWorking', 'DeviceFailure' + * + * @param {string} [reportIssueDetails.deviceIssueType] Device Issue Type. Only + * used for Device failure issue. Possible values include: 'DeviceTampering', + * 'DeviceNotBootingUp', 'DeviceHealthCheckShowFailures', 'NICsAreNotWorking', + * 'Misc' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + reportIssue(resourceGroupName: string, jobName: string, reportIssueDetails: models.ReportIssueDetails, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + reportIssue(resourceGroupName: string, jobName: string, reportIssueDetails: models.ReportIssueDetails, callback: ServiceCallback): void; + reportIssue(resourceGroupName: string, jobName: string, reportIssueDetails: models.ReportIssueDetails, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates a new job with the specified parameters. Existing job cannot be + * updated with this API and should instead be updated with the Update job API. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} jobResource Job details from request body. + * + * @param {string} [jobResource.deviceType] Type of the device to be used for + * the job. Possible values include: 'Pod', 'Disk', 'Cabinet' + * + * @param {boolean} [jobResource.isCancellable] Describes whether the job is + * cancellable or not. + * + * @param {boolean} [jobResource.isShippingAddressEditable] Describes whether + * the shipping address is editable or not. + * + * @param {string} [jobResource.status] Name of the stage which is in progress. + * Possible values include: 'DeviceOrdered', 'DevicePrepared', 'Dispatched', + * 'Delivered', 'PickedUp', 'AtAzureDC', 'DataCopy', 'Completed', + * 'CompletedWithErrors', 'Cancelled', 'Failed_IssueReportedAtCustomer', + * 'Failed_IssueDetectedAtAzureDC', 'Aborted' + * + * @param {date} [jobResource.startTime] Time at which the job was started in + * UTC ISO 8601 format. + * + * @param {object} [jobResource.error] Top level error for the job. + * + * @param {string} jobResource.error.code Error code that can be used to + * programmatically identify the error. + * + * @param {string} [jobResource.error.message] Describes the error in detail + * and provides debugging information. + * + * @param {object} [jobResource.deliveryPackage] Delivery package shipping + * details. + * + * @param {object} [jobResource.returnPackage] Return package shipping details. + * + * @param {string} [jobResource.returnPackage.carrierName] Name of the carrier. + * + * @param {string} [jobResource.returnPackage.trackingId] Tracking Id of + * shipment. + * + * @param {string} [jobResource.returnPackage.trackingUrl] Url where shipment + * can be tracked. + * + * @param {array} jobResource.destinationAccountDetails Destination account + * details. + * + * @param {object} [jobResource.details] Details of a job run. This field will + * only be sent for expand details filter. + * + * @param {number} [jobResource.details.expectedDataSizeInTeraBytes] The + * expected size of the data, which needs to be transfered in this job, in tera + * bytes. + * + * @param {array} [jobResource.details.jobStages] List of stages that run in + * the job. + * + * @param {object} jobResource.details.contactDetails Contact details for + * notification and shipping. + * + * @param {string} [jobResource.details.contactDetails.contactName] Contact + * name of the person. + * + * @param {string} jobResource.details.contactDetails.phone Phone number of the + * contact person. + * + * @param {string} [jobResource.details.contactDetails.phoneExtension] Phone + * extension number of the contact person. + * + * @param {string} [jobResource.details.contactDetails.mobile] Mobile number of + * the contact person. + * + * @param {array} jobResource.details.contactDetails.emailList List of + * Email-ids to be notified about job progress. + * + * @param {array} [jobResource.details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * + * @param {object} jobResource.details.shippingAddress Shipping address of the + * customer. + * + * @param {string} jobResource.details.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} [jobResource.details.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} [jobResource.details.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [jobResource.details.shippingAddress.city] Name of the City. + * + * @param {string} [jobResource.details.shippingAddress.stateOrProvince] Name + * of the State or Province. + * + * @param {string} jobResource.details.shippingAddress.country Name of the + * Country. + * + * @param {string} jobResource.details.shippingAddress.postalCode Postal code. + * + * @param {string} [jobResource.details.shippingAddress.zipExtendedCode] + * Extended Zip Code. + * + * @param {string} [jobResource.details.shippingAddress.companyName] Name of + * the company. + * + * @param {string} [jobResource.details.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {array} [jobResource.details.errorDetails] Error details for failure. + * This is optional. + * + * @param {string} jobResource.details.jobDetailsType Polymorphic Discriminator + * + * @param {string} [jobResource.cancellationReason] Reason for cancellation. + * + * @param {string} jobResource.location The location of the resource. This will + * be one of the supported and registered Azure Regions (e.g. West US, East US, + * Southeast Asia, etc.). The region of a resource cannot be changed once it is + * created, but if an identical region is specified on update the request will + * succeed. + * + * @param {object} [jobResource.tags] The list of key value pairs that describe + * the resource. These tags can be used in viewing and grouping this resource + * (across resource groups). + * + * @param {object} jobResource.sku The sku type. + * + * @param {string} jobResource.sku.name The sku name. + * + * @param {string} [jobResource.sku.displayName] The display name of the sku. + * + * @param {string} [jobResource.sku.family] The sku family. + * + * @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. + */ + beginCreateWithHttpOperationResponse(resourceGroupName: string, jobName: string, jobResource: models.JobResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates a new job with the specified parameters. Existing job cannot be + * updated with this API and should instead be updated with the Update job API. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} jobResource Job details from request body. + * + * @param {string} [jobResource.deviceType] Type of the device to be used for + * the job. Possible values include: 'Pod', 'Disk', 'Cabinet' + * + * @param {boolean} [jobResource.isCancellable] Describes whether the job is + * cancellable or not. + * + * @param {boolean} [jobResource.isShippingAddressEditable] Describes whether + * the shipping address is editable or not. + * + * @param {string} [jobResource.status] Name of the stage which is in progress. + * Possible values include: 'DeviceOrdered', 'DevicePrepared', 'Dispatched', + * 'Delivered', 'PickedUp', 'AtAzureDC', 'DataCopy', 'Completed', + * 'CompletedWithErrors', 'Cancelled', 'Failed_IssueReportedAtCustomer', + * 'Failed_IssueDetectedAtAzureDC', 'Aborted' + * + * @param {date} [jobResource.startTime] Time at which the job was started in + * UTC ISO 8601 format. + * + * @param {object} [jobResource.error] Top level error for the job. + * + * @param {string} jobResource.error.code Error code that can be used to + * programmatically identify the error. + * + * @param {string} [jobResource.error.message] Describes the error in detail + * and provides debugging information. + * + * @param {object} [jobResource.deliveryPackage] Delivery package shipping + * details. + * + * @param {object} [jobResource.returnPackage] Return package shipping details. + * + * @param {string} [jobResource.returnPackage.carrierName] Name of the carrier. + * + * @param {string} [jobResource.returnPackage.trackingId] Tracking Id of + * shipment. + * + * @param {string} [jobResource.returnPackage.trackingUrl] Url where shipment + * can be tracked. + * + * @param {array} jobResource.destinationAccountDetails Destination account + * details. + * + * @param {object} [jobResource.details] Details of a job run. This field will + * only be sent for expand details filter. + * + * @param {number} [jobResource.details.expectedDataSizeInTeraBytes] The + * expected size of the data, which needs to be transfered in this job, in tera + * bytes. + * + * @param {array} [jobResource.details.jobStages] List of stages that run in + * the job. + * + * @param {object} jobResource.details.contactDetails Contact details for + * notification and shipping. + * + * @param {string} [jobResource.details.contactDetails.contactName] Contact + * name of the person. + * + * @param {string} jobResource.details.contactDetails.phone Phone number of the + * contact person. + * + * @param {string} [jobResource.details.contactDetails.phoneExtension] Phone + * extension number of the contact person. + * + * @param {string} [jobResource.details.contactDetails.mobile] Mobile number of + * the contact person. + * + * @param {array} jobResource.details.contactDetails.emailList List of + * Email-ids to be notified about job progress. + * + * @param {array} [jobResource.details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * + * @param {object} jobResource.details.shippingAddress Shipping address of the + * customer. + * + * @param {string} jobResource.details.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} [jobResource.details.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} [jobResource.details.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [jobResource.details.shippingAddress.city] Name of the City. + * + * @param {string} [jobResource.details.shippingAddress.stateOrProvince] Name + * of the State or Province. + * + * @param {string} jobResource.details.shippingAddress.country Name of the + * Country. + * + * @param {string} jobResource.details.shippingAddress.postalCode Postal code. + * + * @param {string} [jobResource.details.shippingAddress.zipExtendedCode] + * Extended Zip Code. + * + * @param {string} [jobResource.details.shippingAddress.companyName] Name of + * the company. + * + * @param {string} [jobResource.details.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {array} [jobResource.details.errorDetails] Error details for failure. + * This is optional. + * + * @param {string} jobResource.details.jobDetailsType Polymorphic Discriminator + * + * @param {string} [jobResource.cancellationReason] Reason for cancellation. + * + * @param {string} jobResource.location The location of the resource. This will + * be one of the supported and registered Azure Regions (e.g. West US, East US, + * Southeast Asia, etc.). The region of a resource cannot be changed once it is + * created, but if an identical region is specified on update the request will + * succeed. + * + * @param {object} [jobResource.tags] The list of key value pairs that describe + * the resource. These tags can be used in viewing and grouping this resource + * (across resource groups). + * + * @param {object} jobResource.sku The sku type. + * + * @param {string} jobResource.sku.name The sku name. + * + * @param {string} [jobResource.sku.displayName] The display name of the sku. + * + * @param {string} [jobResource.sku.family] The sku family. + * + * @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 {JobResource} - 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. + * + * {JobResource} [result] - The deserialized result object if an error did not occur. + * See {@link JobResource} 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. + */ + beginCreate(resourceGroupName: string, jobName: string, jobResource: models.JobResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreate(resourceGroupName: string, jobName: string, jobResource: models.JobResource, callback: ServiceCallback): void; + beginCreate(resourceGroupName: string, jobName: string, jobResource: models.JobResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates the properties of an existing job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} jobResourceUpdateParameter Job update parameters from + * request body. + * + * @param {object} jobResourceUpdateParameter.details Details of a job to be + * updated. + * + * @param {object} [jobResourceUpdateParameter.details.contactDetails] Contact + * details for notification and shipping. + * + * @param {string} + * [jobResourceUpdateParameter.details.contactDetails.contactName] Contact name + * of the person. + * + * @param {string} jobResourceUpdateParameter.details.contactDetails.phone + * Phone number of the contact person. + * + * @param {string} + * [jobResourceUpdateParameter.details.contactDetails.phoneExtension] Phone + * extension number of the contact person. + * + * @param {string} [jobResourceUpdateParameter.details.contactDetails.mobile] + * Mobile number of the contact person. + * + * @param {array} jobResourceUpdateParameter.details.contactDetails.emailList + * List of Email-ids to be notified about job progress. + * + * @param {array} + * [jobResourceUpdateParameter.details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * + * @param {object} [jobResourceUpdateParameter.details.shippingAddress] + * Shipping address of the customer. + * + * @param {string} + * jobResourceUpdateParameter.details.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [jobResourceUpdateParameter.details.shippingAddress.city] + * Name of the City. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.stateOrProvince] Name of + * the State or Province. + * + * @param {string} jobResourceUpdateParameter.details.shippingAddress.country + * Name of the Country. + * + * @param {string} + * jobResourceUpdateParameter.details.shippingAddress.postalCode Postal code. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.zipExtendedCode] + * Extended Zip Code. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.companyName] Name of the + * company. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {object} [jobResourceUpdateParameter.tags] The list of key value + * pairs that describe the resource. These tags can be used in viewing and + * grouping this resource (across resource groups). + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.ifMatch] Defines the If-Match condition. The patch + * will be performed only if the ETag of the job on the server matches this + * value. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginUpdateWithHttpOperationResponse(resourceGroupName: string, jobName: string, jobResourceUpdateParameter: models.JobResourceUpdateParameter, options?: { ifMatch? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates the properties of an existing job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} jobResourceUpdateParameter Job update parameters from + * request body. + * + * @param {object} jobResourceUpdateParameter.details Details of a job to be + * updated. + * + * @param {object} [jobResourceUpdateParameter.details.contactDetails] Contact + * details for notification and shipping. + * + * @param {string} + * [jobResourceUpdateParameter.details.contactDetails.contactName] Contact name + * of the person. + * + * @param {string} jobResourceUpdateParameter.details.contactDetails.phone + * Phone number of the contact person. + * + * @param {string} + * [jobResourceUpdateParameter.details.contactDetails.phoneExtension] Phone + * extension number of the contact person. + * + * @param {string} [jobResourceUpdateParameter.details.contactDetails.mobile] + * Mobile number of the contact person. + * + * @param {array} jobResourceUpdateParameter.details.contactDetails.emailList + * List of Email-ids to be notified about job progress. + * + * @param {array} + * [jobResourceUpdateParameter.details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * + * @param {object} [jobResourceUpdateParameter.details.shippingAddress] + * Shipping address of the customer. + * + * @param {string} + * jobResourceUpdateParameter.details.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [jobResourceUpdateParameter.details.shippingAddress.city] + * Name of the City. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.stateOrProvince] Name of + * the State or Province. + * + * @param {string} jobResourceUpdateParameter.details.shippingAddress.country + * Name of the Country. + * + * @param {string} + * jobResourceUpdateParameter.details.shippingAddress.postalCode Postal code. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.zipExtendedCode] + * Extended Zip Code. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.companyName] Name of the + * company. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {object} [jobResourceUpdateParameter.tags] The list of key value + * pairs that describe the resource. These tags can be used in viewing and + * grouping this resource (across resource groups). + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.ifMatch] Defines the If-Match condition. The patch + * will be performed only if the ETag of the job on the server matches this + * value. + * + * @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 {JobResource} - 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. + * + * {JobResource} [result] - The deserialized result object if an error did not occur. + * See {@link JobResource} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdate(resourceGroupName: string, jobName: string, jobResourceUpdateParameter: models.JobResourceUpdateParameter, options?: { ifMatch? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, jobName: string, jobResourceUpdateParameter: models.JobResourceUpdateParameter, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, jobName: string, jobResourceUpdateParameter: models.JobResourceUpdateParameter, options: { ifMatch? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all the jobs available under the subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all the jobs available under the subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {JobResourceList} - 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. + * + * {JobResourceList} [result] - The deserialized result object if an error did not occur. + * See {@link JobResourceList} 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; + + + /** + * Lists all the jobs available under the given resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all the jobs available under the given resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {JobResourceList} - 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. + * + * {JobResourceList} [result] - The deserialized result object if an error did not occur. + * See {@link JobResourceList} 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; +} + +/** + * @class + * Service + * __NOTE__: An instance of this class is automatically created for an + * instance of the DataBoxManagementClient. + */ +export interface Service { + + + /** + * This method provides the list of available skus for the given subscription + * and location. + * + * @param {string} location The location of the resource + * + * @param {object} availableSkuRequest Filters for showing the available skus. + * + * @param {string} availableSkuRequest.country ISO country code. Country for + * hardware shipment. For codes check: + * https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + * + * @param {string} availableSkuRequest.location Location for data transfer. For + * locations check: + * https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + * + * @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. + */ + listAvailableSkusWithHttpOperationResponse(location: string, availableSkuRequest: models.AvailableSkuRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * This method provides the list of available skus for the given subscription + * and location. + * + * @param {string} location The location of the resource + * + * @param {object} availableSkuRequest Filters for showing the available skus. + * + * @param {string} availableSkuRequest.country ISO country code. Country for + * hardware shipment. For codes check: + * https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + * + * @param {string} availableSkuRequest.location Location for data transfer. For + * locations check: + * https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + * + * @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 {AvailableSkusResult} - 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. + * + * {AvailableSkusResult} [result] - The deserialized result object if an error did not occur. + * See {@link AvailableSkusResult} 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. + */ + listAvailableSkus(location: string, availableSkuRequest: models.AvailableSkuRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAvailableSkus(location: string, availableSkuRequest: models.AvailableSkuRequest, callback: ServiceCallback): void; + listAvailableSkus(location: string, availableSkuRequest: models.AvailableSkuRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * This method validates the customer shipping address and provide alternate + * addresses if any. + * + * @param {string} location The location of the resource + * + * @param {object} validateAddress Shipping address of the customer. + * + * @param {object} [validateAddress.shippingAddress] Shipping address of the + * customer. + * + * @param {string} validateAddress.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} [validateAddress.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} [validateAddress.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [validateAddress.shippingAddress.city] Name of the City. + * + * @param {string} [validateAddress.shippingAddress.stateOrProvince] Name of + * the State or Province. + * + * @param {string} validateAddress.shippingAddress.country Name of the Country. + * + * @param {string} validateAddress.shippingAddress.postalCode Postal code. + * + * @param {string} [validateAddress.shippingAddress.zipExtendedCode] Extended + * Zip Code. + * + * @param {string} [validateAddress.shippingAddress.companyName] Name of the + * company. + * + * @param {string} [validateAddress.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {string} [validateAddress.deviceType] Device type to be used for the + * job. Possible values include: 'Pod', 'Disk', 'Cabinet' + * + * @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. + */ + validateAddressMethodWithHttpOperationResponse(location: string, validateAddress: models.ValidateAddress, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * This method validates the customer shipping address and provide alternate + * addresses if any. + * + * @param {string} location The location of the resource + * + * @param {object} validateAddress Shipping address of the customer. + * + * @param {object} [validateAddress.shippingAddress] Shipping address of the + * customer. + * + * @param {string} validateAddress.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} [validateAddress.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} [validateAddress.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [validateAddress.shippingAddress.city] Name of the City. + * + * @param {string} [validateAddress.shippingAddress.stateOrProvince] Name of + * the State or Province. + * + * @param {string} validateAddress.shippingAddress.country Name of the Country. + * + * @param {string} validateAddress.shippingAddress.postalCode Postal code. + * + * @param {string} [validateAddress.shippingAddress.zipExtendedCode] Extended + * Zip Code. + * + * @param {string} [validateAddress.shippingAddress.companyName] Name of the + * company. + * + * @param {string} [validateAddress.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {string} [validateAddress.deviceType] Device type to be used for the + * job. Possible values include: 'Pod', 'Disk', 'Cabinet' + * + * @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 {AddressValidationOutput} - 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. + * + * {AddressValidationOutput} [result] - The deserialized result object if an error did not occur. + * See {@link AddressValidationOutput} 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. + */ + validateAddressMethod(location: string, validateAddress: models.ValidateAddress, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + validateAddressMethod(location: string, validateAddress: models.ValidateAddress, callback: ServiceCallback): void; + validateAddressMethod(location: string, validateAddress: models.ValidateAddress, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * This method provides the list of available skus for the given subscription + * and location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listAvailableSkusNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * This method provides the list of available skus for the given subscription + * and location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {AvailableSkusResult} - 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. + * + * {AvailableSkusResult} [result] - The deserialized result object if an error did not occur. + * See {@link AvailableSkusResult} 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. + */ + listAvailableSkusNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAvailableSkusNext(nextPageLink: string, callback: ServiceCallback): void; + listAvailableSkusNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} diff --git a/lib/services/databox/lib/operations/index.js b/lib/services/databox/lib/operations/index.js new file mode 100644 index 0000000000..9ece56c7e9 --- /dev/null +++ b/lib/services/databox/lib/operations/index.js @@ -0,0 +1,19 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +/* jshint latedef:false */ +/* jshint forin:false */ +/* jshint noempty:false */ + +'use strict'; + +exports.Operations = require('./operations'); +exports.Jobs = require('./jobs'); +exports.Service = require('./service'); diff --git a/lib/services/databox/lib/operations/jobs.js b/lib/services/databox/lib/operations/jobs.js new file mode 100644 index 0000000000..ec67d62513 --- /dev/null +++ b/lib/services/databox/lib/operations/jobs.js @@ -0,0 +1,5172 @@ +/* + * 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; + +/** + * Lists all the jobs available under the subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.skipToken] $skipToken is supported on Get list of + * jobs, which provides the next page in the list of jobs. + * + * @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 JobResourceList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let skipToken = (options && options.skipToken !== undefined) ? options.skipToken : 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (skipToken !== null && skipToken !== undefined && typeof skipToken.valueOf() !== 'string') { + throw new Error('skipToken must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (skipToken !== null && skipToken !== undefined) { + queryParameters.push('$skipToken=' + encodeURIComponent(skipToken)); + } + 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().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['JobResourceList']().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 all the jobs available under the given resource group. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.skipToken] $skipToken is supported on Get list of + * jobs, which provides the next page in the list of jobs. + * + * @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 JobResourceList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByResourceGroup(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.'); + } + let skipToken = (options && options.skipToken !== undefined) ? options.skipToken : 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 (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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (skipToken !== null && skipToken !== undefined && typeof skipToken.valueOf() !== 'string') { + throw new Error('skipToken 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.DataBox/jobs'; + 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 (skipToken !== null && skipToken !== undefined) { + queryParameters.push('$skipToken=' + encodeURIComponent(skipToken)); + } + 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().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['JobResourceList']().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 information about the specified job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] $expand is supported on details parameter + * for job, which provides details on the job stages. + * + * @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 JobResource} 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) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let expand = (options && options.expand !== undefined) ? options.expand : undefined; + // 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 (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 (jobName !== null && jobName !== undefined) { + if (jobName.length > 24) + { + throw new Error('"jobName" should satisfy the constraint - "MaxLength": 24'); + } + if (jobName.length < 3) + { + throw new Error('"jobName" should satisfy the constraint - "MinLength": 3'); + } + if (jobName.match(/^[-\w\.]+$/) === null) + { + throw new Error('"jobName" should satisfy the constraint - "Pattern": /^[-\w\.]+$/'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { + throw new Error('expand 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.DataBox/jobs/{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 (expand !== null && expand !== undefined) { + queryParameters.push('$expand=' + encodeURIComponent(expand)); + } + 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().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['JobResource']().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); + }); +} + + +/** + * Creates a new job with the specified parameters. Existing job cannot be + * updated with this API and should instead be updated with the Update job API. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} jobResource Job details from request body. + * + * @param {string} [jobResource.deviceType] Type of the device to be used for + * the job. Possible values include: 'Pod', 'Disk', 'Cabinet' + * + * @param {boolean} [jobResource.isCancellable] Describes whether the job is + * cancellable or not. + * + * @param {boolean} [jobResource.isShippingAddressEditable] Describes whether + * the shipping address is editable or not. + * + * @param {string} [jobResource.status] Name of the stage which is in progress. + * Possible values include: 'DeviceOrdered', 'DevicePrepared', 'Dispatched', + * 'Delivered', 'PickedUp', 'AtAzureDC', 'DataCopy', 'Completed', + * 'CompletedWithErrors', 'Cancelled', 'Failed_IssueReportedAtCustomer', + * 'Failed_IssueDetectedAtAzureDC', 'Aborted' + * + * @param {date} [jobResource.startTime] Time at which the job was started in + * UTC ISO 8601 format. + * + * @param {object} [jobResource.error] Top level error for the job. + * + * @param {string} jobResource.error.code Error code that can be used to + * programmatically identify the error. + * + * @param {string} [jobResource.error.message] Describes the error in detail + * and provides debugging information. + * + * @param {object} [jobResource.deliveryPackage] Delivery package shipping + * details. + * + * @param {object} [jobResource.returnPackage] Return package shipping details. + * + * @param {string} [jobResource.returnPackage.carrierName] Name of the carrier. + * + * @param {string} [jobResource.returnPackage.trackingId] Tracking Id of + * shipment. + * + * @param {string} [jobResource.returnPackage.trackingUrl] Url where shipment + * can be tracked. + * + * @param {array} jobResource.destinationAccountDetails Destination account + * details. + * + * @param {object} [jobResource.details] Details of a job run. This field will + * only be sent for expand details filter. + * + * @param {number} [jobResource.details.expectedDataSizeInTeraBytes] The + * expected size of the data, which needs to be transfered in this job, in tera + * bytes. + * + * @param {array} [jobResource.details.jobStages] List of stages that run in + * the job. + * + * @param {object} jobResource.details.contactDetails Contact details for + * notification and shipping. + * + * @param {string} [jobResource.details.contactDetails.contactName] Contact + * name of the person. + * + * @param {string} jobResource.details.contactDetails.phone Phone number of the + * contact person. + * + * @param {string} [jobResource.details.contactDetails.phoneExtension] Phone + * extension number of the contact person. + * + * @param {string} [jobResource.details.contactDetails.mobile] Mobile number of + * the contact person. + * + * @param {array} jobResource.details.contactDetails.emailList List of + * Email-ids to be notified about job progress. + * + * @param {array} [jobResource.details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * + * @param {object} jobResource.details.shippingAddress Shipping address of the + * customer. + * + * @param {string} jobResource.details.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} [jobResource.details.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} [jobResource.details.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [jobResource.details.shippingAddress.city] Name of the City. + * + * @param {string} [jobResource.details.shippingAddress.stateOrProvince] Name + * of the State or Province. + * + * @param {string} jobResource.details.shippingAddress.country Name of the + * Country. + * + * @param {string} jobResource.details.shippingAddress.postalCode Postal code. + * + * @param {string} [jobResource.details.shippingAddress.zipExtendedCode] + * Extended Zip Code. + * + * @param {string} [jobResource.details.shippingAddress.companyName] Name of + * the company. + * + * @param {string} [jobResource.details.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {array} [jobResource.details.errorDetails] Error details for failure. + * This is optional. + * + * @param {string} jobResource.details.jobDetailsType Polymorphic Discriminator + * + * @param {string} [jobResource.cancellationReason] Reason for cancellation. + * + * @param {string} jobResource.location The location of the resource. This will + * be one of the supported and registered Azure Regions (e.g. West US, East US, + * Southeast Asia, etc.). The region of a resource cannot be changed once it is + * created, but if an identical region is specified on update the request will + * succeed. + * + * @param {object} [jobResource.tags] The list of key value pairs that describe + * the resource. These tags can be used in viewing and grouping this resource + * (across resource groups). + * + * @param {object} jobResource.sku The sku type. + * + * @param {string} jobResource.sku.name The sku name. + * + * @param {string} [jobResource.sku.displayName] The display name of the sku. + * + * @param {string} [jobResource.sku.family] The sku family. + * + * @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 JobResource} 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 _create(resourceGroupName, jobName, jobResource, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreate(resourceGroupName, jobName, jobResource, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['JobResource']().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); + }); + }); +} + +/** + * Deletes a job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(resourceGroupName, jobName, 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.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 (jobName !== null && jobName !== undefined) { + if (jobName.length > 24) + { + throw new Error('"jobName" should satisfy the constraint - "MaxLength": 24'); + } + if (jobName.length < 3) + { + throw new Error('"jobName" should satisfy the constraint - "MinLength": 3'); + } + if (jobName.match(/^[-\w\.]+$/) === null) + { + throw new Error('"jobName" should satisfy the constraint - "Pattern": /^[-\w\.]+$/'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion 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.DataBox/jobs/{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) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Updates the properties of an existing job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} jobResourceUpdateParameter Job update parameters from + * request body. + * + * @param {object} jobResourceUpdateParameter.details Details of a job to be + * updated. + * + * @param {object} [jobResourceUpdateParameter.details.contactDetails] Contact + * details for notification and shipping. + * + * @param {string} + * [jobResourceUpdateParameter.details.contactDetails.contactName] Contact name + * of the person. + * + * @param {string} jobResourceUpdateParameter.details.contactDetails.phone + * Phone number of the contact person. + * + * @param {string} + * [jobResourceUpdateParameter.details.contactDetails.phoneExtension] Phone + * extension number of the contact person. + * + * @param {string} [jobResourceUpdateParameter.details.contactDetails.mobile] + * Mobile number of the contact person. + * + * @param {array} jobResourceUpdateParameter.details.contactDetails.emailList + * List of Email-ids to be notified about job progress. + * + * @param {array} + * [jobResourceUpdateParameter.details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * + * @param {object} [jobResourceUpdateParameter.details.shippingAddress] + * Shipping address of the customer. + * + * @param {string} + * jobResourceUpdateParameter.details.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [jobResourceUpdateParameter.details.shippingAddress.city] + * Name of the City. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.stateOrProvince] Name of + * the State or Province. + * + * @param {string} jobResourceUpdateParameter.details.shippingAddress.country + * Name of the Country. + * + * @param {string} + * jobResourceUpdateParameter.details.shippingAddress.postalCode Postal code. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.zipExtendedCode] + * Extended Zip Code. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.companyName] Name of the + * company. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {object} [jobResourceUpdateParameter.tags] The list of key value + * pairs that describe the resource. These tags can be used in viewing and + * grouping this resource (across resource groups). + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.ifMatch] Defines the If-Match condition. The patch + * will be performed only if the ETag of the job on the server matches this + * value. + * + * @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 JobResource} 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, jobResourceUpdateParameter, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginUpdate(resourceGroupName, jobName, jobResourceUpdateParameter, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['JobResource']().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); + }); + }); +} + +/** + * Book shipment pick up. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} shipmentPickUpRequest Details of shipment pick up request. + * + * @param {date} [shipmentPickUpRequest.startTime] Minimum date after which the + * pick up should commence, this must be in local time of pick up area. + * + * @param {date} [shipmentPickUpRequest.endTime] Maximum date before which the + * pick up should commence, this must be in local time of pick up area. + * + * @param {string} [shipmentPickUpRequest.shipmentLocation] Shipment Location + * in the pickup place. Eg.front desk + * + * @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 ShipmentPickUpResponse} 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 _bookShipmentPickUp(resourceGroupName, jobName, shipmentPickUpRequest, 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.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 (jobName !== null && jobName !== undefined) { + if (jobName.length > 24) + { + throw new Error('"jobName" should satisfy the constraint - "MaxLength": 24'); + } + if (jobName.length < 3) + { + throw new Error('"jobName" should satisfy the constraint - "MinLength": 3'); + } + if (jobName.match(/^[-\w\.]+$/) === null) + { + throw new Error('"jobName" should satisfy the constraint - "Pattern": /^[-\w\.]+$/'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (shipmentPickUpRequest === null || shipmentPickUpRequest === undefined) { + throw new Error('shipmentPickUpRequest 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.DataBox/jobs/{jobName}/bookShipmentPickUp'; + 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('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (shipmentPickUpRequest !== null && shipmentPickUpRequest !== undefined) { + let requestModelMapper = new client.models['ShipmentPickUpRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, shipmentPickUpRequest, 'shipmentPickUpRequest'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(shipmentPickUpRequest, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().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['ShipmentPickUpResponse']().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); + }); +} + +/** + * CancelJob. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} cancellationReason Reason for cancellation. + * + * @param {string} cancellationReason.reason Reason for cancellation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _cancel(resourceGroupName, jobName, cancellationReason, 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.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 (jobName !== null && jobName !== undefined) { + if (jobName.length > 24) + { + throw new Error('"jobName" should satisfy the constraint - "MaxLength": 24'); + } + if (jobName.length < 3) + { + throw new Error('"jobName" should satisfy the constraint - "MinLength": 3'); + } + if (jobName.match(/^[-\w\.]+$/) === null) + { + throw new Error('"jobName" should satisfy the constraint - "Pattern": /^[-\w\.]+$/'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (cancellationReason === null || cancellationReason === undefined) { + throw new Error('cancellationReason 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.DataBox/jobs/{jobName}/cancel'; + 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('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (cancellationReason !== null && cancellationReason !== undefined) { + let requestModelMapper = new client.models['CancellationReason']().mapper(); + requestModel = client.serialize(requestModelMapper, cancellationReason, 'cancellationReason'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(cancellationReason, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Provides list of copy logs uri. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @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 GetCopyLogsUriOutput} 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 _getCopyLogsUri(resourceGroupName, jobName, 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.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 (jobName !== null && jobName !== undefined) { + if (jobName.length > 24) + { + throw new Error('"jobName" should satisfy the constraint - "MaxLength": 24'); + } + if (jobName.length < 3) + { + throw new Error('"jobName" should satisfy the constraint - "MinLength": 3'); + } + if (jobName.match(/^[-\w\.]+$/) === null) + { + throw new Error('"jobName" should satisfy the constraint - "Pattern": /^[-\w\.]+$/'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion 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.DataBox/jobs/{jobName}/copyLogsUri'; + 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('&'); + } + + // 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().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['GetCopyLogsUriOutput']().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); + }); +} + +/** + * Get shipping label sas uri. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @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 ShippingLabelDetails} 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 _downloadShippingLabelUri(resourceGroupName, jobName, 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.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 (jobName !== null && jobName !== undefined) { + if (jobName.length > 24) + { + throw new Error('"jobName" should satisfy the constraint - "MaxLength": 24'); + } + if (jobName.length < 3) + { + throw new Error('"jobName" should satisfy the constraint - "MinLength": 3'); + } + if (jobName.match(/^[-\w\.]+$/) === null) + { + throw new Error('"jobName" should satisfy the constraint - "Pattern": /^[-\w\.]+$/'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion 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.DataBox/jobs/{jobName}/downloadShippingLabel'; + 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('&'); + } + + // 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().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['ShippingLabelDetails']().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); + }); +} + +/** + * This method gets the unencrypted secrets related to the job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @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 UnencryptedSecrets} 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 _listSecrets(resourceGroupName, jobName, 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.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 (jobName !== null && jobName !== undefined) { + if (jobName.length > 24) + { + throw new Error('"jobName" should satisfy the constraint - "MaxLength": 24'); + } + if (jobName.length < 3) + { + throw new Error('"jobName" should satisfy the constraint - "MinLength": 3'); + } + if (jobName.match(/^[-\w\.]+$/) === null) + { + throw new Error('"jobName" should satisfy the constraint - "Pattern": /^[-\w\.]+$/'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion 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.DataBox/jobs/{jobName}/listSecrets'; + 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('&'); + } + + // 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().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['UnencryptedSecrets']().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); + }); +} + +/** + * Reports an issue. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} reportIssueDetails Details of reported issue. + * + * @param {string} [reportIssueDetails.issueType] Issue Type. Possible values + * include: 'DeviceMismatch', 'ValidationStringMismatch', + * 'CredentialNotWorking', 'DeviceFailure' + * + * @param {string} [reportIssueDetails.deviceIssueType] Device Issue Type. Only + * used for Device failure issue. Possible values include: 'DeviceTampering', + * 'DeviceNotBootingUp', 'DeviceHealthCheckShowFailures', 'NICsAreNotWorking', + * 'Misc' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _reportIssue(resourceGroupName, jobName, reportIssueDetails, 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.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 (jobName !== null && jobName !== undefined) { + if (jobName.length > 24) + { + throw new Error('"jobName" should satisfy the constraint - "MaxLength": 24'); + } + if (jobName.length < 3) + { + throw new Error('"jobName" should satisfy the constraint - "MinLength": 3'); + } + if (jobName.match(/^[-\w\.]+$/) === null) + { + throw new Error('"jobName" should satisfy the constraint - "Pattern": /^[-\w\.]+$/'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (reportIssueDetails === null || reportIssueDetails === undefined) { + throw new Error('reportIssueDetails 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.DataBox/jobs/{jobName}/reportIssue'; + 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('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (reportIssueDetails !== null && reportIssueDetails !== undefined) { + let requestModelMapper = new client.models['ReportIssueDetails']().mapper(); + requestModel = client.serialize(requestModelMapper, reportIssueDetails, 'reportIssueDetails'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(reportIssueDetails, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Creates a new job with the specified parameters. Existing job cannot be + * updated with this API and should instead be updated with the Update job API. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} jobResource Job details from request body. + * + * @param {string} [jobResource.deviceType] Type of the device to be used for + * the job. Possible values include: 'Pod', 'Disk', 'Cabinet' + * + * @param {boolean} [jobResource.isCancellable] Describes whether the job is + * cancellable or not. + * + * @param {boolean} [jobResource.isShippingAddressEditable] Describes whether + * the shipping address is editable or not. + * + * @param {string} [jobResource.status] Name of the stage which is in progress. + * Possible values include: 'DeviceOrdered', 'DevicePrepared', 'Dispatched', + * 'Delivered', 'PickedUp', 'AtAzureDC', 'DataCopy', 'Completed', + * 'CompletedWithErrors', 'Cancelled', 'Failed_IssueReportedAtCustomer', + * 'Failed_IssueDetectedAtAzureDC', 'Aborted' + * + * @param {date} [jobResource.startTime] Time at which the job was started in + * UTC ISO 8601 format. + * + * @param {object} [jobResource.error] Top level error for the job. + * + * @param {string} jobResource.error.code Error code that can be used to + * programmatically identify the error. + * + * @param {string} [jobResource.error.message] Describes the error in detail + * and provides debugging information. + * + * @param {object} [jobResource.deliveryPackage] Delivery package shipping + * details. + * + * @param {object} [jobResource.returnPackage] Return package shipping details. + * + * @param {string} [jobResource.returnPackage.carrierName] Name of the carrier. + * + * @param {string} [jobResource.returnPackage.trackingId] Tracking Id of + * shipment. + * + * @param {string} [jobResource.returnPackage.trackingUrl] Url where shipment + * can be tracked. + * + * @param {array} jobResource.destinationAccountDetails Destination account + * details. + * + * @param {object} [jobResource.details] Details of a job run. This field will + * only be sent for expand details filter. + * + * @param {number} [jobResource.details.expectedDataSizeInTeraBytes] The + * expected size of the data, which needs to be transfered in this job, in tera + * bytes. + * + * @param {array} [jobResource.details.jobStages] List of stages that run in + * the job. + * + * @param {object} jobResource.details.contactDetails Contact details for + * notification and shipping. + * + * @param {string} [jobResource.details.contactDetails.contactName] Contact + * name of the person. + * + * @param {string} jobResource.details.contactDetails.phone Phone number of the + * contact person. + * + * @param {string} [jobResource.details.contactDetails.phoneExtension] Phone + * extension number of the contact person. + * + * @param {string} [jobResource.details.contactDetails.mobile] Mobile number of + * the contact person. + * + * @param {array} jobResource.details.contactDetails.emailList List of + * Email-ids to be notified about job progress. + * + * @param {array} [jobResource.details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * + * @param {object} jobResource.details.shippingAddress Shipping address of the + * customer. + * + * @param {string} jobResource.details.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} [jobResource.details.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} [jobResource.details.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [jobResource.details.shippingAddress.city] Name of the City. + * + * @param {string} [jobResource.details.shippingAddress.stateOrProvince] Name + * of the State or Province. + * + * @param {string} jobResource.details.shippingAddress.country Name of the + * Country. + * + * @param {string} jobResource.details.shippingAddress.postalCode Postal code. + * + * @param {string} [jobResource.details.shippingAddress.zipExtendedCode] + * Extended Zip Code. + * + * @param {string} [jobResource.details.shippingAddress.companyName] Name of + * the company. + * + * @param {string} [jobResource.details.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {array} [jobResource.details.errorDetails] Error details for failure. + * This is optional. + * + * @param {string} jobResource.details.jobDetailsType Polymorphic Discriminator + * + * @param {string} [jobResource.cancellationReason] Reason for cancellation. + * + * @param {string} jobResource.location The location of the resource. This will + * be one of the supported and registered Azure Regions (e.g. West US, East US, + * Southeast Asia, etc.). The region of a resource cannot be changed once it is + * created, but if an identical region is specified on update the request will + * succeed. + * + * @param {object} [jobResource.tags] The list of key value pairs that describe + * the resource. These tags can be used in viewing and grouping this resource + * (across resource groups). + * + * @param {object} jobResource.sku The sku type. + * + * @param {string} jobResource.sku.name The sku name. + * + * @param {string} [jobResource.sku.displayName] The display name of the sku. + * + * @param {string} [jobResource.sku.family] The sku family. + * + * @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 JobResource} 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 _beginCreate(resourceGroupName, jobName, jobResource, 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.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 (jobName !== null && jobName !== undefined) { + if (jobName.length > 24) + { + throw new Error('"jobName" should satisfy the constraint - "MaxLength": 24'); + } + if (jobName.length < 3) + { + throw new Error('"jobName" should satisfy the constraint - "MinLength": 3'); + } + if (jobName.match(/^[-\w\.]+$/) === null) + { + throw new Error('"jobName" should satisfy the constraint - "Pattern": /^[-\w\.]+$/'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (jobResource === null || jobResource === undefined) { + throw new Error('jobResource 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.DataBox/jobs/{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) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (jobResource !== null && jobResource !== undefined) { + let requestModelMapper = new client.models['JobResource']().mapper(); + requestModel = client.serialize(requestModelMapper, jobResource, 'jobResource'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(jobResource, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().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['JobResource']().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); + }); +} + +/** + * Updates the properties of an existing job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} jobResourceUpdateParameter Job update parameters from + * request body. + * + * @param {object} jobResourceUpdateParameter.details Details of a job to be + * updated. + * + * @param {object} [jobResourceUpdateParameter.details.contactDetails] Contact + * details for notification and shipping. + * + * @param {string} + * [jobResourceUpdateParameter.details.contactDetails.contactName] Contact name + * of the person. + * + * @param {string} jobResourceUpdateParameter.details.contactDetails.phone + * Phone number of the contact person. + * + * @param {string} + * [jobResourceUpdateParameter.details.contactDetails.phoneExtension] Phone + * extension number of the contact person. + * + * @param {string} [jobResourceUpdateParameter.details.contactDetails.mobile] + * Mobile number of the contact person. + * + * @param {array} jobResourceUpdateParameter.details.contactDetails.emailList + * List of Email-ids to be notified about job progress. + * + * @param {array} + * [jobResourceUpdateParameter.details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * + * @param {object} [jobResourceUpdateParameter.details.shippingAddress] + * Shipping address of the customer. + * + * @param {string} + * jobResourceUpdateParameter.details.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [jobResourceUpdateParameter.details.shippingAddress.city] + * Name of the City. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.stateOrProvince] Name of + * the State or Province. + * + * @param {string} jobResourceUpdateParameter.details.shippingAddress.country + * Name of the Country. + * + * @param {string} + * jobResourceUpdateParameter.details.shippingAddress.postalCode Postal code. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.zipExtendedCode] + * Extended Zip Code. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.companyName] Name of the + * company. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {object} [jobResourceUpdateParameter.tags] The list of key value + * pairs that describe the resource. These tags can be used in viewing and + * grouping this resource (across resource groups). + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.ifMatch] Defines the If-Match condition. The patch + * will be performed only if the ETag of the job on the server matches this + * value. + * + * @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 JobResource} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginUpdate(resourceGroupName, jobName, jobResourceUpdateParameter, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let ifMatch = (options && options.ifMatch !== undefined) ? options.ifMatch : 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 (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 (jobName !== null && jobName !== undefined) { + if (jobName.length > 24) + { + throw new Error('"jobName" should satisfy the constraint - "MaxLength": 24'); + } + if (jobName.length < 3) + { + throw new Error('"jobName" should satisfy the constraint - "MinLength": 3'); + } + if (jobName.match(/^[-\w\.]+$/) === null) + { + throw new Error('"jobName" should satisfy the constraint - "Pattern": /^[-\w\.]+$/'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (ifMatch !== null && ifMatch !== undefined && typeof ifMatch.valueOf() !== 'string') { + throw new Error('ifMatch must be of type string.'); + } + if (jobResourceUpdateParameter === null || jobResourceUpdateParameter === undefined) { + throw new Error('jobResourceUpdateParameter 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.DataBox/jobs/{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) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (ifMatch !== undefined && ifMatch !== null) { + httpRequest.headers['If-Match'] = ifMatch; + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (jobResourceUpdateParameter !== null && jobResourceUpdateParameter !== undefined) { + let requestModelMapper = new client.models['JobResourceUpdateParameter']().mapper(); + requestModel = client.serialize(requestModelMapper, jobResourceUpdateParameter, 'jobResourceUpdateParameter'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(jobResourceUpdateParameter, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().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['JobResource']().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 all the jobs available under the 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 JobResourceList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().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['JobResourceList']().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 all the jobs available under the given 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 JobResourceList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByResourceGroupNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().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['JobResourceList']().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 {DataBoxManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._listByResourceGroup = _listByResourceGroup; + this._get = _get; + this._create = _create; + this._deleteMethod = _deleteMethod; + this._update = _update; + this._bookShipmentPickUp = _bookShipmentPickUp; + this._cancel = _cancel; + this._getCopyLogsUri = _getCopyLogsUri; + this._downloadShippingLabelUri = _downloadShippingLabelUri; + this._listSecrets = _listSecrets; + this._reportIssue = _reportIssue; + this._beginCreate = _beginCreate; + this._beginUpdate = _beginUpdate; + this._listNext = _listNext; + this._listByResourceGroupNext = _listByResourceGroupNext; + } + + /** + * Lists all the jobs available under the subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.skipToken] $skipToken is supported on Get list of + * jobs, which provides the next page in the list of jobs. + * + * @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; + }); + }); + } + + /** + * Lists all the jobs available under the subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.skipToken] $skipToken is supported on Get list of + * jobs, which provides the next page in the list of jobs. + * + * @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 {JobResourceList} - 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 JobResourceList} 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); + } + } + + /** + * Lists all the jobs available under the given resource group. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.skipToken] $skipToken is supported on Get list of + * jobs, which provides the next page in the list of jobs. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all the jobs available under the given resource group. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.skipToken] $skipToken is supported on Get list of + * jobs, which provides the next page in the list of jobs. + * + * @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 {JobResourceList} - 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 JobResourceList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroup(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._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroup(resourceGroupName, options, optionalCallback); + } + } + + /** + * Gets information about the specified job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] $expand is supported on details parameter + * for job, which provides details on the job stages. + * + * @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(resourceGroupName, jobName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(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; + }); + }); + } + + /** + * Gets information about the specified job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.expand] $expand is supported on details parameter + * for job, which provides details on the job stages. + * + * @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 {JobResource} - 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 JobResource} 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) { + 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(resourceGroupName, jobName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, jobName, options, optionalCallback); + } + } + + /** + * Creates a new job with the specified parameters. Existing job cannot be + * updated with this API and should instead be updated with the Update job API. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} jobResource Job details from request body. + * + * @param {string} [jobResource.deviceType] Type of the device to be used for + * the job. Possible values include: 'Pod', 'Disk', 'Cabinet' + * + * @param {boolean} [jobResource.isCancellable] Describes whether the job is + * cancellable or not. + * + * @param {boolean} [jobResource.isShippingAddressEditable] Describes whether + * the shipping address is editable or not. + * + * @param {string} [jobResource.status] Name of the stage which is in progress. + * Possible values include: 'DeviceOrdered', 'DevicePrepared', 'Dispatched', + * 'Delivered', 'PickedUp', 'AtAzureDC', 'DataCopy', 'Completed', + * 'CompletedWithErrors', 'Cancelled', 'Failed_IssueReportedAtCustomer', + * 'Failed_IssueDetectedAtAzureDC', 'Aborted' + * + * @param {date} [jobResource.startTime] Time at which the job was started in + * UTC ISO 8601 format. + * + * @param {object} [jobResource.error] Top level error for the job. + * + * @param {string} jobResource.error.code Error code that can be used to + * programmatically identify the error. + * + * @param {string} [jobResource.error.message] Describes the error in detail + * and provides debugging information. + * + * @param {object} [jobResource.deliveryPackage] Delivery package shipping + * details. + * + * @param {object} [jobResource.returnPackage] Return package shipping details. + * + * @param {string} [jobResource.returnPackage.carrierName] Name of the carrier. + * + * @param {string} [jobResource.returnPackage.trackingId] Tracking Id of + * shipment. + * + * @param {string} [jobResource.returnPackage.trackingUrl] Url where shipment + * can be tracked. + * + * @param {array} jobResource.destinationAccountDetails Destination account + * details. + * + * @param {object} [jobResource.details] Details of a job run. This field will + * only be sent for expand details filter. + * + * @param {number} [jobResource.details.expectedDataSizeInTeraBytes] The + * expected size of the data, which needs to be transfered in this job, in tera + * bytes. + * + * @param {array} [jobResource.details.jobStages] List of stages that run in + * the job. + * + * @param {object} jobResource.details.contactDetails Contact details for + * notification and shipping. + * + * @param {string} [jobResource.details.contactDetails.contactName] Contact + * name of the person. + * + * @param {string} jobResource.details.contactDetails.phone Phone number of the + * contact person. + * + * @param {string} [jobResource.details.contactDetails.phoneExtension] Phone + * extension number of the contact person. + * + * @param {string} [jobResource.details.contactDetails.mobile] Mobile number of + * the contact person. + * + * @param {array} jobResource.details.contactDetails.emailList List of + * Email-ids to be notified about job progress. + * + * @param {array} [jobResource.details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * + * @param {object} jobResource.details.shippingAddress Shipping address of the + * customer. + * + * @param {string} jobResource.details.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} [jobResource.details.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} [jobResource.details.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [jobResource.details.shippingAddress.city] Name of the City. + * + * @param {string} [jobResource.details.shippingAddress.stateOrProvince] Name + * of the State or Province. + * + * @param {string} jobResource.details.shippingAddress.country Name of the + * Country. + * + * @param {string} jobResource.details.shippingAddress.postalCode Postal code. + * + * @param {string} [jobResource.details.shippingAddress.zipExtendedCode] + * Extended Zip Code. + * + * @param {string} [jobResource.details.shippingAddress.companyName] Name of + * the company. + * + * @param {string} [jobResource.details.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {array} [jobResource.details.errorDetails] Error details for failure. + * This is optional. + * + * @param {string} jobResource.details.jobDetailsType Polymorphic Discriminator + * + * @param {string} [jobResource.cancellationReason] Reason for cancellation. + * + * @param {string} jobResource.location The location of the resource. This will + * be one of the supported and registered Azure Regions (e.g. West US, East US, + * Southeast Asia, etc.). The region of a resource cannot be changed once it is + * created, but if an identical region is specified on update the request will + * succeed. + * + * @param {object} [jobResource.tags] The list of key value pairs that describe + * the resource. These tags can be used in viewing and grouping this resource + * (across resource groups). + * + * @param {object} jobResource.sku The sku type. + * + * @param {string} jobResource.sku.name The sku name. + * + * @param {string} [jobResource.sku.displayName] The display name of the sku. + * + * @param {string} [jobResource.sku.family] The sku family. + * + * @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. + */ + createWithHttpOperationResponse(resourceGroupName, jobName, jobResource, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._create(resourceGroupName, jobName, jobResource, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a new job with the specified parameters. Existing job cannot be + * updated with this API and should instead be updated with the Update job API. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} jobResource Job details from request body. + * + * @param {string} [jobResource.deviceType] Type of the device to be used for + * the job. Possible values include: 'Pod', 'Disk', 'Cabinet' + * + * @param {boolean} [jobResource.isCancellable] Describes whether the job is + * cancellable or not. + * + * @param {boolean} [jobResource.isShippingAddressEditable] Describes whether + * the shipping address is editable or not. + * + * @param {string} [jobResource.status] Name of the stage which is in progress. + * Possible values include: 'DeviceOrdered', 'DevicePrepared', 'Dispatched', + * 'Delivered', 'PickedUp', 'AtAzureDC', 'DataCopy', 'Completed', + * 'CompletedWithErrors', 'Cancelled', 'Failed_IssueReportedAtCustomer', + * 'Failed_IssueDetectedAtAzureDC', 'Aborted' + * + * @param {date} [jobResource.startTime] Time at which the job was started in + * UTC ISO 8601 format. + * + * @param {object} [jobResource.error] Top level error for the job. + * + * @param {string} jobResource.error.code Error code that can be used to + * programmatically identify the error. + * + * @param {string} [jobResource.error.message] Describes the error in detail + * and provides debugging information. + * + * @param {object} [jobResource.deliveryPackage] Delivery package shipping + * details. + * + * @param {object} [jobResource.returnPackage] Return package shipping details. + * + * @param {string} [jobResource.returnPackage.carrierName] Name of the carrier. + * + * @param {string} [jobResource.returnPackage.trackingId] Tracking Id of + * shipment. + * + * @param {string} [jobResource.returnPackage.trackingUrl] Url where shipment + * can be tracked. + * + * @param {array} jobResource.destinationAccountDetails Destination account + * details. + * + * @param {object} [jobResource.details] Details of a job run. This field will + * only be sent for expand details filter. + * + * @param {number} [jobResource.details.expectedDataSizeInTeraBytes] The + * expected size of the data, which needs to be transfered in this job, in tera + * bytes. + * + * @param {array} [jobResource.details.jobStages] List of stages that run in + * the job. + * + * @param {object} jobResource.details.contactDetails Contact details for + * notification and shipping. + * + * @param {string} [jobResource.details.contactDetails.contactName] Contact + * name of the person. + * + * @param {string} jobResource.details.contactDetails.phone Phone number of the + * contact person. + * + * @param {string} [jobResource.details.contactDetails.phoneExtension] Phone + * extension number of the contact person. + * + * @param {string} [jobResource.details.contactDetails.mobile] Mobile number of + * the contact person. + * + * @param {array} jobResource.details.contactDetails.emailList List of + * Email-ids to be notified about job progress. + * + * @param {array} [jobResource.details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * + * @param {object} jobResource.details.shippingAddress Shipping address of the + * customer. + * + * @param {string} jobResource.details.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} [jobResource.details.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} [jobResource.details.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [jobResource.details.shippingAddress.city] Name of the City. + * + * @param {string} [jobResource.details.shippingAddress.stateOrProvince] Name + * of the State or Province. + * + * @param {string} jobResource.details.shippingAddress.country Name of the + * Country. + * + * @param {string} jobResource.details.shippingAddress.postalCode Postal code. + * + * @param {string} [jobResource.details.shippingAddress.zipExtendedCode] + * Extended Zip Code. + * + * @param {string} [jobResource.details.shippingAddress.companyName] Name of + * the company. + * + * @param {string} [jobResource.details.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {array} [jobResource.details.errorDetails] Error details for failure. + * This is optional. + * + * @param {string} jobResource.details.jobDetailsType Polymorphic Discriminator + * + * @param {string} [jobResource.cancellationReason] Reason for cancellation. + * + * @param {string} jobResource.location The location of the resource. This will + * be one of the supported and registered Azure Regions (e.g. West US, East US, + * Southeast Asia, etc.). The region of a resource cannot be changed once it is + * created, but if an identical region is specified on update the request will + * succeed. + * + * @param {object} [jobResource.tags] The list of key value pairs that describe + * the resource. These tags can be used in viewing and grouping this resource + * (across resource groups). + * + * @param {object} jobResource.sku The sku type. + * + * @param {string} jobResource.sku.name The sku name. + * + * @param {string} [jobResource.sku.displayName] The display name of the sku. + * + * @param {string} [jobResource.sku.family] The sku family. + * + * @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 {JobResource} - 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 JobResource} 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. + */ + create(resourceGroupName, jobName, jobResource, 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._create(resourceGroupName, jobName, jobResource, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._create(resourceGroupName, jobName, jobResource, options, optionalCallback); + } + } + + /** + * Deletes a job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @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 a job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName, jobName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, jobName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, jobName, options, optionalCallback); + } + } + + /** + * Updates the properties of an existing job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} jobResourceUpdateParameter Job update parameters from + * request body. + * + * @param {object} jobResourceUpdateParameter.details Details of a job to be + * updated. + * + * @param {object} [jobResourceUpdateParameter.details.contactDetails] Contact + * details for notification and shipping. + * + * @param {string} + * [jobResourceUpdateParameter.details.contactDetails.contactName] Contact name + * of the person. + * + * @param {string} jobResourceUpdateParameter.details.contactDetails.phone + * Phone number of the contact person. + * + * @param {string} + * [jobResourceUpdateParameter.details.contactDetails.phoneExtension] Phone + * extension number of the contact person. + * + * @param {string} [jobResourceUpdateParameter.details.contactDetails.mobile] + * Mobile number of the contact person. + * + * @param {array} jobResourceUpdateParameter.details.contactDetails.emailList + * List of Email-ids to be notified about job progress. + * + * @param {array} + * [jobResourceUpdateParameter.details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * + * @param {object} [jobResourceUpdateParameter.details.shippingAddress] + * Shipping address of the customer. + * + * @param {string} + * jobResourceUpdateParameter.details.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [jobResourceUpdateParameter.details.shippingAddress.city] + * Name of the City. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.stateOrProvince] Name of + * the State or Province. + * + * @param {string} jobResourceUpdateParameter.details.shippingAddress.country + * Name of the Country. + * + * @param {string} + * jobResourceUpdateParameter.details.shippingAddress.postalCode Postal code. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.zipExtendedCode] + * Extended Zip Code. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.companyName] Name of the + * company. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {object} [jobResourceUpdateParameter.tags] The list of key value + * pairs that describe the resource. These tags can be used in viewing and + * grouping this resource (across resource groups). + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.ifMatch] Defines the If-Match condition. The patch + * will be performed only if the ETag of the job on the server matches this + * value. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName, jobName, jobResourceUpdateParameter, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, jobName, jobResourceUpdateParameter, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates the properties of an existing job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} jobResourceUpdateParameter Job update parameters from + * request body. + * + * @param {object} jobResourceUpdateParameter.details Details of a job to be + * updated. + * + * @param {object} [jobResourceUpdateParameter.details.contactDetails] Contact + * details for notification and shipping. + * + * @param {string} + * [jobResourceUpdateParameter.details.contactDetails.contactName] Contact name + * of the person. + * + * @param {string} jobResourceUpdateParameter.details.contactDetails.phone + * Phone number of the contact person. + * + * @param {string} + * [jobResourceUpdateParameter.details.contactDetails.phoneExtension] Phone + * extension number of the contact person. + * + * @param {string} [jobResourceUpdateParameter.details.contactDetails.mobile] + * Mobile number of the contact person. + * + * @param {array} jobResourceUpdateParameter.details.contactDetails.emailList + * List of Email-ids to be notified about job progress. + * + * @param {array} + * [jobResourceUpdateParameter.details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * + * @param {object} [jobResourceUpdateParameter.details.shippingAddress] + * Shipping address of the customer. + * + * @param {string} + * jobResourceUpdateParameter.details.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [jobResourceUpdateParameter.details.shippingAddress.city] + * Name of the City. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.stateOrProvince] Name of + * the State or Province. + * + * @param {string} jobResourceUpdateParameter.details.shippingAddress.country + * Name of the Country. + * + * @param {string} + * jobResourceUpdateParameter.details.shippingAddress.postalCode Postal code. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.zipExtendedCode] + * Extended Zip Code. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.companyName] Name of the + * company. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {object} [jobResourceUpdateParameter.tags] The list of key value + * pairs that describe the resource. These tags can be used in viewing and + * grouping this resource (across resource groups). + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.ifMatch] Defines the If-Match condition. The patch + * will be performed only if the ETag of the job on the server matches this + * value. + * + * @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 {JobResource} - 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 JobResource} 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, jobResourceUpdateParameter, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._update(resourceGroupName, jobName, jobResourceUpdateParameter, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, jobName, jobResourceUpdateParameter, options, optionalCallback); + } + } + + /** + * Book shipment pick up. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} shipmentPickUpRequest Details of shipment pick up request. + * + * @param {date} [shipmentPickUpRequest.startTime] Minimum date after which the + * pick up should commence, this must be in local time of pick up area. + * + * @param {date} [shipmentPickUpRequest.endTime] Maximum date before which the + * pick up should commence, this must be in local time of pick up area. + * + * @param {string} [shipmentPickUpRequest.shipmentLocation] Shipment Location + * in the pickup place. Eg.front desk + * + * @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. + */ + bookShipmentPickUpWithHttpOperationResponse(resourceGroupName, jobName, shipmentPickUpRequest, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._bookShipmentPickUp(resourceGroupName, jobName, shipmentPickUpRequest, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Book shipment pick up. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} shipmentPickUpRequest Details of shipment pick up request. + * + * @param {date} [shipmentPickUpRequest.startTime] Minimum date after which the + * pick up should commence, this must be in local time of pick up area. + * + * @param {date} [shipmentPickUpRequest.endTime] Maximum date before which the + * pick up should commence, this must be in local time of pick up area. + * + * @param {string} [shipmentPickUpRequest.shipmentLocation] Shipment Location + * in the pickup place. Eg.front desk + * + * @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 {ShipmentPickUpResponse} - 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 ShipmentPickUpResponse} 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. + */ + bookShipmentPickUp(resourceGroupName, jobName, shipmentPickUpRequest, 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._bookShipmentPickUp(resourceGroupName, jobName, shipmentPickUpRequest, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._bookShipmentPickUp(resourceGroupName, jobName, shipmentPickUpRequest, options, optionalCallback); + } + } + + /** + * CancelJob. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} cancellationReason Reason for cancellation. + * + * @param {string} cancellationReason.reason Reason for cancellation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + cancelWithHttpOperationResponse(resourceGroupName, jobName, cancellationReason, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._cancel(resourceGroupName, jobName, cancellationReason, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * CancelJob. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} cancellationReason Reason for cancellation. + * + * @param {string} cancellationReason.reason Reason for cancellation. + * + * @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. + */ + cancel(resourceGroupName, jobName, cancellationReason, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._cancel(resourceGroupName, jobName, cancellationReason, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._cancel(resourceGroupName, jobName, cancellationReason, options, optionalCallback); + } + } + + /** + * Provides list of copy logs uri. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @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. + */ + getCopyLogsUriWithHttpOperationResponse(resourceGroupName, jobName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getCopyLogsUri(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; + }); + }); + } + + /** + * Provides list of copy logs uri. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @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 {GetCopyLogsUriOutput} - 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 GetCopyLogsUriOutput} 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. + */ + getCopyLogsUri(resourceGroupName, jobName, 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._getCopyLogsUri(resourceGroupName, jobName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getCopyLogsUri(resourceGroupName, jobName, options, optionalCallback); + } + } + + /** + * Get shipping label sas uri. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @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. + */ + downloadShippingLabelUriWithHttpOperationResponse(resourceGroupName, jobName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._downloadShippingLabelUri(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; + }); + }); + } + + /** + * Get shipping label sas uri. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @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 {ShippingLabelDetails} - 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 ShippingLabelDetails} 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. + */ + downloadShippingLabelUri(resourceGroupName, jobName, 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._downloadShippingLabelUri(resourceGroupName, jobName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._downloadShippingLabelUri(resourceGroupName, jobName, options, optionalCallback); + } + } + + /** + * This method gets the unencrypted secrets related to the job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @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. + */ + listSecretsWithHttpOperationResponse(resourceGroupName, jobName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSecrets(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; + }); + }); + } + + /** + * This method gets the unencrypted secrets related to the job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @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 {UnencryptedSecrets} - 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 UnencryptedSecrets} 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. + */ + listSecrets(resourceGroupName, jobName, 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._listSecrets(resourceGroupName, jobName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSecrets(resourceGroupName, jobName, options, optionalCallback); + } + } + + /** + * Reports an issue. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} reportIssueDetails Details of reported issue. + * + * @param {string} [reportIssueDetails.issueType] Issue Type. Possible values + * include: 'DeviceMismatch', 'ValidationStringMismatch', + * 'CredentialNotWorking', 'DeviceFailure' + * + * @param {string} [reportIssueDetails.deviceIssueType] Device Issue Type. Only + * used for Device failure issue. Possible values include: 'DeviceTampering', + * 'DeviceNotBootingUp', 'DeviceHealthCheckShowFailures', 'NICsAreNotWorking', + * 'Misc' + * + * @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. + */ + reportIssueWithHttpOperationResponse(resourceGroupName, jobName, reportIssueDetails, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._reportIssue(resourceGroupName, jobName, reportIssueDetails, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Reports an issue. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} reportIssueDetails Details of reported issue. + * + * @param {string} [reportIssueDetails.issueType] Issue Type. Possible values + * include: 'DeviceMismatch', 'ValidationStringMismatch', + * 'CredentialNotWorking', 'DeviceFailure' + * + * @param {string} [reportIssueDetails.deviceIssueType] Device Issue Type. Only + * used for Device failure issue. Possible values include: 'DeviceTampering', + * 'DeviceNotBootingUp', 'DeviceHealthCheckShowFailures', 'NICsAreNotWorking', + * 'Misc' + * + * @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. + */ + reportIssue(resourceGroupName, jobName, reportIssueDetails, 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._reportIssue(resourceGroupName, jobName, reportIssueDetails, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._reportIssue(resourceGroupName, jobName, reportIssueDetails, options, optionalCallback); + } + } + + /** + * Creates a new job with the specified parameters. Existing job cannot be + * updated with this API and should instead be updated with the Update job API. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} jobResource Job details from request body. + * + * @param {string} [jobResource.deviceType] Type of the device to be used for + * the job. Possible values include: 'Pod', 'Disk', 'Cabinet' + * + * @param {boolean} [jobResource.isCancellable] Describes whether the job is + * cancellable or not. + * + * @param {boolean} [jobResource.isShippingAddressEditable] Describes whether + * the shipping address is editable or not. + * + * @param {string} [jobResource.status] Name of the stage which is in progress. + * Possible values include: 'DeviceOrdered', 'DevicePrepared', 'Dispatched', + * 'Delivered', 'PickedUp', 'AtAzureDC', 'DataCopy', 'Completed', + * 'CompletedWithErrors', 'Cancelled', 'Failed_IssueReportedAtCustomer', + * 'Failed_IssueDetectedAtAzureDC', 'Aborted' + * + * @param {date} [jobResource.startTime] Time at which the job was started in + * UTC ISO 8601 format. + * + * @param {object} [jobResource.error] Top level error for the job. + * + * @param {string} jobResource.error.code Error code that can be used to + * programmatically identify the error. + * + * @param {string} [jobResource.error.message] Describes the error in detail + * and provides debugging information. + * + * @param {object} [jobResource.deliveryPackage] Delivery package shipping + * details. + * + * @param {object} [jobResource.returnPackage] Return package shipping details. + * + * @param {string} [jobResource.returnPackage.carrierName] Name of the carrier. + * + * @param {string} [jobResource.returnPackage.trackingId] Tracking Id of + * shipment. + * + * @param {string} [jobResource.returnPackage.trackingUrl] Url where shipment + * can be tracked. + * + * @param {array} jobResource.destinationAccountDetails Destination account + * details. + * + * @param {object} [jobResource.details] Details of a job run. This field will + * only be sent for expand details filter. + * + * @param {number} [jobResource.details.expectedDataSizeInTeraBytes] The + * expected size of the data, which needs to be transfered in this job, in tera + * bytes. + * + * @param {array} [jobResource.details.jobStages] List of stages that run in + * the job. + * + * @param {object} jobResource.details.contactDetails Contact details for + * notification and shipping. + * + * @param {string} [jobResource.details.contactDetails.contactName] Contact + * name of the person. + * + * @param {string} jobResource.details.contactDetails.phone Phone number of the + * contact person. + * + * @param {string} [jobResource.details.contactDetails.phoneExtension] Phone + * extension number of the contact person. + * + * @param {string} [jobResource.details.contactDetails.mobile] Mobile number of + * the contact person. + * + * @param {array} jobResource.details.contactDetails.emailList List of + * Email-ids to be notified about job progress. + * + * @param {array} [jobResource.details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * + * @param {object} jobResource.details.shippingAddress Shipping address of the + * customer. + * + * @param {string} jobResource.details.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} [jobResource.details.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} [jobResource.details.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [jobResource.details.shippingAddress.city] Name of the City. + * + * @param {string} [jobResource.details.shippingAddress.stateOrProvince] Name + * of the State or Province. + * + * @param {string} jobResource.details.shippingAddress.country Name of the + * Country. + * + * @param {string} jobResource.details.shippingAddress.postalCode Postal code. + * + * @param {string} [jobResource.details.shippingAddress.zipExtendedCode] + * Extended Zip Code. + * + * @param {string} [jobResource.details.shippingAddress.companyName] Name of + * the company. + * + * @param {string} [jobResource.details.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {array} [jobResource.details.errorDetails] Error details for failure. + * This is optional. + * + * @param {string} jobResource.details.jobDetailsType Polymorphic Discriminator + * + * @param {string} [jobResource.cancellationReason] Reason for cancellation. + * + * @param {string} jobResource.location The location of the resource. This will + * be one of the supported and registered Azure Regions (e.g. West US, East US, + * Southeast Asia, etc.). The region of a resource cannot be changed once it is + * created, but if an identical region is specified on update the request will + * succeed. + * + * @param {object} [jobResource.tags] The list of key value pairs that describe + * the resource. These tags can be used in viewing and grouping this resource + * (across resource groups). + * + * @param {object} jobResource.sku The sku type. + * + * @param {string} jobResource.sku.name The sku name. + * + * @param {string} [jobResource.sku.displayName] The display name of the sku. + * + * @param {string} [jobResource.sku.family] The sku family. + * + * @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. + */ + beginCreateWithHttpOperationResponse(resourceGroupName, jobName, jobResource, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreate(resourceGroupName, jobName, jobResource, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a new job with the specified parameters. Existing job cannot be + * updated with this API and should instead be updated with the Update job API. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} jobResource Job details from request body. + * + * @param {string} [jobResource.deviceType] Type of the device to be used for + * the job. Possible values include: 'Pod', 'Disk', 'Cabinet' + * + * @param {boolean} [jobResource.isCancellable] Describes whether the job is + * cancellable or not. + * + * @param {boolean} [jobResource.isShippingAddressEditable] Describes whether + * the shipping address is editable or not. + * + * @param {string} [jobResource.status] Name of the stage which is in progress. + * Possible values include: 'DeviceOrdered', 'DevicePrepared', 'Dispatched', + * 'Delivered', 'PickedUp', 'AtAzureDC', 'DataCopy', 'Completed', + * 'CompletedWithErrors', 'Cancelled', 'Failed_IssueReportedAtCustomer', + * 'Failed_IssueDetectedAtAzureDC', 'Aborted' + * + * @param {date} [jobResource.startTime] Time at which the job was started in + * UTC ISO 8601 format. + * + * @param {object} [jobResource.error] Top level error for the job. + * + * @param {string} jobResource.error.code Error code that can be used to + * programmatically identify the error. + * + * @param {string} [jobResource.error.message] Describes the error in detail + * and provides debugging information. + * + * @param {object} [jobResource.deliveryPackage] Delivery package shipping + * details. + * + * @param {object} [jobResource.returnPackage] Return package shipping details. + * + * @param {string} [jobResource.returnPackage.carrierName] Name of the carrier. + * + * @param {string} [jobResource.returnPackage.trackingId] Tracking Id of + * shipment. + * + * @param {string} [jobResource.returnPackage.trackingUrl] Url where shipment + * can be tracked. + * + * @param {array} jobResource.destinationAccountDetails Destination account + * details. + * + * @param {object} [jobResource.details] Details of a job run. This field will + * only be sent for expand details filter. + * + * @param {number} [jobResource.details.expectedDataSizeInTeraBytes] The + * expected size of the data, which needs to be transfered in this job, in tera + * bytes. + * + * @param {array} [jobResource.details.jobStages] List of stages that run in + * the job. + * + * @param {object} jobResource.details.contactDetails Contact details for + * notification and shipping. + * + * @param {string} [jobResource.details.contactDetails.contactName] Contact + * name of the person. + * + * @param {string} jobResource.details.contactDetails.phone Phone number of the + * contact person. + * + * @param {string} [jobResource.details.contactDetails.phoneExtension] Phone + * extension number of the contact person. + * + * @param {string} [jobResource.details.contactDetails.mobile] Mobile number of + * the contact person. + * + * @param {array} jobResource.details.contactDetails.emailList List of + * Email-ids to be notified about job progress. + * + * @param {array} [jobResource.details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * + * @param {object} jobResource.details.shippingAddress Shipping address of the + * customer. + * + * @param {string} jobResource.details.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} [jobResource.details.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} [jobResource.details.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [jobResource.details.shippingAddress.city] Name of the City. + * + * @param {string} [jobResource.details.shippingAddress.stateOrProvince] Name + * of the State or Province. + * + * @param {string} jobResource.details.shippingAddress.country Name of the + * Country. + * + * @param {string} jobResource.details.shippingAddress.postalCode Postal code. + * + * @param {string} [jobResource.details.shippingAddress.zipExtendedCode] + * Extended Zip Code. + * + * @param {string} [jobResource.details.shippingAddress.companyName] Name of + * the company. + * + * @param {string} [jobResource.details.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {array} [jobResource.details.errorDetails] Error details for failure. + * This is optional. + * + * @param {string} jobResource.details.jobDetailsType Polymorphic Discriminator + * + * @param {string} [jobResource.cancellationReason] Reason for cancellation. + * + * @param {string} jobResource.location The location of the resource. This will + * be one of the supported and registered Azure Regions (e.g. West US, East US, + * Southeast Asia, etc.). The region of a resource cannot be changed once it is + * created, but if an identical region is specified on update the request will + * succeed. + * + * @param {object} [jobResource.tags] The list of key value pairs that describe + * the resource. These tags can be used in viewing and grouping this resource + * (across resource groups). + * + * @param {object} jobResource.sku The sku type. + * + * @param {string} jobResource.sku.name The sku name. + * + * @param {string} [jobResource.sku.displayName] The display name of the sku. + * + * @param {string} [jobResource.sku.family] The sku family. + * + * @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 {JobResource} - 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 JobResource} 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. + */ + beginCreate(resourceGroupName, jobName, jobResource, 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._beginCreate(resourceGroupName, jobName, jobResource, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreate(resourceGroupName, jobName, jobResource, options, optionalCallback); + } + } + + /** + * Updates the properties of an existing job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} jobResourceUpdateParameter Job update parameters from + * request body. + * + * @param {object} jobResourceUpdateParameter.details Details of a job to be + * updated. + * + * @param {object} [jobResourceUpdateParameter.details.contactDetails] Contact + * details for notification and shipping. + * + * @param {string} + * [jobResourceUpdateParameter.details.contactDetails.contactName] Contact name + * of the person. + * + * @param {string} jobResourceUpdateParameter.details.contactDetails.phone + * Phone number of the contact person. + * + * @param {string} + * [jobResourceUpdateParameter.details.contactDetails.phoneExtension] Phone + * extension number of the contact person. + * + * @param {string} [jobResourceUpdateParameter.details.contactDetails.mobile] + * Mobile number of the contact person. + * + * @param {array} jobResourceUpdateParameter.details.contactDetails.emailList + * List of Email-ids to be notified about job progress. + * + * @param {array} + * [jobResourceUpdateParameter.details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * + * @param {object} [jobResourceUpdateParameter.details.shippingAddress] + * Shipping address of the customer. + * + * @param {string} + * jobResourceUpdateParameter.details.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [jobResourceUpdateParameter.details.shippingAddress.city] + * Name of the City. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.stateOrProvince] Name of + * the State or Province. + * + * @param {string} jobResourceUpdateParameter.details.shippingAddress.country + * Name of the Country. + * + * @param {string} + * jobResourceUpdateParameter.details.shippingAddress.postalCode Postal code. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.zipExtendedCode] + * Extended Zip Code. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.companyName] Name of the + * company. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {object} [jobResourceUpdateParameter.tags] The list of key value + * pairs that describe the resource. These tags can be used in viewing and + * grouping this resource (across resource groups). + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.ifMatch] Defines the If-Match condition. The patch + * will be performed only if the ETag of the job on the server matches this + * value. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginUpdateWithHttpOperationResponse(resourceGroupName, jobName, jobResourceUpdateParameter, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdate(resourceGroupName, jobName, jobResourceUpdateParameter, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates the properties of an existing job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @param {object} jobResourceUpdateParameter Job update parameters from + * request body. + * + * @param {object} jobResourceUpdateParameter.details Details of a job to be + * updated. + * + * @param {object} [jobResourceUpdateParameter.details.contactDetails] Contact + * details for notification and shipping. + * + * @param {string} + * [jobResourceUpdateParameter.details.contactDetails.contactName] Contact name + * of the person. + * + * @param {string} jobResourceUpdateParameter.details.contactDetails.phone + * Phone number of the contact person. + * + * @param {string} + * [jobResourceUpdateParameter.details.contactDetails.phoneExtension] Phone + * extension number of the contact person. + * + * @param {string} [jobResourceUpdateParameter.details.contactDetails.mobile] + * Mobile number of the contact person. + * + * @param {array} jobResourceUpdateParameter.details.contactDetails.emailList + * List of Email-ids to be notified about job progress. + * + * @param {array} + * [jobResourceUpdateParameter.details.contactDetails.notificationPreference] + * Notification preference for a job stage. + * + * @param {object} [jobResourceUpdateParameter.details.shippingAddress] + * Shipping address of the customer. + * + * @param {string} + * jobResourceUpdateParameter.details.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [jobResourceUpdateParameter.details.shippingAddress.city] + * Name of the City. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.stateOrProvince] Name of + * the State or Province. + * + * @param {string} jobResourceUpdateParameter.details.shippingAddress.country + * Name of the Country. + * + * @param {string} + * jobResourceUpdateParameter.details.shippingAddress.postalCode Postal code. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.zipExtendedCode] + * Extended Zip Code. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.companyName] Name of the + * company. + * + * @param {string} + * [jobResourceUpdateParameter.details.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {object} [jobResourceUpdateParameter.tags] The list of key value + * pairs that describe the resource. These tags can be used in viewing and + * grouping this resource (across resource groups). + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.ifMatch] Defines the If-Match condition. The patch + * will be performed only if the ETag of the job on the server matches this + * value. + * + * @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 {JobResource} - 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 JobResource} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdate(resourceGroupName, jobName, jobResourceUpdateParameter, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginUpdate(resourceGroupName, jobName, jobResourceUpdateParameter, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdate(resourceGroupName, jobName, jobResourceUpdateParameter, options, optionalCallback); + } + } + + /** + * Lists all the jobs available under the subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all the jobs available under the subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {JobResourceList} - 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 JobResourceList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Lists all the jobs available under the given resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all the jobs available under the given resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {JobResourceList} - 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 JobResourceList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroupNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = Jobs; diff --git a/lib/services/databox/lib/operations/listSecrets.js b/lib/services/databox/lib/operations/listSecrets.js new file mode 100644 index 0000000000..17726dd56b --- /dev/null +++ b/lib/services/databox/lib/operations/listSecrets.js @@ -0,0 +1,281 @@ +/* + * 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; + +/** + * This method gets the unencrypted secrets related to the job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @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 UnencryptedSecrets} 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 _listByJobs(resourceGroupName, jobName, 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.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 (jobName !== null && jobName !== undefined) { + if (jobName.length > 24) + { + throw new Error('"jobName" should satisfy the constraint - "MaxLength": 24'); + } + if (jobName.length < 3) + { + throw new Error('"jobName" should satisfy the constraint - "MinLength": 3'); + } + if (jobName.match(/^[-\w\.]+$/) === null) + { + throw new Error('"jobName" should satisfy the constraint - "Pattern": /^[-\w\.]+$/'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion 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.DataBox/jobs/{jobName}/listSecrets'; + 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('&'); + } + + // 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().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['UnencryptedSecrets']().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 ListSecrets. */ +class ListSecrets { + /** + * Create a ListSecrets. + * @param {DataBoxManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._listByJobs = _listByJobs; + } + + /** + * This method gets the unencrypted secrets related to the job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @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. + */ + listByJobsWithHttpOperationResponse(resourceGroupName, jobName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByJobs(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; + }); + }); + } + + /** + * This method gets the unencrypted secrets related to the job. + * + * @param {string} resourceGroupName The Resource Group Name + * + * @param {string} jobName The name of the job Resource within the specified + * resource group. job names must be between 3 and 24 characters in length and + * use any alphanumeric and underscore only + * + * @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 {UnencryptedSecrets} - 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 UnencryptedSecrets} 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. + */ + listByJobs(resourceGroupName, jobName, 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._listByJobs(resourceGroupName, jobName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByJobs(resourceGroupName, jobName, options, optionalCallback); + } + } + +} + +module.exports = ListSecrets; diff --git a/lib/services/databox/lib/operations/operations.js b/lib/services/databox/lib/operations/operations.js new file mode 100644 index 0000000000..a9780b8d99 --- /dev/null +++ b/lib/services/databox/lib/operations/operations.js @@ -0,0 +1,449 @@ +/* + * 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; + +/** + * This method gets all the operations. + * + * @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 OperationList} 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion 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.DataBox/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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().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['OperationList']().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); + }); +} + +/** + * This method gets all the operations. + * + * @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 OperationList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().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['OperationList']().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 {DataBoxManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._listNext = _listNext; + } + + /** + * This method gets all the operations. + * + * @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; + }); + }); + } + + /** + * This method gets all the operations. + * + * @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 {OperationList} - 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 OperationList} 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); + } + } + + /** + * This method gets all the operations. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * This method gets all the operations. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {OperationList} - 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 OperationList} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = Operations; diff --git a/lib/services/databox/lib/operations/service.js b/lib/services/databox/lib/operations/service.js new file mode 100644 index 0000000000..c833ed4327 --- /dev/null +++ b/lib/services/databox/lib/operations/service.js @@ -0,0 +1,869 @@ +/* + * 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; + +/** + * This method provides the list of available skus for the given subscription + * and location. + * + * @param {string} location The location of the resource + * + * @param {object} availableSkuRequest Filters for showing the available skus. + * + * @param {string} availableSkuRequest.country ISO country code. Country for + * hardware shipment. For codes check: + * https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + * + * @param {string} availableSkuRequest.location Location for data transfer. For + * locations check: + * https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + * + * @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 AvailableSkusResult} 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 _listAvailableSkus(location, availableSkuRequest, 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.'); + } + if (availableSkuRequest === null || availableSkuRequest === undefined) + { + availableSkuRequest = {}; + } + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (location === null || location === undefined || typeof location.valueOf() !== 'string') { + throw new Error('location cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (availableSkuRequest === null || availableSkuRequest === undefined) { + throw new Error('availableSkuRequest cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/availableSkus'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{location}', encodeURIComponent(location)); + 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]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (availableSkuRequest !== null && availableSkuRequest !== undefined) { + let requestModelMapper = new client.models['AvailableSkuRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, availableSkuRequest, 'availableSkuRequest'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(availableSkuRequest, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().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['AvailableSkusResult']().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); + }); +} + +/** + * This method validates the customer shipping address and provide alternate + * addresses if any. + * + * @param {string} location The location of the resource + * + * @param {object} validateAddress Shipping address of the customer. + * + * @param {object} [validateAddress.shippingAddress] Shipping address of the + * customer. + * + * @param {string} validateAddress.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} [validateAddress.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} [validateAddress.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [validateAddress.shippingAddress.city] Name of the City. + * + * @param {string} [validateAddress.shippingAddress.stateOrProvince] Name of + * the State or Province. + * + * @param {string} validateAddress.shippingAddress.country Name of the Country. + * + * @param {string} validateAddress.shippingAddress.postalCode Postal code. + * + * @param {string} [validateAddress.shippingAddress.zipExtendedCode] Extended + * Zip Code. + * + * @param {string} [validateAddress.shippingAddress.companyName] Name of the + * company. + * + * @param {string} [validateAddress.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {string} [validateAddress.deviceType] Device type to be used for the + * job. Possible values include: 'Pod', 'Disk', 'Cabinet' + * + * @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 AddressValidationOutput} 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 _validateAddressMethod(location, validateAddress, 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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (location === null || location === undefined || typeof location.valueOf() !== 'string') { + throw new Error('location cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (validateAddress === null || validateAddress === undefined) { + throw new Error('validateAddress cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{location}', encodeURIComponent(location)); + 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]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (validateAddress !== null && validateAddress !== undefined) { + let requestModelMapper = new client.models['ValidateAddress']().mapper(); + requestModel = client.serialize(requestModelMapper, validateAddress, 'validateAddress'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(validateAddress, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().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['AddressValidationOutput']().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); + }); +} + +/** + * This method provides the list of available skus for the given subscription + * and location. + * + * @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 AvailableSkusResult} 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 _listAvailableSkusNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = '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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().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['AvailableSkusResult']().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 Service. */ +class Service { + /** + * Create a Service. + * @param {DataBoxManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._listAvailableSkus = _listAvailableSkus; + this._validateAddressMethod = _validateAddressMethod; + this._listAvailableSkusNext = _listAvailableSkusNext; + } + + /** + * This method provides the list of available skus for the given subscription + * and location. + * + * @param {string} location The location of the resource + * + * @param {object} availableSkuRequest Filters for showing the available skus. + * + * @param {string} availableSkuRequest.country ISO country code. Country for + * hardware shipment. For codes check: + * https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + * + * @param {string} availableSkuRequest.location Location for data transfer. For + * locations check: + * https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + * + * @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. + */ + listAvailableSkusWithHttpOperationResponse(location, availableSkuRequest, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAvailableSkus(location, availableSkuRequest, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * This method provides the list of available skus for the given subscription + * and location. + * + * @param {string} location The location of the resource + * + * @param {object} availableSkuRequest Filters for showing the available skus. + * + * @param {string} availableSkuRequest.country ISO country code. Country for + * hardware shipment. For codes check: + * https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + * + * @param {string} availableSkuRequest.location Location for data transfer. For + * locations check: + * https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + * + * @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 {AvailableSkusResult} - 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 AvailableSkusResult} 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. + */ + listAvailableSkus(location, availableSkuRequest, 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._listAvailableSkus(location, availableSkuRequest, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAvailableSkus(location, availableSkuRequest, options, optionalCallback); + } + } + + /** + * This method validates the customer shipping address and provide alternate + * addresses if any. + * + * @param {string} location The location of the resource + * + * @param {object} validateAddress Shipping address of the customer. + * + * @param {object} [validateAddress.shippingAddress] Shipping address of the + * customer. + * + * @param {string} validateAddress.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} [validateAddress.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} [validateAddress.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [validateAddress.shippingAddress.city] Name of the City. + * + * @param {string} [validateAddress.shippingAddress.stateOrProvince] Name of + * the State or Province. + * + * @param {string} validateAddress.shippingAddress.country Name of the Country. + * + * @param {string} validateAddress.shippingAddress.postalCode Postal code. + * + * @param {string} [validateAddress.shippingAddress.zipExtendedCode] Extended + * Zip Code. + * + * @param {string} [validateAddress.shippingAddress.companyName] Name of the + * company. + * + * @param {string} [validateAddress.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {string} [validateAddress.deviceType] Device type to be used for the + * job. Possible values include: 'Pod', 'Disk', 'Cabinet' + * + * @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. + */ + validateAddressMethodWithHttpOperationResponse(location, validateAddress, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._validateAddressMethod(location, validateAddress, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * This method validates the customer shipping address and provide alternate + * addresses if any. + * + * @param {string} location The location of the resource + * + * @param {object} validateAddress Shipping address of the customer. + * + * @param {object} [validateAddress.shippingAddress] Shipping address of the + * customer. + * + * @param {string} validateAddress.shippingAddress.streetAddress1 Street + * Address line 1. + * + * @param {string} [validateAddress.shippingAddress.streetAddress2] Street + * Address line 2. + * + * @param {string} [validateAddress.shippingAddress.streetAddress3] Street + * Address line 3. + * + * @param {string} [validateAddress.shippingAddress.city] Name of the City. + * + * @param {string} [validateAddress.shippingAddress.stateOrProvince] Name of + * the State or Province. + * + * @param {string} validateAddress.shippingAddress.country Name of the Country. + * + * @param {string} validateAddress.shippingAddress.postalCode Postal code. + * + * @param {string} [validateAddress.shippingAddress.zipExtendedCode] Extended + * Zip Code. + * + * @param {string} [validateAddress.shippingAddress.companyName] Name of the + * company. + * + * @param {string} [validateAddress.shippingAddress.addressType] Type of + * address. Possible values include: 'None', 'Residential', 'Commercial' + * + * @param {string} [validateAddress.deviceType] Device type to be used for the + * job. Possible values include: 'Pod', 'Disk', 'Cabinet' + * + * @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 {AddressValidationOutput} - 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 AddressValidationOutput} 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. + */ + validateAddressMethod(location, validateAddress, 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._validateAddressMethod(location, validateAddress, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._validateAddressMethod(location, validateAddress, options, optionalCallback); + } + } + + /** + * This method provides the list of available skus for the given subscription + * and location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listAvailableSkusNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAvailableSkusNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * This method provides the list of available skus for the given subscription + * and location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {AvailableSkusResult} - 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 AvailableSkusResult} 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. + */ + listAvailableSkusNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listAvailableSkusNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAvailableSkusNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = Service; diff --git a/lib/services/databox/lib/package.json b/lib/services/databox/lib/package.json new file mode 100644 index 0000000000..ccdf622dfa --- /dev/null +++ b/lib/services/databox/lib/package.json @@ -0,0 +1,22 @@ +{ + "name": "azure-arm-databox", + "author": "Microsoft Corporation", + "description": "DataBoxManagementClient Library with typescript type definitions for node", + "version": "", + "dependencies": { + "ms-rest": "^2.3.2", + "ms-rest-azure": "^2.5.5" + }, + "keywords": [ "node", "azure" ], + "license": "MIT", + "main": "./lib/dataBoxManagementClient.js", + "types": "./lib/dataBoxManagementClient.d.ts", + "homepage": "http://github.com/azure/azure-sdk-for-node", + "repository": { + "type": "git", + "url": "https://github.com/azure/azure-sdk-for-node.git" + }, + "bugs": { + "url": "http://github.com/Azure/azure-sdk-for-node/issues" + } +} diff --git a/lib/services/databox/package-lock.json b/lib/services/databox/package-lock.json new file mode 100644 index 0000000000..ba40f6a964 --- /dev/null +++ b/lib/services/databox/package-lock.json @@ -0,0 +1,474 @@ +{ + "name": "azure-arm-databox", + "version": "1.0.0-preview", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@types/node": { + "version": "8.10.22", + "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.22.tgz", + "integrity": "sha512-HCJ1dUJEQVFRekwBAlyv9pJ+2rzxq9uimSmsK2q7YDYMbXR3b4BXcO9rsN+36ZBwSWQ5BNh5o8xdZijDSonS5A==" + }, + "adal-node": { + "version": "0.1.28", + "resolved": "https://registry.npmjs.org/adal-node/-/adal-node-0.1.28.tgz", + "integrity": "sha1-RoxLs+u9lrEnBmn0ucuk4AZepIU=", + "requires": { + "@types/node": "^8.0.47", + "async": ">=0.6.0", + "date-utils": "*", + "jws": "3.x.x", + "request": ">= 2.52.0", + "underscore": ">= 1.3.1", + "uuid": "^3.1.0", + "xmldom": ">= 0.1.x", + "xpath.js": "~1.1.0" + } + }, + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "requires": { + "co": "^4.6.0", + "fast-deep-equal": "^1.0.0", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.3.0" + } + }, + "asn1": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", + "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=" + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + }, + "async": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz", + "integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==", + "requires": { + "lodash": "^4.14.0" + } + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + }, + "aws4": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.7.0.tgz", + "integrity": "sha512-32NDda82rhwD9/JBCCkB+MRYDp0oSvlo2IL6rQWA10PQi7tDUM3eqMSltXmY+Oyl/7N3P3qNtAlv7X0d9bI28w==" + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "optional": true, + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" + }, + "combined-stream": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", + "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "requires": { + "assert-plus": "^1.0.0" + } + }, + "date-utils": { + "version": "1.2.21", + "resolved": "https://registry.npmjs.org/date-utils/-/date-utils-1.2.21.tgz", + "integrity": "sha1-YfsWzcEnSzyayq/+n8ad+HIKK2Q=" + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, + "duplexer": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", + "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=" + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "optional": true, + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "ecdsa-sig-formatter": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.10.tgz", + "integrity": "sha1-HFlQAPBKiJffuFAAiSoPTDOvhsM=", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + }, + "fast-deep-equal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=" + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + }, + "form-data": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", + "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "1.0.6", + "mime-types": "^2.1.12" + } + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "requires": { + "assert-plus": "^1.0.0" + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + }, + "har-validator": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", + "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", + "requires": { + "ajv": "^5.1.0", + "har-schema": "^2.0.0" + } + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "optional": true + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=" + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "jwa": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.1.6.tgz", + "integrity": "sha512-tBO/cf++BUsJkYql/kBbJroKOgHWEigTKBAjjBEmrMGYd1QMBC74Hr4Wo2zCZw6ZrVhlJPvoMrkcOnlWR/DJfw==", + "requires": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.10", + "safe-buffer": "^5.0.1" + } + }, + "jws": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.1.5.tgz", + "integrity": "sha512-GsCSexFADNQUr8T5HPJvayTjvPIfoyJPtLQBwn5a4WZQchcrPMPMAWcC1AzJVRDKyD6ZPROPAxgv6rfHViO4uQ==", + "requires": { + "jwa": "^1.1.5", + "safe-buffer": "^5.0.1" + } + }, + "lodash": { + "version": "4.17.10", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", + "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==" + }, + "mime-db": { + "version": "1.35.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.35.0.tgz", + "integrity": "sha512-JWT/IcCTsB0Io3AhWUMjRqucrHSPsSf2xKLaRldJVULioggvkJvggZ3VXNNSRkCddE6D+BUI4HEIZIA2OjwIvg==" + }, + "mime-types": { + "version": "2.1.19", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.19.tgz", + "integrity": "sha512-P1tKYHVSZ6uFo26mtnve4HQFE3koh1UWVkp8YUC+ESBHe945xWSoXuHHiGarDqcEZ+whpCDnlNw5LON0kLo+sw==", + "requires": { + "mime-db": "~1.35.0" + } + }, + "moment": { + "version": "2.22.2", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.22.2.tgz", + "integrity": "sha1-PCV/mDn8DpP/UxSWMiOeuQeD/2Y=" + }, + "ms-rest": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/ms-rest/-/ms-rest-2.3.6.tgz", + "integrity": "sha512-M+Lx9P7Wy4TeAk7jqPLwGS1QS1gvxF6Xo+OHv5j1g3Kcb44T/GTUuSjxTKarF6aKyeacZH1ZD++Nt7pcql7dDA==", + "requires": { + "duplexer": "^0.1.1", + "is-buffer": "^1.1.6", + "is-stream": "^1.1.0", + "moment": "^2.21.0", + "request": "^2.87.0", + "through": "^2.3.8", + "tunnel": "0.0.5", + "uuid": "^3.2.1" + } + }, + "ms-rest-azure": { + "version": "2.5.7", + "resolved": "https://registry.npmjs.org/ms-rest-azure/-/ms-rest-azure-2.5.7.tgz", + "integrity": "sha512-e4lgB0z29Dx4ufu/c+PmEAYY1WXq98GYUBkE+iRx7WsxsN04lrM3B1vj8y+B8rKt7clPUE0niqB9VovVL8zvag==", + "requires": { + "adal-node": "^0.1.28", + "async": "2.6.0", + "moment": "^2.22.2", + "ms-rest": "^2.3.2", + "uuid": "^3.2.1" + } + }, + "oauth-sign": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", + "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=" + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + }, + "request": { + "version": "2.87.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.87.0.tgz", + "integrity": "sha512-fcogkm7Az5bsS6Sl0sibkbhcKsnyon/jV1kF3ajGmF0c8HrttdKTPRT9hieOaQHA5HEq6r8OyWOo/o781C1tNw==", + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.6.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.5", + "extend": "~3.0.1", + "forever-agent": "~0.6.1", + "form-data": "~2.3.1", + "har-validator": "~5.0.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.17", + "oauth-sign": "~0.8.2", + "performance-now": "^2.1.0", + "qs": "~6.5.1", + "safe-buffer": "^5.1.1", + "tough-cookie": "~2.3.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.1.0" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "sshpk": { + "version": "1.14.2", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.2.tgz", + "integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=", + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + } + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" + }, + "tough-cookie": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", + "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", + "requires": { + "punycode": "^1.4.1" + } + }, + "tunnel": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.5.tgz", + "integrity": "sha512-gj5sdqherx4VZKMcBA4vewER7zdK25Td+z1npBqpbDys4eJrLx+SlYjJvq1bDXs2irkuJM5pf8ktaEQVipkrbA==" + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "optional": true + }, + "underscore": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.1.tgz", + "integrity": "sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg==" + }, + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "xmldom": { + "version": "0.1.27", + "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.27.tgz", + "integrity": "sha1-1QH5ezvbQDr4757MIFcxh6rawOk=" + }, + "xpath.js": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/xpath.js/-/xpath.js-1.1.0.tgz", + "integrity": "sha512-jg+qkfS4K8E7965sqaUl8mRngXiKb3WZGfONgE18pr03FUQiuSV6G+Ej4tS55B+rIQSFEIw3phdVAQ4pPqNWfQ==" + } + } +} diff --git a/lib/services/databox/package.json b/lib/services/databox/package.json new file mode 100644 index 0000000000..fbf1f866a9 --- /dev/null +++ b/lib/services/databox/package.json @@ -0,0 +1,25 @@ +{ + "name": "azure-arm-databox", + "author": "Microsoft Corporation", + "description": "DataBoxManagementClient Library with typescript type definitions for node", + "version": "1.0.0-preview", + "dependencies": { + "ms-rest": "^2.3.3", + "ms-rest-azure": "^2.5.5" + }, + "keywords": [ + "node", + "azure" + ], + "license": "MIT", + "main": "./lib/dataBoxManagementClient.js", + "types": "./lib/dataBoxManagementClient.d.ts", + "homepage": "https://github.com/azure/azure-sdk-for-node/lib/services/databox", + "repository": { + "type": "git", + "url": "https://github.com/azure/azure-sdk-for-node.git" + }, + "bugs": { + "url": "https://github.com/azure/azure-sdk-for-node/issues" + } +}