From 9c4a47c687c61ff0c17a32321390cc2daa649b89 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 14 Nov 2018 17:06:13 -0800 Subject: [PATCH 1/8] Generated from e2352b510b4d4bcc89aed634b99985388b785ba3 (#4100) Add maximum chunk size to data lake store docs. --- ...taLakeStoreFileSystemManagementClient.d.ts | 82 + ...dataLakeStoreFileSystemManagementClient.js | 81 + .../lib/filesystem/models/aclStatus.js | 95 + .../lib/filesystem/models/aclStatusResult.js | 62 + .../models/adlsAccessControlException.js | 79 + .../models/adlsBadOffsetException.js | 79 + .../lib/filesystem/models/adlsError.js | 67 + .../models/adlsFileAlreadyExistsException.js | 78 + .../models/adlsFileNotFoundException.js | 78 + .../lib/filesystem/models/adlsIOException.js | 78 + .../models/adlsIllegalArgumentException.js | 78 + .../filesystem/models/adlsRemoteException.js | 80 + .../filesystem/models/adlsRuntimeException.js | 79 + .../models/adlsSecurityException.js | 78 + .../models/adlsThrottledException.js | 79 + .../adlsUnsupportedOperationException.js | 78 + .../lib/filesystem/models/contentSummary.js | 80 + .../filesystem/models/contentSummaryResult.js | 62 + .../filesystem/models/fileOperationResult.js | 54 + .../filesystem/models/fileStatusProperties.js | 149 + .../lib/filesystem/models/fileStatusResult.js | 73 + .../lib/filesystem/models/fileStatuses.js | 62 + .../filesystem/models/fileStatusesResult.js | 57 + .../lib/filesystem/models/index.d.ts | 276 + .../lib/filesystem/models/index.js | 54 + .../lib/filesystem/operations/fileSystem.js | 5855 +++++++++++++++++ .../lib/filesystem/operations/index.d.ts | 1758 +++++ .../lib/filesystem/operations/index.js | 17 + 28 files changed, 9748 insertions(+) create mode 100644 lib/services/datalake.Store/lib/filesystem/dataLakeStoreFileSystemManagementClient.d.ts create mode 100644 lib/services/datalake.Store/lib/filesystem/dataLakeStoreFileSystemManagementClient.js create mode 100644 lib/services/datalake.Store/lib/filesystem/models/aclStatus.js create mode 100644 lib/services/datalake.Store/lib/filesystem/models/aclStatusResult.js create mode 100644 lib/services/datalake.Store/lib/filesystem/models/adlsAccessControlException.js create mode 100644 lib/services/datalake.Store/lib/filesystem/models/adlsBadOffsetException.js create mode 100644 lib/services/datalake.Store/lib/filesystem/models/adlsError.js create mode 100644 lib/services/datalake.Store/lib/filesystem/models/adlsFileAlreadyExistsException.js create mode 100644 lib/services/datalake.Store/lib/filesystem/models/adlsFileNotFoundException.js create mode 100644 lib/services/datalake.Store/lib/filesystem/models/adlsIOException.js create mode 100644 lib/services/datalake.Store/lib/filesystem/models/adlsIllegalArgumentException.js create mode 100644 lib/services/datalake.Store/lib/filesystem/models/adlsRemoteException.js create mode 100644 lib/services/datalake.Store/lib/filesystem/models/adlsRuntimeException.js create mode 100644 lib/services/datalake.Store/lib/filesystem/models/adlsSecurityException.js create mode 100644 lib/services/datalake.Store/lib/filesystem/models/adlsThrottledException.js create mode 100644 lib/services/datalake.Store/lib/filesystem/models/adlsUnsupportedOperationException.js create mode 100644 lib/services/datalake.Store/lib/filesystem/models/contentSummary.js create mode 100644 lib/services/datalake.Store/lib/filesystem/models/contentSummaryResult.js create mode 100644 lib/services/datalake.Store/lib/filesystem/models/fileOperationResult.js create mode 100644 lib/services/datalake.Store/lib/filesystem/models/fileStatusProperties.js create mode 100644 lib/services/datalake.Store/lib/filesystem/models/fileStatusResult.js create mode 100644 lib/services/datalake.Store/lib/filesystem/models/fileStatuses.js create mode 100644 lib/services/datalake.Store/lib/filesystem/models/fileStatusesResult.js create mode 100644 lib/services/datalake.Store/lib/filesystem/models/index.d.ts create mode 100644 lib/services/datalake.Store/lib/filesystem/models/index.js create mode 100644 lib/services/datalake.Store/lib/filesystem/operations/fileSystem.js create mode 100644 lib/services/datalake.Store/lib/filesystem/operations/index.d.ts create mode 100644 lib/services/datalake.Store/lib/filesystem/operations/index.js diff --git a/lib/services/datalake.Store/lib/filesystem/dataLakeStoreFileSystemManagementClient.d.ts b/lib/services/datalake.Store/lib/filesystem/dataLakeStoreFileSystemManagementClient.d.ts new file mode 100644 index 0000000000..6096d849da --- /dev/null +++ b/lib/services/datalake.Store/lib/filesystem/dataLakeStoreFileSystemManagementClient.d.ts @@ -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. + */ + +import { ServiceClientCredentials } from 'ms-rest'; +import { AzureServiceClient, AzureServiceClientOptions } from 'ms-rest-azure'; +import * as models from "./models"; +import * as operations from "./operations"; + +/** + * DataLakeStoreFileSystemManagementClientOptions for DataLakeStoreFileSystemManagementClient. + */ +declare interface DataLakeStoreFileSystemManagementClientOptions extends AzureServiceClientOptions { + /** + * @property {string} [adlsFileSystemDnsSuffix] - Gets the URI used as the base for all cloud service requests. + */ + adlsFileSystemDnsSuffix?: string; + /** + * @property {string} [acceptLanguage] - The preferred language for the response. + */ + acceptLanguage?: string; + /** + * @property {number} [longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. + */ + longRunningOperationRetryTimeout?: number; + /** + * @property {boolean} [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. + */ + generateClientRequestId?: boolean; +} + +export default class DataLakeStoreFileSystemManagementClient extends AzureServiceClient { + /** + * Initializes a new instance of the DataLakeStoreFileSystemManagementClient class. + * @constructor + * + * @class + * @param {credentials} credentials - Credentials needed for the client to connect to Azure. + * + * @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.adlsFileSystemDnsSuffix] - Gets the URI used as the base for all cloud service requests. + * + * @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, options?: DataLakeStoreFileSystemManagementClientOptions); + + credentials: ServiceClientCredentials; + + apiVersion: string; + + adlsFileSystemDnsSuffix: string; + + acceptLanguage: string; + + longRunningOperationRetryTimeout: number; + + generateClientRequestId: boolean; + + // Operation groups + fileSystem: operations.FileSystem; +} + +export { DataLakeStoreFileSystemManagementClient, models as DataLakeStoreFileSystemManagementModels }; diff --git a/lib/services/datalake.Store/lib/filesystem/dataLakeStoreFileSystemManagementClient.js b/lib/services/datalake.Store/lib/filesystem/dataLakeStoreFileSystemManagementClient.js new file mode 100644 index 0000000000..f1518f7367 --- /dev/null +++ b/lib/services/datalake.Store/lib/filesystem/dataLakeStoreFileSystemManagementClient.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. + */ + +/* 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 DataLakeStoreFileSystemManagementClient. */ +class DataLakeStoreFileSystemManagementClient extends ServiceClient { + /** + * Create a DataLakeStoreFileSystemManagementClient. + * @param {credentials} credentials - Credentials needed for the client to connect to Azure. + * @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.adlsFileSystemDnsSuffix] - Gets the URI used as the base for all cloud service requests. + * @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, options) { + if (credentials === null || credentials === undefined) { + throw new Error('\'credentials\' cannot be null.'); + } + + if (!options) options = {}; + + super(credentials, options); + + this.apiVersion = '2016-11-01'; + this.adlsFileSystemDnsSuffix = 'azuredatalakestore.net'; + this.acceptLanguage = 'en-US'; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.baseUri = 'https://{accountName}.{adlsFileSystemDnsSuffix}'; + this.credentials = credentials; + + let packageInfo = this.getPackageJsonInfo(__dirname); + this.addUserAgentInfo(`${packageInfo.name}/${packageInfo.version}`); + if(options.adlsFileSystemDnsSuffix !== null && options.adlsFileSystemDnsSuffix !== undefined) { + this.adlsFileSystemDnsSuffix = options.adlsFileSystemDnsSuffix; + } + 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.fileSystem = new operations.FileSystem(this); + this.models = models; + msRest.addSerializationMixin(this); + } + +} + +module.exports = DataLakeStoreFileSystemManagementClient; +module.exports['default'] = DataLakeStoreFileSystemManagementClient; +module.exports.DataLakeStoreFileSystemManagementClient = DataLakeStoreFileSystemManagementClient; +module.exports.DataLakeStoreFileSystemManagementModels = models; diff --git a/lib/services/datalake.Store/lib/filesystem/models/aclStatus.js b/lib/services/datalake.Store/lib/filesystem/models/aclStatus.js new file mode 100644 index 0000000000..5c33de6971 --- /dev/null +++ b/lib/services/datalake.Store/lib/filesystem/models/aclStatus.js @@ -0,0 +1,95 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Data Lake Store file or directory Access Control List information. + * + */ +class AclStatus { + /** + * Create a AclStatus. + * @property {array} [entries] the list of ACLSpec entries on a file or + * directory. + * @property {string} [group] the group owner, an AAD Object ID. + * @property {string} [owner] the user owner, an AAD Object ID. + * @property {string} [permission] The octal representation of the unnamed + * user, mask and other permissions. + * @property {boolean} [stickyBit] the indicator of whether the sticky bit is + * on or off. + */ + constructor() { + } + + /** + * Defines the metadata of AclStatus + * + * @returns {object} metadata of AclStatus + * + */ + mapper() { + return { + required: false, + serializedName: 'AclStatus', + type: { + name: 'Composite', + className: 'AclStatus', + modelProperties: { + entries: { + required: false, + serializedName: 'entries', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + group: { + required: false, + serializedName: 'group', + type: { + name: 'String' + } + }, + owner: { + required: false, + serializedName: 'owner', + type: { + name: 'String' + } + }, + permission: { + required: false, + serializedName: 'permission', + type: { + name: 'String' + } + }, + stickyBit: { + required: false, + readOnly: true, + serializedName: 'stickyBit', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = AclStatus; diff --git a/lib/services/datalake.Store/lib/filesystem/models/aclStatusResult.js b/lib/services/datalake.Store/lib/filesystem/models/aclStatusResult.js new file mode 100644 index 0000000000..45076aa4ab --- /dev/null +++ b/lib/services/datalake.Store/lib/filesystem/models/aclStatusResult.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'; + +/** + * Data Lake Store file or directory Access Control List information. + * + */ +class AclStatusResult { + /** + * Create a AclStatusResult. + * @property {object} [aclStatus] the AclStatus object for a given file or + * directory. + * @property {array} [aclStatus.entries] the list of ACLSpec entries on a + * file or directory. + * @property {string} [aclStatus.group] the group owner, an AAD Object ID. + * @property {string} [aclStatus.owner] the user owner, an AAD Object ID. + * @property {string} [aclStatus.permission] The octal representation of the + * unnamed user, mask and other permissions. + * @property {boolean} [aclStatus.stickyBit] the indicator of whether the + * sticky bit is on or off. + */ + constructor() { + } + + /** + * Defines the metadata of AclStatusResult + * + * @returns {object} metadata of AclStatusResult + * + */ + mapper() { + return { + required: false, + serializedName: 'AclStatusResult', + type: { + name: 'Composite', + className: 'AclStatusResult', + modelProperties: { + aclStatus: { + required: false, + serializedName: 'aclStatus', + type: { + name: 'Composite', + className: 'AclStatus' + } + } + } + } + }; + } +} + +module.exports = AclStatusResult; diff --git a/lib/services/datalake.Store/lib/filesystem/models/adlsAccessControlException.js b/lib/services/datalake.Store/lib/filesystem/models/adlsAccessControlException.js new file mode 100644 index 0000000000..bd8dfb50b9 --- /dev/null +++ b/lib/services/datalake.Store/lib/filesystem/models/adlsAccessControlException.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'); + +/** + * A WebHDFS exception thrown indicating that access is denied due to + * insufficient permissions. Thrown when a 403 error response code is returned + * (forbidden). + * + * @extends models['AdlsRemoteException'] + */ +class AdlsAccessControlException extends models['AdlsRemoteException'] { + /** + * Create a AdlsAccessControlException. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AdlsAccessControlException + * + * @returns {object} metadata of AdlsAccessControlException + * + */ + mapper() { + return { + required: false, + serializedName: 'AccessControlException', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'exception', + clientName: 'exception' + }, + uberParent: 'AdlsRemoteException', + className: 'AdlsAccessControlException', + modelProperties: { + javaClassName: { + required: false, + readOnly: true, + serializedName: 'javaClassName', + type: { + name: 'String' + } + }, + message: { + required: false, + readOnly: true, + serializedName: 'message', + type: { + name: 'String' + } + }, + exception: { + required: true, + serializedName: 'exception', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AdlsAccessControlException; diff --git a/lib/services/datalake.Store/lib/filesystem/models/adlsBadOffsetException.js b/lib/services/datalake.Store/lib/filesystem/models/adlsBadOffsetException.js new file mode 100644 index 0000000000..b37a11a3bb --- /dev/null +++ b/lib/services/datalake.Store/lib/filesystem/models/adlsBadOffsetException.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'); + +/** + * A WebHDFS exception thrown indicating the append or read is from a bad + * offset. Thrown when a 400 error response code is returned for append and + * open operations (Bad request). + * + * @extends models['AdlsRemoteException'] + */ +class AdlsBadOffsetException extends models['AdlsRemoteException'] { + /** + * Create a AdlsBadOffsetException. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AdlsBadOffsetException + * + * @returns {object} metadata of AdlsBadOffsetException + * + */ + mapper() { + return { + required: false, + serializedName: 'BadOffsetException', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'exception', + clientName: 'exception' + }, + uberParent: 'AdlsRemoteException', + className: 'AdlsBadOffsetException', + modelProperties: { + javaClassName: { + required: false, + readOnly: true, + serializedName: 'javaClassName', + type: { + name: 'String' + } + }, + message: { + required: false, + readOnly: true, + serializedName: 'message', + type: { + name: 'String' + } + }, + exception: { + required: true, + serializedName: 'exception', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AdlsBadOffsetException; diff --git a/lib/services/datalake.Store/lib/filesystem/models/adlsError.js b/lib/services/datalake.Store/lib/filesystem/models/adlsError.js new file mode 100644 index 0000000000..afee6cdaca --- /dev/null +++ b/lib/services/datalake.Store/lib/filesystem/models/adlsError.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'; + +/** + * Data Lake Store filesystem error containing a specific WebHDFS exception. + * + */ +class AdlsError { + /** + * Create a AdlsError. + * @property {object} [remoteException] the object representing the actual + * WebHDFS exception being returned. + * @property {string} [remoteException.javaClassName] the full class package + * name for the exception thrown, such as + * 'java.lang.IllegalArgumentException'. + * @property {string} [remoteException.message] the message associated with + * the exception that was thrown, such as 'Invalid value for webhdfs + * parameter "permission":...'. + * @property {string} [remoteException.exception] Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of AdlsError + * + * @returns {object} metadata of AdlsError + * + */ + mapper() { + return { + required: false, + serializedName: 'AdlsError', + type: { + name: 'Composite', + className: 'AdlsError', + modelProperties: { + remoteException: { + required: false, + readOnly: true, + serializedName: 'remoteException', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'exception', + clientName: 'exception' + }, + uberParent: 'AdlsRemoteException', + className: 'AdlsRemoteException' + } + } + } + } + }; + } +} + +module.exports = AdlsError; diff --git a/lib/services/datalake.Store/lib/filesystem/models/adlsFileAlreadyExistsException.js b/lib/services/datalake.Store/lib/filesystem/models/adlsFileAlreadyExistsException.js new file mode 100644 index 0000000000..322a120690 --- /dev/null +++ b/lib/services/datalake.Store/lib/filesystem/models/adlsFileAlreadyExistsException.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'); + +/** + * A WebHDFS exception thrown indicating the file or folder already exists. + * Thrown when a 403 error response code is returned (forbidden). + * + * @extends models['AdlsRemoteException'] + */ +class AdlsFileAlreadyExistsException extends models['AdlsRemoteException'] { + /** + * Create a AdlsFileAlreadyExistsException. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AdlsFileAlreadyExistsException + * + * @returns {object} metadata of AdlsFileAlreadyExistsException + * + */ + mapper() { + return { + required: false, + serializedName: 'FileAlreadyExistsException', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'exception', + clientName: 'exception' + }, + uberParent: 'AdlsRemoteException', + className: 'AdlsFileAlreadyExistsException', + modelProperties: { + javaClassName: { + required: false, + readOnly: true, + serializedName: 'javaClassName', + type: { + name: 'String' + } + }, + message: { + required: false, + readOnly: true, + serializedName: 'message', + type: { + name: 'String' + } + }, + exception: { + required: true, + serializedName: 'exception', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AdlsFileAlreadyExistsException; diff --git a/lib/services/datalake.Store/lib/filesystem/models/adlsFileNotFoundException.js b/lib/services/datalake.Store/lib/filesystem/models/adlsFileNotFoundException.js new file mode 100644 index 0000000000..fc7dedb0b7 --- /dev/null +++ b/lib/services/datalake.Store/lib/filesystem/models/adlsFileNotFoundException.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'); + +/** + * A WebHDFS exception thrown indicating the file or folder could not be found. + * Thrown when a 404 error response code is returned (not found). + * + * @extends models['AdlsRemoteException'] + */ +class AdlsFileNotFoundException extends models['AdlsRemoteException'] { + /** + * Create a AdlsFileNotFoundException. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AdlsFileNotFoundException + * + * @returns {object} metadata of AdlsFileNotFoundException + * + */ + mapper() { + return { + required: false, + serializedName: 'FileNotFoundException', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'exception', + clientName: 'exception' + }, + uberParent: 'AdlsRemoteException', + className: 'AdlsFileNotFoundException', + modelProperties: { + javaClassName: { + required: false, + readOnly: true, + serializedName: 'javaClassName', + type: { + name: 'String' + } + }, + message: { + required: false, + readOnly: true, + serializedName: 'message', + type: { + name: 'String' + } + }, + exception: { + required: true, + serializedName: 'exception', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AdlsFileNotFoundException; diff --git a/lib/services/datalake.Store/lib/filesystem/models/adlsIOException.js b/lib/services/datalake.Store/lib/filesystem/models/adlsIOException.js new file mode 100644 index 0000000000..144d991c95 --- /dev/null +++ b/lib/services/datalake.Store/lib/filesystem/models/adlsIOException.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'); + +/** + * A WebHDFS exception thrown indicating there was an IO (read or write) error. + * Thrown when a 403 error response code is returned (forbidden). + * + * @extends models['AdlsRemoteException'] + */ +class AdlsIOException extends models['AdlsRemoteException'] { + /** + * Create a AdlsIOException. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AdlsIOException + * + * @returns {object} metadata of AdlsIOException + * + */ + mapper() { + return { + required: false, + serializedName: 'IOException', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'exception', + clientName: 'exception' + }, + uberParent: 'AdlsRemoteException', + className: 'AdlsIOException', + modelProperties: { + javaClassName: { + required: false, + readOnly: true, + serializedName: 'javaClassName', + type: { + name: 'String' + } + }, + message: { + required: false, + readOnly: true, + serializedName: 'message', + type: { + name: 'String' + } + }, + exception: { + required: true, + serializedName: 'exception', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AdlsIOException; diff --git a/lib/services/datalake.Store/lib/filesystem/models/adlsIllegalArgumentException.js b/lib/services/datalake.Store/lib/filesystem/models/adlsIllegalArgumentException.js new file mode 100644 index 0000000000..3487ead2f7 --- /dev/null +++ b/lib/services/datalake.Store/lib/filesystem/models/adlsIllegalArgumentException.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'); + +/** + * A WebHDFS exception thrown indicating that one more arguments is incorrect. + * Thrown when a 400 error response code is returned (bad request). + * + * @extends models['AdlsRemoteException'] + */ +class AdlsIllegalArgumentException extends models['AdlsRemoteException'] { + /** + * Create a AdlsIllegalArgumentException. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AdlsIllegalArgumentException + * + * @returns {object} metadata of AdlsIllegalArgumentException + * + */ + mapper() { + return { + required: false, + serializedName: 'IllegalArgumentException', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'exception', + clientName: 'exception' + }, + uberParent: 'AdlsRemoteException', + className: 'AdlsIllegalArgumentException', + modelProperties: { + javaClassName: { + required: false, + readOnly: true, + serializedName: 'javaClassName', + type: { + name: 'String' + } + }, + message: { + required: false, + readOnly: true, + serializedName: 'message', + type: { + name: 'String' + } + }, + exception: { + required: true, + serializedName: 'exception', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AdlsIllegalArgumentException; diff --git a/lib/services/datalake.Store/lib/filesystem/models/adlsRemoteException.js b/lib/services/datalake.Store/lib/filesystem/models/adlsRemoteException.js new file mode 100644 index 0000000000..63bc60d088 --- /dev/null +++ b/lib/services/datalake.Store/lib/filesystem/models/adlsRemoteException.js @@ -0,0 +1,80 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Data Lake Store filesystem exception based on the WebHDFS definition for + * RemoteExceptions. This is a WebHDFS 'catch all' exception + * + */ +class AdlsRemoteException { + /** + * Create a AdlsRemoteException. + * @property {string} [javaClassName] the full class package name for the + * exception thrown, such as 'java.lang.IllegalArgumentException'. + * @property {string} [message] the message associated with the exception + * that was thrown, such as 'Invalid value for webhdfs parameter + * "permission":...'. + * @property {string} exception Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of AdlsRemoteException + * + * @returns {object} metadata of AdlsRemoteException + * + */ + mapper() { + return { + required: false, + serializedName: 'AdlsRemoteException', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'exception', + clientName: 'exception' + }, + uberParent: 'AdlsRemoteException', + className: 'AdlsRemoteException', + modelProperties: { + javaClassName: { + required: false, + readOnly: true, + serializedName: 'javaClassName', + type: { + name: 'String' + } + }, + message: { + required: false, + readOnly: true, + serializedName: 'message', + type: { + name: 'String' + } + }, + exception: { + required: true, + serializedName: 'exception', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AdlsRemoteException; diff --git a/lib/services/datalake.Store/lib/filesystem/models/adlsRuntimeException.js b/lib/services/datalake.Store/lib/filesystem/models/adlsRuntimeException.js new file mode 100644 index 0000000000..fa925f17ec --- /dev/null +++ b/lib/services/datalake.Store/lib/filesystem/models/adlsRuntimeException.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'); + +/** + * A WebHDFS exception thrown when an unexpected error occurs during an + * operation. Thrown when a 500 error response code is returned (Internal + * server error). + * + * @extends models['AdlsRemoteException'] + */ +class AdlsRuntimeException extends models['AdlsRemoteException'] { + /** + * Create a AdlsRuntimeException. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AdlsRuntimeException + * + * @returns {object} metadata of AdlsRuntimeException + * + */ + mapper() { + return { + required: false, + serializedName: 'RuntimeException', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'exception', + clientName: 'exception' + }, + uberParent: 'AdlsRemoteException', + className: 'AdlsRuntimeException', + modelProperties: { + javaClassName: { + required: false, + readOnly: true, + serializedName: 'javaClassName', + type: { + name: 'String' + } + }, + message: { + required: false, + readOnly: true, + serializedName: 'message', + type: { + name: 'String' + } + }, + exception: { + required: true, + serializedName: 'exception', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AdlsRuntimeException; diff --git a/lib/services/datalake.Store/lib/filesystem/models/adlsSecurityException.js b/lib/services/datalake.Store/lib/filesystem/models/adlsSecurityException.js new file mode 100644 index 0000000000..7bef0f8275 --- /dev/null +++ b/lib/services/datalake.Store/lib/filesystem/models/adlsSecurityException.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'); + +/** + * A WebHDFS exception thrown indicating that access is denied. Thrown when a + * 401 error response code is returned (Unauthorized). + * + * @extends models['AdlsRemoteException'] + */ +class AdlsSecurityException extends models['AdlsRemoteException'] { + /** + * Create a AdlsSecurityException. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AdlsSecurityException + * + * @returns {object} metadata of AdlsSecurityException + * + */ + mapper() { + return { + required: false, + serializedName: 'SecurityException', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'exception', + clientName: 'exception' + }, + uberParent: 'AdlsRemoteException', + className: 'AdlsSecurityException', + modelProperties: { + javaClassName: { + required: false, + readOnly: true, + serializedName: 'javaClassName', + type: { + name: 'String' + } + }, + message: { + required: false, + readOnly: true, + serializedName: 'message', + type: { + name: 'String' + } + }, + exception: { + required: true, + serializedName: 'exception', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AdlsSecurityException; diff --git a/lib/services/datalake.Store/lib/filesystem/models/adlsThrottledException.js b/lib/services/datalake.Store/lib/filesystem/models/adlsThrottledException.js new file mode 100644 index 0000000000..f06eca6765 --- /dev/null +++ b/lib/services/datalake.Store/lib/filesystem/models/adlsThrottledException.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'); + +/** + * A WebHDFS exception thrown indicating that the request is being throttled. + * Reducing the number of requests or request size helps to mitigate this + * error. + * + * @extends models['AdlsRemoteException'] + */ +class AdlsThrottledException extends models['AdlsRemoteException'] { + /** + * Create a AdlsThrottledException. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AdlsThrottledException + * + * @returns {object} metadata of AdlsThrottledException + * + */ + mapper() { + return { + required: false, + serializedName: 'ThrottledException', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'exception', + clientName: 'exception' + }, + uberParent: 'AdlsRemoteException', + className: 'AdlsThrottledException', + modelProperties: { + javaClassName: { + required: false, + readOnly: true, + serializedName: 'javaClassName', + type: { + name: 'String' + } + }, + message: { + required: false, + readOnly: true, + serializedName: 'message', + type: { + name: 'String' + } + }, + exception: { + required: true, + serializedName: 'exception', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AdlsThrottledException; diff --git a/lib/services/datalake.Store/lib/filesystem/models/adlsUnsupportedOperationException.js b/lib/services/datalake.Store/lib/filesystem/models/adlsUnsupportedOperationException.js new file mode 100644 index 0000000000..9bedfacb32 --- /dev/null +++ b/lib/services/datalake.Store/lib/filesystem/models/adlsUnsupportedOperationException.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'); + +/** + * A WebHDFS exception thrown indicating that the requested operation is not + * supported. Thrown when a 400 error response code is returned (bad request). + * + * @extends models['AdlsRemoteException'] + */ +class AdlsUnsupportedOperationException extends models['AdlsRemoteException'] { + /** + * Create a AdlsUnsupportedOperationException. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AdlsUnsupportedOperationException + * + * @returns {object} metadata of AdlsUnsupportedOperationException + * + */ + mapper() { + return { + required: false, + serializedName: 'UnsupportedOperationException', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'exception', + clientName: 'exception' + }, + uberParent: 'AdlsRemoteException', + className: 'AdlsUnsupportedOperationException', + modelProperties: { + javaClassName: { + required: false, + readOnly: true, + serializedName: 'javaClassName', + type: { + name: 'String' + } + }, + message: { + required: false, + readOnly: true, + serializedName: 'message', + type: { + name: 'String' + } + }, + exception: { + required: true, + serializedName: 'exception', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AdlsUnsupportedOperationException; diff --git a/lib/services/datalake.Store/lib/filesystem/models/contentSummary.js b/lib/services/datalake.Store/lib/filesystem/models/contentSummary.js new file mode 100644 index 0000000000..0a28148049 --- /dev/null +++ b/lib/services/datalake.Store/lib/filesystem/models/contentSummary.js @@ -0,0 +1,80 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Data Lake Store content summary information + * + */ +class ContentSummary { + /** + * Create a ContentSummary. + * @property {number} [directoryCount] the number of directories. + * @property {number} [fileCount] the number of files. + * @property {number} [length] the number of bytes used by the content. + * @property {number} [spaceConsumed] the disk space consumed by the content. + */ + constructor() { + } + + /** + * Defines the metadata of ContentSummary + * + * @returns {object} metadata of ContentSummary + * + */ + mapper() { + return { + required: false, + serializedName: 'ContentSummary', + type: { + name: 'Composite', + className: 'ContentSummary', + modelProperties: { + directoryCount: { + required: false, + readOnly: true, + serializedName: 'directoryCount', + type: { + name: 'Number' + } + }, + fileCount: { + required: false, + readOnly: true, + serializedName: 'fileCount', + type: { + name: 'Number' + } + }, + length: { + required: false, + readOnly: true, + serializedName: 'length', + type: { + name: 'Number' + } + }, + spaceConsumed: { + required: false, + readOnly: true, + serializedName: 'spaceConsumed', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = ContentSummary; diff --git a/lib/services/datalake.Store/lib/filesystem/models/contentSummaryResult.js b/lib/services/datalake.Store/lib/filesystem/models/contentSummaryResult.js new file mode 100644 index 0000000000..33569c05d6 --- /dev/null +++ b/lib/services/datalake.Store/lib/filesystem/models/contentSummaryResult.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'; + +/** + * Data Lake Store filesystem content summary information response. + * + */ +class ContentSummaryResult { + /** + * Create a ContentSummaryResult. + * @property {object} [contentSummary] the content summary for the specified + * path + * @property {number} [contentSummary.directoryCount] the number of + * directories. + * @property {number} [contentSummary.fileCount] the number of files. + * @property {number} [contentSummary.length] the number of bytes used by the + * content. + * @property {number} [contentSummary.spaceConsumed] the disk space consumed + * by the content. + */ + constructor() { + } + + /** + * Defines the metadata of ContentSummaryResult + * + * @returns {object} metadata of ContentSummaryResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ContentSummaryResult', + type: { + name: 'Composite', + className: 'ContentSummaryResult', + modelProperties: { + contentSummary: { + required: false, + readOnly: true, + serializedName: 'contentSummary', + type: { + name: 'Composite', + className: 'ContentSummary' + } + } + } + } + }; + } +} + +module.exports = ContentSummaryResult; diff --git a/lib/services/datalake.Store/lib/filesystem/models/fileOperationResult.js b/lib/services/datalake.Store/lib/filesystem/models/fileOperationResult.js new file mode 100644 index 0000000000..adab3af571 --- /dev/null +++ b/lib/services/datalake.Store/lib/filesystem/models/fileOperationResult.js @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 result of the request or operation. + * + */ +class FileOperationResult { + /** + * Create a FileOperationResult. + * @property {boolean} [operationResult] the result of the operation or + * request. + */ + constructor() { + } + + /** + * Defines the metadata of FileOperationResult + * + * @returns {object} metadata of FileOperationResult + * + */ + mapper() { + return { + required: false, + serializedName: 'FileOperationResult', + type: { + name: 'Composite', + className: 'FileOperationResult', + modelProperties: { + operationResult: { + required: false, + readOnly: true, + serializedName: 'boolean', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = FileOperationResult; diff --git a/lib/services/datalake.Store/lib/filesystem/models/fileStatusProperties.js b/lib/services/datalake.Store/lib/filesystem/models/fileStatusProperties.js new file mode 100644 index 0000000000..73fed29d22 --- /dev/null +++ b/lib/services/datalake.Store/lib/filesystem/models/fileStatusProperties.js @@ -0,0 +1,149 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Data Lake Store file or directory information. + * + */ +class FileStatusProperties { + /** + * Create a FileStatusProperties. + * @property {number} [accessTime] the last access time as ticks since the + * epoch. + * @property {number} [blockSize] the block size for the file. + * @property {number} [expirationTime] Gets the expiration time, if any, as + * ticks since the epoch. If the value is 0 or DateTime.MaxValue there is no + * expiration. + * @property {string} [group] the group owner. + * @property {number} [length] the number of bytes in a file. + * @property {number} [modificationTime] the modification time as ticks since + * the epoch. + * @property {string} [owner] the user who is the owner. + * @property {string} [pathSuffix] the path suffix. + * @property {string} [permission] the permission represented as an string. + * @property {string} [type] the type of the path object. Possible values + * include: 'FILE', 'DIRECTORY' + * @property {boolean} [aclBit] flag to indicate if extended acls are enabled + */ + constructor() { + } + + /** + * Defines the metadata of FileStatusProperties + * + * @returns {object} metadata of FileStatusProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'FileStatusProperties', + type: { + name: 'Composite', + className: 'FileStatusProperties', + modelProperties: { + accessTime: { + required: false, + readOnly: true, + serializedName: 'accessTime', + type: { + name: 'Number' + } + }, + blockSize: { + required: false, + readOnly: true, + serializedName: 'blockSize', + type: { + name: 'Number' + } + }, + expirationTime: { + required: false, + readOnly: true, + serializedName: 'msExpirationTime', + type: { + name: 'Number' + } + }, + group: { + required: false, + readOnly: true, + serializedName: 'group', + type: { + name: 'String' + } + }, + length: { + required: false, + readOnly: true, + serializedName: 'length', + type: { + name: 'Number' + } + }, + modificationTime: { + required: false, + readOnly: true, + serializedName: 'modificationTime', + type: { + name: 'Number' + } + }, + owner: { + required: false, + readOnly: true, + serializedName: 'owner', + type: { + name: 'String' + } + }, + pathSuffix: { + required: false, + readOnly: true, + serializedName: 'pathSuffix', + type: { + name: 'String' + } + }, + permission: { + required: false, + readOnly: true, + serializedName: 'permission', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'Enum', + allowedValues: [ 'FILE', 'DIRECTORY' ] + } + }, + aclBit: { + required: false, + readOnly: true, + serializedName: 'aclBit', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = FileStatusProperties; diff --git a/lib/services/datalake.Store/lib/filesystem/models/fileStatusResult.js b/lib/services/datalake.Store/lib/filesystem/models/fileStatusResult.js new file mode 100644 index 0000000000..5940e4c7a8 --- /dev/null +++ b/lib/services/datalake.Store/lib/filesystem/models/fileStatusResult.js @@ -0,0 +1,73 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Data Lake Store filesystem file status information response. + * + */ +class FileStatusResult { + /** + * Create a FileStatusResult. + * @property {object} [fileStatus] the file status object associated with the + * specified path. + * @property {number} [fileStatus.accessTime] the last access time as ticks + * since the epoch. + * @property {number} [fileStatus.blockSize] the block size for the file. + * @property {number} [fileStatus.expirationTime] Gets the expiration time, + * if any, as ticks since the epoch. If the value is 0 or DateTime.MaxValue + * there is no expiration. + * @property {string} [fileStatus.group] the group owner. + * @property {number} [fileStatus.length] the number of bytes in a file. + * @property {number} [fileStatus.modificationTime] the modification time as + * ticks since the epoch. + * @property {string} [fileStatus.owner] the user who is the owner. + * @property {string} [fileStatus.pathSuffix] the path suffix. + * @property {string} [fileStatus.permission] the permission represented as + * an string. + * @property {string} [fileStatus.type] the type of the path object. Possible + * values include: 'FILE', 'DIRECTORY' + * @property {boolean} [fileStatus.aclBit] flag to indicate if extended acls + * are enabled + */ + constructor() { + } + + /** + * Defines the metadata of FileStatusResult + * + * @returns {object} metadata of FileStatusResult + * + */ + mapper() { + return { + required: false, + serializedName: 'FileStatusResult', + type: { + name: 'Composite', + className: 'FileStatusResult', + modelProperties: { + fileStatus: { + required: false, + readOnly: true, + serializedName: 'fileStatus', + type: { + name: 'Composite', + className: 'FileStatusProperties' + } + } + } + } + }; + } +} + +module.exports = FileStatusResult; diff --git a/lib/services/datalake.Store/lib/filesystem/models/fileStatuses.js b/lib/services/datalake.Store/lib/filesystem/models/fileStatuses.js new file mode 100644 index 0000000000..c73fa30d0b --- /dev/null +++ b/lib/services/datalake.Store/lib/filesystem/models/fileStatuses.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'; + +/** + * Data Lake Store file status list information. + * + */ +class FileStatuses { + /** + * Create a FileStatuses. + * @property {array} [fileStatus] the object containing the list of + * properties of the files. + */ + constructor() { + } + + /** + * Defines the metadata of FileStatuses + * + * @returns {object} metadata of FileStatuses + * + */ + mapper() { + return { + required: false, + serializedName: 'FileStatuses', + type: { + name: 'Composite', + className: 'FileStatuses', + modelProperties: { + fileStatus: { + required: false, + readOnly: true, + serializedName: 'fileStatus', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'FileStatusPropertiesElementType', + type: { + name: 'Composite', + className: 'FileStatusProperties' + } + } + } + } + } + } + }; + } +} + +module.exports = FileStatuses; diff --git a/lib/services/datalake.Store/lib/filesystem/models/fileStatusesResult.js b/lib/services/datalake.Store/lib/filesystem/models/fileStatusesResult.js new file mode 100644 index 0000000000..bff868c5f7 --- /dev/null +++ b/lib/services/datalake.Store/lib/filesystem/models/fileStatusesResult.js @@ -0,0 +1,57 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Data Lake Store filesystem file status list information response. + * + */ +class FileStatusesResult { + /** + * Create a FileStatusesResult. + * @property {object} [fileStatuses] the object representing the list of file + * statuses. + * @property {array} [fileStatuses.fileStatus] the object containing the list + * of properties of the files. + */ + constructor() { + } + + /** + * Defines the metadata of FileStatusesResult + * + * @returns {object} metadata of FileStatusesResult + * + */ + mapper() { + return { + required: false, + serializedName: 'FileStatusesResult', + type: { + name: 'Composite', + className: 'FileStatusesResult', + modelProperties: { + fileStatuses: { + required: false, + readOnly: true, + serializedName: 'fileStatuses', + type: { + name: 'Composite', + className: 'FileStatuses' + } + } + } + } + }; + } +} + +module.exports = FileStatusesResult; diff --git a/lib/services/datalake.Store/lib/filesystem/models/index.d.ts b/lib/services/datalake.Store/lib/filesystem/models/index.d.ts new file mode 100644 index 0000000000..2055076f20 --- /dev/null +++ b/lib/services/datalake.Store/lib/filesystem/models/index.d.ts @@ -0,0 +1,276 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { BaseResource, CloudError } from "ms-rest-azure"; +import * as moment from "moment"; + +export { + + BaseResource, + CloudError +}; + +/** + * The result of the request or operation. + */ +export interface FileOperationResult { + /** + * the result of the operation or request. + */ + readonly operationResult?: boolean; +} + +/** + * Data Lake Store file or directory Access Control List information. + */ +export interface AclStatus { + /** + * the list of ACLSpec entries on a file or directory. + */ + entries?: string[]; + /** + * the group owner, an AAD Object ID. + */ + group?: string; + /** + * the user owner, an AAD Object ID. + */ + owner?: string; + /** + * The octal representation of the unnamed user, mask and other permissions. + */ + permission?: string; + /** + * the indicator of whether the sticky bit is on or off. + */ + readonly stickyBit?: boolean; +} + +/** + * Data Lake Store file or directory Access Control List information. + */ +export interface AclStatusResult { + /** + * the AclStatus object for a given file or directory. + */ + aclStatus?: AclStatus; +} + +/** + * Data Lake Store content summary information + */ +export interface ContentSummary { + /** + * the number of directories. + */ + readonly directoryCount?: number; + /** + * the number of files. + */ + readonly fileCount?: number; + /** + * the number of bytes used by the content. + */ + readonly length?: number; + /** + * the disk space consumed by the content. + */ + readonly spaceConsumed?: number; +} + +/** + * Data Lake Store filesystem content summary information response. + */ +export interface ContentSummaryResult { + /** + * the content summary for the specified path + */ + readonly contentSummary?: ContentSummary; +} + +/** + * Data Lake Store file or directory information. + */ +export interface FileStatusProperties { + /** + * the last access time as ticks since the epoch. + */ + readonly accessTime?: number; + /** + * the block size for the file. + */ + readonly blockSize?: number; + /** + * Gets the expiration time, if any, as ticks since the epoch. If the value is 0 or + * DateTime.MaxValue there is no expiration. + */ + readonly expirationTime?: number; + /** + * the group owner. + */ + readonly group?: string; + /** + * the number of bytes in a file. + */ + readonly length?: number; + /** + * the modification time as ticks since the epoch. + */ + readonly modificationTime?: number; + /** + * the user who is the owner. + */ + readonly owner?: string; + /** + * the path suffix. + */ + readonly pathSuffix?: string; + /** + * the permission represented as an string. + */ + readonly permission?: string; + /** + * the type of the path object. Possible values include: 'FILE', 'DIRECTORY' + */ + readonly type?: string; + /** + * flag to indicate if extended acls are enabled + */ + readonly aclBit?: boolean; +} + +/** + * Data Lake Store file status list information. + */ +export interface FileStatuses { + /** + * the object containing the list of properties of the files. + */ + readonly fileStatus?: FileStatusProperties[]; +} + +/** + * Data Lake Store filesystem file status list information response. + */ +export interface FileStatusesResult { + /** + * the object representing the list of file statuses. + */ + readonly fileStatuses?: FileStatuses; +} + +/** + * Data Lake Store filesystem file status information response. + */ +export interface FileStatusResult { + /** + * the file status object associated with the specified path. + */ + readonly fileStatus?: FileStatusProperties; +} + +/** + * Data Lake Store filesystem exception based on the WebHDFS definition for RemoteExceptions. This + * is a WebHDFS 'catch all' exception + */ +export interface AdlsRemoteException { + /** + * the full class package name for the exception thrown, such as + * 'java.lang.IllegalArgumentException'. + */ + readonly javaClassName?: string; + /** + * the message associated with the exception that was thrown, such as 'Invalid value for webhdfs + * parameter "permission":...'. + */ + readonly message?: string; + /** + * Polymorphic Discriminator + */ + exception: string; +} + +/** + * A WebHDFS exception thrown indicating that one more arguments is incorrect. Thrown when a 400 + * error response code is returned (bad request). + */ +export interface AdlsIllegalArgumentException extends AdlsRemoteException { +} + +/** + * A WebHDFS exception thrown indicating that the requested operation is not supported. Thrown when + * a 400 error response code is returned (bad request). + */ +export interface AdlsUnsupportedOperationException extends AdlsRemoteException { +} + +/** + * A WebHDFS exception thrown indicating that access is denied. Thrown when a 401 error response + * code is returned (Unauthorized). + */ +export interface AdlsSecurityException extends AdlsRemoteException { +} + +/** + * A WebHDFS exception thrown indicating there was an IO (read or write) error. Thrown when a 403 + * error response code is returned (forbidden). + */ +export interface AdlsIOException extends AdlsRemoteException { +} + +/** + * A WebHDFS exception thrown indicating the file or folder could not be found. Thrown when a 404 + * error response code is returned (not found). + */ +export interface AdlsFileNotFoundException extends AdlsRemoteException { +} + +/** + * A WebHDFS exception thrown indicating the file or folder already exists. Thrown when a 403 error + * response code is returned (forbidden). + */ +export interface AdlsFileAlreadyExistsException extends AdlsRemoteException { +} + +/** + * A WebHDFS exception thrown indicating the append or read is from a bad offset. Thrown when a 400 + * error response code is returned for append and open operations (Bad request). + */ +export interface AdlsBadOffsetException extends AdlsRemoteException { +} + +/** + * A WebHDFS exception thrown when an unexpected error occurs during an operation. Thrown when a + * 500 error response code is returned (Internal server error). + */ +export interface AdlsRuntimeException extends AdlsRemoteException { +} + +/** + * A WebHDFS exception thrown indicating that access is denied due to insufficient permissions. + * Thrown when a 403 error response code is returned (forbidden). + */ +export interface AdlsAccessControlException extends AdlsRemoteException { +} + +/** + * A WebHDFS exception thrown indicating that the request is being throttled. Reducing the number + * of requests or request size helps to mitigate this error. + */ +export interface AdlsThrottledException extends AdlsRemoteException { +} + +/** + * Data Lake Store filesystem error containing a specific WebHDFS exception. + */ +export interface AdlsError { + /** + * the object representing the actual WebHDFS exception being returned. + */ + readonly remoteException?: AdlsRemoteException; +} diff --git a/lib/services/datalake.Store/lib/filesystem/models/index.js b/lib/services/datalake.Store/lib/filesystem/models/index.js new file mode 100644 index 0000000000..010fcdf236 --- /dev/null +++ b/lib/services/datalake.Store/lib/filesystem/models/index.js @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * 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.FileOperationResult = require('./fileOperationResult'); +exports.AclStatus = require('./aclStatus'); +exports.AclStatusResult = require('./aclStatusResult'); +exports.ContentSummary = require('./contentSummary'); +exports.ContentSummaryResult = require('./contentSummaryResult'); +exports.FileStatusProperties = require('./fileStatusProperties'); +exports.FileStatuses = require('./fileStatuses'); +exports.FileStatusesResult = require('./fileStatusesResult'); +exports.FileStatusResult = require('./fileStatusResult'); +exports.AdlsRemoteException = require('./adlsRemoteException'); +exports.AdlsIllegalArgumentException = require('./adlsIllegalArgumentException'); +exports.AdlsUnsupportedOperationException = require('./adlsUnsupportedOperationException'); +exports.AdlsSecurityException = require('./adlsSecurityException'); +exports.AdlsIOException = require('./adlsIOException'); +exports.AdlsFileNotFoundException = require('./adlsFileNotFoundException'); +exports.AdlsFileAlreadyExistsException = require('./adlsFileAlreadyExistsException'); +exports.AdlsBadOffsetException = require('./adlsBadOffsetException'); +exports.AdlsRuntimeException = require('./adlsRuntimeException'); +exports.AdlsAccessControlException = require('./adlsAccessControlException'); +exports.AdlsThrottledException = require('./adlsThrottledException'); +exports.AdlsError = require('./adlsError'); +exports.discriminators = { + 'AdlsRemoteException.IllegalArgumentException' : exports.AdlsIllegalArgumentException, + 'AdlsRemoteException.UnsupportedOperationException' : exports.AdlsUnsupportedOperationException, + 'AdlsRemoteException.SecurityException' : exports.AdlsSecurityException, + 'AdlsRemoteException.IOException' : exports.AdlsIOException, + 'AdlsRemoteException.FileNotFoundException' : exports.AdlsFileNotFoundException, + 'AdlsRemoteException.FileAlreadyExistsException' : exports.AdlsFileAlreadyExistsException, + 'AdlsRemoteException.BadOffsetException' : exports.AdlsBadOffsetException, + 'AdlsRemoteException.RuntimeException' : exports.AdlsRuntimeException, + 'AdlsRemoteException.AccessControlException' : exports.AdlsAccessControlException, + 'AdlsRemoteException.ThrottledException' : exports.AdlsThrottledException, + 'AdlsRemoteException' : exports.AdlsRemoteException +}; diff --git a/lib/services/datalake.Store/lib/filesystem/operations/fileSystem.js b/lib/services/datalake.Store/lib/filesystem/operations/fileSystem.js new file mode 100644 index 0000000000..2d288d3dc7 --- /dev/null +++ b/lib/services/datalake.Store/lib/filesystem/operations/fileSystem.js @@ -0,0 +1,5855 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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; + +/** + * Sets or removes the expiration time on the specified file. This operation + * can only be executed against files. Folders are not supported. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file on which to set or remove the expiration time. + * + * @param {string} expiryOption Indicates the type of expiration to use for the + * file: 1. NeverExpire: ExpireTime is ignored. 2. RelativeToNow: ExpireTime is + * an integer in milliseconds representing the expiration date relative to when + * file expiration is updated. 3. RelativeToCreationDate: ExpireTime is an + * integer in milliseconds representing the expiration date relative to file + * creation. 4. Absolute: ExpireTime is an integer in milliseconds, as a Unix + * timestamp relative to 1/1/1970 00:00:00. Possible values include: + * 'NeverExpire', 'RelativeToNow', 'RelativeToCreationDate', 'Absolute' + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.expireTime] The time that the file will expire, + * corresponding to the ExpiryOption that was set. + * + * @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 _setFileExpiry(accountName, path, expiryOption, 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 expireTime = (options && options.expireTime !== undefined) ? options.expireTime : undefined; + let op = 'SETEXPIRY'; + // Validate + try { + if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { + throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); + } + if (path === null || path === undefined || typeof path.valueOf() !== 'string') { + throw new Error('path cannot be null or undefined and it must be of type string.'); + } + if (expiryOption) { + let allowedValues = [ 'NeverExpire', 'RelativeToNow', 'RelativeToCreationDate', 'Absolute' ]; + if (!allowedValues.some( function(item) { return item === expiryOption; })) { + throw new Error(expiryOption + ' is not a valid value. The valid values are: ' + allowedValues); + } + } else { + throw new Error('expiryOption cannot be null or undefined.'); + } + if (expireTime !== null && expireTime !== undefined && typeof expireTime !== 'number') { + throw new Error('expireTime must be of type number.'); + } + 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('/') ? '' : '/') + 'WebHdfsExt/{path}'; + requestUrl = requestUrl.replace('{accountName}', accountName); + requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); + requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); + let queryParameters = []; + queryParameters.push('expiryOption=' + encodeURIComponent(expiryOption)); + if (expireTime !== null && expireTime !== undefined) { + queryParameters.push('expireTime=' + encodeURIComponent(expireTime.toString())); + } + queryParameters.push('op=' + encodeURIComponent(op)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['AdlsError']().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); + }); +} + +/** + * Appends to the specified file, optionally first creating the file if it does + * not yet exist. This method supports multiple concurrent appends to the file. + * NOTE: The target must not contain data added by Create or normal (serial) + * Append. ConcurrentAppend and Append cannot be used interchangeably; once a + * target file has been modified using either of these append options, the + * other append option cannot be used on the target file. ConcurrentAppend does + * not guarantee order and can result in duplicated data landing in the target + * file. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file to which to append using concurrent append. + * + * @param {object} streamContents The file contents to include when appending + * to the file. The maximum content size is 4MB. For content larger than 4MB + * you must append the content in 4MB chunks. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.appendMode] Indicates the concurrent append call + * should create the file if it doesn't exist or just open the existing file + * for append. Possible values include: 'autocreate' + * + * @param {string} [options.syncFlag] Optionally indicates what to do after + * completion of the concurrent append. DATA indicates that more data will be + * sent immediately by the client, the file handle should remain open/locked, + * and file metadata (including file length, last modified time) should NOT get + * updated. METADATA indicates that more data will be sent immediately by the + * client, the file handle should remain open/locked, and file metadata should + * get updated. CLOSE indicates that the client is done sending data, the file + * handle should be closed/unlocked, and file metadata should get updated. + * Possible values include: 'DATA', 'METADATA', 'CLOSE' + * + * @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 _concurrentAppend(accountName, path, streamContents, 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 appendMode = (options && options.appendMode !== undefined) ? options.appendMode : undefined; + let syncFlag = (options && options.syncFlag !== undefined) ? options.syncFlag : 'DATA'; + let op = 'CONCURRENTAPPEND'; + let transferEncoding = 'chunked'; + // Validate + try { + if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { + throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); + } + if (path === null || path === undefined || typeof path.valueOf() !== 'string') { + throw new Error('path cannot be null or undefined and it must be of type string.'); + } + if (streamContents === null || streamContents === undefined) { + throw new Error('streamContents cannot be null or undefined and it must be of type object.'); + } + if (appendMode) { + let allowedValues = [ 'autocreate' ]; + if (!allowedValues.some( function(item) { return item === appendMode; })) { + throw new Error(appendMode + ' is not a valid value. The valid values are: ' + allowedValues); + } + } + if (syncFlag) { + let allowedValues1 = [ 'DATA', 'METADATA', 'CLOSE' ]; + if (!allowedValues1.some( function(item) { return item === syncFlag; })) { + throw new Error(syncFlag + ' is not a valid value. The valid values are: ' + allowedValues1); + } + } + 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('/') ? '' : '/') + 'WebHdfsExt/{path}'; + requestUrl = requestUrl.replace('{accountName}', accountName); + requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); + requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); + let queryParameters = []; + if (appendMode !== null && appendMode !== undefined) { + queryParameters.push('appendMode=' + encodeURIComponent(appendMode)); + } + queryParameters.push('op=' + encodeURIComponent(op)); + if (syncFlag !== null && syncFlag !== undefined) { + queryParameters.push('syncFlag=' + encodeURIComponent(syncFlag)); + } + 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/octet-stream'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (transferEncoding !== undefined && transferEncoding !== null) { + httpRequest.headers['Transfer-Encoding'] = transferEncoding; + } + 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 = streamContents; + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['AdlsError']().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); + }); +} + +/** + * Checks if the specified access is available at the given path. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory for which to check access. + * + * @param {string} fsaction File system operation read/write/execute in string + * form, matching regex pattern '[rwx-]{3}' + * + * @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 _checkAccess(accountName, path, fsaction, 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 op = 'CHECKACCESS'; + // Validate + try { + if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { + throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); + } + if (path === null || path === undefined || typeof path.valueOf() !== 'string') { + throw new Error('path cannot be null or undefined and it must be of type string.'); + } + if (fsaction === null || fsaction === undefined || typeof fsaction.valueOf() !== 'string') { + throw new Error('fsaction 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 (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('/') ? '' : '/') + 'webhdfs/v1/{path}'; + requestUrl = requestUrl.replace('{accountName}', accountName); + requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); + requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); + let queryParameters = []; + queryParameters.push('fsaction=' + encodeURIComponent(fsaction)); + queryParameters.push('op=' + encodeURIComponent(op)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['AdlsError']().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 directory. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * directory to create. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.permission] Optional octal permission with which + * the directory should be created. + * + * @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 FileOperationResult} 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 _mkdirs(accountName, path, 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 permission = (options && options.permission !== undefined) ? options.permission : undefined; + let op = 'MKDIRS'; + // Validate + try { + if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { + throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); + } + if (path === null || path === undefined || typeof path.valueOf() !== 'string') { + throw new Error('path cannot be null or undefined and it must be of type string.'); + } + if (permission !== null && permission !== undefined && typeof permission !== 'number') { + throw new Error('permission must be of type number.'); + } + 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('/') ? '' : '/') + 'webhdfs/v1/{path}'; + requestUrl = requestUrl.replace('{accountName}', accountName); + requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); + requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); + let queryParameters = []; + if (permission !== null && permission !== undefined) { + queryParameters.push('permission=' + encodeURIComponent(permission.toString())); + } + queryParameters.push('op=' + encodeURIComponent(op)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['AdlsError']().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['FileOperationResult']().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); + }); +} + +/** + * Concatenates the list of source files into the destination file, removing + * all source files upon success. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * destination file resulting from the concatenation. + * + * @param {array} sources A list of comma separated Data Lake Store paths + * (starting with '/') of the files to concatenate, in the order in which they + * should be concatenated. + * + * @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 _concat(accountName, path, sources, 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 op = 'CONCAT'; + // Validate + try { + if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { + throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); + } + if (path === null || path === undefined || typeof path.valueOf() !== 'string') { + throw new Error('path cannot be null or undefined and it must be of type string.'); + } + if (!Array.isArray(sources)) { + throw new Error('sources cannot be null or undefined and it must be of type array.'); + } + for (let i = 0; i < sources.length; i++) { + if (sources[i] !== null && sources[i] !== undefined && typeof sources[i].valueOf() !== 'string') { + throw new Error('sources[i] 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 (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('/') ? '' : '/') + 'webhdfs/v1/{path}'; + requestUrl = requestUrl.replace('{accountName}', accountName); + requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); + requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); + let queryParameters = []; + queryParameters.push('sources=' + encodeURIComponent(sources.join(','))); + queryParameters.push('op=' + encodeURIComponent(op)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['AdlsError']().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); + }); +} + +/** + * Concatenates the list of source files into the destination file, deleting + * all source files upon success. This method accepts more source file paths + * than the Concat method. This method and the parameters it accepts are + * subject to change for usability in an upcoming version. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * destination file resulting from the concatenation. + * + * @param {object} streamContents A list of Data Lake Store paths (starting + * with '/') of the source files. Must be a comma-separated path list in the + * format: sources=/file/path/1.txt,/file/path/2.txt,/file/path/lastfile.csv + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.deleteSourceDirectory] Indicates that as an + * optimization instead of deleting each individual source stream, delete the + * source stream folder if all streams are in the same folder instead. This + * results in a substantial performance improvement when the only streams in + * the folder are part of the concatenation operation. WARNING: This includes + * the deletion of any other files that are not source files. Only set this to + * true when source files are the only files in the source directory. + * + * @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 _msConcat(accountName, path, streamContents, 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 deleteSourceDirectory = (options && options.deleteSourceDirectory !== undefined) ? options.deleteSourceDirectory : undefined; + let op = 'MSCONCAT'; + // Validate + try { + if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { + throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); + } + if (path === null || path === undefined || typeof path.valueOf() !== 'string') { + throw new Error('path cannot be null or undefined and it must be of type string.'); + } + if (deleteSourceDirectory !== null && deleteSourceDirectory !== undefined && typeof deleteSourceDirectory !== 'boolean') { + throw new Error('deleteSourceDirectory must be of type boolean.'); + } + if (streamContents === null || streamContents === undefined) { + throw new Error('streamContents cannot be null or undefined and it must be of type object.'); + } + 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('/') ? '' : '/') + 'webhdfs/v1/{path}'; + requestUrl = requestUrl.replace('{accountName}', accountName); + requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); + requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); + let queryParameters = []; + if (deleteSourceDirectory !== null && deleteSourceDirectory !== undefined) { + queryParameters.push('deleteSourceDirectory=' + encodeURIComponent(deleteSourceDirectory.toString())); + } + queryParameters.push('op=' + encodeURIComponent(op)); + 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/octet-stream'; + 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 = streamContents; + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['AdlsError']().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); + }); +} + +/** + * Get the list of file status objects specified by the file path, with + * optional pagination parameters + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * directory to list. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.listSize] Gets or sets the number of items to + * return. Optional. + * + * @param {string} [options.listAfter] Gets or sets the item or lexographical + * index after which to begin returning results. For example, a file list of + * 'a','b','d' and listAfter='b' will return 'd', and a listAfter='c' will also + * return 'd'. Optional. + * + * @param {string} [options.listBefore] Gets or sets the item or lexographical + * index before which to begin returning results. For example, a file list of + * 'a','b','d' and listBefore='d' will return 'a','b', and a listBefore='c' + * will also return 'a','b'. Optional. + * + * @param {boolean} [options.tooId] An optional switch to return friendly names + * in place of owner and group. tooid=false returns friendly names instead of + * the AAD Object ID. Default value is true, returning AAD object IDs. + * + * @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 FileStatusesResult} 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 _listFileStatus(accountName, path, 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 listSize = (options && options.listSize !== undefined) ? options.listSize : undefined; + let listAfter = (options && options.listAfter !== undefined) ? options.listAfter : undefined; + let listBefore = (options && options.listBefore !== undefined) ? options.listBefore : undefined; + let tooId = (options && options.tooId !== undefined) ? options.tooId : undefined; + let op = 'LISTSTATUS'; + // Validate + try { + if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { + throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); + } + if (path === null || path === undefined || typeof path.valueOf() !== 'string') { + throw new Error('path cannot be null or undefined and it must be of type string.'); + } + if (listSize !== null && listSize !== undefined && typeof listSize !== 'number') { + throw new Error('listSize must be of type number.'); + } + if (listAfter !== null && listAfter !== undefined && typeof listAfter.valueOf() !== 'string') { + throw new Error('listAfter must be of type string.'); + } + if (listBefore !== null && listBefore !== undefined && typeof listBefore.valueOf() !== 'string') { + throw new Error('listBefore must be of type string.'); + } + if (tooId !== null && tooId !== undefined && typeof tooId !== 'boolean') { + throw new Error('tooId must be of type boolean.'); + } + 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('/') ? '' : '/') + 'webhdfs/v1/{path}'; + requestUrl = requestUrl.replace('{accountName}', accountName); + requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); + requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); + let queryParameters = []; + if (listSize !== null && listSize !== undefined) { + queryParameters.push('listSize=' + encodeURIComponent(listSize.toString())); + } + if (listAfter !== null && listAfter !== undefined) { + queryParameters.push('listAfter=' + encodeURIComponent(listAfter)); + } + if (listBefore !== null && listBefore !== undefined) { + queryParameters.push('listBefore=' + encodeURIComponent(listBefore)); + } + if (tooId !== null && tooId !== undefined) { + queryParameters.push('tooId=' + encodeURIComponent(tooId.toString())); + } + queryParameters.push('op=' + encodeURIComponent(op)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['AdlsError']().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['FileStatusesResult']().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 the file content summary object specified by the file path. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file for which to retrieve the summary. + * + * @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 ContentSummaryResult} 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 _getContentSummary(accountName, path, 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 op = 'GETCONTENTSUMMARY'; + // Validate + try { + if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { + throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); + } + if (path === null || path === undefined || typeof path.valueOf() !== 'string') { + throw new Error('path 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 (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('/') ? '' : '/') + 'webhdfs/v1/{path}'; + requestUrl = requestUrl.replace('{accountName}', accountName); + requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); + requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); + let queryParameters = []; + queryParameters.push('op=' + encodeURIComponent(op)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['AdlsError']().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['ContentSummaryResult']().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 the file status object specified by the file path. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory for which to retrieve the status. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.tooId] An optional switch to return friendly names + * in place of owner and group. tooid=false returns friendly names instead of + * the AAD Object ID. Default value is true, returning AAD object IDs. + * + * @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 FileStatusResult} 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 _getFileStatus(accountName, path, 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 tooId = (options && options.tooId !== undefined) ? options.tooId : undefined; + let op = 'GETFILESTATUS'; + // Validate + try { + if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { + throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); + } + if (path === null || path === undefined || typeof path.valueOf() !== 'string') { + throw new Error('path cannot be null or undefined and it must be of type string.'); + } + if (tooId !== null && tooId !== undefined && typeof tooId !== 'boolean') { + throw new Error('tooId must be of type boolean.'); + } + 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('/') ? '' : '/') + 'webhdfs/v1/{path}'; + requestUrl = requestUrl.replace('{accountName}', accountName); + requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); + requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); + let queryParameters = []; + if (tooId !== null && tooId !== undefined) { + queryParameters.push('tooId=' + encodeURIComponent(tooId.toString())); + } + queryParameters.push('op=' + encodeURIComponent(op)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['AdlsError']().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['FileStatusResult']().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); + }); +} + +/** + * Opens and reads from the specified file. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file to open. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.length] The number of bytes that the server will + * attempt to retrieve. It will retrieve <= length bytes. + * + * @param {number} [options.offset] The byte offset to start reading data from. + * + * @param {uuid} [options.fileSessionId] Optional unique GUID per file + * indicating all the reads with the same fileSessionId are from the same + * client and same session. This will give a performance benefit. + * + * @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. + * + * {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 _open(accountName, path, 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 length = (options && options.length !== undefined) ? options.length : undefined; + let offset = (options && options.offset !== undefined) ? options.offset : undefined; + let fileSessionId = (options && options.fileSessionId !== undefined) ? options.fileSessionId : undefined; + let read = 'true'; + let op = 'OPEN'; + // Validate + try { + if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { + throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); + } + if (path === null || path === undefined || typeof path.valueOf() !== 'string') { + throw new Error('path cannot be null or undefined and it must be of type string.'); + } + if (length !== null && length !== undefined && typeof length !== 'number') { + throw new Error('length must be of type number.'); + } + if (offset !== null && offset !== undefined && typeof offset !== 'number') { + throw new Error('offset must be of type number.'); + } + if (fileSessionId !== null && fileSessionId !== undefined && !(typeof fileSessionId.valueOf() === 'string' && msRest.isValidUuid(fileSessionId))) { + throw new Error('fileSessionId must be of type string and must be a valid uuid.'); + } + 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('/') ? '' : '/') + 'webhdfs/v1/{path}'; + requestUrl = requestUrl.replace('{accountName}', accountName); + requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); + requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); + let queryParameters = []; + if (length !== null && length !== undefined) { + queryParameters.push('length=' + encodeURIComponent(length.toString())); + } + if (offset !== null && offset !== undefined) { + queryParameters.push('offset=' + encodeURIComponent(offset.toString())); + } + if (fileSessionId !== null && fileSessionId !== undefined) { + queryParameters.push('fileSessionId=' + encodeURIComponent(fileSessionId.toString())); + } + queryParameters.push('read=' + encodeURIComponent(read)); + queryParameters.push('op=' + encodeURIComponent(op)); + 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 + httpRequest.streamedResponse = true; + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(`Unexpected status code: ${statusCode}`); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + if (responseBody !== undefined) 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 = response; + return callback(null, result, httpRequest, response); + }); +} + +/** + * Used for serial appends to the specified file. NOTE: The target must not + * contain data added by ConcurrentAppend. ConcurrentAppend and Append cannot + * be used interchangeably; once a target file has been modified using either + * of these append options, the other append option cannot be used on the + * target file. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file to which to append. + * + * @param {object} streamContents The file contents to include when appending + * to the file. The maximum content size is 4MB. For content larger than 4MB + * you must append the content in 4MB chunks. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.offset] The optional offset in the stream to begin + * the append operation. Default is to append at the end of the stream. + * + * @param {string} [options.syncFlag] Optionally indicates what to do after + * completion of the concurrent append. DATA indicates that more data will be + * sent immediately by the client, the file handle should remain open/locked, + * and file metadata (including file length, last modified time) should NOT get + * updated. METADATA indicates that more data will be sent immediately by the + * client, the file handle should remain open/locked, and file metadata should + * get updated. CLOSE indicates that the client is done sending data, the file + * handle should be closed/unlocked, and file metadata should get updated. + * Possible values include: 'DATA', 'METADATA', 'CLOSE' + * + * @param {uuid} [options.leaseId] Optional unique GUID per file to ensure + * single writer semantics, meaning that only clients that append to the file + * with the same leaseId will be allowed to do so. + * + * @param {uuid} [options.fileSessionId] Optional unique GUID per file + * indicating all the appends with the same fileSessionId are from the same + * client and same session. This will give a performance benefit when syncFlag + * is DATA or METADATA. + * + * @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 _append(accountName, path, streamContents, 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 offset = (options && options.offset !== undefined) ? options.offset : undefined; + let syncFlag = (options && options.syncFlag !== undefined) ? options.syncFlag : 'CLOSE'; + let leaseId = (options && options.leaseId !== undefined) ? options.leaseId : undefined; + let fileSessionId = (options && options.fileSessionId !== undefined) ? options.fileSessionId : undefined; + let appendParameter = 'true'; + let op = 'APPEND'; + // Validate + try { + if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { + throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); + } + if (path === null || path === undefined || typeof path.valueOf() !== 'string') { + throw new Error('path cannot be null or undefined and it must be of type string.'); + } + if (streamContents === null || streamContents === undefined) { + throw new Error('streamContents cannot be null or undefined and it must be of type object.'); + } + if (offset !== null && offset !== undefined && typeof offset !== 'number') { + throw new Error('offset must be of type number.'); + } + if (syncFlag) { + let allowedValues = [ 'DATA', 'METADATA', 'CLOSE' ]; + if (!allowedValues.some( function(item) { return item === syncFlag; })) { + throw new Error(syncFlag + ' is not a valid value. The valid values are: ' + allowedValues); + } + } + if (leaseId !== null && leaseId !== undefined && !(typeof leaseId.valueOf() === 'string' && msRest.isValidUuid(leaseId))) { + throw new Error('leaseId must be of type string and must be a valid uuid.'); + } + if (fileSessionId !== null && fileSessionId !== undefined && !(typeof fileSessionId.valueOf() === 'string' && msRest.isValidUuid(fileSessionId))) { + throw new Error('fileSessionId must be of type string and must be a valid uuid.'); + } + 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('/') ? '' : '/') + 'webhdfs/v1/{path}'; + requestUrl = requestUrl.replace('{accountName}', accountName); + requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); + requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); + let queryParameters = []; + if (offset !== null && offset !== undefined) { + queryParameters.push('offset=' + encodeURIComponent(offset.toString())); + } + if (syncFlag !== null && syncFlag !== undefined) { + queryParameters.push('syncFlag=' + encodeURIComponent(syncFlag)); + } + if (leaseId !== null && leaseId !== undefined) { + queryParameters.push('leaseId=' + encodeURIComponent(leaseId.toString())); + } + if (fileSessionId !== null && fileSessionId !== undefined) { + queryParameters.push('fileSessionId=' + encodeURIComponent(fileSessionId.toString())); + } + queryParameters.push('append=' + encodeURIComponent(appendParameter)); + queryParameters.push('op=' + encodeURIComponent(op)); + 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/octet-stream'; + 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 = streamContents; + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['AdlsError']().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 file with optionally specified content. NOTE: If content is + * provided, the resulting file cannot be modified using ConcurrentAppend. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file to create. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.streamContents] The file contents to include when + * creating the file. This parameter is optional, resulting in an empty file if + * not specified. The maximum content size is 4MB. For content larger than + * 4MB you must append the content in 4MB chunks. + * + * @param {boolean} [options.overwrite] The indication of if the file should be + * overwritten. + * + * @param {string} [options.syncFlag] Optionally indicates what to do after + * completion of the create. DATA indicates that more data will be sent + * immediately by the client, the file handle should remain open/locked, and + * file metadata (including file length, last modified time) should NOT get + * updated. METADATA indicates that more data will be sent immediately by the + * client, the file handle should remain open/locked, and file metadata should + * get updated. CLOSE indicates that the client is done sending data, the file + * handle should be closed/unlocked, and file metadata should get updated. + * Possible values include: 'DATA', 'METADATA', 'CLOSE' + * + * @param {uuid} [options.leaseId] Optional unique GUID per file to ensure + * single writer semantics, meaning that only clients that append to the file + * with the same leaseId will be allowed to do so. + * + * @param {number} [options.permission] The octal representation of the unnamed + * user, mask and other permissions that should be set for the file when + * created. If not specified, it inherits these from the container. + * + * @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 _create(accountName, path, 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 streamContents = (options && options.streamContents !== undefined) ? options.streamContents : undefined; + let overwrite = (options && options.overwrite !== undefined) ? options.overwrite : undefined; + let syncFlag = (options && options.syncFlag !== undefined) ? options.syncFlag : 'CLOSE'; + let leaseId = (options && options.leaseId !== undefined) ? options.leaseId : undefined; + let permission = (options && options.permission !== undefined) ? options.permission : undefined; + let write = 'true'; + let op = 'CREATE'; + // Validate + try { + if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { + throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); + } + if (path === null || path === undefined || typeof path.valueOf() !== 'string') { + throw new Error('path cannot be null or undefined and it must be of type string.'); + } + if (streamContents !== null && streamContents !== undefined && typeof streamContents.valueOf() !== 'object') { + throw new Error('streamContents must be of type object.'); + } + if (overwrite !== null && overwrite !== undefined && typeof overwrite !== 'boolean') { + throw new Error('overwrite must be of type boolean.'); + } + if (syncFlag) { + let allowedValues = [ 'DATA', 'METADATA', 'CLOSE' ]; + if (!allowedValues.some( function(item) { return item === syncFlag; })) { + throw new Error(syncFlag + ' is not a valid value. The valid values are: ' + allowedValues); + } + } + if (leaseId !== null && leaseId !== undefined && !(typeof leaseId.valueOf() === 'string' && msRest.isValidUuid(leaseId))) { + throw new Error('leaseId must be of type string and must be a valid uuid.'); + } + if (permission !== null && permission !== undefined && typeof permission !== 'number') { + throw new Error('permission must be of type number.'); + } + 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('/') ? '' : '/') + 'webhdfs/v1/{path}'; + requestUrl = requestUrl.replace('{accountName}', accountName); + requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); + requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); + let queryParameters = []; + if (overwrite !== null && overwrite !== undefined) { + queryParameters.push('overwrite=' + encodeURIComponent(overwrite.toString())); + } + if (syncFlag !== null && syncFlag !== undefined) { + queryParameters.push('syncFlag=' + encodeURIComponent(syncFlag)); + } + if (leaseId !== null && leaseId !== undefined) { + queryParameters.push('leaseId=' + encodeURIComponent(leaseId.toString())); + } + if (permission !== null && permission !== undefined) { + queryParameters.push('permission=' + encodeURIComponent(permission.toString())); + } + queryParameters.push('write=' + encodeURIComponent(write)); + queryParameters.push('op=' + encodeURIComponent(op)); + 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/octet-stream'; + 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 = streamContents; + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 201) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['AdlsError']().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); + }); +} + +/** + * Sets the Access Control List (ACL) for a file or folder. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory on which to set the ACL. + * + * @param {string} aclspec The ACL spec included in ACL creation operations in + * the format '[default:]user|group|other::r|-w|-x|-' + * + * @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 _setAcl(accountName, path, aclspec, 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 op = 'SETACL'; + // Validate + try { + if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { + throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); + } + if (path === null || path === undefined || typeof path.valueOf() !== 'string') { + throw new Error('path cannot be null or undefined and it must be of type string.'); + } + if (aclspec === null || aclspec === undefined || typeof aclspec.valueOf() !== 'string') { + throw new Error('aclspec 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 (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('/') ? '' : '/') + 'webhdfs/v1/{path}'; + requestUrl = requestUrl.replace('{accountName}', accountName); + requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); + requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); + let queryParameters = []; + queryParameters.push('aclspec=' + encodeURIComponent(aclspec)); + queryParameters.push('op=' + encodeURIComponent(op)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['AdlsError']().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); + }); +} + +/** + * Modifies existing Access Control List (ACL) entries on a file or folder. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory with the ACL being modified. + * + * @param {string} aclspec The ACL specification included in ACL modification + * operations in the format '[default:]user|group|other::r|-w|-x|-' + * + * @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 _modifyAclEntries(accountName, path, aclspec, 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 op = 'MODIFYACLENTRIES'; + // Validate + try { + if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { + throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); + } + if (path === null || path === undefined || typeof path.valueOf() !== 'string') { + throw new Error('path cannot be null or undefined and it must be of type string.'); + } + if (aclspec === null || aclspec === undefined || typeof aclspec.valueOf() !== 'string') { + throw new Error('aclspec 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 (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('/') ? '' : '/') + 'webhdfs/v1/{path}'; + requestUrl = requestUrl.replace('{accountName}', accountName); + requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); + requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); + let queryParameters = []; + queryParameters.push('aclspec=' + encodeURIComponent(aclspec)); + queryParameters.push('op=' + encodeURIComponent(op)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['AdlsError']().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); + }); +} + +/** + * Removes existing Access Control List (ACL) entries for a file or folder. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory with the ACL being removed. + * + * @param {string} aclspec The ACL spec included in ACL removal operations in + * the format '[default:]user|group|other' + * + * @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 _removeAclEntries(accountName, path, aclspec, 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 op = 'REMOVEACLENTRIES'; + // Validate + try { + if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { + throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); + } + if (path === null || path === undefined || typeof path.valueOf() !== 'string') { + throw new Error('path cannot be null or undefined and it must be of type string.'); + } + if (aclspec === null || aclspec === undefined || typeof aclspec.valueOf() !== 'string') { + throw new Error('aclspec 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 (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('/') ? '' : '/') + 'webhdfs/v1/{path}'; + requestUrl = requestUrl.replace('{accountName}', accountName); + requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); + requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); + let queryParameters = []; + queryParameters.push('aclspec=' + encodeURIComponent(aclspec)); + queryParameters.push('op=' + encodeURIComponent(op)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['AdlsError']().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); + }); +} + +/** + * Removes the existing Default Access Control List (ACL) of the specified + * directory. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * directory with the default ACL being removed. + * + * @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 _removeDefaultAcl(accountName, path, 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 op = 'REMOVEDEFAULTACL'; + // Validate + try { + if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { + throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); + } + if (path === null || path === undefined || typeof path.valueOf() !== 'string') { + throw new Error('path 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 (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('/') ? '' : '/') + 'webhdfs/v1/{path}'; + requestUrl = requestUrl.replace('{accountName}', accountName); + requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); + requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); + let queryParameters = []; + queryParameters.push('op=' + encodeURIComponent(op)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['AdlsError']().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); + }); +} + +/** + * Removes the existing Access Control List (ACL) of the specified file or + * directory. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory with the ACL being removed. + * + * @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 _removeAcl(accountName, path, 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 op = 'REMOVEACL'; + // Validate + try { + if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { + throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); + } + if (path === null || path === undefined || typeof path.valueOf() !== 'string') { + throw new Error('path 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 (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('/') ? '' : '/') + 'webhdfs/v1/{path}'; + requestUrl = requestUrl.replace('{accountName}', accountName); + requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); + requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); + let queryParameters = []; + queryParameters.push('op=' + encodeURIComponent(op)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['AdlsError']().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); + }); +} + +/** + * Gets Access Control List (ACL) entries for the specified file or directory. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory for which to get the ACL. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.tooId] An optional switch to return friendly names + * in place of object ID for ACL entries. tooid=false returns friendly names + * instead of the AAD Object ID. Default value is true, returning AAD object + * IDs. + * + * @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 AclStatusResult} 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 _getAclStatus(accountName, path, 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 tooId = (options && options.tooId !== undefined) ? options.tooId : undefined; + let op = 'GETACLSTATUS'; + // Validate + try { + if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { + throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); + } + if (path === null || path === undefined || typeof path.valueOf() !== 'string') { + throw new Error('path cannot be null or undefined and it must be of type string.'); + } + if (tooId !== null && tooId !== undefined && typeof tooId !== 'boolean') { + throw new Error('tooId must be of type boolean.'); + } + 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('/') ? '' : '/') + 'webhdfs/v1/{path}'; + requestUrl = requestUrl.replace('{accountName}', accountName); + requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); + requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); + let queryParameters = []; + if (tooId !== null && tooId !== undefined) { + queryParameters.push('tooId=' + encodeURIComponent(tooId.toString())); + } + queryParameters.push('op=' + encodeURIComponent(op)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['AdlsError']().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['AclStatusResult']().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 the requested file or directory, optionally recursively. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory to delete. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.recursive] The optional switch indicating if the + * delete should be recursive + * + * @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 FileOperationResult} 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 _deleteMethod(accountName, path, 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 recursive = (options && options.recursive !== undefined) ? options.recursive : undefined; + let op = 'DELETE'; + // Validate + try { + if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { + throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); + } + if (path === null || path === undefined || typeof path.valueOf() !== 'string') { + throw new Error('path cannot be null or undefined and it must be of type string.'); + } + if (recursive !== null && recursive !== undefined && typeof recursive !== 'boolean') { + throw new Error('recursive must be of type boolean.'); + } + 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('/') ? '' : '/') + 'webhdfs/v1/{path}'; + requestUrl = requestUrl.replace('{accountName}', accountName); + requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); + requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); + let queryParameters = []; + if (recursive !== null && recursive !== undefined) { + queryParameters.push('recursive=' + encodeURIComponent(recursive.toString())); + } + queryParameters.push('op=' + encodeURIComponent(op)); + 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 !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['AdlsError']().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['FileOperationResult']().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); + }); +} + +/** + * Rename a file or directory. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory to move/rename. + * + * @param {string} destination The path to move/rename the file or folder to + * + * @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 FileOperationResult} 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 _rename(accountName, path, destination, 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 op = 'RENAME'; + // Validate + try { + if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { + throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); + } + if (path === null || path === undefined || typeof path.valueOf() !== 'string') { + throw new Error('path cannot be null or undefined and it must be of type string.'); + } + if (destination === null || destination === undefined || typeof destination.valueOf() !== 'string') { + throw new Error('destination 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 (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('/') ? '' : '/') + 'webhdfs/v1/{path}'; + requestUrl = requestUrl.replace('{accountName}', accountName); + requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); + requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); + let queryParameters = []; + queryParameters.push('destination=' + encodeURIComponent(destination)); + queryParameters.push('op=' + encodeURIComponent(op)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['AdlsError']().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['FileOperationResult']().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); + }); +} + +/** + * Sets the owner of a file or directory. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory for which to set the owner. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.owner] The AAD Object ID of the user owner of the + * file or directory. If empty, the property will remain unchanged. + * + * @param {string} [options.group] The AAD Object ID of the group owner of the + * file or directory. If empty, the property will remain unchanged. + * + * @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 _setOwner(accountName, path, 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 owner = (options && options.owner !== undefined) ? options.owner : undefined; + let group = (options && options.group !== undefined) ? options.group : undefined; + let op = 'SETOWNER'; + // Validate + try { + if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { + throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); + } + if (path === null || path === undefined || typeof path.valueOf() !== 'string') { + throw new Error('path cannot be null or undefined and it must be of type string.'); + } + if (owner !== null && owner !== undefined && typeof owner.valueOf() !== 'string') { + throw new Error('owner must be of type string.'); + } + if (group !== null && group !== undefined && typeof group.valueOf() !== 'string') { + throw new Error('group 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 (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('/') ? '' : '/') + 'webhdfs/v1/{path}'; + requestUrl = requestUrl.replace('{accountName}', accountName); + requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); + requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); + let queryParameters = []; + if (owner !== null && owner !== undefined) { + queryParameters.push('owner=' + encodeURIComponent(owner)); + } + if (group !== null && group !== undefined) { + queryParameters.push('group=' + encodeURIComponent(group)); + } + queryParameters.push('op=' + encodeURIComponent(op)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['AdlsError']().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); + }); +} + +/** + * Sets the permission of the file or folder. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory for which to set the permission. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.permission] A string representation of the + * permission (i.e 'rwx'). If empty, this property remains unchanged. + * + * @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 _setPermission(accountName, path, 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 permission = (options && options.permission !== undefined) ? options.permission : undefined; + let op = 'SETPERMISSION'; + // Validate + try { + if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { + throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); + } + if (path === null || path === undefined || typeof path.valueOf() !== 'string') { + throw new Error('path cannot be null or undefined and it must be of type string.'); + } + if (permission !== null && permission !== undefined && typeof permission.valueOf() !== 'string') { + throw new Error('permission 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 (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('/') ? '' : '/') + 'webhdfs/v1/{path}'; + requestUrl = requestUrl.replace('{accountName}', accountName); + requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); + requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); + let queryParameters = []; + if (permission !== null && permission !== undefined) { + queryParameters.push('permission=' + encodeURIComponent(permission)); + } + queryParameters.push('op=' + encodeURIComponent(op)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['AdlsError']().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); + }); +} + +/** Class representing a FileSystem. */ +class FileSystem { + /** + * Create a FileSystem. + * @param {DataLakeStoreFileSystemManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._setFileExpiry = _setFileExpiry; + this._concurrentAppend = _concurrentAppend; + this._checkAccess = _checkAccess; + this._mkdirs = _mkdirs; + this._concat = _concat; + this._msConcat = _msConcat; + this._listFileStatus = _listFileStatus; + this._getContentSummary = _getContentSummary; + this._getFileStatus = _getFileStatus; + this._open = _open; + this._append = _append; + this._create = _create; + this._setAcl = _setAcl; + this._modifyAclEntries = _modifyAclEntries; + this._removeAclEntries = _removeAclEntries; + this._removeDefaultAcl = _removeDefaultAcl; + this._removeAcl = _removeAcl; + this._getAclStatus = _getAclStatus; + this._deleteMethod = _deleteMethod; + this._rename = _rename; + this._setOwner = _setOwner; + this._setPermission = _setPermission; + } + + /** + * Sets or removes the expiration time on the specified file. This operation + * can only be executed against files. Folders are not supported. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file on which to set or remove the expiration time. + * + * @param {string} expiryOption Indicates the type of expiration to use for the + * file: 1. NeverExpire: ExpireTime is ignored. 2. RelativeToNow: ExpireTime is + * an integer in milliseconds representing the expiration date relative to when + * file expiration is updated. 3. RelativeToCreationDate: ExpireTime is an + * integer in milliseconds representing the expiration date relative to file + * creation. 4. Absolute: ExpireTime is an integer in milliseconds, as a Unix + * timestamp relative to 1/1/1970 00:00:00. Possible values include: + * 'NeverExpire', 'RelativeToNow', 'RelativeToCreationDate', 'Absolute' + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.expireTime] The time that the file will expire, + * corresponding to the ExpiryOption that was set. + * + * @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. + */ + setFileExpiryWithHttpOperationResponse(accountName, path, expiryOption, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._setFileExpiry(accountName, path, expiryOption, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Sets or removes the expiration time on the specified file. This operation + * can only be executed against files. Folders are not supported. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file on which to set or remove the expiration time. + * + * @param {string} expiryOption Indicates the type of expiration to use for the + * file: 1. NeverExpire: ExpireTime is ignored. 2. RelativeToNow: ExpireTime is + * an integer in milliseconds representing the expiration date relative to when + * file expiration is updated. 3. RelativeToCreationDate: ExpireTime is an + * integer in milliseconds representing the expiration date relative to file + * creation. 4. Absolute: ExpireTime is an integer in milliseconds, as a Unix + * timestamp relative to 1/1/1970 00:00:00. Possible values include: + * 'NeverExpire', 'RelativeToNow', 'RelativeToCreationDate', 'Absolute' + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.expireTime] The time that the file will expire, + * corresponding to the ExpiryOption that was set. + * + * @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. + */ + setFileExpiry(accountName, path, expiryOption, 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._setFileExpiry(accountName, path, expiryOption, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._setFileExpiry(accountName, path, expiryOption, options, optionalCallback); + } + } + + /** + * Appends to the specified file, optionally first creating the file if it does + * not yet exist. This method supports multiple concurrent appends to the file. + * NOTE: The target must not contain data added by Create or normal (serial) + * Append. ConcurrentAppend and Append cannot be used interchangeably; once a + * target file has been modified using either of these append options, the + * other append option cannot be used on the target file. ConcurrentAppend does + * not guarantee order and can result in duplicated data landing in the target + * file. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file to which to append using concurrent append. + * + * @param {object} streamContents The file contents to include when appending + * to the file. The maximum content size is 4MB. For content larger than 4MB + * you must append the content in 4MB chunks. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.appendMode] Indicates the concurrent append call + * should create the file if it doesn't exist or just open the existing file + * for append. Possible values include: 'autocreate' + * + * @param {string} [options.syncFlag] Optionally indicates what to do after + * completion of the concurrent append. DATA indicates that more data will be + * sent immediately by the client, the file handle should remain open/locked, + * and file metadata (including file length, last modified time) should NOT get + * updated. METADATA indicates that more data will be sent immediately by the + * client, the file handle should remain open/locked, and file metadata should + * get updated. CLOSE indicates that the client is done sending data, the file + * handle should be closed/unlocked, and file metadata should get updated. + * Possible values include: 'DATA', 'METADATA', 'CLOSE' + * + * @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. + */ + concurrentAppendWithHttpOperationResponse(accountName, path, streamContents, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._concurrentAppend(accountName, path, streamContents, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Appends to the specified file, optionally first creating the file if it does + * not yet exist. This method supports multiple concurrent appends to the file. + * NOTE: The target must not contain data added by Create or normal (serial) + * Append. ConcurrentAppend and Append cannot be used interchangeably; once a + * target file has been modified using either of these append options, the + * other append option cannot be used on the target file. ConcurrentAppend does + * not guarantee order and can result in duplicated data landing in the target + * file. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file to which to append using concurrent append. + * + * @param {object} streamContents The file contents to include when appending + * to the file. The maximum content size is 4MB. For content larger than 4MB + * you must append the content in 4MB chunks. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.appendMode] Indicates the concurrent append call + * should create the file if it doesn't exist or just open the existing file + * for append. Possible values include: 'autocreate' + * + * @param {string} [options.syncFlag] Optionally indicates what to do after + * completion of the concurrent append. DATA indicates that more data will be + * sent immediately by the client, the file handle should remain open/locked, + * and file metadata (including file length, last modified time) should NOT get + * updated. METADATA indicates that more data will be sent immediately by the + * client, the file handle should remain open/locked, and file metadata should + * get updated. CLOSE indicates that the client is done sending data, the file + * handle should be closed/unlocked, and file metadata should get updated. + * Possible values include: 'DATA', 'METADATA', 'CLOSE' + * + * @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. + */ + concurrentAppend(accountName, path, streamContents, 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._concurrentAppend(accountName, path, streamContents, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._concurrentAppend(accountName, path, streamContents, options, optionalCallback); + } + } + + /** + * Checks if the specified access is available at the given path. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory for which to check access. + * + * @param {string} fsaction File system operation read/write/execute in string + * form, matching regex pattern '[rwx-]{3}' + * + * @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. + */ + checkAccessWithHttpOperationResponse(accountName, path, fsaction, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._checkAccess(accountName, path, fsaction, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Checks if the specified access is available at the given path. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory for which to check access. + * + * @param {string} fsaction File system operation read/write/execute in string + * form, matching regex pattern '[rwx-]{3}' + * + * @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. + */ + checkAccess(accountName, path, fsaction, 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._checkAccess(accountName, path, fsaction, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._checkAccess(accountName, path, fsaction, options, optionalCallback); + } + } + + /** + * Creates a directory. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * directory to create. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.permission] Optional octal permission with which + * the directory should be created. + * + * @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. + */ + mkdirsWithHttpOperationResponse(accountName, path, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._mkdirs(accountName, path, 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 directory. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * directory to create. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.permission] Optional octal permission with which + * the directory should be created. + * + * @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 {FileOperationResult} - 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 FileOperationResult} 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. + */ + mkdirs(accountName, path, 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._mkdirs(accountName, path, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._mkdirs(accountName, path, options, optionalCallback); + } + } + + /** + * Concatenates the list of source files into the destination file, removing + * all source files upon success. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * destination file resulting from the concatenation. + * + * @param {array} sources A list of comma separated Data Lake Store paths + * (starting with '/') of the files to concatenate, in the order in which they + * should be concatenated. + * + * @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. + */ + concatWithHttpOperationResponse(accountName, path, sources, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._concat(accountName, path, sources, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Concatenates the list of source files into the destination file, removing + * all source files upon success. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * destination file resulting from the concatenation. + * + * @param {array} sources A list of comma separated Data Lake Store paths + * (starting with '/') of the files to concatenate, in the order in which they + * should be concatenated. + * + * @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. + */ + concat(accountName, path, sources, 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._concat(accountName, path, sources, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._concat(accountName, path, sources, options, optionalCallback); + } + } + + /** + * Concatenates the list of source files into the destination file, deleting + * all source files upon success. This method accepts more source file paths + * than the Concat method. This method and the parameters it accepts are + * subject to change for usability in an upcoming version. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * destination file resulting from the concatenation. + * + * @param {object} streamContents A list of Data Lake Store paths (starting + * with '/') of the source files. Must be a comma-separated path list in the + * format: sources=/file/path/1.txt,/file/path/2.txt,/file/path/lastfile.csv + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.deleteSourceDirectory] Indicates that as an + * optimization instead of deleting each individual source stream, delete the + * source stream folder if all streams are in the same folder instead. This + * results in a substantial performance improvement when the only streams in + * the folder are part of the concatenation operation. WARNING: This includes + * the deletion of any other files that are not source files. Only set this to + * true when source files are the only files in the source directory. + * + * @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. + */ + msConcatWithHttpOperationResponse(accountName, path, streamContents, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._msConcat(accountName, path, streamContents, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Concatenates the list of source files into the destination file, deleting + * all source files upon success. This method accepts more source file paths + * than the Concat method. This method and the parameters it accepts are + * subject to change for usability in an upcoming version. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * destination file resulting from the concatenation. + * + * @param {object} streamContents A list of Data Lake Store paths (starting + * with '/') of the source files. Must be a comma-separated path list in the + * format: sources=/file/path/1.txt,/file/path/2.txt,/file/path/lastfile.csv + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.deleteSourceDirectory] Indicates that as an + * optimization instead of deleting each individual source stream, delete the + * source stream folder if all streams are in the same folder instead. This + * results in a substantial performance improvement when the only streams in + * the folder are part of the concatenation operation. WARNING: This includes + * the deletion of any other files that are not source files. Only set this to + * true when source files are the only files in the source directory. + * + * @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. + */ + msConcat(accountName, path, streamContents, 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._msConcat(accountName, path, streamContents, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._msConcat(accountName, path, streamContents, options, optionalCallback); + } + } + + /** + * Get the list of file status objects specified by the file path, with + * optional pagination parameters + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * directory to list. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.listSize] Gets or sets the number of items to + * return. Optional. + * + * @param {string} [options.listAfter] Gets or sets the item or lexographical + * index after which to begin returning results. For example, a file list of + * 'a','b','d' and listAfter='b' will return 'd', and a listAfter='c' will also + * return 'd'. Optional. + * + * @param {string} [options.listBefore] Gets or sets the item or lexographical + * index before which to begin returning results. For example, a file list of + * 'a','b','d' and listBefore='d' will return 'a','b', and a listBefore='c' + * will also return 'a','b'. Optional. + * + * @param {boolean} [options.tooId] An optional switch to return friendly names + * in place of owner and group. tooid=false returns friendly names instead of + * the AAD Object ID. Default value is true, returning AAD object IDs. + * + * @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. + */ + listFileStatusWithHttpOperationResponse(accountName, path, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listFileStatus(accountName, path, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Get the list of file status objects specified by the file path, with + * optional pagination parameters + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * directory to list. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.listSize] Gets or sets the number of items to + * return. Optional. + * + * @param {string} [options.listAfter] Gets or sets the item or lexographical + * index after which to begin returning results. For example, a file list of + * 'a','b','d' and listAfter='b' will return 'd', and a listAfter='c' will also + * return 'd'. Optional. + * + * @param {string} [options.listBefore] Gets or sets the item or lexographical + * index before which to begin returning results. For example, a file list of + * 'a','b','d' and listBefore='d' will return 'a','b', and a listBefore='c' + * will also return 'a','b'. Optional. + * + * @param {boolean} [options.tooId] An optional switch to return friendly names + * in place of owner and group. tooid=false returns friendly names instead of + * the AAD Object ID. Default value is true, returning AAD object IDs. + * + * @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 {FileStatusesResult} - 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 FileStatusesResult} 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. + */ + listFileStatus(accountName, path, 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._listFileStatus(accountName, path, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listFileStatus(accountName, path, options, optionalCallback); + } + } + + /** + * Gets the file content summary object specified by the file path. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file for which to retrieve the summary. + * + * @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. + */ + getContentSummaryWithHttpOperationResponse(accountName, path, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getContentSummary(accountName, path, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the file content summary object specified by the file path. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file for which to retrieve the summary. + * + * @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 {ContentSummaryResult} - 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 ContentSummaryResult} 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. + */ + getContentSummary(accountName, path, 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._getContentSummary(accountName, path, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getContentSummary(accountName, path, options, optionalCallback); + } + } + + /** + * Get the file status object specified by the file path. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory for which to retrieve the status. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.tooId] An optional switch to return friendly names + * in place of owner and group. tooid=false returns friendly names instead of + * the AAD Object ID. Default value is true, returning AAD object IDs. + * + * @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. + */ + getFileStatusWithHttpOperationResponse(accountName, path, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getFileStatus(accountName, path, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Get the file status object specified by the file path. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory for which to retrieve the status. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.tooId] An optional switch to return friendly names + * in place of owner and group. tooid=false returns friendly names instead of + * the AAD Object ID. Default value is true, returning AAD object IDs. + * + * @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 {FileStatusResult} - 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 FileStatusResult} 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. + */ + getFileStatus(accountName, path, 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._getFileStatus(accountName, path, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getFileStatus(accountName, path, options, optionalCallback); + } + } + + /** + * Opens and reads from the specified file. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file to open. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.length] The number of bytes that the server will + * attempt to retrieve. It will retrieve <= length bytes. + * + * @param {number} [options.offset] The byte offset to start reading data from. + * + * @param {uuid} [options.fileSessionId] Optional unique GUID per file + * indicating all the reads with the same fileSessionId are from the same + * client and same session. This will give a performance benefit. + * + * @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. + */ + openWithHttpOperationResponse(accountName, path, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._open(accountName, path, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Opens and reads from the specified file. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file to open. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.length] The number of bytes that the server will + * attempt to retrieve. It will retrieve <= length bytes. + * + * @param {number} [options.offset] The byte offset to start reading data from. + * + * @param {uuid} [options.fileSessionId] Optional unique GUID per file + * indicating all the reads with the same fileSessionId are from the same + * client and same session. This will give a performance benefit. + * + * @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 {Object} - 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. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + open(accountName, path, 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._open(accountName, path, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._open(accountName, path, options, optionalCallback); + } + } + + /** + * Used for serial appends to the specified file. NOTE: The target must not + * contain data added by ConcurrentAppend. ConcurrentAppend and Append cannot + * be used interchangeably; once a target file has been modified using either + * of these append options, the other append option cannot be used on the + * target file. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file to which to append. + * + * @param {object} streamContents The file contents to include when appending + * to the file. The maximum content size is 4MB. For content larger than 4MB + * you must append the content in 4MB chunks. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.offset] The optional offset in the stream to begin + * the append operation. Default is to append at the end of the stream. + * + * @param {string} [options.syncFlag] Optionally indicates what to do after + * completion of the concurrent append. DATA indicates that more data will be + * sent immediately by the client, the file handle should remain open/locked, + * and file metadata (including file length, last modified time) should NOT get + * updated. METADATA indicates that more data will be sent immediately by the + * client, the file handle should remain open/locked, and file metadata should + * get updated. CLOSE indicates that the client is done sending data, the file + * handle should be closed/unlocked, and file metadata should get updated. + * Possible values include: 'DATA', 'METADATA', 'CLOSE' + * + * @param {uuid} [options.leaseId] Optional unique GUID per file to ensure + * single writer semantics, meaning that only clients that append to the file + * with the same leaseId will be allowed to do so. + * + * @param {uuid} [options.fileSessionId] Optional unique GUID per file + * indicating all the appends with the same fileSessionId are from the same + * client and same session. This will give a performance benefit when syncFlag + * is DATA or METADATA. + * + * @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. + */ + appendWithHttpOperationResponse(accountName, path, streamContents, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._append(accountName, path, streamContents, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Used for serial appends to the specified file. NOTE: The target must not + * contain data added by ConcurrentAppend. ConcurrentAppend and Append cannot + * be used interchangeably; once a target file has been modified using either + * of these append options, the other append option cannot be used on the + * target file. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file to which to append. + * + * @param {object} streamContents The file contents to include when appending + * to the file. The maximum content size is 4MB. For content larger than 4MB + * you must append the content in 4MB chunks. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.offset] The optional offset in the stream to begin + * the append operation. Default is to append at the end of the stream. + * + * @param {string} [options.syncFlag] Optionally indicates what to do after + * completion of the concurrent append. DATA indicates that more data will be + * sent immediately by the client, the file handle should remain open/locked, + * and file metadata (including file length, last modified time) should NOT get + * updated. METADATA indicates that more data will be sent immediately by the + * client, the file handle should remain open/locked, and file metadata should + * get updated. CLOSE indicates that the client is done sending data, the file + * handle should be closed/unlocked, and file metadata should get updated. + * Possible values include: 'DATA', 'METADATA', 'CLOSE' + * + * @param {uuid} [options.leaseId] Optional unique GUID per file to ensure + * single writer semantics, meaning that only clients that append to the file + * with the same leaseId will be allowed to do so. + * + * @param {uuid} [options.fileSessionId] Optional unique GUID per file + * indicating all the appends with the same fileSessionId are from the same + * client and same session. This will give a performance benefit when syncFlag + * is DATA or METADATA. + * + * @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. + */ + append(accountName, path, streamContents, 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._append(accountName, path, streamContents, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._append(accountName, path, streamContents, options, optionalCallback); + } + } + + /** + * Creates a file with optionally specified content. NOTE: If content is + * provided, the resulting file cannot be modified using ConcurrentAppend. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file to create. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.streamContents] The file contents to include when + * creating the file. This parameter is optional, resulting in an empty file if + * not specified. The maximum content size is 4MB. For content larger than + * 4MB you must append the content in 4MB chunks. + * + * @param {boolean} [options.overwrite] The indication of if the file should be + * overwritten. + * + * @param {string} [options.syncFlag] Optionally indicates what to do after + * completion of the create. DATA indicates that more data will be sent + * immediately by the client, the file handle should remain open/locked, and + * file metadata (including file length, last modified time) should NOT get + * updated. METADATA indicates that more data will be sent immediately by the + * client, the file handle should remain open/locked, and file metadata should + * get updated. CLOSE indicates that the client is done sending data, the file + * handle should be closed/unlocked, and file metadata should get updated. + * Possible values include: 'DATA', 'METADATA', 'CLOSE' + * + * @param {uuid} [options.leaseId] Optional unique GUID per file to ensure + * single writer semantics, meaning that only clients that append to the file + * with the same leaseId will be allowed to do so. + * + * @param {number} [options.permission] The octal representation of the unnamed + * user, mask and other permissions that should be set for the file when + * created. If not specified, it inherits these from the container. + * + * @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(accountName, path, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._create(accountName, path, 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 file with optionally specified content. NOTE: If content is + * provided, the resulting file cannot be modified using ConcurrentAppend. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file to create. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.streamContents] The file contents to include when + * creating the file. This parameter is optional, resulting in an empty file if + * not specified. The maximum content size is 4MB. For content larger than + * 4MB you must append the content in 4MB chunks. + * + * @param {boolean} [options.overwrite] The indication of if the file should be + * overwritten. + * + * @param {string} [options.syncFlag] Optionally indicates what to do after + * completion of the create. DATA indicates that more data will be sent + * immediately by the client, the file handle should remain open/locked, and + * file metadata (including file length, last modified time) should NOT get + * updated. METADATA indicates that more data will be sent immediately by the + * client, the file handle should remain open/locked, and file metadata should + * get updated. CLOSE indicates that the client is done sending data, the file + * handle should be closed/unlocked, and file metadata should get updated. + * Possible values include: 'DATA', 'METADATA', 'CLOSE' + * + * @param {uuid} [options.leaseId] Optional unique GUID per file to ensure + * single writer semantics, meaning that only clients that append to the file + * with the same leaseId will be allowed to do so. + * + * @param {number} [options.permission] The octal representation of the unnamed + * user, mask and other permissions that should be set for the file when + * created. If not specified, it inherits these from the container. + * + * @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. + */ + create(accountName, path, 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(accountName, path, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._create(accountName, path, options, optionalCallback); + } + } + + /** + * Sets the Access Control List (ACL) for a file or folder. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory on which to set the ACL. + * + * @param {string} aclspec The ACL spec included in ACL creation operations in + * the format '[default:]user|group|other::r|-w|-x|-' + * + * @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. + */ + setAclWithHttpOperationResponse(accountName, path, aclspec, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._setAcl(accountName, path, aclspec, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Sets the Access Control List (ACL) for a file or folder. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory on which to set the ACL. + * + * @param {string} aclspec The ACL spec included in ACL creation operations in + * the format '[default:]user|group|other::r|-w|-x|-' + * + * @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. + */ + setAcl(accountName, path, aclspec, 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._setAcl(accountName, path, aclspec, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._setAcl(accountName, path, aclspec, options, optionalCallback); + } + } + + /** + * Modifies existing Access Control List (ACL) entries on a file or folder. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory with the ACL being modified. + * + * @param {string} aclspec The ACL specification included in ACL modification + * operations in the format '[default:]user|group|other::r|-w|-x|-' + * + * @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. + */ + modifyAclEntriesWithHttpOperationResponse(accountName, path, aclspec, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._modifyAclEntries(accountName, path, aclspec, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Modifies existing Access Control List (ACL) entries on a file or folder. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory with the ACL being modified. + * + * @param {string} aclspec The ACL specification included in ACL modification + * operations in the format '[default:]user|group|other::r|-w|-x|-' + * + * @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. + */ + modifyAclEntries(accountName, path, aclspec, 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._modifyAclEntries(accountName, path, aclspec, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._modifyAclEntries(accountName, path, aclspec, options, optionalCallback); + } + } + + /** + * Removes existing Access Control List (ACL) entries for a file or folder. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory with the ACL being removed. + * + * @param {string} aclspec The ACL spec included in ACL removal operations in + * the format '[default:]user|group|other' + * + * @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. + */ + removeAclEntriesWithHttpOperationResponse(accountName, path, aclspec, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._removeAclEntries(accountName, path, aclspec, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Removes existing Access Control List (ACL) entries for a file or folder. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory with the ACL being removed. + * + * @param {string} aclspec The ACL spec included in ACL removal operations in + * the format '[default:]user|group|other' + * + * @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. + */ + removeAclEntries(accountName, path, aclspec, 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._removeAclEntries(accountName, path, aclspec, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._removeAclEntries(accountName, path, aclspec, options, optionalCallback); + } + } + + /** + * Removes the existing Default Access Control List (ACL) of the specified + * directory. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * directory with the default ACL being removed. + * + * @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. + */ + removeDefaultAclWithHttpOperationResponse(accountName, path, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._removeDefaultAcl(accountName, path, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Removes the existing Default Access Control List (ACL) of the specified + * directory. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * directory with the default ACL being removed. + * + * @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. + */ + removeDefaultAcl(accountName, path, 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._removeDefaultAcl(accountName, path, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._removeDefaultAcl(accountName, path, options, optionalCallback); + } + } + + /** + * Removes the existing Access Control List (ACL) of the specified file or + * directory. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory with the ACL being removed. + * + * @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. + */ + removeAclWithHttpOperationResponse(accountName, path, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._removeAcl(accountName, path, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Removes the existing Access Control List (ACL) of the specified file or + * directory. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory with the ACL being removed. + * + * @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. + */ + removeAcl(accountName, path, 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._removeAcl(accountName, path, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._removeAcl(accountName, path, options, optionalCallback); + } + } + + /** + * Gets Access Control List (ACL) entries for the specified file or directory. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory for which to get the ACL. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.tooId] An optional switch to return friendly names + * in place of object ID for ACL entries. tooid=false returns friendly names + * instead of the AAD Object ID. Default value is true, returning AAD object + * IDs. + * + * @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. + */ + getAclStatusWithHttpOperationResponse(accountName, path, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getAclStatus(accountName, path, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets Access Control List (ACL) entries for the specified file or directory. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory for which to get the ACL. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.tooId] An optional switch to return friendly names + * in place of object ID for ACL entries. tooid=false returns friendly names + * instead of the AAD Object ID. Default value is true, returning AAD object + * IDs. + * + * @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 {AclStatusResult} - 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 AclStatusResult} 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. + */ + getAclStatus(accountName, path, 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._getAclStatus(accountName, path, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getAclStatus(accountName, path, options, optionalCallback); + } + } + + /** + * Deletes the requested file or directory, optionally recursively. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory to delete. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.recursive] The optional switch indicating if the + * delete should be recursive + * + * @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(accountName, path, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(accountName, path, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the requested file or directory, optionally recursively. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory to delete. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.recursive] The optional switch indicating if the + * delete should be recursive + * + * @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 {FileOperationResult} - 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 FileOperationResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(accountName, path, 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(accountName, path, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(accountName, path, options, optionalCallback); + } + } + + /** + * Rename a file or directory. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory to move/rename. + * + * @param {string} destination The path to move/rename the file or folder to + * + * @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. + */ + renameWithHttpOperationResponse(accountName, path, destination, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._rename(accountName, path, destination, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Rename a file or directory. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory to move/rename. + * + * @param {string} destination The path to move/rename the file or folder to + * + * @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 {FileOperationResult} - 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 FileOperationResult} 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. + */ + rename(accountName, path, destination, 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._rename(accountName, path, destination, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._rename(accountName, path, destination, options, optionalCallback); + } + } + + /** + * Sets the owner of a file or directory. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory for which to set the owner. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.owner] The AAD Object ID of the user owner of the + * file or directory. If empty, the property will remain unchanged. + * + * @param {string} [options.group] The AAD Object ID of the group owner of the + * file or directory. If empty, the property will remain unchanged. + * + * @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. + */ + setOwnerWithHttpOperationResponse(accountName, path, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._setOwner(accountName, path, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Sets the owner of a file or directory. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory for which to set the owner. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.owner] The AAD Object ID of the user owner of the + * file or directory. If empty, the property will remain unchanged. + * + * @param {string} [options.group] The AAD Object ID of the group owner of the + * file or directory. If empty, the property will remain unchanged. + * + * @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. + */ + setOwner(accountName, path, 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._setOwner(accountName, path, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._setOwner(accountName, path, options, optionalCallback); + } + } + + /** + * Sets the permission of the file or folder. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory for which to set the permission. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.permission] A string representation of the + * permission (i.e 'rwx'). If empty, this property remains unchanged. + * + * @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. + */ + setPermissionWithHttpOperationResponse(accountName, path, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._setPermission(accountName, path, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Sets the permission of the file or folder. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory for which to set the permission. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.permission] A string representation of the + * permission (i.e 'rwx'). If empty, this property remains unchanged. + * + * @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. + */ + setPermission(accountName, path, 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._setPermission(accountName, path, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._setPermission(accountName, path, options, optionalCallback); + } + } + +} + +module.exports = FileSystem; diff --git a/lib/services/datalake.Store/lib/filesystem/operations/index.d.ts b/lib/services/datalake.Store/lib/filesystem/operations/index.d.ts new file mode 100644 index 0000000000..cd17fe23fc --- /dev/null +++ b/lib/services/datalake.Store/lib/filesystem/operations/index.d.ts @@ -0,0 +1,1758 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * 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 stream from 'stream'; +import * as models from '../models'; + + +/** + * @class + * FileSystem + * __NOTE__: An instance of this class is automatically created for an + * instance of the DataLakeStoreFileSystemManagementClient. + */ +export interface FileSystem { + + + /** + * Sets or removes the expiration time on the specified file. This operation + * can only be executed against files. Folders are not supported. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file on which to set or remove the expiration time. + * + * @param {string} expiryOption Indicates the type of expiration to use for the + * file: 1. NeverExpire: ExpireTime is ignored. 2. RelativeToNow: ExpireTime is + * an integer in milliseconds representing the expiration date relative to when + * file expiration is updated. 3. RelativeToCreationDate: ExpireTime is an + * integer in milliseconds representing the expiration date relative to file + * creation. 4. Absolute: ExpireTime is an integer in milliseconds, as a Unix + * timestamp relative to 1/1/1970 00:00:00. Possible values include: + * 'NeverExpire', 'RelativeToNow', 'RelativeToCreationDate', 'Absolute' + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.expireTime] The time that the file will expire, + * corresponding to the ExpiryOption that was set. + * + * @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. + */ + setFileExpiryWithHttpOperationResponse(accountName: string, path: string, expiryOption: string, options?: { expireTime? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Sets or removes the expiration time on the specified file. This operation + * can only be executed against files. Folders are not supported. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file on which to set or remove the expiration time. + * + * @param {string} expiryOption Indicates the type of expiration to use for the + * file: 1. NeverExpire: ExpireTime is ignored. 2. RelativeToNow: ExpireTime is + * an integer in milliseconds representing the expiration date relative to when + * file expiration is updated. 3. RelativeToCreationDate: ExpireTime is an + * integer in milliseconds representing the expiration date relative to file + * creation. 4. Absolute: ExpireTime is an integer in milliseconds, as a Unix + * timestamp relative to 1/1/1970 00:00:00. Possible values include: + * 'NeverExpire', 'RelativeToNow', 'RelativeToCreationDate', 'Absolute' + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.expireTime] The time that the file will expire, + * corresponding to the ExpiryOption that was set. + * + * @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. + */ + setFileExpiry(accountName: string, path: string, expiryOption: string, options?: { expireTime? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + setFileExpiry(accountName: string, path: string, expiryOption: string, callback: ServiceCallback): void; + setFileExpiry(accountName: string, path: string, expiryOption: string, options: { expireTime? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Appends to the specified file, optionally first creating the file if it does + * not yet exist. This method supports multiple concurrent appends to the file. + * NOTE: The target must not contain data added by Create or normal (serial) + * Append. ConcurrentAppend and Append cannot be used interchangeably; once a + * target file has been modified using either of these append options, the + * other append option cannot be used on the target file. ConcurrentAppend does + * not guarantee order and can result in duplicated data landing in the target + * file. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file to which to append using concurrent append. + * + * @param {object} streamContents The file contents to include when appending + * to the file. The maximum content size is 4MB. For content larger than 4MB + * you must append the content in 4MB chunks. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.appendMode] Indicates the concurrent append call + * should create the file if it doesn't exist or just open the existing file + * for append. Possible values include: 'autocreate' + * + * @param {string} [options.syncFlag] Optionally indicates what to do after + * completion of the concurrent append. DATA indicates that more data will be + * sent immediately by the client, the file handle should remain open/locked, + * and file metadata (including file length, last modified time) should NOT get + * updated. METADATA indicates that more data will be sent immediately by the + * client, the file handle should remain open/locked, and file metadata should + * get updated. CLOSE indicates that the client is done sending data, the file + * handle should be closed/unlocked, and file metadata should get updated. + * Possible values include: 'DATA', 'METADATA', 'CLOSE' + * + * @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. + */ + concurrentAppendWithHttpOperationResponse(accountName: string, path: string, streamContents: stream.Readable, options?: { appendMode? : string, syncFlag? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Appends to the specified file, optionally first creating the file if it does + * not yet exist. This method supports multiple concurrent appends to the file. + * NOTE: The target must not contain data added by Create or normal (serial) + * Append. ConcurrentAppend and Append cannot be used interchangeably; once a + * target file has been modified using either of these append options, the + * other append option cannot be used on the target file. ConcurrentAppend does + * not guarantee order and can result in duplicated data landing in the target + * file. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file to which to append using concurrent append. + * + * @param {object} streamContents The file contents to include when appending + * to the file. The maximum content size is 4MB. For content larger than 4MB + * you must append the content in 4MB chunks. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.appendMode] Indicates the concurrent append call + * should create the file if it doesn't exist or just open the existing file + * for append. Possible values include: 'autocreate' + * + * @param {string} [options.syncFlag] Optionally indicates what to do after + * completion of the concurrent append. DATA indicates that more data will be + * sent immediately by the client, the file handle should remain open/locked, + * and file metadata (including file length, last modified time) should NOT get + * updated. METADATA indicates that more data will be sent immediately by the + * client, the file handle should remain open/locked, and file metadata should + * get updated. CLOSE indicates that the client is done sending data, the file + * handle should be closed/unlocked, and file metadata should get updated. + * Possible values include: 'DATA', 'METADATA', 'CLOSE' + * + * @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. + */ + concurrentAppend(accountName: string, path: string, streamContents: stream.Readable, options?: { appendMode? : string, syncFlag? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + concurrentAppend(accountName: string, path: string, streamContents: stream.Readable, callback: ServiceCallback): void; + concurrentAppend(accountName: string, path: string, streamContents: stream.Readable, options: { appendMode? : string, syncFlag? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Checks if the specified access is available at the given path. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory for which to check access. + * + * @param {string} fsaction File system operation read/write/execute in string + * form, matching regex pattern '[rwx-]{3}' + * + * @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. + */ + checkAccessWithHttpOperationResponse(accountName: string, path: string, fsaction: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Checks if the specified access is available at the given path. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory for which to check access. + * + * @param {string} fsaction File system operation read/write/execute in string + * form, matching regex pattern '[rwx-]{3}' + * + * @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. + */ + checkAccess(accountName: string, path: string, fsaction: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + checkAccess(accountName: string, path: string, fsaction: string, callback: ServiceCallback): void; + checkAccess(accountName: string, path: string, fsaction: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates a directory. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * directory to create. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.permission] Optional octal permission with which + * the directory should be created. + * + * @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. + */ + mkdirsWithHttpOperationResponse(accountName: string, path: string, options?: { permission? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates a directory. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * directory to create. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.permission] Optional octal permission with which + * the directory should be created. + * + * @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 {FileOperationResult} - 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. + * + * {FileOperationResult} [result] - The deserialized result object if an error did not occur. + * See {@link FileOperationResult} 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. + */ + mkdirs(accountName: string, path: string, options?: { permission? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + mkdirs(accountName: string, path: string, callback: ServiceCallback): void; + mkdirs(accountName: string, path: string, options: { permission? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Concatenates the list of source files into the destination file, removing + * all source files upon success. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * destination file resulting from the concatenation. + * + * @param {array} sources A list of comma separated Data Lake Store paths + * (starting with '/') of the files to concatenate, in the order in which they + * should be concatenated. + * + * @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. + */ + concatWithHttpOperationResponse(accountName: string, path: string, sources: string[], options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Concatenates the list of source files into the destination file, removing + * all source files upon success. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * destination file resulting from the concatenation. + * + * @param {array} sources A list of comma separated Data Lake Store paths + * (starting with '/') of the files to concatenate, in the order in which they + * should be concatenated. + * + * @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. + */ + concat(accountName: string, path: string, sources: string[], options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + concat(accountName: string, path: string, sources: string[], callback: ServiceCallback): void; + concat(accountName: string, path: string, sources: string[], options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Concatenates the list of source files into the destination file, deleting + * all source files upon success. This method accepts more source file paths + * than the Concat method. This method and the parameters it accepts are + * subject to change for usability in an upcoming version. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * destination file resulting from the concatenation. + * + * @param {object} streamContents A list of Data Lake Store paths (starting + * with '/') of the source files. Must be a comma-separated path list in the + * format: sources=/file/path/1.txt,/file/path/2.txt,/file/path/lastfile.csv + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.deleteSourceDirectory] Indicates that as an + * optimization instead of deleting each individual source stream, delete the + * source stream folder if all streams are in the same folder instead. This + * results in a substantial performance improvement when the only streams in + * the folder are part of the concatenation operation. WARNING: This includes + * the deletion of any other files that are not source files. Only set this to + * true when source files are the only files in the source directory. + * + * @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. + */ + msConcatWithHttpOperationResponse(accountName: string, path: string, streamContents: stream.Readable, options?: { deleteSourceDirectory? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Concatenates the list of source files into the destination file, deleting + * all source files upon success. This method accepts more source file paths + * than the Concat method. This method and the parameters it accepts are + * subject to change for usability in an upcoming version. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * destination file resulting from the concatenation. + * + * @param {object} streamContents A list of Data Lake Store paths (starting + * with '/') of the source files. Must be a comma-separated path list in the + * format: sources=/file/path/1.txt,/file/path/2.txt,/file/path/lastfile.csv + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.deleteSourceDirectory] Indicates that as an + * optimization instead of deleting each individual source stream, delete the + * source stream folder if all streams are in the same folder instead. This + * results in a substantial performance improvement when the only streams in + * the folder are part of the concatenation operation. WARNING: This includes + * the deletion of any other files that are not source files. Only set this to + * true when source files are the only files in the source directory. + * + * @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. + */ + msConcat(accountName: string, path: string, streamContents: stream.Readable, options?: { deleteSourceDirectory? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + msConcat(accountName: string, path: string, streamContents: stream.Readable, callback: ServiceCallback): void; + msConcat(accountName: string, path: string, streamContents: stream.Readable, options: { deleteSourceDirectory? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Get the list of file status objects specified by the file path, with + * optional pagination parameters + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * directory to list. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.listSize] Gets or sets the number of items to + * return. Optional. + * + * @param {string} [options.listAfter] Gets or sets the item or lexographical + * index after which to begin returning results. For example, a file list of + * 'a','b','d' and listAfter='b' will return 'd', and a listAfter='c' will also + * return 'd'. Optional. + * + * @param {string} [options.listBefore] Gets or sets the item or lexographical + * index before which to begin returning results. For example, a file list of + * 'a','b','d' and listBefore='d' will return 'a','b', and a listBefore='c' + * will also return 'a','b'. Optional. + * + * @param {boolean} [options.tooId] An optional switch to return friendly names + * in place of owner and group. tooid=false returns friendly names instead of + * the AAD Object ID. Default value is true, returning AAD object IDs. + * + * @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. + */ + listFileStatusWithHttpOperationResponse(accountName: string, path: string, options?: { listSize? : number, listAfter? : string, listBefore? : string, tooId? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Get the list of file status objects specified by the file path, with + * optional pagination parameters + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * directory to list. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.listSize] Gets or sets the number of items to + * return. Optional. + * + * @param {string} [options.listAfter] Gets or sets the item or lexographical + * index after which to begin returning results. For example, a file list of + * 'a','b','d' and listAfter='b' will return 'd', and a listAfter='c' will also + * return 'd'. Optional. + * + * @param {string} [options.listBefore] Gets or sets the item or lexographical + * index before which to begin returning results. For example, a file list of + * 'a','b','d' and listBefore='d' will return 'a','b', and a listBefore='c' + * will also return 'a','b'. Optional. + * + * @param {boolean} [options.tooId] An optional switch to return friendly names + * in place of owner and group. tooid=false returns friendly names instead of + * the AAD Object ID. Default value is true, returning AAD object IDs. + * + * @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 {FileStatusesResult} - 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. + * + * {FileStatusesResult} [result] - The deserialized result object if an error did not occur. + * See {@link FileStatusesResult} 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. + */ + listFileStatus(accountName: string, path: string, options?: { listSize? : number, listAfter? : string, listBefore? : string, tooId? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + listFileStatus(accountName: string, path: string, callback: ServiceCallback): void; + listFileStatus(accountName: string, path: string, options: { listSize? : number, listAfter? : string, listBefore? : string, tooId? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the file content summary object specified by the file path. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file for which to retrieve the summary. + * + * @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. + */ + getContentSummaryWithHttpOperationResponse(accountName: string, path: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the file content summary object specified by the file path. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file for which to retrieve the summary. + * + * @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 {ContentSummaryResult} - 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. + * + * {ContentSummaryResult} [result] - The deserialized result object if an error did not occur. + * See {@link ContentSummaryResult} 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. + */ + getContentSummary(accountName: string, path: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getContentSummary(accountName: string, path: string, callback: ServiceCallback): void; + getContentSummary(accountName: string, path: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Get the file status object specified by the file path. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory for which to retrieve the status. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.tooId] An optional switch to return friendly names + * in place of owner and group. tooid=false returns friendly names instead of + * the AAD Object ID. Default value is true, returning AAD object IDs. + * + * @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. + */ + getFileStatusWithHttpOperationResponse(accountName: string, path: string, options?: { tooId? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Get the file status object specified by the file path. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory for which to retrieve the status. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.tooId] An optional switch to return friendly names + * in place of owner and group. tooid=false returns friendly names instead of + * the AAD Object ID. Default value is true, returning AAD object IDs. + * + * @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 {FileStatusResult} - 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. + * + * {FileStatusResult} [result] - The deserialized result object if an error did not occur. + * See {@link FileStatusResult} 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. + */ + getFileStatus(accountName: string, path: string, options?: { tooId? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + getFileStatus(accountName: string, path: string, callback: ServiceCallback): void; + getFileStatus(accountName: string, path: string, options: { tooId? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Opens and reads from the specified file. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file to open. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.length] The number of bytes that the server will + * attempt to retrieve. It will retrieve <= length bytes. + * + * @param {number} [options.offset] The byte offset to start reading data from. + * + * @param {uuid} [options.fileSessionId] Optional unique GUID per file + * indicating all the reads with the same fileSessionId are from the same + * client and same session. This will give a performance benefit. + * + * @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. + */ + openWithHttpOperationResponse(accountName: string, path: string, options?: { length? : number, offset? : number, fileSessionId? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Opens and reads from the specified file. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file to open. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.length] The number of bytes that the server will + * attempt to retrieve. It will retrieve <= length bytes. + * + * @param {number} [options.offset] The byte offset to start reading data from. + * + * @param {uuid} [options.fileSessionId] Optional unique GUID per file + * indicating all the reads with the same fileSessionId are from the same + * client and same session. This will give a performance benefit. + * + * @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 {Object} - 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. + * + * {Object} [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. + */ + open(accountName: string, path: string, options?: { length? : number, offset? : number, fileSessionId? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + open(accountName: string, path: string, callback: ServiceCallback): void; + open(accountName: string, path: string, options: { length? : number, offset? : number, fileSessionId? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Used for serial appends to the specified file. NOTE: The target must not + * contain data added by ConcurrentAppend. ConcurrentAppend and Append cannot + * be used interchangeably; once a target file has been modified using either + * of these append options, the other append option cannot be used on the + * target file. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file to which to append. + * + * @param {object} streamContents The file contents to include when appending + * to the file. The maximum content size is 4MB. For content larger than 4MB + * you must append the content in 4MB chunks. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.offset] The optional offset in the stream to begin + * the append operation. Default is to append at the end of the stream. + * + * @param {string} [options.syncFlag] Optionally indicates what to do after + * completion of the concurrent append. DATA indicates that more data will be + * sent immediately by the client, the file handle should remain open/locked, + * and file metadata (including file length, last modified time) should NOT get + * updated. METADATA indicates that more data will be sent immediately by the + * client, the file handle should remain open/locked, and file metadata should + * get updated. CLOSE indicates that the client is done sending data, the file + * handle should be closed/unlocked, and file metadata should get updated. + * Possible values include: 'DATA', 'METADATA', 'CLOSE' + * + * @param {uuid} [options.leaseId] Optional unique GUID per file to ensure + * single writer semantics, meaning that only clients that append to the file + * with the same leaseId will be allowed to do so. + * + * @param {uuid} [options.fileSessionId] Optional unique GUID per file + * indicating all the appends with the same fileSessionId are from the same + * client and same session. This will give a performance benefit when syncFlag + * is DATA or METADATA. + * + * @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. + */ + appendWithHttpOperationResponse(accountName: string, path: string, streamContents: stream.Readable, options?: { offset? : number, syncFlag? : string, leaseId? : string, fileSessionId? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Used for serial appends to the specified file. NOTE: The target must not + * contain data added by ConcurrentAppend. ConcurrentAppend and Append cannot + * be used interchangeably; once a target file has been modified using either + * of these append options, the other append option cannot be used on the + * target file. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file to which to append. + * + * @param {object} streamContents The file contents to include when appending + * to the file. The maximum content size is 4MB. For content larger than 4MB + * you must append the content in 4MB chunks. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.offset] The optional offset in the stream to begin + * the append operation. Default is to append at the end of the stream. + * + * @param {string} [options.syncFlag] Optionally indicates what to do after + * completion of the concurrent append. DATA indicates that more data will be + * sent immediately by the client, the file handle should remain open/locked, + * and file metadata (including file length, last modified time) should NOT get + * updated. METADATA indicates that more data will be sent immediately by the + * client, the file handle should remain open/locked, and file metadata should + * get updated. CLOSE indicates that the client is done sending data, the file + * handle should be closed/unlocked, and file metadata should get updated. + * Possible values include: 'DATA', 'METADATA', 'CLOSE' + * + * @param {uuid} [options.leaseId] Optional unique GUID per file to ensure + * single writer semantics, meaning that only clients that append to the file + * with the same leaseId will be allowed to do so. + * + * @param {uuid} [options.fileSessionId] Optional unique GUID per file + * indicating all the appends with the same fileSessionId are from the same + * client and same session. This will give a performance benefit when syncFlag + * is DATA or METADATA. + * + * @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. + */ + append(accountName: string, path: string, streamContents: stream.Readable, options?: { offset? : number, syncFlag? : string, leaseId? : string, fileSessionId? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + append(accountName: string, path: string, streamContents: stream.Readable, callback: ServiceCallback): void; + append(accountName: string, path: string, streamContents: stream.Readable, options: { offset? : number, syncFlag? : string, leaseId? : string, fileSessionId? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates a file with optionally specified content. NOTE: If content is + * provided, the resulting file cannot be modified using ConcurrentAppend. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file to create. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.streamContents] The file contents to include when + * creating the file. This parameter is optional, resulting in an empty file if + * not specified. The maximum content size is 4MB. For content larger than + * 4MB you must append the content in 4MB chunks. + * + * @param {boolean} [options.overwrite] The indication of if the file should be + * overwritten. + * + * @param {string} [options.syncFlag] Optionally indicates what to do after + * completion of the create. DATA indicates that more data will be sent + * immediately by the client, the file handle should remain open/locked, and + * file metadata (including file length, last modified time) should NOT get + * updated. METADATA indicates that more data will be sent immediately by the + * client, the file handle should remain open/locked, and file metadata should + * get updated. CLOSE indicates that the client is done sending data, the file + * handle should be closed/unlocked, and file metadata should get updated. + * Possible values include: 'DATA', 'METADATA', 'CLOSE' + * + * @param {uuid} [options.leaseId] Optional unique GUID per file to ensure + * single writer semantics, meaning that only clients that append to the file + * with the same leaseId will be allowed to do so. + * + * @param {number} [options.permission] The octal representation of the unnamed + * user, mask and other permissions that should be set for the file when + * created. If not specified, it inherits these from the container. + * + * @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(accountName: string, path: string, options?: { streamContents? : stream.Readable, overwrite? : boolean, syncFlag? : string, leaseId? : string, permission? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates a file with optionally specified content. NOTE: If content is + * provided, the resulting file cannot be modified using ConcurrentAppend. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file to create. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.streamContents] The file contents to include when + * creating the file. This parameter is optional, resulting in an empty file if + * not specified. The maximum content size is 4MB. For content larger than + * 4MB you must append the content in 4MB chunks. + * + * @param {boolean} [options.overwrite] The indication of if the file should be + * overwritten. + * + * @param {string} [options.syncFlag] Optionally indicates what to do after + * completion of the create. DATA indicates that more data will be sent + * immediately by the client, the file handle should remain open/locked, and + * file metadata (including file length, last modified time) should NOT get + * updated. METADATA indicates that more data will be sent immediately by the + * client, the file handle should remain open/locked, and file metadata should + * get updated. CLOSE indicates that the client is done sending data, the file + * handle should be closed/unlocked, and file metadata should get updated. + * Possible values include: 'DATA', 'METADATA', 'CLOSE' + * + * @param {uuid} [options.leaseId] Optional unique GUID per file to ensure + * single writer semantics, meaning that only clients that append to the file + * with the same leaseId will be allowed to do so. + * + * @param {number} [options.permission] The octal representation of the unnamed + * user, mask and other permissions that should be set for the file when + * created. If not specified, it inherits these from the container. + * + * @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. + */ + create(accountName: string, path: string, options?: { streamContents? : stream.Readable, overwrite? : boolean, syncFlag? : string, leaseId? : string, permission? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + create(accountName: string, path: string, callback: ServiceCallback): void; + create(accountName: string, path: string, options: { streamContents? : stream.Readable, overwrite? : boolean, syncFlag? : string, leaseId? : string, permission? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Sets the Access Control List (ACL) for a file or folder. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory on which to set the ACL. + * + * @param {string} aclspec The ACL spec included in ACL creation operations in + * the format '[default:]user|group|other::r|-w|-x|-' + * + * @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. + */ + setAclWithHttpOperationResponse(accountName: string, path: string, aclspec: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Sets the Access Control List (ACL) for a file or folder. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory on which to set the ACL. + * + * @param {string} aclspec The ACL spec included in ACL creation operations in + * the format '[default:]user|group|other::r|-w|-x|-' + * + * @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. + */ + setAcl(accountName: string, path: string, aclspec: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + setAcl(accountName: string, path: string, aclspec: string, callback: ServiceCallback): void; + setAcl(accountName: string, path: string, aclspec: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Modifies existing Access Control List (ACL) entries on a file or folder. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory with the ACL being modified. + * + * @param {string} aclspec The ACL specification included in ACL modification + * operations in the format '[default:]user|group|other::r|-w|-x|-' + * + * @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. + */ + modifyAclEntriesWithHttpOperationResponse(accountName: string, path: string, aclspec: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Modifies existing Access Control List (ACL) entries on a file or folder. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory with the ACL being modified. + * + * @param {string} aclspec The ACL specification included in ACL modification + * operations in the format '[default:]user|group|other::r|-w|-x|-' + * + * @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. + */ + modifyAclEntries(accountName: string, path: string, aclspec: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + modifyAclEntries(accountName: string, path: string, aclspec: string, callback: ServiceCallback): void; + modifyAclEntries(accountName: string, path: string, aclspec: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Removes existing Access Control List (ACL) entries for a file or folder. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory with the ACL being removed. + * + * @param {string} aclspec The ACL spec included in ACL removal operations in + * the format '[default:]user|group|other' + * + * @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. + */ + removeAclEntriesWithHttpOperationResponse(accountName: string, path: string, aclspec: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Removes existing Access Control List (ACL) entries for a file or folder. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory with the ACL being removed. + * + * @param {string} aclspec The ACL spec included in ACL removal operations in + * the format '[default:]user|group|other' + * + * @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. + */ + removeAclEntries(accountName: string, path: string, aclspec: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + removeAclEntries(accountName: string, path: string, aclspec: string, callback: ServiceCallback): void; + removeAclEntries(accountName: string, path: string, aclspec: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Removes the existing Default Access Control List (ACL) of the specified + * directory. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * directory with the default ACL being removed. + * + * @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. + */ + removeDefaultAclWithHttpOperationResponse(accountName: string, path: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Removes the existing Default Access Control List (ACL) of the specified + * directory. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * directory with the default ACL being removed. + * + * @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. + */ + removeDefaultAcl(accountName: string, path: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + removeDefaultAcl(accountName: string, path: string, callback: ServiceCallback): void; + removeDefaultAcl(accountName: string, path: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Removes the existing Access Control List (ACL) of the specified file or + * directory. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory with the ACL being removed. + * + * @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. + */ + removeAclWithHttpOperationResponse(accountName: string, path: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Removes the existing Access Control List (ACL) of the specified file or + * directory. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory with the ACL being removed. + * + * @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. + */ + removeAcl(accountName: string, path: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + removeAcl(accountName: string, path: string, callback: ServiceCallback): void; + removeAcl(accountName: string, path: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets Access Control List (ACL) entries for the specified file or directory. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory for which to get the ACL. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.tooId] An optional switch to return friendly names + * in place of object ID for ACL entries. tooid=false returns friendly names + * instead of the AAD Object ID. Default value is true, returning AAD object + * IDs. + * + * @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. + */ + getAclStatusWithHttpOperationResponse(accountName: string, path: string, options?: { tooId? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets Access Control List (ACL) entries for the specified file or directory. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory for which to get the ACL. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.tooId] An optional switch to return friendly names + * in place of object ID for ACL entries. tooid=false returns friendly names + * instead of the AAD Object ID. Default value is true, returning AAD object + * IDs. + * + * @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 {AclStatusResult} - 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. + * + * {AclStatusResult} [result] - The deserialized result object if an error did not occur. + * See {@link AclStatusResult} 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. + */ + getAclStatus(accountName: string, path: string, options?: { tooId? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + getAclStatus(accountName: string, path: string, callback: ServiceCallback): void; + getAclStatus(accountName: string, path: string, options: { tooId? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the requested file or directory, optionally recursively. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory to delete. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.recursive] The optional switch indicating if the + * delete should be recursive + * + * @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(accountName: string, path: string, options?: { recursive? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the requested file or directory, optionally recursively. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory to delete. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.recursive] The optional switch indicating if the + * delete should be recursive + * + * @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 {FileOperationResult} - 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. + * + * {FileOperationResult} [result] - The deserialized result object if an error did not occur. + * See {@link FileOperationResult} 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. + */ + deleteMethod(accountName: string, path: string, options?: { recursive? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(accountName: string, path: string, callback: ServiceCallback): void; + deleteMethod(accountName: string, path: string, options: { recursive? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Rename a file or directory. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory to move/rename. + * + * @param {string} destination The path to move/rename the file or folder to + * + * @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. + */ + renameWithHttpOperationResponse(accountName: string, path: string, destination: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Rename a file or directory. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory to move/rename. + * + * @param {string} destination The path to move/rename the file or folder to + * + * @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 {FileOperationResult} - 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. + * + * {FileOperationResult} [result] - The deserialized result object if an error did not occur. + * See {@link FileOperationResult} 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. + */ + rename(accountName: string, path: string, destination: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + rename(accountName: string, path: string, destination: string, callback: ServiceCallback): void; + rename(accountName: string, path: string, destination: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Sets the owner of a file or directory. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory for which to set the owner. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.owner] The AAD Object ID of the user owner of the + * file or directory. If empty, the property will remain unchanged. + * + * @param {string} [options.group] The AAD Object ID of the group owner of the + * file or directory. If empty, the property will remain unchanged. + * + * @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. + */ + setOwnerWithHttpOperationResponse(accountName: string, path: string, options?: { owner? : string, group? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Sets the owner of a file or directory. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory for which to set the owner. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.owner] The AAD Object ID of the user owner of the + * file or directory. If empty, the property will remain unchanged. + * + * @param {string} [options.group] The AAD Object ID of the group owner of the + * file or directory. If empty, the property will remain unchanged. + * + * @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. + */ + setOwner(accountName: string, path: string, options?: { owner? : string, group? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + setOwner(accountName: string, path: string, callback: ServiceCallback): void; + setOwner(accountName: string, path: string, options: { owner? : string, group? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Sets the permission of the file or folder. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory for which to set the permission. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.permission] A string representation of the + * permission (i.e 'rwx'). If empty, this property remains unchanged. + * + * @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. + */ + setPermissionWithHttpOperationResponse(accountName: string, path: string, options?: { permission? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Sets the permission of the file or folder. + * + * @param {string} accountName The Azure Data Lake Store account to execute + * filesystem operations on. + * + * @param {string} path The Data Lake Store path (starting with '/') of the + * file or directory for which to set the permission. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.permission] A string representation of the + * permission (i.e 'rwx'). If empty, this property remains unchanged. + * + * @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. + */ + setPermission(accountName: string, path: string, options?: { permission? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + setPermission(accountName: string, path: string, callback: ServiceCallback): void; + setPermission(accountName: string, path: string, options: { permission? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} diff --git a/lib/services/datalake.Store/lib/filesystem/operations/index.js b/lib/services/datalake.Store/lib/filesystem/operations/index.js new file mode 100644 index 0000000000..bfe29f562c --- /dev/null +++ b/lib/services/datalake.Store/lib/filesystem/operations/index.js @@ -0,0 +1,17 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * 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.FileSystem = require('./fileSystem'); From d75f099cda27e68ce3b5250a1e3af5e35614f1c2 Mon Sep 17 00:00:00 2001 From: Dan Schulte Date: Thu, 15 Nov 2018 09:43:30 -0800 Subject: [PATCH 2/8] Resolve file path changes --- ...taLakeStoreFileSystemManagementClient.d.ts | 17 +- ...dataLakeStoreFileSystemManagementClient.js | 9 +- .../lib/filesystem/models/aclStatus.js | 12 +- .../lib/filesystem/models/aclStatusResult.js | 18 +- .../models/adlsAccessControlException.js | 6 + .../models/adlsBadOffsetException.js | 6 + .../lib/filesystem/models/adlsError.js | 16 +- .../models/adlsFileAlreadyExistsException.js | 6 + .../models/adlsFileNotFoundException.js | 6 + .../lib/filesystem/models/adlsIOException.js | 6 + .../models/adlsIllegalArgumentException.js | 6 + .../filesystem/models/adlsRemoteException.js | 9 +- .../filesystem/models/adlsRuntimeException.js | 6 + .../models/adlsSecurityException.js | 6 + .../models/adlsThrottledException.js | 6 + .../adlsUnsupportedOperationException.js | 6 + .../lib/filesystem/models/contentSummary.js | 8 +- .../filesystem/models/contentSummaryResult.js | 16 +- .../filesystem/models/fileOperationResult.js | 2 +- .../filesystem/models/fileStatusProperties.js | 31 +- .../lib/filesystem/models/fileStatusResult.js | 34 +- .../lib/filesystem/models/fileStatuses.js | 8 +- .../filesystem/models/fileStatusesResult.js | 8 +- .../lib/filesystem/models/index.d.ts | 333 +++++++----------- .../lib/filesystem/operations/fileSystem.js | 27 +- .../lib/filesystem/operations/index.d.ts | 18 +- 26 files changed, 299 insertions(+), 327 deletions(-) diff --git a/lib/services/dataLake.Store/lib/filesystem/dataLakeStoreFileSystemManagementClient.d.ts b/lib/services/dataLake.Store/lib/filesystem/dataLakeStoreFileSystemManagementClient.d.ts index d4e827ccdb..6096d849da 100644 --- a/lib/services/dataLake.Store/lib/filesystem/dataLakeStoreFileSystemManagementClient.d.ts +++ b/lib/services/dataLake.Store/lib/filesystem/dataLakeStoreFileSystemManagementClient.d.ts @@ -10,6 +10,7 @@ import { ServiceClientCredentials } from 'ms-rest'; import { AzureServiceClient, AzureServiceClientOptions } from 'ms-rest-azure'; +import * as models from "./models"; import * as operations from "./operations"; /** @@ -21,20 +22,20 @@ declare interface DataLakeStoreFileSystemManagementClientOptions extends AzureSe */ adlsFileSystemDnsSuffix?: string; /** - * @property {string} [acceptLanguage] - Gets or sets the preferred language for the response. + * @property {string} [acceptLanguage] - The preferred language for the response. */ acceptLanguage?: string; /** - * @property {number} [longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * @property {number} [longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. */ longRunningOperationRetryTimeout?: number; /** - * @property {boolean} [generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @property {boolean} [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. */ generateClientRequestId?: boolean; } -declare class DataLakeStoreFileSystemManagementClient extends AzureServiceClient { +export default class DataLakeStoreFileSystemManagementClient extends AzureServiceClient { /** * Initializes a new instance of the DataLakeStoreFileSystemManagementClient class. * @constructor @@ -53,11 +54,11 @@ declare class DataLakeStoreFileSystemManagementClient extends AzureServiceClient * * @param {string} [options.adlsFileSystemDnsSuffix] - Gets the URI used as the base for all cloud service requests. * - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. + * @param {string} [options.acceptLanguage] - 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 {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. * - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {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, options?: DataLakeStoreFileSystemManagementClientOptions); @@ -78,4 +79,4 @@ declare class DataLakeStoreFileSystemManagementClient extends AzureServiceClient fileSystem: operations.FileSystem; } -export = DataLakeStoreFileSystemManagementClient; +export { DataLakeStoreFileSystemManagementClient, models as DataLakeStoreFileSystemManagementModels }; diff --git a/lib/services/dataLake.Store/lib/filesystem/dataLakeStoreFileSystemManagementClient.js b/lib/services/dataLake.Store/lib/filesystem/dataLakeStoreFileSystemManagementClient.js index 5f35579b9e..f1518f7367 100644 --- a/lib/services/dataLake.Store/lib/filesystem/dataLakeStoreFileSystemManagementClient.js +++ b/lib/services/dataLake.Store/lib/filesystem/dataLakeStoreFileSystemManagementClient.js @@ -33,9 +33,9 @@ class DataLakeStoreFileSystemManagementClient extends ServiceClient { * {@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.adlsFileSystemDnsSuffix] - Gets the URI used as the base for all cloud service requests. - * @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. + * @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, options) { if (credentials === null || credentials === undefined) { @@ -76,3 +76,6 @@ class DataLakeStoreFileSystemManagementClient extends ServiceClient { } module.exports = DataLakeStoreFileSystemManagementClient; +module.exports['default'] = DataLakeStoreFileSystemManagementClient; +module.exports.DataLakeStoreFileSystemManagementClient = DataLakeStoreFileSystemManagementClient; +module.exports.DataLakeStoreFileSystemManagementModels = models; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/aclStatus.js b/lib/services/dataLake.Store/lib/filesystem/models/aclStatus.js index 6d902fbcfe..5c33de6971 100644 --- a/lib/services/dataLake.Store/lib/filesystem/models/aclStatus.js +++ b/lib/services/dataLake.Store/lib/filesystem/models/aclStatus.js @@ -17,13 +17,13 @@ class AclStatus { /** * Create a AclStatus. - * @member {array} [entries] the list of ACLSpec entries on a file or + * @property {array} [entries] the list of ACLSpec entries on a file or * directory. - * @member {string} [group] the group owner, an AAD Object ID. - * @member {string} [owner] the user owner, an AAD Object ID. - * @member {number} [permission] The octal representation of the unnamed + * @property {string} [group] the group owner, an AAD Object ID. + * @property {string} [owner] the user owner, an AAD Object ID. + * @property {string} [permission] The octal representation of the unnamed * user, mask and other permissions. - * @member {boolean} [stickyBit] the indicator of whether the sticky bit is + * @property {boolean} [stickyBit] the indicator of whether the sticky bit is * on or off. */ constructor() { @@ -75,7 +75,7 @@ class AclStatus { required: false, serializedName: 'permission', type: { - name: 'Number' + name: 'String' } }, stickyBit: { diff --git a/lib/services/dataLake.Store/lib/filesystem/models/aclStatusResult.js b/lib/services/dataLake.Store/lib/filesystem/models/aclStatusResult.js index bcdea0159c..45076aa4ab 100644 --- a/lib/services/dataLake.Store/lib/filesystem/models/aclStatusResult.js +++ b/lib/services/dataLake.Store/lib/filesystem/models/aclStatusResult.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Data Lake Store file or directory Access Control List information. * @@ -19,15 +17,15 @@ const models = require('./index'); class AclStatusResult { /** * Create a AclStatusResult. - * @member {object} [aclStatus] the AclStatus object for a given file or + * @property {object} [aclStatus] the AclStatus object for a given file or * directory. - * @member {array} [aclStatus.entries] the list of ACLSpec entries on a file - * or directory. - * @member {string} [aclStatus.group] the group owner, an AAD Object ID. - * @member {string} [aclStatus.owner] the user owner, an AAD Object ID. - * @member {number} [aclStatus.permission] The octal representation of the + * @property {array} [aclStatus.entries] the list of ACLSpec entries on a + * file or directory. + * @property {string} [aclStatus.group] the group owner, an AAD Object ID. + * @property {string} [aclStatus.owner] the user owner, an AAD Object ID. + * @property {string} [aclStatus.permission] The octal representation of the * unnamed user, mask and other permissions. - * @member {boolean} [aclStatus.stickyBit] the indicator of whether the + * @property {boolean} [aclStatus.stickyBit] the indicator of whether the * sticky bit is on or off. */ constructor() { @@ -49,7 +47,7 @@ class AclStatusResult { modelProperties: { aclStatus: { required: false, - serializedName: 'AclStatus', + serializedName: 'aclStatus', type: { name: 'Composite', className: 'AclStatus' diff --git a/lib/services/dataLake.Store/lib/filesystem/models/adlsAccessControlException.js b/lib/services/dataLake.Store/lib/filesystem/models/adlsAccessControlException.js index 2cad613d2b..bd8dfb50b9 100644 --- a/lib/services/dataLake.Store/lib/filesystem/models/adlsAccessControlException.js +++ b/lib/services/dataLake.Store/lib/filesystem/models/adlsAccessControlException.js @@ -39,6 +39,11 @@ class AdlsAccessControlException extends models['AdlsRemoteException'] { serializedName: 'AccessControlException', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'exception', + clientName: 'exception' + }, + uberParent: 'AdlsRemoteException', className: 'AdlsAccessControlException', modelProperties: { javaClassName: { @@ -60,6 +65,7 @@ class AdlsAccessControlException extends models['AdlsRemoteException'] { exception: { required: true, serializedName: 'exception', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/dataLake.Store/lib/filesystem/models/adlsBadOffsetException.js b/lib/services/dataLake.Store/lib/filesystem/models/adlsBadOffsetException.js index 3e31de0f64..b37a11a3bb 100644 --- a/lib/services/dataLake.Store/lib/filesystem/models/adlsBadOffsetException.js +++ b/lib/services/dataLake.Store/lib/filesystem/models/adlsBadOffsetException.js @@ -39,6 +39,11 @@ class AdlsBadOffsetException extends models['AdlsRemoteException'] { serializedName: 'BadOffsetException', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'exception', + clientName: 'exception' + }, + uberParent: 'AdlsRemoteException', className: 'AdlsBadOffsetException', modelProperties: { javaClassName: { @@ -60,6 +65,7 @@ class AdlsBadOffsetException extends models['AdlsRemoteException'] { exception: { required: true, serializedName: 'exception', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/dataLake.Store/lib/filesystem/models/adlsError.js b/lib/services/dataLake.Store/lib/filesystem/models/adlsError.js index 5acc259073..afee6cdaca 100644 --- a/lib/services/dataLake.Store/lib/filesystem/models/adlsError.js +++ b/lib/services/dataLake.Store/lib/filesystem/models/adlsError.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Data Lake Store filesystem error containing a specific WebHDFS exception. * @@ -19,15 +17,15 @@ const models = require('./index'); class AdlsError { /** * Create a AdlsError. - * @member {object} [remoteException] the object representing the actual + * @property {object} [remoteException] the object representing the actual * WebHDFS exception being returned. - * @member {string} [remoteException.javaClassName] the full class package + * @property {string} [remoteException.javaClassName] the full class package * name for the exception thrown, such as * 'java.lang.IllegalArgumentException'. - * @member {string} [remoteException.message] the message associated with the - * exception that was thrown, such as 'Invalid value for webhdfs parameter - * "permission":...'. - * @member {string} [remoteException.exception] Polymorphic Discriminator + * @property {string} [remoteException.message] the message associated with + * the exception that was thrown, such as 'Invalid value for webhdfs + * parameter "permission":...'. + * @property {string} [remoteException.exception] Polymorphic Discriminator */ constructor() { } @@ -49,7 +47,7 @@ class AdlsError { remoteException: { required: false, readOnly: true, - serializedName: 'RemoteException', + serializedName: 'remoteException', type: { name: 'Composite', polymorphicDiscriminator: { diff --git a/lib/services/dataLake.Store/lib/filesystem/models/adlsFileAlreadyExistsException.js b/lib/services/dataLake.Store/lib/filesystem/models/adlsFileAlreadyExistsException.js index afa345170a..322a120690 100644 --- a/lib/services/dataLake.Store/lib/filesystem/models/adlsFileAlreadyExistsException.js +++ b/lib/services/dataLake.Store/lib/filesystem/models/adlsFileAlreadyExistsException.js @@ -38,6 +38,11 @@ class AdlsFileAlreadyExistsException extends models['AdlsRemoteException'] { serializedName: 'FileAlreadyExistsException', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'exception', + clientName: 'exception' + }, + uberParent: 'AdlsRemoteException', className: 'AdlsFileAlreadyExistsException', modelProperties: { javaClassName: { @@ -59,6 +64,7 @@ class AdlsFileAlreadyExistsException extends models['AdlsRemoteException'] { exception: { required: true, serializedName: 'exception', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/dataLake.Store/lib/filesystem/models/adlsFileNotFoundException.js b/lib/services/dataLake.Store/lib/filesystem/models/adlsFileNotFoundException.js index d8c925970e..fc7dedb0b7 100644 --- a/lib/services/dataLake.Store/lib/filesystem/models/adlsFileNotFoundException.js +++ b/lib/services/dataLake.Store/lib/filesystem/models/adlsFileNotFoundException.js @@ -38,6 +38,11 @@ class AdlsFileNotFoundException extends models['AdlsRemoteException'] { serializedName: 'FileNotFoundException', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'exception', + clientName: 'exception' + }, + uberParent: 'AdlsRemoteException', className: 'AdlsFileNotFoundException', modelProperties: { javaClassName: { @@ -59,6 +64,7 @@ class AdlsFileNotFoundException extends models['AdlsRemoteException'] { exception: { required: true, serializedName: 'exception', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/dataLake.Store/lib/filesystem/models/adlsIOException.js b/lib/services/dataLake.Store/lib/filesystem/models/adlsIOException.js index fe2d2eb379..144d991c95 100644 --- a/lib/services/dataLake.Store/lib/filesystem/models/adlsIOException.js +++ b/lib/services/dataLake.Store/lib/filesystem/models/adlsIOException.js @@ -38,6 +38,11 @@ class AdlsIOException extends models['AdlsRemoteException'] { serializedName: 'IOException', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'exception', + clientName: 'exception' + }, + uberParent: 'AdlsRemoteException', className: 'AdlsIOException', modelProperties: { javaClassName: { @@ -59,6 +64,7 @@ class AdlsIOException extends models['AdlsRemoteException'] { exception: { required: true, serializedName: 'exception', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/dataLake.Store/lib/filesystem/models/adlsIllegalArgumentException.js b/lib/services/dataLake.Store/lib/filesystem/models/adlsIllegalArgumentException.js index 0ee8fd1295..3487ead2f7 100644 --- a/lib/services/dataLake.Store/lib/filesystem/models/adlsIllegalArgumentException.js +++ b/lib/services/dataLake.Store/lib/filesystem/models/adlsIllegalArgumentException.js @@ -38,6 +38,11 @@ class AdlsIllegalArgumentException extends models['AdlsRemoteException'] { serializedName: 'IllegalArgumentException', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'exception', + clientName: 'exception' + }, + uberParent: 'AdlsRemoteException', className: 'AdlsIllegalArgumentException', modelProperties: { javaClassName: { @@ -59,6 +64,7 @@ class AdlsIllegalArgumentException extends models['AdlsRemoteException'] { exception: { required: true, serializedName: 'exception', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/dataLake.Store/lib/filesystem/models/adlsRemoteException.js b/lib/services/dataLake.Store/lib/filesystem/models/adlsRemoteException.js index f40dac889a..63bc60d088 100644 --- a/lib/services/dataLake.Store/lib/filesystem/models/adlsRemoteException.js +++ b/lib/services/dataLake.Store/lib/filesystem/models/adlsRemoteException.js @@ -18,12 +18,12 @@ class AdlsRemoteException { /** * Create a AdlsRemoteException. - * @member {string} [javaClassName] the full class package name for the + * @property {string} [javaClassName] the full class package name for the * exception thrown, such as 'java.lang.IllegalArgumentException'. - * @member {string} [message] the message associated with the exception that - * was thrown, such as 'Invalid value for webhdfs parameter + * @property {string} [message] the message associated with the exception + * that was thrown, such as 'Invalid value for webhdfs parameter * "permission":...'. - * @member {string} exception Polymorphic Discriminator + * @property {string} exception Polymorphic Discriminator */ constructor() { } @@ -66,6 +66,7 @@ class AdlsRemoteException { exception: { required: true, serializedName: 'exception', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/dataLake.Store/lib/filesystem/models/adlsRuntimeException.js b/lib/services/dataLake.Store/lib/filesystem/models/adlsRuntimeException.js index ffc414c763..fa925f17ec 100644 --- a/lib/services/dataLake.Store/lib/filesystem/models/adlsRuntimeException.js +++ b/lib/services/dataLake.Store/lib/filesystem/models/adlsRuntimeException.js @@ -39,6 +39,11 @@ class AdlsRuntimeException extends models['AdlsRemoteException'] { serializedName: 'RuntimeException', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'exception', + clientName: 'exception' + }, + uberParent: 'AdlsRemoteException', className: 'AdlsRuntimeException', modelProperties: { javaClassName: { @@ -60,6 +65,7 @@ class AdlsRuntimeException extends models['AdlsRemoteException'] { exception: { required: true, serializedName: 'exception', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/dataLake.Store/lib/filesystem/models/adlsSecurityException.js b/lib/services/dataLake.Store/lib/filesystem/models/adlsSecurityException.js index 71084c3e39..7bef0f8275 100644 --- a/lib/services/dataLake.Store/lib/filesystem/models/adlsSecurityException.js +++ b/lib/services/dataLake.Store/lib/filesystem/models/adlsSecurityException.js @@ -38,6 +38,11 @@ class AdlsSecurityException extends models['AdlsRemoteException'] { serializedName: 'SecurityException', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'exception', + clientName: 'exception' + }, + uberParent: 'AdlsRemoteException', className: 'AdlsSecurityException', modelProperties: { javaClassName: { @@ -59,6 +64,7 @@ class AdlsSecurityException extends models['AdlsRemoteException'] { exception: { required: true, serializedName: 'exception', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/dataLake.Store/lib/filesystem/models/adlsThrottledException.js b/lib/services/dataLake.Store/lib/filesystem/models/adlsThrottledException.js index 9885773656..f06eca6765 100644 --- a/lib/services/dataLake.Store/lib/filesystem/models/adlsThrottledException.js +++ b/lib/services/dataLake.Store/lib/filesystem/models/adlsThrottledException.js @@ -39,6 +39,11 @@ class AdlsThrottledException extends models['AdlsRemoteException'] { serializedName: 'ThrottledException', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'exception', + clientName: 'exception' + }, + uberParent: 'AdlsRemoteException', className: 'AdlsThrottledException', modelProperties: { javaClassName: { @@ -60,6 +65,7 @@ class AdlsThrottledException extends models['AdlsRemoteException'] { exception: { required: true, serializedName: 'exception', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/dataLake.Store/lib/filesystem/models/adlsUnsupportedOperationException.js b/lib/services/dataLake.Store/lib/filesystem/models/adlsUnsupportedOperationException.js index 73fd2f6575..9bedfacb32 100644 --- a/lib/services/dataLake.Store/lib/filesystem/models/adlsUnsupportedOperationException.js +++ b/lib/services/dataLake.Store/lib/filesystem/models/adlsUnsupportedOperationException.js @@ -38,6 +38,11 @@ class AdlsUnsupportedOperationException extends models['AdlsRemoteException'] { serializedName: 'UnsupportedOperationException', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'exception', + clientName: 'exception' + }, + uberParent: 'AdlsRemoteException', className: 'AdlsUnsupportedOperationException', modelProperties: { javaClassName: { @@ -59,6 +64,7 @@ class AdlsUnsupportedOperationException extends models['AdlsRemoteException'] { exception: { required: true, serializedName: 'exception', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/dataLake.Store/lib/filesystem/models/contentSummary.js b/lib/services/dataLake.Store/lib/filesystem/models/contentSummary.js index d1ef650c0e..0a28148049 100644 --- a/lib/services/dataLake.Store/lib/filesystem/models/contentSummary.js +++ b/lib/services/dataLake.Store/lib/filesystem/models/contentSummary.js @@ -17,10 +17,10 @@ class ContentSummary { /** * Create a ContentSummary. - * @member {number} [directoryCount] the number of directories. - * @member {number} [fileCount] the number of files. - * @member {number} [length] the number of bytes used by the content. - * @member {number} [spaceConsumed] the disk space consumed by the content. + * @property {number} [directoryCount] the number of directories. + * @property {number} [fileCount] the number of files. + * @property {number} [length] the number of bytes used by the content. + * @property {number} [spaceConsumed] the disk space consumed by the content. */ constructor() { } diff --git a/lib/services/dataLake.Store/lib/filesystem/models/contentSummaryResult.js b/lib/services/dataLake.Store/lib/filesystem/models/contentSummaryResult.js index 3196c10645..33569c05d6 100644 --- a/lib/services/dataLake.Store/lib/filesystem/models/contentSummaryResult.js +++ b/lib/services/dataLake.Store/lib/filesystem/models/contentSummaryResult.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Data Lake Store filesystem content summary information response. * @@ -19,15 +17,15 @@ const models = require('./index'); class ContentSummaryResult { /** * Create a ContentSummaryResult. - * @member {object} [contentSummary] the content summary for the specified + * @property {object} [contentSummary] the content summary for the specified * path - * @member {number} [contentSummary.directoryCount] the number of + * @property {number} [contentSummary.directoryCount] the number of * directories. - * @member {number} [contentSummary.fileCount] the number of files. - * @member {number} [contentSummary.length] the number of bytes used by the + * @property {number} [contentSummary.fileCount] the number of files. + * @property {number} [contentSummary.length] the number of bytes used by the * content. - * @member {number} [contentSummary.spaceConsumed] the disk space consumed by - * the content. + * @property {number} [contentSummary.spaceConsumed] the disk space consumed + * by the content. */ constructor() { } @@ -49,7 +47,7 @@ class ContentSummaryResult { contentSummary: { required: false, readOnly: true, - serializedName: 'ContentSummary', + serializedName: 'contentSummary', type: { name: 'Composite', className: 'ContentSummary' diff --git a/lib/services/dataLake.Store/lib/filesystem/models/fileOperationResult.js b/lib/services/dataLake.Store/lib/filesystem/models/fileOperationResult.js index 4e661bd57a..adab3af571 100644 --- a/lib/services/dataLake.Store/lib/filesystem/models/fileOperationResult.js +++ b/lib/services/dataLake.Store/lib/filesystem/models/fileOperationResult.js @@ -17,7 +17,7 @@ class FileOperationResult { /** * Create a FileOperationResult. - * @member {boolean} [operationResult] the result of the operation or + * @property {boolean} [operationResult] the result of the operation or * request. */ constructor() { diff --git a/lib/services/dataLake.Store/lib/filesystem/models/fileStatusProperties.js b/lib/services/dataLake.Store/lib/filesystem/models/fileStatusProperties.js index 47abe76bbe..73fed29d22 100644 --- a/lib/services/dataLake.Store/lib/filesystem/models/fileStatusProperties.js +++ b/lib/services/dataLake.Store/lib/filesystem/models/fileStatusProperties.js @@ -17,23 +17,22 @@ class FileStatusProperties { /** * Create a FileStatusProperties. - * @member {number} [accessTime] the last access time as ticks since the + * @property {number} [accessTime] the last access time as ticks since the * epoch. - * @member {number} [blockSize] the block size for the file. - * @member {number} [childrenNum] the number of children in the directory. - * @member {number} [expirationTime] Gets the expiration time, if any, as + * @property {number} [blockSize] the block size for the file. + * @property {number} [expirationTime] Gets the expiration time, if any, as * ticks since the epoch. If the value is 0 or DateTime.MaxValue there is no * expiration. - * @member {string} [group] the group owner. - * @member {number} [length] the number of bytes in a file. - * @member {number} [modificationTime] the modification time as ticks since + * @property {string} [group] the group owner. + * @property {number} [length] the number of bytes in a file. + * @property {number} [modificationTime] the modification time as ticks since * the epoch. - * @member {string} [owner] the user who is the owner. - * @member {string} [pathSuffix] the path suffix. - * @member {string} [permission] the permission represented as an string. - * @member {string} [type] the type of the path object. Possible values + * @property {string} [owner] the user who is the owner. + * @property {string} [pathSuffix] the path suffix. + * @property {string} [permission] the permission represented as an string. + * @property {string} [type] the type of the path object. Possible values * include: 'FILE', 'DIRECTORY' - * @member {boolean} [aclBit] flag to indicate if extended acls are enabled + * @property {boolean} [aclBit] flag to indicate if extended acls are enabled */ constructor() { } @@ -68,14 +67,6 @@ class FileStatusProperties { name: 'Number' } }, - childrenNum: { - required: false, - readOnly: true, - serializedName: 'childrenNum', - type: { - name: 'Number' - } - }, expirationTime: { required: false, readOnly: true, diff --git a/lib/services/dataLake.Store/lib/filesystem/models/fileStatusResult.js b/lib/services/dataLake.Store/lib/filesystem/models/fileStatusResult.js index 01670a42a2..5940e4c7a8 100644 --- a/lib/services/dataLake.Store/lib/filesystem/models/fileStatusResult.js +++ b/lib/services/dataLake.Store/lib/filesystem/models/fileStatusResult.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Data Lake Store filesystem file status information response. * @@ -19,27 +17,25 @@ const models = require('./index'); class FileStatusResult { /** * Create a FileStatusResult. - * @member {object} [fileStatus] the file status object associated with the + * @property {object} [fileStatus] the file status object associated with the * specified path. - * @member {number} [fileStatus.accessTime] the last access time as ticks + * @property {number} [fileStatus.accessTime] the last access time as ticks * since the epoch. - * @member {number} [fileStatus.blockSize] the block size for the file. - * @member {number} [fileStatus.childrenNum] the number of children in the - * directory. - * @member {number} [fileStatus.expirationTime] Gets the expiration time, if - * any, as ticks since the epoch. If the value is 0 or DateTime.MaxValue + * @property {number} [fileStatus.blockSize] the block size for the file. + * @property {number} [fileStatus.expirationTime] Gets the expiration time, + * if any, as ticks since the epoch. If the value is 0 or DateTime.MaxValue * there is no expiration. - * @member {string} [fileStatus.group] the group owner. - * @member {number} [fileStatus.length] the number of bytes in a file. - * @member {number} [fileStatus.modificationTime] the modification time as + * @property {string} [fileStatus.group] the group owner. + * @property {number} [fileStatus.length] the number of bytes in a file. + * @property {number} [fileStatus.modificationTime] the modification time as * ticks since the epoch. - * @member {string} [fileStatus.owner] the user who is the owner. - * @member {string} [fileStatus.pathSuffix] the path suffix. - * @member {string} [fileStatus.permission] the permission represented as an - * string. - * @member {string} [fileStatus.type] the type of the path object. Possible + * @property {string} [fileStatus.owner] the user who is the owner. + * @property {string} [fileStatus.pathSuffix] the path suffix. + * @property {string} [fileStatus.permission] the permission represented as + * an string. + * @property {string} [fileStatus.type] the type of the path object. Possible * values include: 'FILE', 'DIRECTORY' - * @member {boolean} [fileStatus.aclBit] flag to indicate if extended acls + * @property {boolean} [fileStatus.aclBit] flag to indicate if extended acls * are enabled */ constructor() { @@ -62,7 +58,7 @@ class FileStatusResult { fileStatus: { required: false, readOnly: true, - serializedName: 'FileStatus', + serializedName: 'fileStatus', type: { name: 'Composite', className: 'FileStatusProperties' diff --git a/lib/services/dataLake.Store/lib/filesystem/models/fileStatuses.js b/lib/services/dataLake.Store/lib/filesystem/models/fileStatuses.js index 01e0d30d46..c73fa30d0b 100644 --- a/lib/services/dataLake.Store/lib/filesystem/models/fileStatuses.js +++ b/lib/services/dataLake.Store/lib/filesystem/models/fileStatuses.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Data Lake Store file status list information. * @@ -19,8 +17,8 @@ const models = require('./index'); class FileStatuses { /** * Create a FileStatuses. - * @member {array} [fileStatus] the object containing the list of properties - * of the files. + * @property {array} [fileStatus] the object containing the list of + * properties of the files. */ constructor() { } @@ -42,7 +40,7 @@ class FileStatuses { fileStatus: { required: false, readOnly: true, - serializedName: 'FileStatus', + serializedName: 'fileStatus', type: { name: 'Sequence', element: { diff --git a/lib/services/dataLake.Store/lib/filesystem/models/fileStatusesResult.js b/lib/services/dataLake.Store/lib/filesystem/models/fileStatusesResult.js index df18600a91..bff868c5f7 100644 --- a/lib/services/dataLake.Store/lib/filesystem/models/fileStatusesResult.js +++ b/lib/services/dataLake.Store/lib/filesystem/models/fileStatusesResult.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Data Lake Store filesystem file status list information response. * @@ -19,9 +17,9 @@ const models = require('./index'); class FileStatusesResult { /** * Create a FileStatusesResult. - * @member {object} [fileStatuses] the object representing the list of file + * @property {object} [fileStatuses] the object representing the list of file * statuses. - * @member {array} [fileStatuses.fileStatus] the object containing the list + * @property {array} [fileStatuses.fileStatus] the object containing the list * of properties of the files. */ constructor() { @@ -44,7 +42,7 @@ class FileStatusesResult { fileStatuses: { required: false, readOnly: true, - serializedName: 'FileStatuses', + serializedName: 'fileStatuses', type: { name: 'Composite', className: 'FileStatuses' diff --git a/lib/services/dataLake.Store/lib/filesystem/models/index.d.ts b/lib/services/dataLake.Store/lib/filesystem/models/index.d.ts index 8e648f2ce1..2055076f20 100644 --- a/lib/services/dataLake.Store/lib/filesystem/models/index.d.ts +++ b/lib/services/dataLake.Store/lib/filesystem/models/index.d.ts @@ -1,361 +1,276 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Licensed under the MIT License. See License.txt in the project root for license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * 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'; +import { BaseResource, CloudError } from "ms-rest-azure"; +import * as moment from "moment"; -export { BaseResource } from 'ms-rest-azure'; -export { CloudError } from 'ms-rest-azure'; +export { + BaseResource, + CloudError +}; /** - * @class - * Initializes a new instance of the FileOperationResult class. - * @constructor * The result of the request or operation. - * - * @member {boolean} [operationResult] the result of the operation or request. */ export interface FileOperationResult { + /** + * the result of the operation or request. + */ readonly operationResult?: boolean; } /** - * @class - * Initializes a new instance of the AclStatus class. - * @constructor * Data Lake Store file or directory Access Control List information. - * - * @member {array} [entries] the list of ACLSpec entries on a file or - * directory. - * @member {string} [group] the group owner, an AAD Object ID. - * @member {string} [owner] the user owner, an AAD Object ID. - * @member {number} [permission] The octal representation of the unnamed user, - * mask and other permissions. - * @member {boolean} [stickyBit] the indicator of whether the sticky bit is on - * or off. */ export interface AclStatus { + /** + * the list of ACLSpec entries on a file or directory. + */ entries?: string[]; + /** + * the group owner, an AAD Object ID. + */ group?: string; + /** + * the user owner, an AAD Object ID. + */ owner?: string; - permission?: number; + /** + * The octal representation of the unnamed user, mask and other permissions. + */ + permission?: string; + /** + * the indicator of whether the sticky bit is on or off. + */ readonly stickyBit?: boolean; } /** - * @class - * Initializes a new instance of the AclStatusResult class. - * @constructor * Data Lake Store file or directory Access Control List information. - * - * @member {object} [aclStatus] the AclStatus object for a given file or - * directory. - * @member {array} [aclStatus.entries] the list of ACLSpec entries on a file or - * directory. - * @member {string} [aclStatus.group] the group owner, an AAD Object ID. - * @member {string} [aclStatus.owner] the user owner, an AAD Object ID. - * @member {number} [aclStatus.permission] The octal representation of the - * unnamed user, mask and other permissions. - * @member {boolean} [aclStatus.stickyBit] the indicator of whether the sticky - * bit is on or off. */ export interface AclStatusResult { + /** + * the AclStatus object for a given file or directory. + */ aclStatus?: AclStatus; } /** - * @class - * Initializes a new instance of the ContentSummary class. - * @constructor * Data Lake Store content summary information - * - * @member {number} [directoryCount] the number of directories. - * @member {number} [fileCount] the number of files. - * @member {number} [length] the number of bytes used by the content. - * @member {number} [spaceConsumed] the disk space consumed by the content. */ export interface ContentSummary { + /** + * the number of directories. + */ readonly directoryCount?: number; + /** + * the number of files. + */ readonly fileCount?: number; + /** + * the number of bytes used by the content. + */ readonly length?: number; + /** + * the disk space consumed by the content. + */ readonly spaceConsumed?: number; } /** - * @class - * Initializes a new instance of the ContentSummaryResult class. - * @constructor * Data Lake Store filesystem content summary information response. - * - * @member {object} [contentSummary] the content summary for the specified path - * @member {number} [contentSummary.directoryCount] the number of directories. - * @member {number} [contentSummary.fileCount] the number of files. - * @member {number} [contentSummary.length] the number of bytes used by the - * content. - * @member {number} [contentSummary.spaceConsumed] the disk space consumed by - * the content. */ export interface ContentSummaryResult { + /** + * the content summary for the specified path + */ readonly contentSummary?: ContentSummary; } /** - * @class - * Initializes a new instance of the FileStatusProperties class. - * @constructor * Data Lake Store file or directory information. - * - * @member {number} [accessTime] the last access time as ticks since the epoch. - * @member {number} [blockSize] the block size for the file. - * @member {number} [childrenNum] the number of children in the directory. - * @member {number} [expirationTime] Gets the expiration time, if any, as ticks - * since the epoch. If the value is 0 or DateTime.MaxValue there is no - * expiration. - * @member {string} [group] the group owner. - * @member {number} [length] the number of bytes in a file. - * @member {number} [modificationTime] the modification time as ticks since the - * epoch. - * @member {string} [owner] the user who is the owner. - * @member {string} [pathSuffix] the path suffix. - * @member {string} [permission] the permission represented as an string. - * @member {string} [type] the type of the path object. Possible values - * include: 'FILE', 'DIRECTORY' - * @member {boolean} [aclBit] flag to indicate if extended acls are enabled */ export interface FileStatusProperties { + /** + * the last access time as ticks since the epoch. + */ readonly accessTime?: number; + /** + * the block size for the file. + */ readonly blockSize?: number; - readonly childrenNum?: number; + /** + * Gets the expiration time, if any, as ticks since the epoch. If the value is 0 or + * DateTime.MaxValue there is no expiration. + */ readonly expirationTime?: number; + /** + * the group owner. + */ readonly group?: string; + /** + * the number of bytes in a file. + */ readonly length?: number; + /** + * the modification time as ticks since the epoch. + */ readonly modificationTime?: number; + /** + * the user who is the owner. + */ readonly owner?: string; + /** + * the path suffix. + */ readonly pathSuffix?: string; + /** + * the permission represented as an string. + */ readonly permission?: string; + /** + * the type of the path object. Possible values include: 'FILE', 'DIRECTORY' + */ readonly type?: string; + /** + * flag to indicate if extended acls are enabled + */ readonly aclBit?: boolean; } /** - * @class - * Initializes a new instance of the FileStatuses class. - * @constructor * Data Lake Store file status list information. - * - * @member {array} [fileStatus] the object containing the list of properties of - * the files. */ export interface FileStatuses { + /** + * the object containing the list of properties of the files. + */ readonly fileStatus?: FileStatusProperties[]; } /** - * @class - * Initializes a new instance of the FileStatusesResult class. - * @constructor * Data Lake Store filesystem file status list information response. - * - * @member {object} [fileStatuses] the object representing the list of file - * statuses. - * @member {array} [fileStatuses.fileStatus] the object containing the list of - * properties of the files. */ export interface FileStatusesResult { + /** + * the object representing the list of file statuses. + */ readonly fileStatuses?: FileStatuses; } /** - * @class - * Initializes a new instance of the FileStatusResult class. - * @constructor * Data Lake Store filesystem file status information response. - * - * @member {object} [fileStatus] the file status object associated with the - * specified path. - * @member {number} [fileStatus.accessTime] the last access time as ticks since - * the epoch. - * @member {number} [fileStatus.blockSize] the block size for the file. - * @member {number} [fileStatus.childrenNum] the number of children in the - * directory. - * @member {number} [fileStatus.expirationTime] Gets the expiration time, if - * any, as ticks since the epoch. If the value is 0 or DateTime.MaxValue there - * is no expiration. - * @member {string} [fileStatus.group] the group owner. - * @member {number} [fileStatus.length] the number of bytes in a file. - * @member {number} [fileStatus.modificationTime] the modification time as - * ticks since the epoch. - * @member {string} [fileStatus.owner] the user who is the owner. - * @member {string} [fileStatus.pathSuffix] the path suffix. - * @member {string} [fileStatus.permission] the permission represented as an - * string. - * @member {string} [fileStatus.type] the type of the path object. Possible - * values include: 'FILE', 'DIRECTORY' - * @member {boolean} [fileStatus.aclBit] flag to indicate if extended acls are - * enabled */ export interface FileStatusResult { + /** + * the file status object associated with the specified path. + */ readonly fileStatus?: FileStatusProperties; } /** - * @class - * Initializes a new instance of the AdlsRemoteException class. - * @constructor - * Data Lake Store filesystem exception based on the WebHDFS definition for - * RemoteExceptions. This is a WebHDFS 'catch all' exception - * - * @member {string} [javaClassName] the full class package name for the - * exception thrown, such as 'java.lang.IllegalArgumentException'. - * @member {string} [message] the message associated with the exception that - * was thrown, such as 'Invalid value for webhdfs parameter "permission":...'. - * @member {string} exception Polymorphic Discriminator + * Data Lake Store filesystem exception based on the WebHDFS definition for RemoteExceptions. This + * is a WebHDFS 'catch all' exception */ export interface AdlsRemoteException { + /** + * the full class package name for the exception thrown, such as + * 'java.lang.IllegalArgumentException'. + */ readonly javaClassName?: string; + /** + * the message associated with the exception that was thrown, such as 'Invalid value for webhdfs + * parameter "permission":...'. + */ readonly message?: string; + /** + * Polymorphic Discriminator + */ exception: string; } /** - * @class - * Initializes a new instance of the AdlsIllegalArgumentException class. - * @constructor - * A WebHDFS exception thrown indicating that one more arguments is incorrect. - * Thrown when a 400 error response code is returned (bad request). - * + * A WebHDFS exception thrown indicating that one more arguments is incorrect. Thrown when a 400 + * error response code is returned (bad request). */ export interface AdlsIllegalArgumentException extends AdlsRemoteException { } /** - * @class - * Initializes a new instance of the AdlsUnsupportedOperationException class. - * @constructor - * A WebHDFS exception thrown indicating that the requested operation is not - * supported. Thrown when a 400 error response code is returned (bad request). - * + * A WebHDFS exception thrown indicating that the requested operation is not supported. Thrown when + * a 400 error response code is returned (bad request). */ export interface AdlsUnsupportedOperationException extends AdlsRemoteException { } /** - * @class - * Initializes a new instance of the AdlsSecurityException class. - * @constructor - * A WebHDFS exception thrown indicating that access is denied. Thrown when a - * 401 error response code is returned (Unauthorized). - * + * A WebHDFS exception thrown indicating that access is denied. Thrown when a 401 error response + * code is returned (Unauthorized). */ export interface AdlsSecurityException extends AdlsRemoteException { } /** - * @class - * Initializes a new instance of the AdlsIOException class. - * @constructor - * A WebHDFS exception thrown indicating there was an IO (read or write) error. - * Thrown when a 403 error response code is returned (forbidden). - * + * A WebHDFS exception thrown indicating there was an IO (read or write) error. Thrown when a 403 + * error response code is returned (forbidden). */ export interface AdlsIOException extends AdlsRemoteException { } /** - * @class - * Initializes a new instance of the AdlsFileNotFoundException class. - * @constructor - * A WebHDFS exception thrown indicating the file or folder could not be found. - * Thrown when a 404 error response code is returned (not found). - * + * A WebHDFS exception thrown indicating the file or folder could not be found. Thrown when a 404 + * error response code is returned (not found). */ export interface AdlsFileNotFoundException extends AdlsRemoteException { } /** - * @class - * Initializes a new instance of the AdlsFileAlreadyExistsException class. - * @constructor - * A WebHDFS exception thrown indicating the file or folder already exists. - * Thrown when a 403 error response code is returned (forbidden). - * + * A WebHDFS exception thrown indicating the file or folder already exists. Thrown when a 403 error + * response code is returned (forbidden). */ export interface AdlsFileAlreadyExistsException extends AdlsRemoteException { } /** - * @class - * Initializes a new instance of the AdlsBadOffsetException class. - * @constructor - * A WebHDFS exception thrown indicating the append or read is from a bad - * offset. Thrown when a 400 error response code is returned for append and - * open operations (Bad request). - * + * A WebHDFS exception thrown indicating the append or read is from a bad offset. Thrown when a 400 + * error response code is returned for append and open operations (Bad request). */ export interface AdlsBadOffsetException extends AdlsRemoteException { } /** - * @class - * Initializes a new instance of the AdlsRuntimeException class. - * @constructor - * A WebHDFS exception thrown when an unexpected error occurs during an - * operation. Thrown when a 500 error response code is returned (Internal - * server error). - * + * A WebHDFS exception thrown when an unexpected error occurs during an operation. Thrown when a + * 500 error response code is returned (Internal server error). */ export interface AdlsRuntimeException extends AdlsRemoteException { } /** - * @class - * Initializes a new instance of the AdlsAccessControlException class. - * @constructor - * A WebHDFS exception thrown indicating that access is denied due to - * insufficient permissions. Thrown when a 403 error response code is returned - * (forbidden). - * + * A WebHDFS exception thrown indicating that access is denied due to insufficient permissions. + * Thrown when a 403 error response code is returned (forbidden). */ export interface AdlsAccessControlException extends AdlsRemoteException { } /** - * @class - * Initializes a new instance of the AdlsThrottledException class. - * @constructor - * A WebHDFS exception thrown indicating that the request is being throttled. - * Reducing the number of requests or request size helps to mitigate this - * error. - * + * A WebHDFS exception thrown indicating that the request is being throttled. Reducing the number + * of requests or request size helps to mitigate this error. */ export interface AdlsThrottledException extends AdlsRemoteException { } /** - * @class - * Initializes a new instance of the AdlsError class. - * @constructor * Data Lake Store filesystem error containing a specific WebHDFS exception. - * - * @member {object} [remoteException] the object representing the actual - * WebHDFS exception being returned. - * @member {string} [remoteException.javaClassName] the full class package name - * for the exception thrown, such as 'java.lang.IllegalArgumentException'. - * @member {string} [remoteException.message] the message associated with the - * exception that was thrown, such as 'Invalid value for webhdfs parameter - * "permission":...'. - * @member {string} [remoteException.exception] Polymorphic Discriminator */ export interface AdlsError { + /** + * the object representing the actual WebHDFS exception being returned. + */ readonly remoteException?: AdlsRemoteException; } - diff --git a/lib/services/dataLake.Store/lib/filesystem/operations/fileSystem.js b/lib/services/dataLake.Store/lib/filesystem/operations/fileSystem.js index b4a83263b9..2d288d3dc7 100644 --- a/lib/services/dataLake.Store/lib/filesystem/operations/fileSystem.js +++ b/lib/services/dataLake.Store/lib/filesystem/operations/fileSystem.js @@ -192,7 +192,8 @@ function _setFileExpiry(accountName, path, expiryOption, options, callback) { * file to which to append using concurrent append. * * @param {object} streamContents The file contents to include when appending - * to the file. + * to the file. The maximum content size is 4MB. For content larger than 4MB + * you must append the content in 4MB chunks. * * @param {object} [options] Optional Parameters. * @@ -1649,7 +1650,8 @@ function _open(accountName, path, options, callback) { * file to which to append. * * @param {object} streamContents The file contents to include when appending - * to the file. + * to the file. The maximum content size is 4MB. For content larger than 4MB + * you must append the content in 4MB chunks. * * @param {object} [options] Optional Parameters. * @@ -1848,7 +1850,8 @@ function _append(accountName, path, streamContents, options, callback) { * * @param {object} [options.streamContents] The file contents to include when * creating the file. This parameter is optional, resulting in an empty file if - * not specified. + * not specified. The maximum content size is 4MB. For content larger than + * 4MB you must append the content in 4MB chunks. * * @param {boolean} [options.overwrite] The indication of if the file should be * overwritten. @@ -3650,7 +3653,8 @@ class FileSystem { * file to which to append using concurrent append. * * @param {object} streamContents The file contents to include when appending - * to the file. + * to the file. The maximum content size is 4MB. For content larger than 4MB + * you must append the content in 4MB chunks. * * @param {object} [options] Optional Parameters. * @@ -3708,7 +3712,8 @@ class FileSystem { * file to which to append using concurrent append. * * @param {object} streamContents The file contents to include when appending - * to the file. + * to the file. The maximum content size is 4MB. For content larger than 4MB + * you must append the content in 4MB chunks. * * @param {object} [options] Optional Parameters. * @@ -4614,7 +4619,8 @@ class FileSystem { * file to which to append. * * @param {object} streamContents The file contents to include when appending - * to the file. + * to the file. The maximum content size is 4MB. For content larger than 4MB + * you must append the content in 4MB chunks. * * @param {object} [options] Optional Parameters. * @@ -4677,7 +4683,8 @@ class FileSystem { * file to which to append. * * @param {object} streamContents The file contents to include when appending - * to the file. + * to the file. The maximum content size is 4MB. For content larger than 4MB + * you must append the content in 4MB chunks. * * @param {object} [options] Optional Parameters. * @@ -4761,7 +4768,8 @@ class FileSystem { * * @param {object} [options.streamContents] The file contents to include when * creating the file. This parameter is optional, resulting in an empty file if - * not specified. + * not specified. The maximum content size is 4MB. For content larger than + * 4MB you must append the content in 4MB chunks. * * @param {boolean} [options.overwrite] The indication of if the file should be * overwritten. @@ -4821,7 +4829,8 @@ class FileSystem { * * @param {object} [options.streamContents] The file contents to include when * creating the file. This parameter is optional, resulting in an empty file if - * not specified. + * not specified. The maximum content size is 4MB. For content larger than + * 4MB you must append the content in 4MB chunks. * * @param {boolean} [options.overwrite] The indication of if the file should be * overwritten. diff --git a/lib/services/dataLake.Store/lib/filesystem/operations/index.d.ts b/lib/services/dataLake.Store/lib/filesystem/operations/index.d.ts index adb56ff294..cd17fe23fc 100644 --- a/lib/services/dataLake.Store/lib/filesystem/operations/index.d.ts +++ b/lib/services/dataLake.Store/lib/filesystem/operations/index.d.ts @@ -127,7 +127,8 @@ export interface FileSystem { * file to which to append using concurrent append. * * @param {object} streamContents The file contents to include when appending - * to the file. + * to the file. The maximum content size is 4MB. For content larger than 4MB + * you must append the content in 4MB chunks. * * @param {object} [options] Optional Parameters. * @@ -173,7 +174,8 @@ export interface FileSystem { * file to which to append using concurrent append. * * @param {object} streamContents The file contents to include when appending - * to the file. + * to the file. The maximum content size is 4MB. For content larger than 4MB + * you must append the content in 4MB chunks. * * @param {object} [options] Optional Parameters. * @@ -848,7 +850,8 @@ export interface FileSystem { * file to which to append. * * @param {object} streamContents The file contents to include when appending - * to the file. + * to the file. The maximum content size is 4MB. For content larger than 4MB + * you must append the content in 4MB chunks. * * @param {object} [options] Optional Parameters. * @@ -899,7 +902,8 @@ export interface FileSystem { * file to which to append. * * @param {object} streamContents The file contents to include when appending - * to the file. + * to the file. The maximum content size is 4MB. For content larger than 4MB + * you must append the content in 4MB chunks. * * @param {object} [options] Optional Parameters. * @@ -968,7 +972,8 @@ export interface FileSystem { * * @param {object} [options.streamContents] The file contents to include when * creating the file. This parameter is optional, resulting in an empty file if - * not specified. + * not specified. The maximum content size is 4MB. For content larger than + * 4MB you must append the content in 4MB chunks. * * @param {boolean} [options.overwrite] The indication of if the file should be * overwritten. @@ -1016,7 +1021,8 @@ export interface FileSystem { * * @param {object} [options.streamContents] The file contents to include when * creating the file. This parameter is optional, resulting in an empty file if - * not specified. + * not specified. The maximum content size is 4MB. For content larger than + * 4MB you must append the content in 4MB chunks. * * @param {boolean} [options.overwrite] The indication of if the file should be * overwritten. From b68cc8edb9776c33303b9c8e6ca8e0d8a35ec323 Mon Sep 17 00:00:00 2001 From: Dan Schulte Date: Thu, 15 Nov 2018 10:08:16 -0800 Subject: [PATCH 3/8] Format azure-arm-datalake-store package.json --- lib/services/dataLake.Store/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/services/dataLake.Store/package.json b/lib/services/dataLake.Store/package.json index 00c01dcc5e..4480690669 100644 --- a/lib/services/dataLake.Store/package.json +++ b/lib/services/dataLake.Store/package.json @@ -32,4 +32,4 @@ "scripts": { "test": "npm -s run-script jshint" } -} \ No newline at end of file +} From 0aecea12f80e011b07044dd2df826aa54562c85c Mon Sep 17 00:00:00 2001 From: Dan Schulte Date: Thu, 15 Nov 2018 13:29:36 -0800 Subject: [PATCH 4/8] Delete files with old-casing --- lib/services/dataLake.Store/LICENSE.txt | 21 - lib/services/dataLake.Store/README.md | 115 - .../dataLakeStoreAccountManagementClient.d.ts | 63 - .../dataLakeStoreAccountManagementClient.js | 84 - .../account/models/dataLakeStoreAccount.js | 315 -- .../models/dataLakeStoreAccountBasic.js | 154 - .../lib/account/models/encryptionConfig.js | 73 - .../lib/account/models/encryptionIdentity.js | 73 - .../lib/account/models/firewallRule.js | 91 - .../lib/account/models/index.d.ts | 410 -- .../lib/account/models/index.js | 38 - .../lib/account/models/keyVaultMetaInfo.js | 71 - .../lib/account/models/resource.js | 98 - .../lib/account/models/trustedIdProvider.js | 79 - .../account/models/updateEncryptionConfig.js | 58 - .../models/updateFirewallRuleParameters.js | 64 - .../account/models/updateKeyVaultMetaInfo.js | 53 - .../updateTrustedIdProviderParameters.js | 52 - .../lib/account/operations/firewallRules.js | 1575 -------- .../lib/account/operations/index.d.ts | 2141 ---------- .../lib/account/operations/index.js | 19 - .../account/operations/trustedIdProviders.js | 1557 -------- lib/services/dataLake.Store/package.json | 35 - .../dataLakeStoreAccountUpdateParameters.js | 135 + .../dataLakeStoreFirewallRuleListResult.js} | 20 +- ...ataLakeStoreTrustedIdProviderListResult.js | 69 + .../lib/account/models/errorDetails.js} | 38 +- .../lib/account/operations/account.js | 3465 +++++++++++++++++ .../datalake.Store/lib/dataLakeStore.js | 20 + .../datalake.Store/lib/datalakeStore.d.ts | 14 + 30 files changed, 3734 insertions(+), 7266 deletions(-) delete mode 100644 lib/services/dataLake.Store/LICENSE.txt delete mode 100644 lib/services/dataLake.Store/README.md delete mode 100644 lib/services/dataLake.Store/lib/account/dataLakeStoreAccountManagementClient.d.ts delete mode 100644 lib/services/dataLake.Store/lib/account/dataLakeStoreAccountManagementClient.js delete mode 100644 lib/services/dataLake.Store/lib/account/models/dataLakeStoreAccount.js delete mode 100644 lib/services/dataLake.Store/lib/account/models/dataLakeStoreAccountBasic.js delete mode 100644 lib/services/dataLake.Store/lib/account/models/encryptionConfig.js delete mode 100644 lib/services/dataLake.Store/lib/account/models/encryptionIdentity.js delete mode 100644 lib/services/dataLake.Store/lib/account/models/firewallRule.js delete mode 100644 lib/services/dataLake.Store/lib/account/models/index.d.ts delete mode 100644 lib/services/dataLake.Store/lib/account/models/index.js delete mode 100644 lib/services/dataLake.Store/lib/account/models/keyVaultMetaInfo.js delete mode 100644 lib/services/dataLake.Store/lib/account/models/resource.js delete mode 100644 lib/services/dataLake.Store/lib/account/models/trustedIdProvider.js delete mode 100644 lib/services/dataLake.Store/lib/account/models/updateEncryptionConfig.js delete mode 100644 lib/services/dataLake.Store/lib/account/models/updateFirewallRuleParameters.js delete mode 100644 lib/services/dataLake.Store/lib/account/models/updateKeyVaultMetaInfo.js delete mode 100644 lib/services/dataLake.Store/lib/account/models/updateTrustedIdProviderParameters.js delete mode 100644 lib/services/dataLake.Store/lib/account/operations/firewallRules.js delete mode 100644 lib/services/dataLake.Store/lib/account/operations/index.d.ts delete mode 100644 lib/services/dataLake.Store/lib/account/operations/index.js delete mode 100644 lib/services/dataLake.Store/lib/account/operations/trustedIdProviders.js delete mode 100644 lib/services/dataLake.Store/package.json create mode 100644 lib/services/datalake.Store/lib/account/models/dataLakeStoreAccountUpdateParameters.js rename lib/services/{dataLake.Store/lib/account/models/dataLakeStoreAccountListResult.js => datalake.Store/lib/account/models/dataLakeStoreFirewallRuleListResult.js} (67%) create mode 100644 lib/services/datalake.Store/lib/account/models/dataLakeStoreTrustedIdProviderListResult.js rename lib/services/{dataLake.Store/lib/account/models/subResource.js => datalake.Store/lib/account/models/errorDetails.js} (53%) create mode 100644 lib/services/datalake.Store/lib/account/operations/account.js create mode 100644 lib/services/datalake.Store/lib/dataLakeStore.js create mode 100644 lib/services/datalake.Store/lib/datalakeStore.d.ts diff --git a/lib/services/dataLake.Store/LICENSE.txt b/lib/services/dataLake.Store/LICENSE.txt deleted file mode 100644 index 0313a903d7..0000000000 --- a/lib/services/dataLake.Store/LICENSE.txt +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2017 Microsoft - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/lib/services/dataLake.Store/README.md b/lib/services/dataLake.Store/README.md deleted file mode 100644 index c176700aa6..0000000000 --- a/lib/services/dataLake.Store/README.md +++ /dev/null @@ -1,115 +0,0 @@ -# Microsoft Azure SDK for Node.js - Data Lake Store - -This project provides a Node.js package that makes it easy to manage Azure Data Lake Store accounts. - -Right now it supports: - - * **Node.js version: 6.x.x or higher** - -## Features - -- Account management: create, get, list, update, and delete. -- File system management: create, get, upload, append, download, read, delete, list. - -## How to Install - -```bash -npm install azure-arm-datalake-store -``` - -## How to Use - -### Authentication, account and filesystem client creation and listing file status as an example - - ```javascript - var msRestAzure = require('ms-rest-azure'); - var adlsManagement = require("azure-arm-datalake-store"); - - // Interactive Login - // It provides a url and code that needs to be copied and pasted in a browser and authenticated over there. If successful, - // the user will get a DeviceTokenCredentials object. - msRestAzure.interactiveLogin(function(err, credentials) { - var accountName = 'testadlsacct'; - var pathToEnumerate = '/myfolder'; - var acccountClient = new adlsManagement.DataLakeStoreAccountClient(credentials, 'your-subscription-id'); - var filesystemClient = new adlsManagement.DataLakeStoreFileSystemClient(credentials, 'azuredatalakestore.net'); - filesystemClient.fileSystem.listFileStatus(accountName, pathToEnumerate, function(err, result, request, response) { - if (err) console.log(err); - console.log(result); - }); - }); - ``` - -### Create a Data Lake Store Account -```javascript -var util = require('util'); -var resourceGroupName = 'testrg'; -var accountName = 'testadlsacct'; -var location = 'eastus2'; - -// account object to create -var accountToCreate = { - tags: { - testtag1: 'testvalue1', - testtag2: 'testvalue2' - }, - location: location -}; - -client.account.create(resourceGroupName, accountName, accountToCreate, function (err, result, request, response) { - if (err) { - console.log(err); - /*err has reference to the actual request and response, so you can see what was sent and received on the wire. - The structure of err looks like this: - err: { - code: 'Error Code', - message: 'Error Message', - body: 'The response body if any', - request: reference to a stripped version of http request - response: reference to a stripped version of the response - } - */ - } else { - console.log('result is: ' + util.inspect(result, {depth: null})); - } -}); -``` - -### Create a file with content -```javascript -var util = require('util'); -var accountName = 'testadlsacct'; -var fileToCreate = '/myfolder/myfile.txt'; -var options = { - streamContents: new Buffer('some string content') -} - -filesystemClient.fileSystem.listFileStatus(accountName, fileToCreate, options, function (err, result, request, response) { - if (err) { - console.log(err); - } else { - // no result is returned, only a 201 response for success. - console.log('response is: ' + util.inspect(response, {depth: null})); - } -}); -``` - -### Get a list of files and folders - -```javascript -var util = require('util'); -var accountName = 'testadlsacct'; -var pathToEnumerate = '/myfolder'; -filesystemClient.fileSystem.listFileStatus(accountName, pathToEnumerate, function (err, result, request, response) { - if (err) { - console.log(err); - } else { - console.log('result is: ' + util.inspect(result, {depth: null})); - } -}); -``` - -## Related projects - -- [Microsoft Azure SDK for Node.js](https://github.com/azure/azure-sdk-for-node) -- [Microsoft Azure SDK for Node.js - Data Lake Analytics Management](https://github.com/Azure/azure-sdk-for-node/tree/autorest/lib/services/dataLake.Store) diff --git a/lib/services/dataLake.Store/lib/account/dataLakeStoreAccountManagementClient.d.ts b/lib/services/dataLake.Store/lib/account/dataLakeStoreAccountManagementClient.d.ts deleted file mode 100644 index 7d1bdf60ec..0000000000 --- a/lib/services/dataLake.Store/lib/account/dataLakeStoreAccountManagementClient.d.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * 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 operations from "./operations"; - -declare class DataLakeStoreAccountManagementClient extends AzureServiceClient { - /** - * Initializes a new instance of the DataLakeStoreAccountManagementClient class. - * @constructor - * - * @class - * @param {credentials} credentials - Credentials needed for the client to connect to Azure. - * - * @param {string} subscriptionId - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - * - * @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; - - subscriptionId: string; - - apiVersion: string; - - acceptLanguage: string; - - longRunningOperationRetryTimeout: number; - - generateClientRequestId: boolean; - - // Operation groups - firewallRules: operations.FirewallRules; - trustedIdProviders: operations.TrustedIdProviders; - account: operations.Account; -} - -export = DataLakeStoreAccountManagementClient; diff --git a/lib/services/dataLake.Store/lib/account/dataLakeStoreAccountManagementClient.js b/lib/services/dataLake.Store/lib/account/dataLakeStoreAccountManagementClient.js deleted file mode 100644 index f8480c9efa..0000000000 --- a/lib/services/dataLake.Store/lib/account/dataLakeStoreAccountManagementClient.js +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * 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 DataLakeStoreAccountManagementClient. */ -class DataLakeStoreAccountManagementClient extends ServiceClient { - /** - * Create a DataLakeStoreAccountManagementClient. - * @param {credentials} credentials - Credentials needed for the client to connect to Azure. - * @param {string} subscriptionId - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - * @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 = '2016-11-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.firewallRules = new operations.FirewallRules(this); - this.trustedIdProviders = new operations.TrustedIdProviders(this); - this.account = new operations.Account(this); - this.models = models; - msRest.addSerializationMixin(this); - } - -} - -module.exports = DataLakeStoreAccountManagementClient; diff --git a/lib/services/dataLake.Store/lib/account/models/dataLakeStoreAccount.js b/lib/services/dataLake.Store/lib/account/models/dataLakeStoreAccount.js deleted file mode 100644 index 1e26563dd5..0000000000 --- a/lib/services/dataLake.Store/lib/account/models/dataLakeStoreAccount.js +++ /dev/null @@ -1,315 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * 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'); - -/** - * Data Lake Store account information - * - * @extends models['Resource'] - */ -class DataLakeStoreAccount extends models['Resource'] { - /** - * Create a DataLakeStoreAccount. - * @member {object} [identity] The Key Vault encryption identity, if any. - * @member {uuid} [identity.principalId] The principal identifier associated - * with the encryption. - * @member {uuid} [identity.tenantId] The tenant identifier associated with - * the encryption. - * @member {string} [provisioningState] the provisioning status of the Data - * Lake Store account. Possible values include: 'Failed', 'Creating', - * 'Running', 'Succeeded', 'Patching', 'Suspending', 'Resuming', 'Deleting', - * 'Deleted', 'Undeleting', 'Canceled' - * @member {string} [state] the state of the Data Lake Store account. - * Possible values include: 'Active', 'Suspended' - * @member {date} [creationTime] the account creation time. - * @member {date} [lastModifiedTime] the account last modified time. - * @member {string} [endpoint] the full CName endpoint for this account. - * @member {uuid} [accountId] The unique identifier associated with this Data - * Lake Store account. - * @member {string} [encryptionState] The current state of encryption for - * this Data Lake store account. Possible values include: 'Enabled', - * 'Disabled' - * @member {string} [encryptionProvisioningState] The current state of - * encryption provisioning for this Data Lake store account. Possible values - * include: 'Creating', 'Succeeded' - * @member {object} [encryptionConfig] The Key Vault encryption - * configuration. - * @member {string} [encryptionConfig.type] The type of encryption - * configuration being used. Currently the only supported types are - * 'UserManaged' and 'ServiceManaged'. Possible values include: - * 'UserManaged', 'ServiceManaged' - * @member {object} [encryptionConfig.keyVaultMetaInfo] The Key Vault - * information for connecting to user managed encryption keys. - * @member {string} [encryptionConfig.keyVaultMetaInfo.keyVaultResourceId] - * The resource identifier for the user managed Key Vault being used to - * encrypt. - * @member {string} [encryptionConfig.keyVaultMetaInfo.encryptionKeyName] The - * name of the user managed encryption key. - * @member {string} [encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] - * The version of the user managed encryption key. - * @member {string} [firewallState] The current state of the IP address - * firewall for this Data Lake store account. Possible values include: - * 'Enabled', 'Disabled' - * @member {array} [firewallRules] The list of firewall rules associated with - * this Data Lake store account. - * @member {string} [trustedIdProviderState] The current state of the trusted - * identity provider feature for this Data Lake store account. Possible - * values include: 'Enabled', 'Disabled' - * @member {array} [trustedIdProviders] The list of trusted identity - * providers associated with this Data Lake store account. - * @member {string} [defaultGroup] the default owner group for all new - * folders and files created in the Data Lake Store account. - * @member {string} [newTier] the commitment tier to use for next month. - * Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', - * 'Commitment_1PB', 'Commitment_5PB' - * @member {string} [currentTier] the commitment tier in use for the current - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', - * 'Commitment_1PB', 'Commitment_5PB' - * @member {string} [firewallAllowAzureIps] The current state of allowing or - * disallowing IPs originating within Azure through the firewall. If the - * firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' - */ - constructor() { - super(); - } - - /** - * Defines the metadata of DataLakeStoreAccount - * - * @returns {object} metadata of DataLakeStoreAccount - * - */ - mapper() { - return { - required: false, - serializedName: 'DataLakeStoreAccount', - type: { - name: 'Composite', - className: 'DataLakeStoreAccount', - modelProperties: { - id: { - required: false, - readOnly: true, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: true, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - identity: { - required: false, - serializedName: 'identity', - type: { - name: 'Composite', - className: 'EncryptionIdentity' - } - }, - provisioningState: { - required: false, - readOnly: true, - serializedName: 'properties.provisioningState', - type: { - name: 'Enum', - allowedValues: [ 'Failed', 'Creating', 'Running', 'Succeeded', 'Patching', 'Suspending', 'Resuming', 'Deleting', 'Deleted', 'Undeleting', 'Canceled' ] - } - }, - state: { - required: false, - readOnly: true, - serializedName: 'properties.state', - type: { - name: 'Enum', - allowedValues: [ 'Active', 'Suspended' ] - } - }, - creationTime: { - required: false, - readOnly: true, - serializedName: 'properties.creationTime', - type: { - name: 'DateTime' - } - }, - lastModifiedTime: { - required: false, - readOnly: true, - serializedName: 'properties.lastModifiedTime', - type: { - name: 'DateTime' - } - }, - endpoint: { - required: false, - readOnly: true, - serializedName: 'properties.endpoint', - type: { - name: 'String' - } - }, - accountId: { - required: false, - readOnly: true, - serializedName: 'properties.accountId', - type: { - name: 'String' - } - }, - encryptionState: { - required: false, - serializedName: 'properties.encryptionState', - type: { - name: 'Enum', - allowedValues: [ 'Enabled', 'Disabled' ] - } - }, - encryptionProvisioningState: { - required: false, - readOnly: true, - serializedName: 'properties.encryptionProvisioningState', - type: { - name: 'Enum', - allowedValues: [ 'Creating', 'Succeeded' ] - } - }, - encryptionConfig: { - required: false, - serializedName: 'properties.encryptionConfig', - type: { - name: 'Composite', - className: 'EncryptionConfig' - } - }, - firewallState: { - required: false, - serializedName: 'properties.firewallState', - type: { - name: 'Enum', - allowedValues: [ 'Enabled', 'Disabled' ] - } - }, - firewallRules: { - required: false, - serializedName: 'properties.firewallRules', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'FirewallRuleElementType', - type: { - name: 'Composite', - className: 'FirewallRule' - } - } - } - }, - trustedIdProviderState: { - required: false, - serializedName: 'properties.trustedIdProviderState', - type: { - name: 'Enum', - allowedValues: [ 'Enabled', 'Disabled' ] - } - }, - trustedIdProviders: { - required: false, - serializedName: 'properties.trustedIdProviders', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'TrustedIdProviderElementType', - type: { - name: 'Composite', - className: 'TrustedIdProvider' - } - } - } - }, - defaultGroup: { - required: false, - serializedName: 'properties.defaultGroup', - type: { - name: 'String' - } - }, - newTier: { - required: false, - serializedName: 'properties.newTier', - type: { - name: 'Enum', - allowedValues: [ 'Consumption', 'Commitment_1TB', 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', 'Commitment_5PB' ] - } - }, - currentTier: { - required: false, - readOnly: true, - serializedName: 'properties.currentTier', - type: { - name: 'Enum', - allowedValues: [ 'Consumption', 'Commitment_1TB', 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', 'Commitment_5PB' ] - } - }, - firewallAllowAzureIps: { - required: false, - serializedName: 'properties.firewallAllowAzureIps', - type: { - name: 'Enum', - allowedValues: [ 'Enabled', 'Disabled' ] - } - } - } - } - }; - } -} - -module.exports = DataLakeStoreAccount; diff --git a/lib/services/dataLake.Store/lib/account/models/dataLakeStoreAccountBasic.js b/lib/services/dataLake.Store/lib/account/models/dataLakeStoreAccountBasic.js deleted file mode 100644 index e2b83691d3..0000000000 --- a/lib/services/dataLake.Store/lib/account/models/dataLakeStoreAccountBasic.js +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * 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'); - -/** - * Basic Data Lake Store account information, returned on list calls. - * - * @extends models['Resource'] - */ -class DataLakeStoreAccountBasic extends models['Resource'] { - /** - * Create a DataLakeStoreAccountBasic. - * @member {string} [provisioningState] the provisioning status of the Data - * Lake Store account. Possible values include: 'Failed', 'Creating', - * 'Running', 'Succeeded', 'Patching', 'Suspending', 'Resuming', 'Deleting', - * 'Deleted', 'Undeleting', 'Canceled' - * @member {string} [state] the state of the Data Lake Store account. - * Possible values include: 'Active', 'Suspended' - * @member {date} [creationTime] the account creation time. - * @member {date} [lastModifiedTime] the account last modified time. - * @member {string} [endpoint] the full CName endpoint for this account. - * @member {uuid} [accountId] The unique identifier associated with this Data - * Lake Store account. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of DataLakeStoreAccountBasic - * - * @returns {object} metadata of DataLakeStoreAccountBasic - * - */ - mapper() { - return { - required: false, - serializedName: 'DataLakeStoreAccountBasic', - type: { - name: 'Composite', - className: 'DataLakeStoreAccountBasic', - modelProperties: { - id: { - required: false, - readOnly: true, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: true, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - provisioningState: { - required: false, - readOnly: true, - serializedName: 'properties.provisioningState', - type: { - name: 'Enum', - allowedValues: [ 'Failed', 'Creating', 'Running', 'Succeeded', 'Patching', 'Suspending', 'Resuming', 'Deleting', 'Deleted', 'Undeleting', 'Canceled' ] - } - }, - state: { - required: false, - readOnly: true, - serializedName: 'properties.state', - type: { - name: 'Enum', - allowedValues: [ 'Active', 'Suspended' ] - } - }, - creationTime: { - required: false, - readOnly: true, - serializedName: 'properties.creationTime', - type: { - name: 'DateTime' - } - }, - lastModifiedTime: { - required: false, - readOnly: true, - serializedName: 'properties.lastModifiedTime', - type: { - name: 'DateTime' - } - }, - endpoint: { - required: false, - readOnly: true, - serializedName: 'properties.endpoint', - type: { - name: 'String' - } - }, - accountId: { - required: false, - readOnly: true, - serializedName: 'properties.accountId', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = DataLakeStoreAccountBasic; diff --git a/lib/services/dataLake.Store/lib/account/models/encryptionConfig.js b/lib/services/dataLake.Store/lib/account/models/encryptionConfig.js deleted file mode 100644 index d6de7129f0..0000000000 --- a/lib/services/dataLake.Store/lib/account/models/encryptionConfig.js +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * 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 encryption configuration for the account. - * - */ -class EncryptionConfig { - /** - * Create a EncryptionConfig. - * @member {string} type The type of encryption configuration being used. - * Currently the only supported types are 'UserManaged' and 'ServiceManaged'. - * Possible values include: 'UserManaged', 'ServiceManaged' - * @member {object} [keyVaultMetaInfo] The Key Vault information for - * connecting to user managed encryption keys. - * @member {string} [keyVaultMetaInfo.keyVaultResourceId] The resource - * identifier for the user managed Key Vault being used to encrypt. - * @member {string} [keyVaultMetaInfo.encryptionKeyName] The name of the user - * managed encryption key. - * @member {string} [keyVaultMetaInfo.encryptionKeyVersion] The version of - * the user managed encryption key. - */ - constructor() { - } - - /** - * Defines the metadata of EncryptionConfig - * - * @returns {object} metadata of EncryptionConfig - * - */ - mapper() { - return { - required: false, - serializedName: 'EncryptionConfig', - type: { - name: 'Composite', - className: 'EncryptionConfig', - modelProperties: { - type: { - required: true, - serializedName: 'type', - type: { - name: 'Enum', - allowedValues: [ 'UserManaged', 'ServiceManaged' ] - } - }, - keyVaultMetaInfo: { - required: false, - serializedName: 'keyVaultMetaInfo', - type: { - name: 'Composite', - className: 'KeyVaultMetaInfo' - } - } - } - } - }; - } -} - -module.exports = EncryptionConfig; diff --git a/lib/services/dataLake.Store/lib/account/models/encryptionIdentity.js b/lib/services/dataLake.Store/lib/account/models/encryptionIdentity.js deleted file mode 100644 index b0eb22543d..0000000000 --- a/lib/services/dataLake.Store/lib/account/models/encryptionIdentity.js +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * 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 encryption identity properties. - * - */ -class EncryptionIdentity { - /** - * Create a EncryptionIdentity. - * @member {uuid} [principalId] The principal identifier associated with the - * encryption. - * @member {uuid} [tenantId] The tenant identifier associated with the - * encryption. - */ - constructor() { - } - - /** - * Defines the metadata of EncryptionIdentity - * - * @returns {object} metadata of EncryptionIdentity - * - */ - mapper() { - return { - required: false, - serializedName: 'EncryptionIdentity', - type: { - name: 'Composite', - className: 'EncryptionIdentity', - modelProperties: { - type: { - required: true, - isConstant: true, - serializedName: 'type', - defaultValue: 'SystemAssigned', - type: { - name: 'String' - } - }, - principalId: { - required: false, - readOnly: true, - serializedName: 'principalId', - type: { - name: 'String' - } - }, - tenantId: { - required: false, - readOnly: true, - serializedName: 'tenantId', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = EncryptionIdentity; diff --git a/lib/services/dataLake.Store/lib/account/models/firewallRule.js b/lib/services/dataLake.Store/lib/account/models/firewallRule.js deleted file mode 100644 index 537ade5868..0000000000 --- a/lib/services/dataLake.Store/lib/account/models/firewallRule.js +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * 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'); - -/** - * Data Lake Store firewall rule information - * - * @extends models['SubResource'] - */ -class FirewallRule extends models['SubResource'] { - /** - * Create a FirewallRule. - * @member {string} startIpAddress the start IP address for the firewall - * rule. This can be either ipv4 or ipv6. Start and End should be in the same - * protocol. - * @member {string} endIpAddress the end IP address for the firewall rule. - * This can be either ipv4 or ipv6. Start and End should be in the same - * protocol. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of FirewallRule - * - * @returns {object} metadata of FirewallRule - * - */ - mapper() { - return { - required: false, - serializedName: 'FirewallRule', - type: { - name: 'Composite', - className: 'FirewallRule', - modelProperties: { - id: { - required: false, - readOnly: true, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - startIpAddress: { - required: true, - serializedName: 'properties.startIpAddress', - type: { - name: 'String' - } - }, - endIpAddress: { - required: true, - serializedName: 'properties.endIpAddress', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = FirewallRule; diff --git a/lib/services/dataLake.Store/lib/account/models/index.d.ts b/lib/services/dataLake.Store/lib/account/models/index.d.ts deleted file mode 100644 index ad7ffc67cd..0000000000 --- a/lib/services/dataLake.Store/lib/account/models/index.d.ts +++ /dev/null @@ -1,410 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * 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 UpdateFirewallRuleParameters class. - * @constructor - * Data Lake Analytics firewall rule update parameters - * - * @member {string} [startIpAddress] the start IP address for the firewall - * rule. This can be either ipv4 or ipv6. Start and End should be in the same - * protocol. - * @member {string} [endIpAddress] the end IP address for the firewall rule. - * This can be either ipv4 or ipv6. Start and End should be in the same - * protocol. - */ -export interface UpdateFirewallRuleParameters { - startIpAddress?: string; - endIpAddress?: string; -} - -/** - * @class - * Initializes a new instance of the SubResource class. - * @constructor - * The Resource model definition for a nested resource. - * - * @member {string} [id] Resource Id - * @member {string} [name] Resource name - * @member {string} [type] Resource type - */ -export interface SubResource { - readonly id?: string; - name?: string; - readonly type?: string; -} - -/** - * @class - * Initializes a new instance of the FirewallRule class. - * @constructor - * Data Lake Store firewall rule information - * - * @member {string} startIpAddress the start IP address for the firewall rule. - * This can be either ipv4 or ipv6. Start and End should be in the same - * protocol. - * @member {string} endIpAddress the end IP address for the firewall rule. This - * can be either ipv4 or ipv6. Start and End should be in the same protocol. - */ -export interface FirewallRule extends SubResource { - startIpAddress: string; - endIpAddress: string; -} - -/** - * @class - * Initializes a new instance of the UpdateTrustedIdProviderParameters class. - * @constructor - * Data Lake Store Trusted Identity Provider update parameters - * - * @member {string} [idProvider] The URL of this trusted identity provider - */ -export interface UpdateTrustedIdProviderParameters { - idProvider?: string; -} - -/** - * @class - * Initializes a new instance of the TrustedIdProvider class. - * @constructor - * Data Lake Store Trusted Identity Provider information - * - * @member {string} idProvider The URL of this trusted identity provider - */ -export interface TrustedIdProvider extends SubResource { - idProvider: string; -} - -/** - * @class - * Initializes a new instance of the EncryptionIdentity class. - * @constructor - * The encryption identity properties. - * - * @member {uuid} [principalId] The principal identifier associated with the - * encryption. - * @member {uuid} [tenantId] The tenant identifier associated with the - * encryption. - */ -export interface EncryptionIdentity { - readonly principalId?: string; - readonly tenantId?: string; -} - -/** - * @class - * Initializes a new instance of the KeyVaultMetaInfo class. - * @constructor - * Metadata information used by account encryption. - * - * @member {string} keyVaultResourceId The resource identifier for the user - * managed Key Vault being used to encrypt. - * @member {string} encryptionKeyName The name of the user managed encryption - * key. - * @member {string} encryptionKeyVersion The version of the user managed - * encryption key. - */ -export interface KeyVaultMetaInfo { - keyVaultResourceId: string; - encryptionKeyName: string; - encryptionKeyVersion: string; -} - -/** - * @class - * Initializes a new instance of the EncryptionConfig class. - * @constructor - * The encryption configuration for the account. - * - * @member {string} type The type of encryption configuration being used. - * Currently the only supported types are 'UserManaged' and 'ServiceManaged'. - * Possible values include: 'UserManaged', 'ServiceManaged' - * @member {object} [keyVaultMetaInfo] The Key Vault information for connecting - * to user managed encryption keys. - * @member {string} [keyVaultMetaInfo.keyVaultResourceId] The resource - * identifier for the user managed Key Vault being used to encrypt. - * @member {string} [keyVaultMetaInfo.encryptionKeyName] The name of the user - * managed encryption key. - * @member {string} [keyVaultMetaInfo.encryptionKeyVersion] The version of the - * user managed encryption key. - */ -export interface EncryptionConfig { - type: string; - keyVaultMetaInfo?: KeyVaultMetaInfo; -} - -/** - * @class - * Initializes a new instance of the UpdateKeyVaultMetaInfo class. - * @constructor - * The Key Vault update information used for user managed key rotation. - * - * @member {string} [encryptionKeyVersion] The version of the user managed - * encryption key to update through a key rotation. - */ -export interface UpdateKeyVaultMetaInfo { - encryptionKeyVersion?: string; -} - -/** - * @class - * Initializes a new instance of the UpdateEncryptionConfig class. - * @constructor - * The encryption configuration used to update a user managed Key Vault key. - * - * @member {object} [keyVaultMetaInfo] The updated Key Vault key to use in user - * managed key rotation. - * @member {string} [keyVaultMetaInfo.encryptionKeyVersion] The version of the - * user managed encryption key to update through a key rotation. - */ -export interface UpdateEncryptionConfig { - keyVaultMetaInfo?: UpdateKeyVaultMetaInfo; -} - -/** - * @class - * Initializes a new instance of the DataLakeStoreAccountUpdateParameters class. - * @constructor - * Data Lake Store account information to update - * - * @member {object} [tags] Resource tags - * @member {string} [firewallState] The current state of the IP address - * firewall for this Data Lake store account. Disabling the firewall does not - * remove existing rules, they will just be ignored until the firewall is - * re-enabled. Possible values include: 'Enabled', 'Disabled' - * @member {string} [trustedIdProviderState] The current state of the trusted - * identity provider feature for this Data Lake store account. Disabling - * trusted identity provider functionality does not remove the providers, they - * will just be ignored until this feature is re-enabled. Possible values - * include: 'Enabled', 'Disabled' - * @member {string} [defaultGroup] the default owner group for all new folders - * and files created in the Data Lake Store account. - * @member {string} [newTier] the commitment tier to use for next month. - * Possible values include: 'Consumption', 'Commitment_1TB', 'Commitment_10TB', - * 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', 'Commitment_5PB' - * @member {string} [firewallAllowAzureIps] The current state of allowing or - * disallowing IPs originating within Azure through the firewall. If the - * firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' - * @member {object} [encryptionConfig] Used for rotation of user managed Key - * Vault keys. Can only be used to rotate a user managed encryption Key Vault - * key. - * @member {object} [encryptionConfig.keyVaultMetaInfo] The updated Key Vault - * key to use in user managed key rotation. - * @member {string} [encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] - * The version of the user managed encryption key to update through a key - * rotation. - */ -export interface DataLakeStoreAccountUpdateParameters { - tags?: { [propertyName: string]: string }; - firewallState?: string; - trustedIdProviderState?: string; - defaultGroup?: string; - newTier?: string; - firewallAllowAzureIps?: string; - encryptionConfig?: UpdateEncryptionConfig; -} - -/** - * @class - * Initializes a new instance of the Resource class. - * @constructor - * The Resource model definition. - * - * @member {string} [id] Resource Id - * @member {string} [name] Resource name - * @member {string} [type] Resource type - * @member {string} location Resource location - * @member {object} [tags] Resource tags - */ -export interface Resource extends BaseResource { - readonly id?: string; - readonly name?: string; - readonly type?: string; - location: string; - tags?: { [propertyName: string]: string }; -} - -/** - * @class - * Initializes a new instance of the DataLakeStoreAccount class. - * @constructor - * Data Lake Store account information - * - * @member {object} [identity] The Key Vault encryption identity, if any. - * @member {uuid} [identity.principalId] The principal identifier associated - * with the encryption. - * @member {uuid} [identity.tenantId] The tenant identifier associated with the - * encryption. - * @member {string} [provisioningState] the provisioning status of the Data - * Lake Store account. Possible values include: 'Failed', 'Creating', - * 'Running', 'Succeeded', 'Patching', 'Suspending', 'Resuming', 'Deleting', - * 'Deleted', 'Undeleting', 'Canceled' - * @member {string} [state] the state of the Data Lake Store account. Possible - * values include: 'Active', 'Suspended' - * @member {date} [creationTime] the account creation time. - * @member {date} [lastModifiedTime] the account last modified time. - * @member {string} [endpoint] the full CName endpoint for this account. - * @member {uuid} [accountId] The unique identifier associated with this Data - * Lake Store account. - * @member {string} [encryptionState] The current state of encryption for this - * Data Lake store account. Possible values include: 'Enabled', 'Disabled' - * @member {string} [encryptionProvisioningState] The current state of - * encryption provisioning for this Data Lake store account. Possible values - * include: 'Creating', 'Succeeded' - * @member {object} [encryptionConfig] The Key Vault encryption configuration. - * @member {string} [encryptionConfig.type] The type of encryption - * configuration being used. Currently the only supported types are - * 'UserManaged' and 'ServiceManaged'. Possible values include: 'UserManaged', - * 'ServiceManaged' - * @member {object} [encryptionConfig.keyVaultMetaInfo] The Key Vault - * information for connecting to user managed encryption keys. - * @member {string} [encryptionConfig.keyVaultMetaInfo.keyVaultResourceId] The - * resource identifier for the user managed Key Vault being used to encrypt. - * @member {string} [encryptionConfig.keyVaultMetaInfo.encryptionKeyName] The - * name of the user managed encryption key. - * @member {string} [encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] - * The version of the user managed encryption key. - * @member {string} [firewallState] The current state of the IP address - * firewall for this Data Lake store account. Possible values include: - * 'Enabled', 'Disabled' - * @member {array} [firewallRules] The list of firewall rules associated with - * this Data Lake store account. - * @member {string} [trustedIdProviderState] The current state of the trusted - * identity provider feature for this Data Lake store account. Possible values - * include: 'Enabled', 'Disabled' - * @member {array} [trustedIdProviders] The list of trusted identity providers - * associated with this Data Lake store account. - * @member {string} [defaultGroup] the default owner group for all new folders - * and files created in the Data Lake Store account. - * @member {string} [newTier] the commitment tier to use for next month. - * Possible values include: 'Consumption', 'Commitment_1TB', 'Commitment_10TB', - * 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', 'Commitment_5PB' - * @member {string} [currentTier] the commitment tier in use for the current - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' - * @member {string} [firewallAllowAzureIps] The current state of allowing or - * disallowing IPs originating within Azure through the firewall. If the - * firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' - */ -export interface DataLakeStoreAccount extends Resource { - identity?: EncryptionIdentity; - readonly provisioningState?: string; - readonly state?: string; - readonly creationTime?: Date; - readonly lastModifiedTime?: Date; - readonly endpoint?: string; - readonly accountId?: string; - encryptionState?: string; - readonly encryptionProvisioningState?: string; - encryptionConfig?: EncryptionConfig; - firewallState?: string; - firewallRules?: FirewallRule[]; - trustedIdProviderState?: string; - trustedIdProviders?: TrustedIdProvider[]; - defaultGroup?: string; - newTier?: string; - readonly currentTier?: string; - firewallAllowAzureIps?: string; -} - -/** - * @class - * Initializes a new instance of the DataLakeStoreAccountBasic class. - * @constructor - * Basic Data Lake Store account information, returned on list calls. - * - * @member {string} [provisioningState] the provisioning status of the Data - * Lake Store account. Possible values include: 'Failed', 'Creating', - * 'Running', 'Succeeded', 'Patching', 'Suspending', 'Resuming', 'Deleting', - * 'Deleted', 'Undeleting', 'Canceled' - * @member {string} [state] the state of the Data Lake Store account. Possible - * values include: 'Active', 'Suspended' - * @member {date} [creationTime] the account creation time. - * @member {date} [lastModifiedTime] the account last modified time. - * @member {string} [endpoint] the full CName endpoint for this account. - * @member {uuid} [accountId] The unique identifier associated with this Data - * Lake Store account. - */ -export interface DataLakeStoreAccountBasic extends Resource { - readonly provisioningState?: string; - readonly state?: string; - readonly creationTime?: Date; - readonly lastModifiedTime?: Date; - readonly endpoint?: string; - readonly accountId?: string; -} - -/** - * @class - * Initializes a new instance of the ErrorDetails class. - * @constructor - * Data Lake Store error details information - * - * @member {string} [code] the HTTP status code or error code associated with - * this error - * @member {string} [message] the error message localized based on - * Accept-Language - * @member {string} [target] the target of the particular error (for example, - * the name of the property in error). - */ -export interface ErrorDetails { - readonly code?: string; - readonly message?: string; - readonly target?: string; -} - - -/** - * @class - * Initializes a new instance of the DataLakeStoreFirewallRuleListResult class. - * @constructor - * Data Lake Store firewall rule list information. - * - * @member {string} [nextLink] the link (url) to the next page of results. - */ -export interface DataLakeStoreFirewallRuleListResult extends Array { - readonly nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the DataLakeStoreTrustedIdProviderListResult class. - * @constructor - * Data Lake Store trusted identity provider list information. - * - * @member {string} [nextLink] the link (url) to the next page of results. - */ -export interface DataLakeStoreTrustedIdProviderListResult extends Array { - readonly nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the DataLakeStoreAccountListResult class. - * @constructor - * Data Lake Store account list information response. - * - * @member {string} [nextLink] the link (url) to the next page of results. - */ -export interface DataLakeStoreAccountListResult extends Array { - readonly nextLink?: string; -} diff --git a/lib/services/dataLake.Store/lib/account/models/index.js b/lib/services/dataLake.Store/lib/account/models/index.js deleted file mode 100644 index b519ace783..0000000000 --- a/lib/services/dataLake.Store/lib/account/models/index.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * 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.UpdateFirewallRuleParameters = require('./updateFirewallRuleParameters'); -exports.SubResource = require('./subResource'); -exports.FirewallRule = require('./firewallRule'); -exports.UpdateTrustedIdProviderParameters = require('./updateTrustedIdProviderParameters'); -exports.TrustedIdProvider = require('./trustedIdProvider'); -exports.EncryptionIdentity = require('./encryptionIdentity'); -exports.KeyVaultMetaInfo = require('./keyVaultMetaInfo'); -exports.EncryptionConfig = require('./encryptionConfig'); -exports.UpdateKeyVaultMetaInfo = require('./updateKeyVaultMetaInfo'); -exports.UpdateEncryptionConfig = require('./updateEncryptionConfig'); -exports.DataLakeStoreAccountUpdateParameters = require('./dataLakeStoreAccountUpdateParameters'); -exports.Resource = require('./resource'); -exports.DataLakeStoreAccount = require('./dataLakeStoreAccount'); -exports.DataLakeStoreAccountBasic = require('./dataLakeStoreAccountBasic'); -exports.ErrorDetails = require('./errorDetails'); -exports.DataLakeStoreFirewallRuleListResult = require('./dataLakeStoreFirewallRuleListResult'); -exports.DataLakeStoreTrustedIdProviderListResult = require('./dataLakeStoreTrustedIdProviderListResult'); -exports.DataLakeStoreAccountListResult = require('./dataLakeStoreAccountListResult'); diff --git a/lib/services/dataLake.Store/lib/account/models/keyVaultMetaInfo.js b/lib/services/dataLake.Store/lib/account/models/keyVaultMetaInfo.js deleted file mode 100644 index 796a718508..0000000000 --- a/lib/services/dataLake.Store/lib/account/models/keyVaultMetaInfo.js +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Metadata information used by account encryption. - * - */ -class KeyVaultMetaInfo { - /** - * Create a KeyVaultMetaInfo. - * @member {string} keyVaultResourceId The resource identifier for the user - * managed Key Vault being used to encrypt. - * @member {string} encryptionKeyName The name of the user managed encryption - * key. - * @member {string} encryptionKeyVersion The version of the user managed - * encryption key. - */ - constructor() { - } - - /** - * Defines the metadata of KeyVaultMetaInfo - * - * @returns {object} metadata of KeyVaultMetaInfo - * - */ - mapper() { - return { - required: false, - serializedName: 'KeyVaultMetaInfo', - type: { - name: 'Composite', - className: 'KeyVaultMetaInfo', - modelProperties: { - keyVaultResourceId: { - required: true, - serializedName: 'keyVaultResourceId', - type: { - name: 'String' - } - }, - encryptionKeyName: { - required: true, - serializedName: 'encryptionKeyName', - type: { - name: 'String' - } - }, - encryptionKeyVersion: { - required: true, - serializedName: 'encryptionKeyVersion', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = KeyVaultMetaInfo; diff --git a/lib/services/dataLake.Store/lib/account/models/resource.js b/lib/services/dataLake.Store/lib/account/models/resource.js deleted file mode 100644 index 7c1448890e..0000000000 --- a/lib/services/dataLake.Store/lib/account/models/resource.js +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * 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 Resource model definition. - * - * @extends models['BaseResource'] - */ -class Resource extends models['BaseResource'] { - /** - * Create a Resource. - * @member {string} [id] Resource Id - * @member {string} [name] Resource name - * @member {string} [type] Resource type - * @member {string} location Resource location - * @member {object} [tags] Resource tags - */ - constructor() { - super(); - } - - /** - * Defines the metadata of Resource - * - * @returns {object} metadata of Resource - * - */ - mapper() { - return { - required: false, - serializedName: 'Resource', - type: { - name: 'Composite', - className: 'Resource', - modelProperties: { - id: { - required: false, - readOnly: true, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: true, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - } - } - } - }; - } -} - -module.exports = Resource; diff --git a/lib/services/dataLake.Store/lib/account/models/trustedIdProvider.js b/lib/services/dataLake.Store/lib/account/models/trustedIdProvider.js deleted file mode 100644 index 37b9155830..0000000000 --- a/lib/services/dataLake.Store/lib/account/models/trustedIdProvider.js +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * 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'); - -/** - * Data Lake Store Trusted Identity Provider information - * - * @extends models['SubResource'] - */ -class TrustedIdProvider extends models['SubResource'] { - /** - * Create a TrustedIdProvider. - * @member {string} idProvider The URL of this trusted identity provider - */ - constructor() { - super(); - } - - /** - * Defines the metadata of TrustedIdProvider - * - * @returns {object} metadata of TrustedIdProvider - * - */ - mapper() { - return { - required: false, - serializedName: 'TrustedIdProvider', - type: { - name: 'Composite', - className: 'TrustedIdProvider', - modelProperties: { - id: { - required: false, - readOnly: true, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - idProvider: { - required: true, - serializedName: 'properties.idProvider', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = TrustedIdProvider; diff --git a/lib/services/dataLake.Store/lib/account/models/updateEncryptionConfig.js b/lib/services/dataLake.Store/lib/account/models/updateEncryptionConfig.js deleted file mode 100644 index 4c931f7c6c..0000000000 --- a/lib/services/dataLake.Store/lib/account/models/updateEncryptionConfig.js +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * 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 encryption configuration used to update a user managed Key Vault key. - * - */ -class UpdateEncryptionConfig { - /** - * Create a UpdateEncryptionConfig. - * @member {object} [keyVaultMetaInfo] The updated Key Vault key to use in - * user managed key rotation. - * @member {string} [keyVaultMetaInfo.encryptionKeyVersion] The version of - * the user managed encryption key to update through a key rotation. - */ - constructor() { - } - - /** - * Defines the metadata of UpdateEncryptionConfig - * - * @returns {object} metadata of UpdateEncryptionConfig - * - */ - mapper() { - return { - required: false, - serializedName: 'UpdateEncryptionConfig', - type: { - name: 'Composite', - className: 'UpdateEncryptionConfig', - modelProperties: { - keyVaultMetaInfo: { - required: false, - serializedName: 'keyVaultMetaInfo', - type: { - name: 'Composite', - className: 'UpdateKeyVaultMetaInfo' - } - } - } - } - }; - } -} - -module.exports = UpdateEncryptionConfig; diff --git a/lib/services/dataLake.Store/lib/account/models/updateFirewallRuleParameters.js b/lib/services/dataLake.Store/lib/account/models/updateFirewallRuleParameters.js deleted file mode 100644 index 5d3aa00b18..0000000000 --- a/lib/services/dataLake.Store/lib/account/models/updateFirewallRuleParameters.js +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Data Lake Analytics firewall rule update parameters - * - */ -class UpdateFirewallRuleParameters { - /** - * Create a UpdateFirewallRuleParameters. - * @member {string} [startIpAddress] the start IP address for the firewall - * rule. This can be either ipv4 or ipv6. Start and End should be in the same - * protocol. - * @member {string} [endIpAddress] the end IP address for the firewall rule. - * This can be either ipv4 or ipv6. Start and End should be in the same - * protocol. - */ - constructor() { - } - - /** - * Defines the metadata of UpdateFirewallRuleParameters - * - * @returns {object} metadata of UpdateFirewallRuleParameters - * - */ - mapper() { - return { - required: false, - serializedName: 'UpdateFirewallRuleParameters', - type: { - name: 'Composite', - className: 'UpdateFirewallRuleParameters', - modelProperties: { - startIpAddress: { - required: false, - serializedName: 'properties.startIpAddress', - type: { - name: 'String' - } - }, - endIpAddress: { - required: false, - serializedName: 'properties.endIpAddress', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = UpdateFirewallRuleParameters; diff --git a/lib/services/dataLake.Store/lib/account/models/updateKeyVaultMetaInfo.js b/lib/services/dataLake.Store/lib/account/models/updateKeyVaultMetaInfo.js deleted file mode 100644 index 28a706b4bd..0000000000 --- a/lib/services/dataLake.Store/lib/account/models/updateKeyVaultMetaInfo.js +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * 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 Key Vault update information used for user managed key rotation. - * - */ -class UpdateKeyVaultMetaInfo { - /** - * Create a UpdateKeyVaultMetaInfo. - * @member {string} [encryptionKeyVersion] The version of the user managed - * encryption key to update through a key rotation. - */ - constructor() { - } - - /** - * Defines the metadata of UpdateKeyVaultMetaInfo - * - * @returns {object} metadata of UpdateKeyVaultMetaInfo - * - */ - mapper() { - return { - required: false, - serializedName: 'UpdateKeyVaultMetaInfo', - type: { - name: 'Composite', - className: 'UpdateKeyVaultMetaInfo', - modelProperties: { - encryptionKeyVersion: { - required: false, - serializedName: 'encryptionKeyVersion', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = UpdateKeyVaultMetaInfo; diff --git a/lib/services/dataLake.Store/lib/account/models/updateTrustedIdProviderParameters.js b/lib/services/dataLake.Store/lib/account/models/updateTrustedIdProviderParameters.js deleted file mode 100644 index a10a3fadad..0000000000 --- a/lib/services/dataLake.Store/lib/account/models/updateTrustedIdProviderParameters.js +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Data Lake Store Trusted Identity Provider update parameters - * - */ -class UpdateTrustedIdProviderParameters { - /** - * Create a UpdateTrustedIdProviderParameters. - * @member {string} [idProvider] The URL of this trusted identity provider - */ - constructor() { - } - - /** - * Defines the metadata of UpdateTrustedIdProviderParameters - * - * @returns {object} metadata of UpdateTrustedIdProviderParameters - * - */ - mapper() { - return { - required: false, - serializedName: 'UpdateTrustedIdProviderParameters', - type: { - name: 'Composite', - className: 'UpdateTrustedIdProviderParameters', - modelProperties: { - idProvider: { - required: false, - serializedName: 'properties.idProvider', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = UpdateTrustedIdProviderParameters; diff --git a/lib/services/dataLake.Store/lib/account/operations/firewallRules.js b/lib/services/dataLake.Store/lib/account/operations/firewallRules.js deleted file mode 100644 index 1ed6d8e4b4..0000000000 --- a/lib/services/dataLake.Store/lib/account/operations/firewallRules.js +++ /dev/null @@ -1,1575 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * 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; - -/** - * Creates or updates the specified firewall rule. During update, the firewall - * rule with the specified name will be replaced with this new firewall rule. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account to add - * or replace the firewall rule. - * - * @param {string} firewallRuleName The name of the firewall rule to create or - * update. - * - * @param {object} parameters Parameters supplied to create or update the - * firewall rule. - * - * @param {string} parameters.startIpAddress the start IP address for the - * firewall rule. This can be either ipv4 or ipv6. Start and End should be in - * the same protocol. - * - * @param {string} parameters.endIpAddress the end IP address for the firewall - * rule. This can be either ipv4 or ipv6. Start and End should be in the same - * protocol. - * - * @param {string} [parameters.name] Resource name - * - * @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 FirewallRule} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _createOrUpdate(resourceGroupName, accountName, firewallRuleName, parameters, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - // Validate - try { - 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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (firewallRuleName === null || firewallRuleName === undefined || typeof firewallRuleName.valueOf() !== 'string') { - throw new Error('firewallRuleName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - if (this.client.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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/firewallRules/{firewallRuleName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); - requestUrl = requestUrl.replace('{firewallRuleName}', encodeURIComponent(firewallRuleName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - 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 (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['FirewallRule']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - 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['FirewallRule']().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 specified firewall rule. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account to which - * to update the firewall rule. - * - * @param {string} firewallRuleName The name of the firewall rule to update. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.parameters] Parameters supplied to update the - * firewall rule. - * - * @param {string} [options.parameters.startIpAddress] the start IP address for - * the firewall rule. This can be either ipv4 or ipv6. Start and End should be - * in the same protocol. - * - * @param {string} [options.parameters.endIpAddress] the end IP address for the - * firewall rule. This can be either ipv4 or ipv6. Start and End should be in - * the same protocol. - * - * @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 FirewallRule} 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, accountName, firewallRuleName, 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 parameters = (options && options.parameters !== undefined) ? options.parameters : undefined; - // Validate - try { - 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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (firewallRuleName === null || firewallRuleName === undefined || typeof firewallRuleName.valueOf() !== 'string') { - throw new Error('firewallRuleName 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/firewallRules/{firewallRuleName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); - requestUrl = requestUrl.replace('{firewallRuleName}', encodeURIComponent(firewallRuleName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - 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 (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['UpdateFirewallRuleParameters']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - 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['FirewallRule']().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 the specified firewall rule from the specified Data Lake Store - * account - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account from - * which to delete the firewall rule. - * - * @param {string} firewallRuleName The name of the firewall rule to delete. - * - * @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, accountName, firewallRuleName, 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 (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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (firewallRuleName === null || firewallRuleName === undefined || typeof firewallRuleName.valueOf() !== 'string') { - throw new Error('firewallRuleName 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/firewallRules/{firewallRuleName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); - requestUrl = requestUrl.replace('{firewallRuleName}', encodeURIComponent(firewallRuleName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - 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 !== 200 && statusCode !== 204) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - 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); - }); -} - -/** - * Gets the specified Data Lake Store firewall rule. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account from - * which to get the firewall rule. - * - * @param {string} firewallRuleName The name of the firewall rule to retrieve. - * - * @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 FirewallRule} 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, accountName, firewallRuleName, 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 (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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (firewallRuleName === null || firewallRuleName === undefined || typeof firewallRuleName.valueOf() !== 'string') { - throw new Error('firewallRuleName 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/firewallRules/{firewallRuleName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); - requestUrl = requestUrl.replace('{firewallRuleName}', encodeURIComponent(firewallRuleName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - 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['FirewallRule']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Lists the Data Lake Store firewall rules within the specified Data Lake - * Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account from - * which to get the firewall rules. - * - * @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 DataLakeStoreFirewallRuleListResult} 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 _listByAccount(resourceGroupName, accountName, 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 (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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/firewallRules'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - 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['DataLakeStoreFirewallRuleListResult']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Lists the Data Lake Store firewall rules within the specified Data Lake - * Store account. - * - * @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 DataLakeStoreFirewallRuleListResult} 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 _listByAccountNext(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['DataLakeStoreFirewallRuleListResult']().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 FirewallRules. */ -class FirewallRules { - /** - * Create a FirewallRules. - * @param {DataLakeStoreAccountManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._createOrUpdate = _createOrUpdate; - this._update = _update; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._listByAccount = _listByAccount; - this._listByAccountNext = _listByAccountNext; - } - - /** - * Creates or updates the specified firewall rule. During update, the firewall - * rule with the specified name will be replaced with this new firewall rule. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account to add - * or replace the firewall rule. - * - * @param {string} firewallRuleName The name of the firewall rule to create or - * update. - * - * @param {object} parameters Parameters supplied to create or update the - * firewall rule. - * - * @param {string} parameters.startIpAddress the start IP address for the - * firewall rule. This can be either ipv4 or ipv6. Start and End should be in - * the same protocol. - * - * @param {string} parameters.endIpAddress the end IP address for the firewall - * rule. This can be either ipv4 or ipv6. Start and End should be in the same - * protocol. - * - * @param {string} [parameters.name] Resource name - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, accountName, firewallRuleName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, accountName, firewallRuleName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates the specified firewall rule. During update, the firewall - * rule with the specified name will be replaced with this new firewall rule. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account to add - * or replace the firewall rule. - * - * @param {string} firewallRuleName The name of the firewall rule to create or - * update. - * - * @param {object} parameters Parameters supplied to create or update the - * firewall rule. - * - * @param {string} parameters.startIpAddress the start IP address for the - * firewall rule. This can be either ipv4 or ipv6. Start and End should be in - * the same protocol. - * - * @param {string} parameters.endIpAddress the end IP address for the firewall - * rule. This can be either ipv4 or ipv6. Start and End should be in the same - * protocol. - * - * @param {string} [parameters.name] Resource name - * - * @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 {FirewallRule} - 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 FirewallRule} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - createOrUpdate(resourceGroupName, accountName, firewallRuleName, parameters, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, accountName, firewallRuleName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, accountName, firewallRuleName, parameters, options, optionalCallback); - } - } - - /** - * Updates the specified firewall rule. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account to which - * to update the firewall rule. - * - * @param {string} firewallRuleName The name of the firewall rule to update. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.parameters] Parameters supplied to update the - * firewall rule. - * - * @param {string} [options.parameters.startIpAddress] the start IP address for - * the firewall rule. This can be either ipv4 or ipv6. Start and End should be - * in the same protocol. - * - * @param {string} [options.parameters.endIpAddress] the end IP address for the - * firewall rule. This can be either ipv4 or ipv6. Start and End should be in - * the same protocol. - * - * @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, accountName, firewallRuleName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._update(resourceGroupName, accountName, firewallRuleName, 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 specified firewall rule. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account to which - * to update the firewall rule. - * - * @param {string} firewallRuleName The name of the firewall rule to update. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.parameters] Parameters supplied to update the - * firewall rule. - * - * @param {string} [options.parameters.startIpAddress] the start IP address for - * the firewall rule. This can be either ipv4 or ipv6. Start and End should be - * in the same protocol. - * - * @param {string} [options.parameters.endIpAddress] the end IP address for the - * firewall rule. This can be either ipv4 or ipv6. Start and End should be in - * the same protocol. - * - * @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 {FirewallRule} - 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 FirewallRule} 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, accountName, firewallRuleName, 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, accountName, firewallRuleName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._update(resourceGroupName, accountName, firewallRuleName, options, optionalCallback); - } - } - - /** - * Deletes the specified firewall rule from the specified Data Lake Store - * account - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account from - * which to delete the firewall rule. - * - * @param {string} firewallRuleName The name of the firewall rule to delete. - * - * @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, accountName, firewallRuleName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, accountName, firewallRuleName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified firewall rule from the specified Data Lake Store - * account - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account from - * which to delete the firewall rule. - * - * @param {string} firewallRuleName The name of the firewall rule to delete. - * - * @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, accountName, firewallRuleName, 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, accountName, firewallRuleName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, accountName, firewallRuleName, options, optionalCallback); - } - } - - /** - * Gets the specified Data Lake Store firewall rule. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account from - * which to get the firewall rule. - * - * @param {string} firewallRuleName The name of the firewall rule to retrieve. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - getWithHttpOperationResponse(resourceGroupName, accountName, firewallRuleName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, accountName, firewallRuleName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Gets the specified Data Lake Store firewall rule. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account from - * which to get the firewall rule. - * - * @param {string} firewallRuleName The name of the firewall rule to retrieve. - * - * @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 {FirewallRule} - 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 FirewallRule} 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, accountName, firewallRuleName, 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, accountName, firewallRuleName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, accountName, firewallRuleName, options, optionalCallback); - } - } - - /** - * Lists the Data Lake Store firewall rules within the specified Data Lake - * Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account from - * which to get the firewall rules. - * - * @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. - */ - listByAccountWithHttpOperationResponse(resourceGroupName, accountName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByAccount(resourceGroupName, accountName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists the Data Lake Store firewall rules within the specified Data Lake - * Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account from - * which to get the firewall rules. - * - * @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 {DataLakeStoreFirewallRuleListResult} - 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 DataLakeStoreFirewallRuleListResult} 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. - */ - listByAccount(resourceGroupName, accountName, 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._listByAccount(resourceGroupName, accountName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByAccount(resourceGroupName, accountName, options, optionalCallback); - } - } - - /** - * Lists the Data Lake Store firewall rules within the specified Data Lake - * Store account. - * - * @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. - */ - listByAccountNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByAccountNext(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 the Data Lake Store firewall rules within the specified Data Lake - * Store account. - * - * @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 {DataLakeStoreFirewallRuleListResult} - 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 DataLakeStoreFirewallRuleListResult} 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. - */ - listByAccountNext(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._listByAccountNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByAccountNext(nextPageLink, options, optionalCallback); - } - } - -} - -module.exports = FirewallRules; diff --git a/lib/services/dataLake.Store/lib/account/operations/index.d.ts b/lib/services/dataLake.Store/lib/account/operations/index.d.ts deleted file mode 100644 index 8698f12a14..0000000000 --- a/lib/services/dataLake.Store/lib/account/operations/index.d.ts +++ /dev/null @@ -1,2141 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * 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 - * FirewallRules - * __NOTE__: An instance of this class is automatically created for an - * instance of the DataLakeStoreAccountManagementClient. - */ -export interface FirewallRules { - - - /** - * Creates or updates the specified firewall rule. During update, the firewall - * rule with the specified name will be replaced with this new firewall rule. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account to add - * or replace the firewall rule. - * - * @param {string} firewallRuleName The name of the firewall rule to create or - * update. - * - * @param {object} parameters Parameters supplied to create or update the - * firewall rule. - * - * @param {string} parameters.startIpAddress the start IP address for the - * firewall rule. This can be either ipv4 or ipv6. Start and End should be in - * the same protocol. - * - * @param {string} parameters.endIpAddress the end IP address for the firewall - * rule. This can be either ipv4 or ipv6. Start and End should be in the same - * protocol. - * - * @param {string} [parameters.name] Resource name - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, accountName: string, firewallRuleName: string, parameters: models.FirewallRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates the specified firewall rule. During update, the firewall - * rule with the specified name will be replaced with this new firewall rule. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account to add - * or replace the firewall rule. - * - * @param {string} firewallRuleName The name of the firewall rule to create or - * update. - * - * @param {object} parameters Parameters supplied to create or update the - * firewall rule. - * - * @param {string} parameters.startIpAddress the start IP address for the - * firewall rule. This can be either ipv4 or ipv6. Start and End should be in - * the same protocol. - * - * @param {string} parameters.endIpAddress the end IP address for the firewall - * rule. This can be either ipv4 or ipv6. Start and End should be in the same - * protocol. - * - * @param {string} [parameters.name] Resource name - * - * @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 {FirewallRule} - 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. - * - * {FirewallRule} [result] - The deserialized result object if an error did not occur. - * See {@link FirewallRule} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - createOrUpdate(resourceGroupName: string, accountName: string, firewallRuleName: string, parameters: models.FirewallRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, accountName: string, firewallRuleName: string, parameters: models.FirewallRule, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, accountName: string, firewallRuleName: string, parameters: models.FirewallRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates the specified firewall rule. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account to which - * to update the firewall rule. - * - * @param {string} firewallRuleName The name of the firewall rule to update. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.parameters] Parameters supplied to update the - * firewall rule. - * - * @param {string} [options.parameters.startIpAddress] the start IP address for - * the firewall rule. This can be either ipv4 or ipv6. Start and End should be - * in the same protocol. - * - * @param {string} [options.parameters.endIpAddress] the end IP address for the - * firewall rule. This can be either ipv4 or ipv6. Start and End should be in - * the same protocol. - * - * @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, accountName: string, firewallRuleName: string, options?: { parameters? : models.UpdateFirewallRuleParameters, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates the specified firewall rule. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account to which - * to update the firewall rule. - * - * @param {string} firewallRuleName The name of the firewall rule to update. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.parameters] Parameters supplied to update the - * firewall rule. - * - * @param {string} [options.parameters.startIpAddress] the start IP address for - * the firewall rule. This can be either ipv4 or ipv6. Start and End should be - * in the same protocol. - * - * @param {string} [options.parameters.endIpAddress] the end IP address for the - * firewall rule. This can be either ipv4 or ipv6. Start and End should be in - * the same protocol. - * - * @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 {FirewallRule} - 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. - * - * {FirewallRule} [result] - The deserialized result object if an error did not occur. - * See {@link FirewallRule} 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, accountName: string, firewallRuleName: string, options?: { parameters? : models.UpdateFirewallRuleParameters, customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, accountName: string, firewallRuleName: string, callback: ServiceCallback): void; - update(resourceGroupName: string, accountName: string, firewallRuleName: string, options: { parameters? : models.UpdateFirewallRuleParameters, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified firewall rule from the specified Data Lake Store - * account - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account from - * which to delete the firewall rule. - * - * @param {string} firewallRuleName The name of the firewall rule to delete. - * - * @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, accountName: string, firewallRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified firewall rule from the specified Data Lake Store - * account - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account from - * which to delete the firewall rule. - * - * @param {string} firewallRuleName The name of the firewall rule to delete. - * - * @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, accountName: string, firewallRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, accountName: string, firewallRuleName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, accountName: string, firewallRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the specified Data Lake Store firewall rule. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account from - * which to get the firewall rule. - * - * @param {string} firewallRuleName The name of the firewall rule to retrieve. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getWithHttpOperationResponse(resourceGroupName: string, accountName: string, firewallRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the specified Data Lake Store firewall rule. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account from - * which to get the firewall rule. - * - * @param {string} firewallRuleName The name of the firewall rule to retrieve. - * - * @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 {FirewallRule} - 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. - * - * {FirewallRule} [result] - The deserialized result object if an error did not occur. - * See {@link FirewallRule} 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, accountName: string, firewallRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, accountName: string, firewallRuleName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, accountName: string, firewallRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the Data Lake Store firewall rules within the specified Data Lake - * Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account from - * which to get the firewall rules. - * - * @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. - */ - listByAccountWithHttpOperationResponse(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the Data Lake Store firewall rules within the specified Data Lake - * Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account from - * which to get the firewall rules. - * - * @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 {DataLakeStoreFirewallRuleListResult} - 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. - * - * {DataLakeStoreFirewallRuleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DataLakeStoreFirewallRuleListResult} 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. - */ - listByAccount(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByAccount(resourceGroupName: string, accountName: string, callback: ServiceCallback): void; - listByAccount(resourceGroupName: string, accountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the Data Lake Store firewall rules within the specified Data Lake - * Store account. - * - * @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. - */ - listByAccountNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the Data Lake Store firewall rules within the specified Data Lake - * Store account. - * - * @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 {DataLakeStoreFirewallRuleListResult} - 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. - * - * {DataLakeStoreFirewallRuleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DataLakeStoreFirewallRuleListResult} 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. - */ - listByAccountNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByAccountNext(nextPageLink: string, callback: ServiceCallback): void; - listByAccountNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * TrustedIdProviders - * __NOTE__: An instance of this class is automatically created for an - * instance of the DataLakeStoreAccountManagementClient. - */ -export interface TrustedIdProviders { - - - /** - * Creates or updates the specified trusted identity provider. During update, - * the trusted identity provider with the specified name will be replaced with - * this new provider - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account to add - * or replace the trusted identity provider. - * - * @param {string} trustedIdProviderName The name of the trusted identity - * provider. This is used for differentiation of providers in the account. - * - * @param {object} parameters Parameters supplied to create or replace the - * trusted identity provider. - * - * @param {string} parameters.idProvider The URL of this trusted identity - * provider - * - * @param {string} [parameters.name] Resource name - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, accountName: string, trustedIdProviderName: string, parameters: models.TrustedIdProvider, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates the specified trusted identity provider. During update, - * the trusted identity provider with the specified name will be replaced with - * this new provider - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account to add - * or replace the trusted identity provider. - * - * @param {string} trustedIdProviderName The name of the trusted identity - * provider. This is used for differentiation of providers in the account. - * - * @param {object} parameters Parameters supplied to create or replace the - * trusted identity provider. - * - * @param {string} parameters.idProvider The URL of this trusted identity - * provider - * - * @param {string} [parameters.name] Resource name - * - * @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 {TrustedIdProvider} - 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. - * - * {TrustedIdProvider} [result] - The deserialized result object if an error did not occur. - * See {@link TrustedIdProvider} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - createOrUpdate(resourceGroupName: string, accountName: string, trustedIdProviderName: string, parameters: models.TrustedIdProvider, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, accountName: string, trustedIdProviderName: string, parameters: models.TrustedIdProvider, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, accountName: string, trustedIdProviderName: string, parameters: models.TrustedIdProvider, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates the specified trusted identity provider. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account to which - * to update the trusted identity provider. - * - * @param {string} trustedIdProviderName The name of the trusted identity - * provider. This is used for differentiation of providers in the account. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.parameters] Parameters supplied to update the - * trusted identity provider. - * - * @param {string} [options.parameters.idProvider] The URL of this trusted - * identity provider - * - * @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, accountName: string, trustedIdProviderName: string, options?: { parameters? : models.UpdateTrustedIdProviderParameters, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates the specified trusted identity provider. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account to which - * to update the trusted identity provider. - * - * @param {string} trustedIdProviderName The name of the trusted identity - * provider. This is used for differentiation of providers in the account. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.parameters] Parameters supplied to update the - * trusted identity provider. - * - * @param {string} [options.parameters.idProvider] The URL of this trusted - * identity provider - * - * @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 {TrustedIdProvider} - 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. - * - * {TrustedIdProvider} [result] - The deserialized result object if an error did not occur. - * See {@link TrustedIdProvider} 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, accountName: string, trustedIdProviderName: string, options?: { parameters? : models.UpdateTrustedIdProviderParameters, customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, accountName: string, trustedIdProviderName: string, callback: ServiceCallback): void; - update(resourceGroupName: string, accountName: string, trustedIdProviderName: string, options: { parameters? : models.UpdateTrustedIdProviderParameters, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified trusted identity provider from the specified Data Lake - * Store account - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account from - * which to delete the trusted identity provider. - * - * @param {string} trustedIdProviderName The name of the trusted identity - * provider to delete. - * - * @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, accountName: string, trustedIdProviderName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified trusted identity provider from the specified Data Lake - * Store account - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account from - * which to delete the trusted identity provider. - * - * @param {string} trustedIdProviderName The name of the trusted identity - * provider to delete. - * - * @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, accountName: string, trustedIdProviderName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, accountName: string, trustedIdProviderName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, accountName: string, trustedIdProviderName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the specified Data Lake Store trusted identity provider. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account from - * which to get the trusted identity provider. - * - * @param {string} trustedIdProviderName The name of the trusted identity - * provider to retrieve. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getWithHttpOperationResponse(resourceGroupName: string, accountName: string, trustedIdProviderName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the specified Data Lake Store trusted identity provider. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account from - * which to get the trusted identity provider. - * - * @param {string} trustedIdProviderName The name of the trusted identity - * provider to retrieve. - * - * @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 {TrustedIdProvider} - 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. - * - * {TrustedIdProvider} [result] - The deserialized result object if an error did not occur. - * See {@link TrustedIdProvider} 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, accountName: string, trustedIdProviderName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, accountName: string, trustedIdProviderName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, accountName: string, trustedIdProviderName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the Data Lake Store trusted identity providers within the specified - * Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account from - * which to get the trusted identity providers. - * - * @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. - */ - listByAccountWithHttpOperationResponse(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the Data Lake Store trusted identity providers within the specified - * Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account from - * which to get the trusted identity providers. - * - * @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 {DataLakeStoreTrustedIdProviderListResult} - 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. - * - * {DataLakeStoreTrustedIdProviderListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DataLakeStoreTrustedIdProviderListResult} - * 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. - */ - listByAccount(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByAccount(resourceGroupName: string, accountName: string, callback: ServiceCallback): void; - listByAccount(resourceGroupName: string, accountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the Data Lake Store trusted identity providers within the specified - * Data Lake Store account. - * - * @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. - */ - listByAccountNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the Data Lake Store trusted identity providers within the specified - * Data Lake Store account. - * - * @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 {DataLakeStoreTrustedIdProviderListResult} - 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. - * - * {DataLakeStoreTrustedIdProviderListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DataLakeStoreTrustedIdProviderListResult} - * 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. - */ - listByAccountNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByAccountNext(nextPageLink: string, callback: ServiceCallback): void; - listByAccountNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * Account - * __NOTE__: An instance of this class is automatically created for an - * instance of the DataLakeStoreAccountManagementClient. - */ -export interface Account { - - - /** - * Creates the specified Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} name The name of the Data Lake Store account to create. - * - * @param {object} parameters Parameters supplied to create the Data Lake Store - * account. - * - * @param {object} [parameters.identity] The Key Vault encryption identity, if - * any. - * - * @param {string} [parameters.encryptionState] The current state of encryption - * for this Data Lake store account. Possible values include: 'Enabled', - * 'Disabled' - * - * @param {object} [parameters.encryptionConfig] The Key Vault encryption - * configuration. - * - * @param {string} parameters.encryptionConfig.type The type of encryption - * configuration being used. Currently the only supported types are - * 'UserManaged' and 'ServiceManaged'. Possible values include: 'UserManaged', - * 'ServiceManaged' - * - * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The Key Vault - * information for connecting to user managed encryption keys. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.keyVaultResourceId The resource - * identifier for the user managed Key Vault being used to encrypt. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyName The name of - * the user managed encryption key. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion The - * version of the user managed encryption key. - * - * @param {string} [parameters.firewallState] The current state of the IP - * address firewall for this Data Lake store account. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {array} [parameters.firewallRules] The list of firewall rules - * associated with this Data Lake store account. - * - * @param {string} [parameters.trustedIdProviderState] The current state of the - * trusted identity provider feature for this Data Lake store account. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {array} [parameters.trustedIdProviders] The list of trusted identity - * providers associated with this Data Lake store account. - * - * @param {string} [parameters.defaultGroup] the default owner group for all - * new folders and files created in the Data Lake Store account. - * - * @param {string} [parameters.newTier] the commitment tier to use for next - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' - * - * @param {string} [parameters.firewallAllowAzureIps] The current state of - * allowing or disallowing IPs originating within Azure through the firewall. - * If the firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {string} parameters.location Resource location - * - * @param {object} [parameters.tags] Resource tags - * - * @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, name: string, parameters: models.DataLakeStoreAccount, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates the specified Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} name The name of the Data Lake Store account to create. - * - * @param {object} parameters Parameters supplied to create the Data Lake Store - * account. - * - * @param {object} [parameters.identity] The Key Vault encryption identity, if - * any. - * - * @param {string} [parameters.encryptionState] The current state of encryption - * for this Data Lake store account. Possible values include: 'Enabled', - * 'Disabled' - * - * @param {object} [parameters.encryptionConfig] The Key Vault encryption - * configuration. - * - * @param {string} parameters.encryptionConfig.type The type of encryption - * configuration being used. Currently the only supported types are - * 'UserManaged' and 'ServiceManaged'. Possible values include: 'UserManaged', - * 'ServiceManaged' - * - * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The Key Vault - * information for connecting to user managed encryption keys. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.keyVaultResourceId The resource - * identifier for the user managed Key Vault being used to encrypt. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyName The name of - * the user managed encryption key. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion The - * version of the user managed encryption key. - * - * @param {string} [parameters.firewallState] The current state of the IP - * address firewall for this Data Lake store account. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {array} [parameters.firewallRules] The list of firewall rules - * associated with this Data Lake store account. - * - * @param {string} [parameters.trustedIdProviderState] The current state of the - * trusted identity provider feature for this Data Lake store account. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {array} [parameters.trustedIdProviders] The list of trusted identity - * providers associated with this Data Lake store account. - * - * @param {string} [parameters.defaultGroup] the default owner group for all - * new folders and files created in the Data Lake Store account. - * - * @param {string} [parameters.newTier] the commitment tier to use for next - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' - * - * @param {string} [parameters.firewallAllowAzureIps] The current state of - * allowing or disallowing IPs originating within Azure through the firewall. - * If the firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {string} parameters.location Resource location - * - * @param {object} [parameters.tags] Resource tags - * - * @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 {DataLakeStoreAccount} - 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. - * - * {DataLakeStoreAccount} [result] - The deserialized result object if an error did not occur. - * See {@link DataLakeStoreAccount} 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, name: string, parameters: models.DataLakeStoreAccount, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - create(resourceGroupName: string, name: string, parameters: models.DataLakeStoreAccount, callback: ServiceCallback): void; - create(resourceGroupName: string, name: string, parameters: models.DataLakeStoreAccount, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates the specified Data Lake Store account information. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} name The name of the Data Lake Store account to update. - * - * @param {object} parameters Parameters supplied to update the Data Lake Store - * account. - * - * @param {object} [parameters.tags] Resource tags - * - * @param {string} [parameters.firewallState] The current state of the IP - * address firewall for this Data Lake store account. Disabling the firewall - * does not remove existing rules, they will just be ignored until the firewall - * is re-enabled. Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.trustedIdProviderState] The current state of the - * trusted identity provider feature for this Data Lake store account. - * Disabling trusted identity provider functionality does not remove the - * providers, they will just be ignored until this feature is re-enabled. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.defaultGroup] the default owner group for all - * new folders and files created in the Data Lake Store account. - * - * @param {string} [parameters.newTier] the commitment tier to use for next - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' - * - * @param {string} [parameters.firewallAllowAzureIps] The current state of - * allowing or disallowing IPs originating within Azure through the firewall. - * If the firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {object} [parameters.encryptionConfig] Used for rotation of user - * managed Key Vault keys. Can only be used to rotate a user managed encryption - * Key Vault key. - * - * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The updated - * Key Vault key to use in user managed key rotation. - * - * @param {string} - * [parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] The - * version of the user managed encryption key to update through a key rotation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - updateWithHttpOperationResponse(resourceGroupName: string, name: string, parameters: models.DataLakeStoreAccountUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates the specified Data Lake Store account information. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} name The name of the Data Lake Store account to update. - * - * @param {object} parameters Parameters supplied to update the Data Lake Store - * account. - * - * @param {object} [parameters.tags] Resource tags - * - * @param {string} [parameters.firewallState] The current state of the IP - * address firewall for this Data Lake store account. Disabling the firewall - * does not remove existing rules, they will just be ignored until the firewall - * is re-enabled. Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.trustedIdProviderState] The current state of the - * trusted identity provider feature for this Data Lake store account. - * Disabling trusted identity provider functionality does not remove the - * providers, they will just be ignored until this feature is re-enabled. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.defaultGroup] the default owner group for all - * new folders and files created in the Data Lake Store account. - * - * @param {string} [parameters.newTier] the commitment tier to use for next - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' - * - * @param {string} [parameters.firewallAllowAzureIps] The current state of - * allowing or disallowing IPs originating within Azure through the firewall. - * If the firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {object} [parameters.encryptionConfig] Used for rotation of user - * managed Key Vault keys. Can only be used to rotate a user managed encryption - * Key Vault key. - * - * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The updated - * Key Vault key to use in user managed key rotation. - * - * @param {string} - * [parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] The - * version of the user managed encryption key to update through a key rotation. - * - * @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 {DataLakeStoreAccount} - 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. - * - * {DataLakeStoreAccount} [result] - The deserialized result object if an error did not occur. - * See {@link DataLakeStoreAccount} 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, name: string, parameters: models.DataLakeStoreAccountUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, name: string, parameters: models.DataLakeStoreAccountUpdateParameters, callback: ServiceCallback): void; - update(resourceGroupName: string, name: string, parameters: models.DataLakeStoreAccountUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} name The name of the Data Lake Store account to delete. - * - * @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, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} name The name of the Data Lake Store account to delete. - * - * @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, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, name: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the specified Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} name The name of the Data Lake Store account to retrieve. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the specified Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} name The name of the Data Lake Store account to retrieve. - * - * @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 {DataLakeStoreAccount} - 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. - * - * {DataLakeStoreAccount} [result] - The deserialized result object if an error did not occur. - * See {@link DataLakeStoreAccount} 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, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, name: string, callback: ServiceCallback): void; - get(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Attempts to enable a user managed Key Vault for encryption of the specified - * Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account to - * attempt to enable the Key Vault for. - * - * @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. - */ - enableKeyVaultWithHttpOperationResponse(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Attempts to enable a user managed Key Vault for encryption of the specified - * Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account to - * attempt to enable the Key Vault for. - * - * @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. - */ - enableKeyVault(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - enableKeyVault(resourceGroupName: string, accountName: string, callback: ServiceCallback): void; - enableKeyVault(resourceGroupName: string, accountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the Data Lake Store accounts within a specific resource group. The - * response includes a link to the next page of results, if any. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account(s). - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData filter. Optional. - * - * @param {number} [options.top] The number of items to return. Optional. - * - * @param {number} [options.skip] The number of items to skip over before - * returning elements. Optional. - * - * @param {string} [options.select] OData Select statement. Limits the - * properties on each entry to just those requested, e.g. - * Categories?$select=CategoryName,Description. Optional. - * - * @param {string} [options.orderby] OrderBy clause. One or more - * comma-separated expressions with an optional "asc" (the default) or "desc" - * depending on the order you'd like the values sorted, e.g. - * Categories?$orderby=CategoryName desc. Optional. - * - * @param {boolean} [options.count] A Boolean value of true or false to request - * a count of the matching resources included with the resources in the - * response, e.g. Categories?$count=true. Optional. - * - * @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?: { filter? : string, top? : number, skip? : number, select? : string, orderby? : string, count? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the Data Lake Store accounts within a specific resource group. The - * response includes a link to the next page of results, if any. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account(s). - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData filter. Optional. - * - * @param {number} [options.top] The number of items to return. Optional. - * - * @param {number} [options.skip] The number of items to skip over before - * returning elements. Optional. - * - * @param {string} [options.select] OData Select statement. Limits the - * properties on each entry to just those requested, e.g. - * Categories?$select=CategoryName,Description. Optional. - * - * @param {string} [options.orderby] OrderBy clause. One or more - * comma-separated expressions with an optional "asc" (the default) or "desc" - * depending on the order you'd like the values sorted, e.g. - * Categories?$orderby=CategoryName desc. Optional. - * - * @param {boolean} [options.count] A Boolean value of true or false to request - * a count of the matching resources included with the resources in the - * response, e.g. Categories?$count=true. Optional. - * - * @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 {DataLakeStoreAccountListResult} - 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. - * - * {DataLakeStoreAccountListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DataLakeStoreAccountListResult} 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?: { filter? : string, top? : number, skip? : number, select? : string, orderby? : string, count? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options: { filter? : string, top? : number, skip? : number, select? : string, orderby? : string, count? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the Data Lake Store accounts within the subscription. The response - * includes a link to the next page of results, if any. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData filter. Optional. - * - * @param {number} [options.top] The number of items to return. Optional. - * - * @param {number} [options.skip] The number of items to skip over before - * returning elements. Optional. - * - * @param {string} [options.select] OData Select statement. Limits the - * properties on each entry to just those requested, e.g. - * Categories?$select=CategoryName,Description. Optional. - * - * @param {string} [options.orderby] OrderBy clause. One or more - * comma-separated expressions with an optional "asc" (the default) or "desc" - * depending on the order you'd like the values sorted, e.g. - * Categories?$orderby=CategoryName desc. Optional. - * - * @param {boolean} [options.count] The Boolean value of true or false to - * request a count of the matching resources included with the resources in the - * response, e.g. Categories?$count=true. Optional. - * - * @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?: { filter? : string, top? : number, skip? : number, select? : string, orderby? : string, count? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the Data Lake Store accounts within the subscription. The response - * includes a link to the next page of results, if any. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData filter. Optional. - * - * @param {number} [options.top] The number of items to return. Optional. - * - * @param {number} [options.skip] The number of items to skip over before - * returning elements. Optional. - * - * @param {string} [options.select] OData Select statement. Limits the - * properties on each entry to just those requested, e.g. - * Categories?$select=CategoryName,Description. Optional. - * - * @param {string} [options.orderby] OrderBy clause. One or more - * comma-separated expressions with an optional "asc" (the default) or "desc" - * depending on the order you'd like the values sorted, e.g. - * Categories?$orderby=CategoryName desc. Optional. - * - * @param {boolean} [options.count] The Boolean value of true or false to - * request a count of the matching resources included with the resources in the - * response, e.g. Categories?$count=true. Optional. - * - * @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 {DataLakeStoreAccountListResult} - 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. - * - * {DataLakeStoreAccountListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DataLakeStoreAccountListResult} 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?: { filter? : string, top? : number, skip? : number, select? : string, orderby? : string, count? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { filter? : string, top? : number, skip? : number, select? : string, orderby? : string, count? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates the specified Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} name The name of the Data Lake Store account to create. - * - * @param {object} parameters Parameters supplied to create the Data Lake Store - * account. - * - * @param {object} [parameters.identity] The Key Vault encryption identity, if - * any. - * - * @param {string} [parameters.encryptionState] The current state of encryption - * for this Data Lake store account. Possible values include: 'Enabled', - * 'Disabled' - * - * @param {object} [parameters.encryptionConfig] The Key Vault encryption - * configuration. - * - * @param {string} parameters.encryptionConfig.type The type of encryption - * configuration being used. Currently the only supported types are - * 'UserManaged' and 'ServiceManaged'. Possible values include: 'UserManaged', - * 'ServiceManaged' - * - * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The Key Vault - * information for connecting to user managed encryption keys. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.keyVaultResourceId The resource - * identifier for the user managed Key Vault being used to encrypt. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyName The name of - * the user managed encryption key. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion The - * version of the user managed encryption key. - * - * @param {string} [parameters.firewallState] The current state of the IP - * address firewall for this Data Lake store account. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {array} [parameters.firewallRules] The list of firewall rules - * associated with this Data Lake store account. - * - * @param {string} [parameters.trustedIdProviderState] The current state of the - * trusted identity provider feature for this Data Lake store account. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {array} [parameters.trustedIdProviders] The list of trusted identity - * providers associated with this Data Lake store account. - * - * @param {string} [parameters.defaultGroup] the default owner group for all - * new folders and files created in the Data Lake Store account. - * - * @param {string} [parameters.newTier] the commitment tier to use for next - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' - * - * @param {string} [parameters.firewallAllowAzureIps] The current state of - * allowing or disallowing IPs originating within Azure through the firewall. - * If the firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {string} parameters.location Resource location - * - * @param {object} [parameters.tags] Resource tags - * - * @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, name: string, parameters: models.DataLakeStoreAccount, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates the specified Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} name The name of the Data Lake Store account to create. - * - * @param {object} parameters Parameters supplied to create the Data Lake Store - * account. - * - * @param {object} [parameters.identity] The Key Vault encryption identity, if - * any. - * - * @param {string} [parameters.encryptionState] The current state of encryption - * for this Data Lake store account. Possible values include: 'Enabled', - * 'Disabled' - * - * @param {object} [parameters.encryptionConfig] The Key Vault encryption - * configuration. - * - * @param {string} parameters.encryptionConfig.type The type of encryption - * configuration being used. Currently the only supported types are - * 'UserManaged' and 'ServiceManaged'. Possible values include: 'UserManaged', - * 'ServiceManaged' - * - * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The Key Vault - * information for connecting to user managed encryption keys. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.keyVaultResourceId The resource - * identifier for the user managed Key Vault being used to encrypt. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyName The name of - * the user managed encryption key. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion The - * version of the user managed encryption key. - * - * @param {string} [parameters.firewallState] The current state of the IP - * address firewall for this Data Lake store account. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {array} [parameters.firewallRules] The list of firewall rules - * associated with this Data Lake store account. - * - * @param {string} [parameters.trustedIdProviderState] The current state of the - * trusted identity provider feature for this Data Lake store account. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {array} [parameters.trustedIdProviders] The list of trusted identity - * providers associated with this Data Lake store account. - * - * @param {string} [parameters.defaultGroup] the default owner group for all - * new folders and files created in the Data Lake Store account. - * - * @param {string} [parameters.newTier] the commitment tier to use for next - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' - * - * @param {string} [parameters.firewallAllowAzureIps] The current state of - * allowing or disallowing IPs originating within Azure through the firewall. - * If the firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {string} parameters.location Resource location - * - * @param {object} [parameters.tags] Resource tags - * - * @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 {DataLakeStoreAccount} - 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. - * - * {DataLakeStoreAccount} [result] - The deserialized result object if an error did not occur. - * See {@link DataLakeStoreAccount} 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, name: string, parameters: models.DataLakeStoreAccount, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreate(resourceGroupName: string, name: string, parameters: models.DataLakeStoreAccount, callback: ServiceCallback): void; - beginCreate(resourceGroupName: string, name: string, parameters: models.DataLakeStoreAccount, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates the specified Data Lake Store account information. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} name The name of the Data Lake Store account to update. - * - * @param {object} parameters Parameters supplied to update the Data Lake Store - * account. - * - * @param {object} [parameters.tags] Resource tags - * - * @param {string} [parameters.firewallState] The current state of the IP - * address firewall for this Data Lake store account. Disabling the firewall - * does not remove existing rules, they will just be ignored until the firewall - * is re-enabled. Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.trustedIdProviderState] The current state of the - * trusted identity provider feature for this Data Lake store account. - * Disabling trusted identity provider functionality does not remove the - * providers, they will just be ignored until this feature is re-enabled. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.defaultGroup] the default owner group for all - * new folders and files created in the Data Lake Store account. - * - * @param {string} [parameters.newTier] the commitment tier to use for next - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' - * - * @param {string} [parameters.firewallAllowAzureIps] The current state of - * allowing or disallowing IPs originating within Azure through the firewall. - * If the firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {object} [parameters.encryptionConfig] Used for rotation of user - * managed Key Vault keys. Can only be used to rotate a user managed encryption - * Key Vault key. - * - * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The updated - * Key Vault key to use in user managed key rotation. - * - * @param {string} - * [parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] The - * version of the user managed encryption key to update through a key rotation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, name: string, parameters: models.DataLakeStoreAccountUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates the specified Data Lake Store account information. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} name The name of the Data Lake Store account to update. - * - * @param {object} parameters Parameters supplied to update the Data Lake Store - * account. - * - * @param {object} [parameters.tags] Resource tags - * - * @param {string} [parameters.firewallState] The current state of the IP - * address firewall for this Data Lake store account. Disabling the firewall - * does not remove existing rules, they will just be ignored until the firewall - * is re-enabled. Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.trustedIdProviderState] The current state of the - * trusted identity provider feature for this Data Lake store account. - * Disabling trusted identity provider functionality does not remove the - * providers, they will just be ignored until this feature is re-enabled. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.defaultGroup] the default owner group for all - * new folders and files created in the Data Lake Store account. - * - * @param {string} [parameters.newTier] the commitment tier to use for next - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' - * - * @param {string} [parameters.firewallAllowAzureIps] The current state of - * allowing or disallowing IPs originating within Azure through the firewall. - * If the firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {object} [parameters.encryptionConfig] Used for rotation of user - * managed Key Vault keys. Can only be used to rotate a user managed encryption - * Key Vault key. - * - * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The updated - * Key Vault key to use in user managed key rotation. - * - * @param {string} - * [parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] The - * version of the user managed encryption key to update through a key rotation. - * - * @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 {DataLakeStoreAccount} - 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. - * - * {DataLakeStoreAccount} [result] - The deserialized result object if an error did not occur. - * See {@link DataLakeStoreAccount} 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, name: string, parameters: models.DataLakeStoreAccountUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdate(resourceGroupName: string, name: string, parameters: models.DataLakeStoreAccountUpdateParameters, callback: ServiceCallback): void; - beginUpdate(resourceGroupName: string, name: string, parameters: models.DataLakeStoreAccountUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} name The name of the Data Lake Store account to delete. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} name The name of the Data Lake Store account to delete. - * - * @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. - */ - beginDeleteMethod(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, name: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the Data Lake Store accounts within a specific resource group. The - * response includes a link to the next page of results, if any. - * - * @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 the Data Lake Store accounts within a specific resource group. The - * response includes a link to the next page of results, if any. - * - * @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 {DataLakeStoreAccountListResult} - 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. - * - * {DataLakeStoreAccountListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DataLakeStoreAccountListResult} 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; - - - /** - * Lists the Data Lake Store accounts within the subscription. The response - * includes a link to the next page of results, if any. - * - * @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 the Data Lake Store accounts within the subscription. The response - * includes a link to the next page of results, if any. - * - * @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 {DataLakeStoreAccountListResult} - 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. - * - * {DataLakeStoreAccountListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DataLakeStoreAccountListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} diff --git a/lib/services/dataLake.Store/lib/account/operations/index.js b/lib/services/dataLake.Store/lib/account/operations/index.js deleted file mode 100644 index 6579c20d81..0000000000 --- a/lib/services/dataLake.Store/lib/account/operations/index.js +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * 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.FirewallRules = require('./firewallRules'); -exports.TrustedIdProviders = require('./trustedIdProviders'); -exports.Account = require('./account'); diff --git a/lib/services/dataLake.Store/lib/account/operations/trustedIdProviders.js b/lib/services/dataLake.Store/lib/account/operations/trustedIdProviders.js deleted file mode 100644 index 0f1b75dd29..0000000000 --- a/lib/services/dataLake.Store/lib/account/operations/trustedIdProviders.js +++ /dev/null @@ -1,1557 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * 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; - -/** - * Creates or updates the specified trusted identity provider. During update, - * the trusted identity provider with the specified name will be replaced with - * this new provider - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account to add - * or replace the trusted identity provider. - * - * @param {string} trustedIdProviderName The name of the trusted identity - * provider. This is used for differentiation of providers in the account. - * - * @param {object} parameters Parameters supplied to create or replace the - * trusted identity provider. - * - * @param {string} parameters.idProvider The URL of this trusted identity - * provider - * - * @param {string} [parameters.name] Resource name - * - * @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 TrustedIdProvider} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _createOrUpdate(resourceGroupName, accountName, trustedIdProviderName, parameters, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - // Validate - try { - 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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (trustedIdProviderName === null || trustedIdProviderName === undefined || typeof trustedIdProviderName.valueOf() !== 'string') { - throw new Error('trustedIdProviderName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - if (this.client.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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/trustedIdProviders/{trustedIdProviderName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); - requestUrl = requestUrl.replace('{trustedIdProviderName}', encodeURIComponent(trustedIdProviderName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - 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 (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['TrustedIdProvider']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - 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['TrustedIdProvider']().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 specified trusted identity provider. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account to which - * to update the trusted identity provider. - * - * @param {string} trustedIdProviderName The name of the trusted identity - * provider. This is used for differentiation of providers in the account. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.parameters] Parameters supplied to update the - * trusted identity provider. - * - * @param {string} [options.parameters.idProvider] The URL of this trusted - * identity provider - * - * @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 TrustedIdProvider} 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, accountName, trustedIdProviderName, 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 parameters = (options && options.parameters !== undefined) ? options.parameters : undefined; - // Validate - try { - 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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (trustedIdProviderName === null || trustedIdProviderName === undefined || typeof trustedIdProviderName.valueOf() !== 'string') { - throw new Error('trustedIdProviderName 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/trustedIdProviders/{trustedIdProviderName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); - requestUrl = requestUrl.replace('{trustedIdProviderName}', encodeURIComponent(trustedIdProviderName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - 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 (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['UpdateTrustedIdProviderParameters']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - 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['TrustedIdProvider']().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 the specified trusted identity provider from the specified Data Lake - * Store account - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account from - * which to delete the trusted identity provider. - * - * @param {string} trustedIdProviderName The name of the trusted identity - * provider to delete. - * - * @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, accountName, trustedIdProviderName, 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 (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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (trustedIdProviderName === null || trustedIdProviderName === undefined || typeof trustedIdProviderName.valueOf() !== 'string') { - throw new Error('trustedIdProviderName 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/trustedIdProviders/{trustedIdProviderName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); - requestUrl = requestUrl.replace('{trustedIdProviderName}', encodeURIComponent(trustedIdProviderName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - 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 !== 200 && statusCode !== 204) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - 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); - }); -} - -/** - * Gets the specified Data Lake Store trusted identity provider. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account from - * which to get the trusted identity provider. - * - * @param {string} trustedIdProviderName The name of the trusted identity - * provider to retrieve. - * - * @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 TrustedIdProvider} 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, accountName, trustedIdProviderName, 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 (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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (trustedIdProviderName === null || trustedIdProviderName === undefined || typeof trustedIdProviderName.valueOf() !== 'string') { - throw new Error('trustedIdProviderName 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/trustedIdProviders/{trustedIdProviderName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); - requestUrl = requestUrl.replace('{trustedIdProviderName}', encodeURIComponent(trustedIdProviderName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - 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['TrustedIdProvider']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Lists the Data Lake Store trusted identity providers within the specified - * Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account from - * which to get the trusted identity providers. - * - * @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 DataLakeStoreTrustedIdProviderListResult} - * 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 _listByAccount(resourceGroupName, accountName, 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 (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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/trustedIdProviders'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - 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['DataLakeStoreTrustedIdProviderListResult']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Lists the Data Lake Store trusted identity providers within the specified - * Data Lake Store account. - * - * @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 DataLakeStoreTrustedIdProviderListResult} - * 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 _listByAccountNext(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['DataLakeStoreTrustedIdProviderListResult']().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 TrustedIdProviders. */ -class TrustedIdProviders { - /** - * Create a TrustedIdProviders. - * @param {DataLakeStoreAccountManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._createOrUpdate = _createOrUpdate; - this._update = _update; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._listByAccount = _listByAccount; - this._listByAccountNext = _listByAccountNext; - } - - /** - * Creates or updates the specified trusted identity provider. During update, - * the trusted identity provider with the specified name will be replaced with - * this new provider - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account to add - * or replace the trusted identity provider. - * - * @param {string} trustedIdProviderName The name of the trusted identity - * provider. This is used for differentiation of providers in the account. - * - * @param {object} parameters Parameters supplied to create or replace the - * trusted identity provider. - * - * @param {string} parameters.idProvider The URL of this trusted identity - * provider - * - * @param {string} [parameters.name] Resource name - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, accountName, trustedIdProviderName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, accountName, trustedIdProviderName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates the specified trusted identity provider. During update, - * the trusted identity provider with the specified name will be replaced with - * this new provider - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account to add - * or replace the trusted identity provider. - * - * @param {string} trustedIdProviderName The name of the trusted identity - * provider. This is used for differentiation of providers in the account. - * - * @param {object} parameters Parameters supplied to create or replace the - * trusted identity provider. - * - * @param {string} parameters.idProvider The URL of this trusted identity - * provider - * - * @param {string} [parameters.name] Resource name - * - * @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 {TrustedIdProvider} - 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 TrustedIdProvider} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - createOrUpdate(resourceGroupName, accountName, trustedIdProviderName, parameters, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, accountName, trustedIdProviderName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, accountName, trustedIdProviderName, parameters, options, optionalCallback); - } - } - - /** - * Updates the specified trusted identity provider. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account to which - * to update the trusted identity provider. - * - * @param {string} trustedIdProviderName The name of the trusted identity - * provider. This is used for differentiation of providers in the account. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.parameters] Parameters supplied to update the - * trusted identity provider. - * - * @param {string} [options.parameters.idProvider] The URL of this trusted - * identity provider - * - * @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, accountName, trustedIdProviderName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._update(resourceGroupName, accountName, trustedIdProviderName, 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 specified trusted identity provider. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account to which - * to update the trusted identity provider. - * - * @param {string} trustedIdProviderName The name of the trusted identity - * provider. This is used for differentiation of providers in the account. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.parameters] Parameters supplied to update the - * trusted identity provider. - * - * @param {string} [options.parameters.idProvider] The URL of this trusted - * identity provider - * - * @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 {TrustedIdProvider} - 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 TrustedIdProvider} 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, accountName, trustedIdProviderName, 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, accountName, trustedIdProviderName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._update(resourceGroupName, accountName, trustedIdProviderName, options, optionalCallback); - } - } - - /** - * Deletes the specified trusted identity provider from the specified Data Lake - * Store account - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account from - * which to delete the trusted identity provider. - * - * @param {string} trustedIdProviderName The name of the trusted identity - * provider to delete. - * - * @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, accountName, trustedIdProviderName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, accountName, trustedIdProviderName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified trusted identity provider from the specified Data Lake - * Store account - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account from - * which to delete the trusted identity provider. - * - * @param {string} trustedIdProviderName The name of the trusted identity - * provider to delete. - * - * @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, accountName, trustedIdProviderName, 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, accountName, trustedIdProviderName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, accountName, trustedIdProviderName, options, optionalCallback); - } - } - - /** - * Gets the specified Data Lake Store trusted identity provider. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account from - * which to get the trusted identity provider. - * - * @param {string} trustedIdProviderName The name of the trusted identity - * provider to retrieve. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - getWithHttpOperationResponse(resourceGroupName, accountName, trustedIdProviderName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, accountName, trustedIdProviderName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Gets the specified Data Lake Store trusted identity provider. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account from - * which to get the trusted identity provider. - * - * @param {string} trustedIdProviderName The name of the trusted identity - * provider to retrieve. - * - * @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 {TrustedIdProvider} - 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 TrustedIdProvider} 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, accountName, trustedIdProviderName, 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, accountName, trustedIdProviderName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, accountName, trustedIdProviderName, options, optionalCallback); - } - } - - /** - * Lists the Data Lake Store trusted identity providers within the specified - * Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account from - * which to get the trusted identity providers. - * - * @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. - */ - listByAccountWithHttpOperationResponse(resourceGroupName, accountName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByAccount(resourceGroupName, accountName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists the Data Lake Store trusted identity providers within the specified - * Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account from - * which to get the trusted identity providers. - * - * @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 {DataLakeStoreTrustedIdProviderListResult} - 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 DataLakeStoreTrustedIdProviderListResult} - * 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. - */ - listByAccount(resourceGroupName, accountName, 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._listByAccount(resourceGroupName, accountName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByAccount(resourceGroupName, accountName, options, optionalCallback); - } - } - - /** - * Lists the Data Lake Store trusted identity providers within the specified - * Data Lake Store account. - * - * @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. - */ - listByAccountNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByAccountNext(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 the Data Lake Store trusted identity providers within the specified - * Data Lake Store account. - * - * @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 {DataLakeStoreTrustedIdProviderListResult} - 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 DataLakeStoreTrustedIdProviderListResult} - * 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. - */ - listByAccountNext(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._listByAccountNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByAccountNext(nextPageLink, options, optionalCallback); - } - } - -} - -module.exports = TrustedIdProviders; diff --git a/lib/services/dataLake.Store/package.json b/lib/services/dataLake.Store/package.json deleted file mode 100644 index 4480690669..0000000000 --- a/lib/services/dataLake.Store/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "azure-arm-datalake-store", - "author": "Microsoft Corporation", - "contributors": [ - "Goldsmith, Benjamin " - ], - "version": "3.1.0-preview", - "description": "Microsoft Azure Data Lake Store Management Client Library for node", - "tags": [ - "azure", - "sdk" - ], - "keywords": [ - "node", - "azure" - ], - "main": "./lib/dataLakeStore.js", - "types": "./lib/dataLakeStore.d.ts", - "license": "MIT", - "dependencies": { - "ms-rest": "^2.2.2", - "ms-rest-azure": "^2.3.3" - }, - "homepage": "http://github.com/Azure/azure-sdk-for-node", - "repository": { - "type": "git", - "url": "git@github.com:Azure/azure-sdk-for-node.git" - }, - "bugs": { - "url": "http://github.com/Azure/azure-sdk-for-node/issues" - }, - "scripts": { - "test": "npm -s run-script jshint" - } -} diff --git a/lib/services/datalake.Store/lib/account/models/dataLakeStoreAccountUpdateParameters.js b/lib/services/datalake.Store/lib/account/models/dataLakeStoreAccountUpdateParameters.js new file mode 100644 index 0000000000..4d42bb7e94 --- /dev/null +++ b/lib/services/datalake.Store/lib/account/models/dataLakeStoreAccountUpdateParameters.js @@ -0,0 +1,135 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Data Lake Store account information to update + * + */ +class DataLakeStoreAccountUpdateParameters { + /** + * Create a DataLakeStoreAccountUpdateParameters. + * @member {object} [tags] Resource tags + * @member {string} [firewallState] The current state of the IP address + * firewall for this Data Lake store account. Disabling the firewall does not + * remove existing rules, they will just be ignored until the firewall is + * re-enabled. Possible values include: 'Enabled', 'Disabled' + * @member {string} [trustedIdProviderState] The current state of the trusted + * identity provider feature for this Data Lake store account. Disabling + * trusted identity provider functionality does not remove the providers, + * they will just be ignored until this feature is re-enabled. Possible + * values include: 'Enabled', 'Disabled' + * @member {string} [defaultGroup] the default owner group for all new + * folders and files created in the Data Lake Store account. + * @member {string} [newTier] the commitment tier to use for next month. + * Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', + * 'Commitment_1PB', 'Commitment_5PB' + * @member {string} [firewallAllowAzureIps] The current state of allowing or + * disallowing IPs originating within Azure through the firewall. If the + * firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * @member {object} [encryptionConfig] Used for rotation of user managed Key + * Vault keys. Can only be used to rotate a user managed encryption Key Vault + * key. + * @member {object} [encryptionConfig.keyVaultMetaInfo] The updated Key Vault + * key to use in user managed key rotation. + * @member {string} [encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] + * The version of the user managed encryption key to update through a key + * rotation. + */ + constructor() { + } + + /** + * Defines the metadata of DataLakeStoreAccountUpdateParameters + * + * @returns {object} metadata of DataLakeStoreAccountUpdateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'DataLakeStoreAccountUpdateParameters', + type: { + name: 'Composite', + className: 'DataLakeStoreAccountUpdateParameters', + modelProperties: { + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + firewallState: { + required: false, + serializedName: 'properties.firewallState', + type: { + name: 'Enum', + allowedValues: [ 'Enabled', 'Disabled' ] + } + }, + trustedIdProviderState: { + required: false, + serializedName: 'properties.trustedIdProviderState', + type: { + name: 'Enum', + allowedValues: [ 'Enabled', 'Disabled' ] + } + }, + defaultGroup: { + required: false, + serializedName: 'properties.defaultGroup', + type: { + name: 'String' + } + }, + newTier: { + required: false, + serializedName: 'properties.newTier', + type: { + name: 'Enum', + allowedValues: [ 'Consumption', 'Commitment_1TB', 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', 'Commitment_5PB' ] + } + }, + firewallAllowAzureIps: { + required: false, + serializedName: 'properties.firewallAllowAzureIps', + type: { + name: 'Enum', + allowedValues: [ 'Enabled', 'Disabled' ] + } + }, + encryptionConfig: { + required: false, + serializedName: 'properties.encryptionConfig', + type: { + name: 'Composite', + className: 'UpdateEncryptionConfig' + } + } + } + } + }; + } +} + +module.exports = DataLakeStoreAccountUpdateParameters; diff --git a/lib/services/dataLake.Store/lib/account/models/dataLakeStoreAccountListResult.js b/lib/services/datalake.Store/lib/account/models/dataLakeStoreFirewallRuleListResult.js similarity index 67% rename from lib/services/dataLake.Store/lib/account/models/dataLakeStoreAccountListResult.js rename to lib/services/datalake.Store/lib/account/models/dataLakeStoreFirewallRuleListResult.js index b866e91e09..97def422ae 100644 --- a/lib/services/dataLake.Store/lib/account/models/dataLakeStoreAccountListResult.js +++ b/lib/services/datalake.Store/lib/account/models/dataLakeStoreFirewallRuleListResult.js @@ -11,11 +11,11 @@ 'use strict'; /** - * Data Lake Store account list information response. + * Data Lake Store firewall rule list information. */ -class DataLakeStoreAccountListResult extends Array { +class DataLakeStoreFirewallRuleListResult extends Array { /** - * Create a DataLakeStoreAccountListResult. + * Create a DataLakeStoreFirewallRuleListResult. * @member {string} [nextLink] the link (url) to the next page of results. */ constructor() { @@ -23,18 +23,18 @@ class DataLakeStoreAccountListResult extends Array { } /** - * Defines the metadata of DataLakeStoreAccountListResult + * Defines the metadata of DataLakeStoreFirewallRuleListResult * - * @returns {object} metadata of DataLakeStoreAccountListResult + * @returns {object} metadata of DataLakeStoreFirewallRuleListResult * */ mapper() { return { required: false, - serializedName: 'DataLakeStoreAccountListResult', + serializedName: 'DataLakeStoreFirewallRuleListResult', type: { name: 'Composite', - className: 'DataLakeStoreAccountListResult', + className: 'DataLakeStoreFirewallRuleListResult', modelProperties: { value: { required: false, @@ -44,10 +44,10 @@ class DataLakeStoreAccountListResult extends Array { name: 'Sequence', element: { required: false, - serializedName: 'DataLakeStoreAccountBasicElementType', + serializedName: 'FirewallRuleElementType', type: { name: 'Composite', - className: 'DataLakeStoreAccountBasic' + className: 'FirewallRule' } } } @@ -66,4 +66,4 @@ class DataLakeStoreAccountListResult extends Array { } } -module.exports = DataLakeStoreAccountListResult; +module.exports = DataLakeStoreFirewallRuleListResult; diff --git a/lib/services/datalake.Store/lib/account/models/dataLakeStoreTrustedIdProviderListResult.js b/lib/services/datalake.Store/lib/account/models/dataLakeStoreTrustedIdProviderListResult.js new file mode 100644 index 0000000000..4eba13e18d --- /dev/null +++ b/lib/services/datalake.Store/lib/account/models/dataLakeStoreTrustedIdProviderListResult.js @@ -0,0 +1,69 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Data Lake Store trusted identity provider list information. + */ +class DataLakeStoreTrustedIdProviderListResult extends Array { + /** + * Create a DataLakeStoreTrustedIdProviderListResult. + * @member {string} [nextLink] the link (url) to the next page of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DataLakeStoreTrustedIdProviderListResult + * + * @returns {object} metadata of DataLakeStoreTrustedIdProviderListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'DataLakeStoreTrustedIdProviderListResult', + type: { + name: 'Composite', + className: 'DataLakeStoreTrustedIdProviderListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'TrustedIdProviderElementType', + type: { + name: 'Composite', + className: 'TrustedIdProvider' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DataLakeStoreTrustedIdProviderListResult; diff --git a/lib/services/dataLake.Store/lib/account/models/subResource.js b/lib/services/datalake.Store/lib/account/models/errorDetails.js similarity index 53% rename from lib/services/dataLake.Store/lib/account/models/subResource.js rename to lib/services/datalake.Store/lib/account/models/errorDetails.js index e0ca7c61f5..0054072586 100644 --- a/lib/services/dataLake.Store/lib/account/models/subResource.js +++ b/lib/services/datalake.Store/lib/account/models/errorDetails.js @@ -11,52 +11,56 @@ 'use strict'; /** - * The Resource model definition for a nested resource. + * Data Lake Store error details information * */ -class SubResource { +class ErrorDetails { /** - * Create a SubResource. - * @member {string} [id] Resource Id - * @member {string} [name] Resource name - * @member {string} [type] Resource type + * Create a ErrorDetails. + * @member {string} [code] the HTTP status code or error code associated with + * this error + * @member {string} [message] the error message localized based on + * Accept-Language + * @member {string} [target] the target of the particular error (for example, + * the name of the property in error). */ constructor() { } /** - * Defines the metadata of SubResource + * Defines the metadata of ErrorDetails * - * @returns {object} metadata of SubResource + * @returns {object} metadata of ErrorDetails * */ mapper() { return { required: false, - serializedName: 'SubResource', + serializedName: 'ErrorDetails', type: { name: 'Composite', - className: 'SubResource', + className: 'ErrorDetails', modelProperties: { - id: { + code: { required: false, readOnly: true, - serializedName: 'id', + serializedName: 'code', type: { name: 'String' } }, - name: { + message: { required: false, - serializedName: 'name', + readOnly: true, + serializedName: 'message', type: { name: 'String' } }, - type: { + target: { required: false, readOnly: true, - serializedName: 'type', + serializedName: 'target', type: { name: 'String' } @@ -67,4 +71,4 @@ class SubResource { } } -module.exports = SubResource; +module.exports = ErrorDetails; diff --git a/lib/services/datalake.Store/lib/account/operations/account.js b/lib/services/datalake.Store/lib/account/operations/account.js new file mode 100644 index 0000000000..5df69b2cad --- /dev/null +++ b/lib/services/datalake.Store/lib/account/operations/account.js @@ -0,0 +1,3465 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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; + + +/** + * Creates the specified Data Lake Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group that + * contains the Data Lake Store account. + * + * @param {string} name The name of the Data Lake Store account to create. + * + * @param {object} parameters Parameters supplied to create the Data Lake Store + * account. + * + * @param {object} [parameters.identity] The Key Vault encryption identity, if + * any. + * + * @param {string} [parameters.encryptionState] The current state of encryption + * for this Data Lake store account. Possible values include: 'Enabled', + * 'Disabled' + * + * @param {object} [parameters.encryptionConfig] The Key Vault encryption + * configuration. + * + * @param {string} parameters.encryptionConfig.type The type of encryption + * configuration being used. Currently the only supported types are + * 'UserManaged' and 'ServiceManaged'. Possible values include: 'UserManaged', + * 'ServiceManaged' + * + * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The Key Vault + * information for connecting to user managed encryption keys. + * + * @param {string} + * parameters.encryptionConfig.keyVaultMetaInfo.keyVaultResourceId The resource + * identifier for the user managed Key Vault being used to encrypt. + * + * @param {string} + * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyName The name of + * the user managed encryption key. + * + * @param {string} + * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion The + * version of the user managed encryption key. + * + * @param {string} [parameters.firewallState] The current state of the IP + * address firewall for this Data Lake store account. Possible values include: + * 'Enabled', 'Disabled' + * + * @param {array} [parameters.firewallRules] The list of firewall rules + * associated with this Data Lake store account. + * + * @param {string} [parameters.trustedIdProviderState] The current state of the + * trusted identity provider feature for this Data Lake store account. Possible + * values include: 'Enabled', 'Disabled' + * + * @param {array} [parameters.trustedIdProviders] The list of trusted identity + * providers associated with this Data Lake store account. + * + * @param {string} [parameters.defaultGroup] the default owner group for all + * new folders and files created in the Data Lake Store account. + * + * @param {string} [parameters.newTier] the commitment tier to use for next + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' + * + * @param {string} [parameters.firewallAllowAzureIps] The current state of + * allowing or disallowing IPs originating within Azure through the firewall. + * If the firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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 DataLakeStoreAccount} 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, name, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreate(resourceGroupName, name, parameters, 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['DataLakeStoreAccount']().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 specified Data Lake Store account information. + * + * @param {string} resourceGroupName The name of the Azure resource group that + * contains the Data Lake Store account. + * + * @param {string} name The name of the Data Lake Store account to update. + * + * @param {object} parameters Parameters supplied to update the Data Lake Store + * account. + * + * @param {object} [parameters.tags] Resource tags + * + * @param {string} [parameters.firewallState] The current state of the IP + * address firewall for this Data Lake store account. Disabling the firewall + * does not remove existing rules, they will just be ignored until the firewall + * is re-enabled. Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.trustedIdProviderState] The current state of the + * trusted identity provider feature for this Data Lake store account. + * Disabling trusted identity provider functionality does not remove the + * providers, they will just be ignored until this feature is re-enabled. + * Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.defaultGroup] the default owner group for all + * new folders and files created in the Data Lake Store account. + * + * @param {string} [parameters.newTier] the commitment tier to use for next + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' + * + * @param {string} [parameters.firewallAllowAzureIps] The current state of + * allowing or disallowing IPs originating within Azure through the firewall. + * If the firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * + * @param {object} [parameters.encryptionConfig] Used for rotation of user + * managed Key Vault keys. Can only be used to rotate a user managed encryption + * Key Vault key. + * + * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The updated + * Key Vault key to use in user managed key rotation. + * + * @param {string} + * [parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] The + * version of the user managed encryption key to update through a key rotation. + * + * @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 DataLakeStoreAccount} 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, name, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginUpdate(resourceGroupName, name, parameters, 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['DataLakeStoreAccount']().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 the specified Data Lake Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group that + * contains the Data Lake Store account. + * + * @param {string} name The name of the Data Lake Store account to delete. + * + * @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, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginDeleteMethod(resourceGroupName, name, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Gets the specified Data Lake Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group that + * contains the Data Lake Store account. + * + * @param {string} name The name of the Data Lake Store account to retrieve. + * + * @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 DataLakeStoreAccount} 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, name, 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 (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 (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{name}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + 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['DataLakeStoreAccount']().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); + }); +} + +/** + * Attempts to enable a user managed Key Vault for encryption of the specified + * Data Lake Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group that + * contains the Data Lake Store account. + * + * @param {string} accountName The name of the Data Lake Store account to + * attempt to enable the Key Vault for. + * + * @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 _enableKeyVault(resourceGroupName, accountName, 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 (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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/enableKeyVault'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + 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; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists the Data Lake Store accounts within a specific resource group. The + * response includes a link to the next page of results, if any. + * + * @param {string} resourceGroupName The name of the Azure resource group that + * contains the Data Lake Store account(s). + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] OData filter. Optional. + * + * @param {number} [options.top] The number of items to return. Optional. + * + * @param {number} [options.skip] The number of items to skip over before + * returning elements. Optional. + * + * @param {string} [options.select] OData Select statement. Limits the + * properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. + * + * @param {string} [options.orderby] OrderBy clause. One or more + * comma-separated expressions with an optional "asc" (the default) or "desc" + * depending on the order you'd like the values sorted, e.g. + * Categories?$orderby=CategoryName desc. Optional. + * + * @param {boolean} [options.count] A Boolean value of true or false to request + * a count of the matching resources included with the resources in the + * response, e.g. Categories?$count=true. Optional. + * + * @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 DataLakeStoreAccountListResult} 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 filter = (options && options.filter !== undefined) ? options.filter : undefined; + let top = (options && options.top !== undefined) ? options.top : undefined; + let skip = (options && options.skip !== undefined) ? options.skip : undefined; + let select = (options && options.select !== undefined) ? options.select : undefined; + let orderby = (options && options.orderby !== undefined) ? options.orderby : undefined; + let count = (options && options.count !== undefined) ? options.count : undefined; + // Validate + try { + 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 (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter must be of type string.'); + } + if (top !== null && top !== undefined && typeof top !== 'number') { + throw new Error('top must be of type number.'); + } + if (top !== null && top !== undefined) { + if (top < 1) + { + throw new Error('"top" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + if (skip !== null && skip !== undefined && typeof skip !== 'number') { + throw new Error('skip must be of type number.'); + } + if (skip !== null && skip !== undefined) { + if (skip < 1) + { + throw new Error('"skip" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + if (select !== null && select !== undefined && typeof select.valueOf() !== 'string') { + throw new Error('select must be of type string.'); + } + if (orderby !== null && orderby !== undefined && typeof orderby.valueOf() !== 'string') { + throw new Error('orderby must be of type string.'); + } + if (count !== null && count !== undefined && typeof count !== 'boolean') { + throw new Error('count must be of type boolean.'); + } + 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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + encodeURIComponent(filter)); + } + if (top !== null && top !== undefined) { + queryParameters.push('$top=' + encodeURIComponent(top.toString())); + } + if (skip !== null && skip !== undefined) { + queryParameters.push('$skip=' + encodeURIComponent(skip.toString())); + } + if (select !== null && select !== undefined) { + queryParameters.push('$select=' + encodeURIComponent(select)); + } + if (orderby !== null && orderby !== undefined) { + queryParameters.push('$orderby=' + encodeURIComponent(orderby)); + } + if (count !== null && count !== undefined) { + queryParameters.push('$count=' + encodeURIComponent(count.toString())); + } + 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['DataLakeStoreAccountListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists the Data Lake Store accounts within the subscription. The response + * includes a link to the next page of results, if any. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] OData filter. Optional. + * + * @param {number} [options.top] The number of items to return. Optional. + * + * @param {number} [options.skip] The number of items to skip over before + * returning elements. Optional. + * + * @param {string} [options.select] OData Select statement. Limits the + * properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. + * + * @param {string} [options.orderby] OrderBy clause. One or more + * comma-separated expressions with an optional "asc" (the default) or "desc" + * depending on the order you'd like the values sorted, e.g. + * Categories?$orderby=CategoryName desc. Optional. + * + * @param {boolean} [options.count] The Boolean value of true or false to + * request a count of the matching resources included with the resources in the + * response, e.g. Categories?$count=true. Optional. + * + * @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 DataLakeStoreAccountListResult} 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 filter = (options && options.filter !== undefined) ? options.filter : undefined; + let top = (options && options.top !== undefined) ? options.top : undefined; + let skip = (options && options.skip !== undefined) ? options.skip : undefined; + let select = (options && options.select !== undefined) ? options.select : undefined; + let orderby = (options && options.orderby !== undefined) ? options.orderby : undefined; + let count = (options && options.count !== undefined) ? options.count : undefined; + // Validate + try { + if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter must be of type string.'); + } + if (top !== null && top !== undefined && typeof top !== 'number') { + throw new Error('top must be of type number.'); + } + if (top !== null && top !== undefined) { + if (top < 1) + { + throw new Error('"top" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + if (skip !== null && skip !== undefined && typeof skip !== 'number') { + throw new Error('skip must be of type number.'); + } + if (skip !== null && skip !== undefined) { + if (skip < 1) + { + throw new Error('"skip" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + if (select !== null && select !== undefined && typeof select.valueOf() !== 'string') { + throw new Error('select must be of type string.'); + } + if (orderby !== null && orderby !== undefined && typeof orderby.valueOf() !== 'string') { + throw new Error('orderby must be of type string.'); + } + if (count !== null && count !== undefined && typeof count !== 'boolean') { + throw new Error('count must be of type boolean.'); + } + 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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.DataLakeStore/accounts'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + encodeURIComponent(filter)); + } + if (top !== null && top !== undefined) { + queryParameters.push('$top=' + encodeURIComponent(top.toString())); + } + if (skip !== null && skip !== undefined) { + queryParameters.push('$skip=' + encodeURIComponent(skip.toString())); + } + if (select !== null && select !== undefined) { + queryParameters.push('$select=' + encodeURIComponent(select)); + } + if (orderby !== null && orderby !== undefined) { + queryParameters.push('$orderby=' + encodeURIComponent(orderby)); + } + if (count !== null && count !== undefined) { + queryParameters.push('$count=' + encodeURIComponent(count.toString())); + } + 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['DataLakeStoreAccountListResult']().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 the specified Data Lake Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group that + * contains the Data Lake Store account. + * + * @param {string} name The name of the Data Lake Store account to create. + * + * @param {object} parameters Parameters supplied to create the Data Lake Store + * account. + * + * @param {object} [parameters.identity] The Key Vault encryption identity, if + * any. + * + * @param {string} [parameters.encryptionState] The current state of encryption + * for this Data Lake store account. Possible values include: 'Enabled', + * 'Disabled' + * + * @param {object} [parameters.encryptionConfig] The Key Vault encryption + * configuration. + * + * @param {string} parameters.encryptionConfig.type The type of encryption + * configuration being used. Currently the only supported types are + * 'UserManaged' and 'ServiceManaged'. Possible values include: 'UserManaged', + * 'ServiceManaged' + * + * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The Key Vault + * information for connecting to user managed encryption keys. + * + * @param {string} + * parameters.encryptionConfig.keyVaultMetaInfo.keyVaultResourceId The resource + * identifier for the user managed Key Vault being used to encrypt. + * + * @param {string} + * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyName The name of + * the user managed encryption key. + * + * @param {string} + * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion The + * version of the user managed encryption key. + * + * @param {string} [parameters.firewallState] The current state of the IP + * address firewall for this Data Lake store account. Possible values include: + * 'Enabled', 'Disabled' + * + * @param {array} [parameters.firewallRules] The list of firewall rules + * associated with this Data Lake store account. + * + * @param {string} [parameters.trustedIdProviderState] The current state of the + * trusted identity provider feature for this Data Lake store account. Possible + * values include: 'Enabled', 'Disabled' + * + * @param {array} [parameters.trustedIdProviders] The list of trusted identity + * providers associated with this Data Lake store account. + * + * @param {string} [parameters.defaultGroup] the default owner group for all + * new folders and files created in the Data Lake Store account. + * + * @param {string} [parameters.newTier] the commitment tier to use for next + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' + * + * @param {string} [parameters.firewallAllowAzureIps] The current state of + * allowing or disallowing IPs originating within Azure through the firewall. + * If the firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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 DataLakeStoreAccount} 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, name, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + if (parameters === null || parameters === undefined) + { + parameters = {}; + } + // Validate + try { + 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 (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{name}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + 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 (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['DataLakeStoreAccount']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + 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['DataLakeStoreAccount']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DataLakeStoreAccount']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Updates the specified Data Lake Store account information. + * + * @param {string} resourceGroupName The name of the Azure resource group that + * contains the Data Lake Store account. + * + * @param {string} name The name of the Data Lake Store account to update. + * + * @param {object} parameters Parameters supplied to update the Data Lake Store + * account. + * + * @param {object} [parameters.tags] Resource tags + * + * @param {string} [parameters.firewallState] The current state of the IP + * address firewall for this Data Lake store account. Disabling the firewall + * does not remove existing rules, they will just be ignored until the firewall + * is re-enabled. Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.trustedIdProviderState] The current state of the + * trusted identity provider feature for this Data Lake store account. + * Disabling trusted identity provider functionality does not remove the + * providers, they will just be ignored until this feature is re-enabled. + * Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.defaultGroup] the default owner group for all + * new folders and files created in the Data Lake Store account. + * + * @param {string} [parameters.newTier] the commitment tier to use for next + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' + * + * @param {string} [parameters.firewallAllowAzureIps] The current state of + * allowing or disallowing IPs originating within Azure through the firewall. + * If the firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * + * @param {object} [parameters.encryptionConfig] Used for rotation of user + * managed Key Vault keys. Can only be used to rotate a user managed encryption + * Key Vault key. + * + * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The updated + * Key Vault key to use in user managed key rotation. + * + * @param {string} + * [parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] The + * version of the user managed encryption key to update through a key rotation. + * + * @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 DataLakeStoreAccount} 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, name, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + 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 (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{name}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + 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 (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['DataLakeStoreAccountUpdateParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + 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['DataLakeStoreAccount']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DataLakeStoreAccount']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes the specified Data Lake Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group that + * contains the Data Lake Store account. + * + * @param {string} name The name of the Data Lake Store account to delete. + * + * @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 _beginDeleteMethod(resourceGroupName, name, 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 (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 (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{name}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + 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 !== 200 && statusCode !== 202 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + 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); + }); +} + +/** + * Lists the Data Lake Store accounts within a specific resource group. The + * response includes a link to the next page of results, if any. + * + * @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 DataLakeStoreAccountListResult} 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['DataLakeStoreAccountListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists the Data Lake Store accounts within the subscription. The response + * includes a link to the next page of results, if any. + * + * @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 DataLakeStoreAccountListResult} 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['DataLakeStoreAccountListResult']().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 Account. */ +class Account { + /** + * Create a Account. + * @param {DataLakeStoreAccountManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._create = _create; + this._update = _update; + this._deleteMethod = _deleteMethod; + this._get = _get; + this._enableKeyVault = _enableKeyVault; + this._listByResourceGroup = _listByResourceGroup; + this._list = _list; + this._beginCreate = _beginCreate; + this._beginUpdate = _beginUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._listByResourceGroupNext = _listByResourceGroupNext; + this._listNext = _listNext; + } + + /** + * Creates the specified Data Lake Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group that + * contains the Data Lake Store account. + * + * @param {string} name The name of the Data Lake Store account to create. + * + * @param {object} parameters Parameters supplied to create the Data Lake Store + * account. + * + * @param {object} [parameters.identity] The Key Vault encryption identity, if + * any. + * + * @param {string} [parameters.encryptionState] The current state of encryption + * for this Data Lake store account. Possible values include: 'Enabled', + * 'Disabled' + * + * @param {object} [parameters.encryptionConfig] The Key Vault encryption + * configuration. + * + * @param {string} parameters.encryptionConfig.type The type of encryption + * configuration being used. Currently the only supported types are + * 'UserManaged' and 'ServiceManaged'. Possible values include: 'UserManaged', + * 'ServiceManaged' + * + * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The Key Vault + * information for connecting to user managed encryption keys. + * + * @param {string} + * parameters.encryptionConfig.keyVaultMetaInfo.keyVaultResourceId The resource + * identifier for the user managed Key Vault being used to encrypt. + * + * @param {string} + * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyName The name of + * the user managed encryption key. + * + * @param {string} + * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion The + * version of the user managed encryption key. + * + * @param {string} [parameters.firewallState] The current state of the IP + * address firewall for this Data Lake store account. Possible values include: + * 'Enabled', 'Disabled' + * + * @param {array} [parameters.firewallRules] The list of firewall rules + * associated with this Data Lake store account. + * + * @param {string} [parameters.trustedIdProviderState] The current state of the + * trusted identity provider feature for this Data Lake store account. Possible + * values include: 'Enabled', 'Disabled' + * + * @param {array} [parameters.trustedIdProviders] The list of trusted identity + * providers associated with this Data Lake store account. + * + * @param {string} [parameters.defaultGroup] the default owner group for all + * new folders and files created in the Data Lake Store account. + * + * @param {string} [parameters.newTier] the commitment tier to use for next + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' + * + * @param {string} [parameters.firewallAllowAzureIps] The current state of + * allowing or disallowing IPs originating within Azure through the firewall. + * If the firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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, name, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._create(resourceGroupName, name, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates the specified Data Lake Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group that + * contains the Data Lake Store account. + * + * @param {string} name The name of the Data Lake Store account to create. + * + * @param {object} parameters Parameters supplied to create the Data Lake Store + * account. + * + * @param {object} [parameters.identity] The Key Vault encryption identity, if + * any. + * + * @param {string} [parameters.encryptionState] The current state of encryption + * for this Data Lake store account. Possible values include: 'Enabled', + * 'Disabled' + * + * @param {object} [parameters.encryptionConfig] The Key Vault encryption + * configuration. + * + * @param {string} parameters.encryptionConfig.type The type of encryption + * configuration being used. Currently the only supported types are + * 'UserManaged' and 'ServiceManaged'. Possible values include: 'UserManaged', + * 'ServiceManaged' + * + * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The Key Vault + * information for connecting to user managed encryption keys. + * + * @param {string} + * parameters.encryptionConfig.keyVaultMetaInfo.keyVaultResourceId The resource + * identifier for the user managed Key Vault being used to encrypt. + * + * @param {string} + * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyName The name of + * the user managed encryption key. + * + * @param {string} + * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion The + * version of the user managed encryption key. + * + * @param {string} [parameters.firewallState] The current state of the IP + * address firewall for this Data Lake store account. Possible values include: + * 'Enabled', 'Disabled' + * + * @param {array} [parameters.firewallRules] The list of firewall rules + * associated with this Data Lake store account. + * + * @param {string} [parameters.trustedIdProviderState] The current state of the + * trusted identity provider feature for this Data Lake store account. Possible + * values include: 'Enabled', 'Disabled' + * + * @param {array} [parameters.trustedIdProviders] The list of trusted identity + * providers associated with this Data Lake store account. + * + * @param {string} [parameters.defaultGroup] the default owner group for all + * new folders and files created in the Data Lake Store account. + * + * @param {string} [parameters.newTier] the commitment tier to use for next + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' + * + * @param {string} [parameters.firewallAllowAzureIps] The current state of + * allowing or disallowing IPs originating within Azure through the firewall. + * If the firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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 {DataLakeStoreAccount} - 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 DataLakeStoreAccount} 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, name, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._create(resourceGroupName, name, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._create(resourceGroupName, name, parameters, options, optionalCallback); + } + } + + /** + * Updates the specified Data Lake Store account information. + * + * @param {string} resourceGroupName The name of the Azure resource group that + * contains the Data Lake Store account. + * + * @param {string} name The name of the Data Lake Store account to update. + * + * @param {object} parameters Parameters supplied to update the Data Lake Store + * account. + * + * @param {object} [parameters.tags] Resource tags + * + * @param {string} [parameters.firewallState] The current state of the IP + * address firewall for this Data Lake store account. Disabling the firewall + * does not remove existing rules, they will just be ignored until the firewall + * is re-enabled. Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.trustedIdProviderState] The current state of the + * trusted identity provider feature for this Data Lake store account. + * Disabling trusted identity provider functionality does not remove the + * providers, they will just be ignored until this feature is re-enabled. + * Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.defaultGroup] the default owner group for all + * new folders and files created in the Data Lake Store account. + * + * @param {string} [parameters.newTier] the commitment tier to use for next + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' + * + * @param {string} [parameters.firewallAllowAzureIps] The current state of + * allowing or disallowing IPs originating within Azure through the firewall. + * If the firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * + * @param {object} [parameters.encryptionConfig] Used for rotation of user + * managed Key Vault keys. Can only be used to rotate a user managed encryption + * Key Vault key. + * + * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The updated + * Key Vault key to use in user managed key rotation. + * + * @param {string} + * [parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] The + * version of the user managed encryption key to update through a key rotation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName, name, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, name, parameters, 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 specified Data Lake Store account information. + * + * @param {string} resourceGroupName The name of the Azure resource group that + * contains the Data Lake Store account. + * + * @param {string} name The name of the Data Lake Store account to update. + * + * @param {object} parameters Parameters supplied to update the Data Lake Store + * account. + * + * @param {object} [parameters.tags] Resource tags + * + * @param {string} [parameters.firewallState] The current state of the IP + * address firewall for this Data Lake store account. Disabling the firewall + * does not remove existing rules, they will just be ignored until the firewall + * is re-enabled. Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.trustedIdProviderState] The current state of the + * trusted identity provider feature for this Data Lake store account. + * Disabling trusted identity provider functionality does not remove the + * providers, they will just be ignored until this feature is re-enabled. + * Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.defaultGroup] the default owner group for all + * new folders and files created in the Data Lake Store account. + * + * @param {string} [parameters.newTier] the commitment tier to use for next + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' + * + * @param {string} [parameters.firewallAllowAzureIps] The current state of + * allowing or disallowing IPs originating within Azure through the firewall. + * If the firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * + * @param {object} [parameters.encryptionConfig] Used for rotation of user + * managed Key Vault keys. Can only be used to rotate a user managed encryption + * Key Vault key. + * + * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The updated + * Key Vault key to use in user managed key rotation. + * + * @param {string} + * [parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] The + * version of the user managed encryption key to update through a key rotation. + * + * @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 {DataLakeStoreAccount} - 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 DataLakeStoreAccount} 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, name, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._update(resourceGroupName, name, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, name, parameters, options, optionalCallback); + } + } + + /** + * Deletes the specified Data Lake Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group that + * contains the Data Lake Store account. + * + * @param {string} name The name of the Data Lake Store account to delete. + * + * @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, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified Data Lake Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group that + * contains the Data Lake Store account. + * + * @param {string} name The name of the Data Lake Store account to delete. + * + * @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, name, 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, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * Gets the specified Data Lake Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group that + * contains the Data Lake Store account. + * + * @param {string} name The name of the Data Lake Store account to retrieve. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the specified Data Lake Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group that + * contains the Data Lake Store account. + * + * @param {string} name The name of the Data Lake Store account to retrieve. + * + * @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 {DataLakeStoreAccount} - 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 DataLakeStoreAccount} 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, name, 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, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * Attempts to enable a user managed Key Vault for encryption of the specified + * Data Lake Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group that + * contains the Data Lake Store account. + * + * @param {string} accountName The name of the Data Lake Store account to + * attempt to enable the Key Vault for. + * + * @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. + */ + enableKeyVaultWithHttpOperationResponse(resourceGroupName, accountName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._enableKeyVault(resourceGroupName, accountName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Attempts to enable a user managed Key Vault for encryption of the specified + * Data Lake Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group that + * contains the Data Lake Store account. + * + * @param {string} accountName The name of the Data Lake Store account to + * attempt to enable the Key Vault for. + * + * @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. + */ + enableKeyVault(resourceGroupName, accountName, 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._enableKeyVault(resourceGroupName, accountName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._enableKeyVault(resourceGroupName, accountName, options, optionalCallback); + } + } + + /** + * Lists the Data Lake Store accounts within a specific resource group. The + * response includes a link to the next page of results, if any. + * + * @param {string} resourceGroupName The name of the Azure resource group that + * contains the Data Lake Store account(s). + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] OData filter. Optional. + * + * @param {number} [options.top] The number of items to return. Optional. + * + * @param {number} [options.skip] The number of items to skip over before + * returning elements. Optional. + * + * @param {string} [options.select] OData Select statement. Limits the + * properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. + * + * @param {string} [options.orderby] OrderBy clause. One or more + * comma-separated expressions with an optional "asc" (the default) or "desc" + * depending on the order you'd like the values sorted, e.g. + * Categories?$orderby=CategoryName desc. Optional. + * + * @param {boolean} [options.count] A Boolean value of true or false to request + * a count of the matching resources included with the resources in the + * response, e.g. Categories?$count=true. Optional. + * + * @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 the Data Lake Store accounts within a specific resource group. The + * response includes a link to the next page of results, if any. + * + * @param {string} resourceGroupName The name of the Azure resource group that + * contains the Data Lake Store account(s). + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] OData filter. Optional. + * + * @param {number} [options.top] The number of items to return. Optional. + * + * @param {number} [options.skip] The number of items to skip over before + * returning elements. Optional. + * + * @param {string} [options.select] OData Select statement. Limits the + * properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. + * + * @param {string} [options.orderby] OrderBy clause. One or more + * comma-separated expressions with an optional "asc" (the default) or "desc" + * depending on the order you'd like the values sorted, e.g. + * Categories?$orderby=CategoryName desc. Optional. + * + * @param {boolean} [options.count] A Boolean value of true or false to request + * a count of the matching resources included with the resources in the + * response, e.g. Categories?$count=true. Optional. + * + * @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 {DataLakeStoreAccountListResult} - 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 DataLakeStoreAccountListResult} 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); + } + } + + /** + * Lists the Data Lake Store accounts within the subscription. The response + * includes a link to the next page of results, if any. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] OData filter. Optional. + * + * @param {number} [options.top] The number of items to return. Optional. + * + * @param {number} [options.skip] The number of items to skip over before + * returning elements. Optional. + * + * @param {string} [options.select] OData Select statement. Limits the + * properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. + * + * @param {string} [options.orderby] OrderBy clause. One or more + * comma-separated expressions with an optional "asc" (the default) or "desc" + * depending on the order you'd like the values sorted, e.g. + * Categories?$orderby=CategoryName desc. Optional. + * + * @param {boolean} [options.count] The Boolean value of true or false to + * request a count of the matching resources included with the resources in the + * response, e.g. Categories?$count=true. Optional. + * + * @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 the Data Lake Store accounts within the subscription. The response + * includes a link to the next page of results, if any. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] OData filter. Optional. + * + * @param {number} [options.top] The number of items to return. Optional. + * + * @param {number} [options.skip] The number of items to skip over before + * returning elements. Optional. + * + * @param {string} [options.select] OData Select statement. Limits the + * properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. + * + * @param {string} [options.orderby] OrderBy clause. One or more + * comma-separated expressions with an optional "asc" (the default) or "desc" + * depending on the order you'd like the values sorted, e.g. + * Categories?$orderby=CategoryName desc. Optional. + * + * @param {boolean} [options.count] The Boolean value of true or false to + * request a count of the matching resources included with the resources in the + * response, e.g. Categories?$count=true. Optional. + * + * @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 {DataLakeStoreAccountListResult} - 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 DataLakeStoreAccountListResult} 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); + } + } + + /** + * Creates the specified Data Lake Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group that + * contains the Data Lake Store account. + * + * @param {string} name The name of the Data Lake Store account to create. + * + * @param {object} parameters Parameters supplied to create the Data Lake Store + * account. + * + * @param {object} [parameters.identity] The Key Vault encryption identity, if + * any. + * + * @param {string} [parameters.encryptionState] The current state of encryption + * for this Data Lake store account. Possible values include: 'Enabled', + * 'Disabled' + * + * @param {object} [parameters.encryptionConfig] The Key Vault encryption + * configuration. + * + * @param {string} parameters.encryptionConfig.type The type of encryption + * configuration being used. Currently the only supported types are + * 'UserManaged' and 'ServiceManaged'. Possible values include: 'UserManaged', + * 'ServiceManaged' + * + * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The Key Vault + * information for connecting to user managed encryption keys. + * + * @param {string} + * parameters.encryptionConfig.keyVaultMetaInfo.keyVaultResourceId The resource + * identifier for the user managed Key Vault being used to encrypt. + * + * @param {string} + * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyName The name of + * the user managed encryption key. + * + * @param {string} + * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion The + * version of the user managed encryption key. + * + * @param {string} [parameters.firewallState] The current state of the IP + * address firewall for this Data Lake store account. Possible values include: + * 'Enabled', 'Disabled' + * + * @param {array} [parameters.firewallRules] The list of firewall rules + * associated with this Data Lake store account. + * + * @param {string} [parameters.trustedIdProviderState] The current state of the + * trusted identity provider feature for this Data Lake store account. Possible + * values include: 'Enabled', 'Disabled' + * + * @param {array} [parameters.trustedIdProviders] The list of trusted identity + * providers associated with this Data Lake store account. + * + * @param {string} [parameters.defaultGroup] the default owner group for all + * new folders and files created in the Data Lake Store account. + * + * @param {string} [parameters.newTier] the commitment tier to use for next + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' + * + * @param {string} [parameters.firewallAllowAzureIps] The current state of + * allowing or disallowing IPs originating within Azure through the firewall. + * If the firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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, name, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreate(resourceGroupName, name, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates the specified Data Lake Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group that + * contains the Data Lake Store account. + * + * @param {string} name The name of the Data Lake Store account to create. + * + * @param {object} parameters Parameters supplied to create the Data Lake Store + * account. + * + * @param {object} [parameters.identity] The Key Vault encryption identity, if + * any. + * + * @param {string} [parameters.encryptionState] The current state of encryption + * for this Data Lake store account. Possible values include: 'Enabled', + * 'Disabled' + * + * @param {object} [parameters.encryptionConfig] The Key Vault encryption + * configuration. + * + * @param {string} parameters.encryptionConfig.type The type of encryption + * configuration being used. Currently the only supported types are + * 'UserManaged' and 'ServiceManaged'. Possible values include: 'UserManaged', + * 'ServiceManaged' + * + * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The Key Vault + * information for connecting to user managed encryption keys. + * + * @param {string} + * parameters.encryptionConfig.keyVaultMetaInfo.keyVaultResourceId The resource + * identifier for the user managed Key Vault being used to encrypt. + * + * @param {string} + * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyName The name of + * the user managed encryption key. + * + * @param {string} + * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion The + * version of the user managed encryption key. + * + * @param {string} [parameters.firewallState] The current state of the IP + * address firewall for this Data Lake store account. Possible values include: + * 'Enabled', 'Disabled' + * + * @param {array} [parameters.firewallRules] The list of firewall rules + * associated with this Data Lake store account. + * + * @param {string} [parameters.trustedIdProviderState] The current state of the + * trusted identity provider feature for this Data Lake store account. Possible + * values include: 'Enabled', 'Disabled' + * + * @param {array} [parameters.trustedIdProviders] The list of trusted identity + * providers associated with this Data Lake store account. + * + * @param {string} [parameters.defaultGroup] the default owner group for all + * new folders and files created in the Data Lake Store account. + * + * @param {string} [parameters.newTier] the commitment tier to use for next + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' + * + * @param {string} [parameters.firewallAllowAzureIps] The current state of + * allowing or disallowing IPs originating within Azure through the firewall. + * If the firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @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 {DataLakeStoreAccount} - 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 DataLakeStoreAccount} 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, name, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginCreate(resourceGroupName, name, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreate(resourceGroupName, name, parameters, options, optionalCallback); + } + } + + /** + * Updates the specified Data Lake Store account information. + * + * @param {string} resourceGroupName The name of the Azure resource group that + * contains the Data Lake Store account. + * + * @param {string} name The name of the Data Lake Store account to update. + * + * @param {object} parameters Parameters supplied to update the Data Lake Store + * account. + * + * @param {object} [parameters.tags] Resource tags + * + * @param {string} [parameters.firewallState] The current state of the IP + * address firewall for this Data Lake store account. Disabling the firewall + * does not remove existing rules, they will just be ignored until the firewall + * is re-enabled. Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.trustedIdProviderState] The current state of the + * trusted identity provider feature for this Data Lake store account. + * Disabling trusted identity provider functionality does not remove the + * providers, they will just be ignored until this feature is re-enabled. + * Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.defaultGroup] the default owner group for all + * new folders and files created in the Data Lake Store account. + * + * @param {string} [parameters.newTier] the commitment tier to use for next + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' + * + * @param {string} [parameters.firewallAllowAzureIps] The current state of + * allowing or disallowing IPs originating within Azure through the firewall. + * If the firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * + * @param {object} [parameters.encryptionConfig] Used for rotation of user + * managed Key Vault keys. Can only be used to rotate a user managed encryption + * Key Vault key. + * + * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The updated + * Key Vault key to use in user managed key rotation. + * + * @param {string} + * [parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] The + * version of the user managed encryption key to update through a key rotation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginUpdateWithHttpOperationResponse(resourceGroupName, name, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdate(resourceGroupName, name, parameters, 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 specified Data Lake Store account information. + * + * @param {string} resourceGroupName The name of the Azure resource group that + * contains the Data Lake Store account. + * + * @param {string} name The name of the Data Lake Store account to update. + * + * @param {object} parameters Parameters supplied to update the Data Lake Store + * account. + * + * @param {object} [parameters.tags] Resource tags + * + * @param {string} [parameters.firewallState] The current state of the IP + * address firewall for this Data Lake store account. Disabling the firewall + * does not remove existing rules, they will just be ignored until the firewall + * is re-enabled. Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.trustedIdProviderState] The current state of the + * trusted identity provider feature for this Data Lake store account. + * Disabling trusted identity provider functionality does not remove the + * providers, they will just be ignored until this feature is re-enabled. + * Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.defaultGroup] the default owner group for all + * new folders and files created in the Data Lake Store account. + * + * @param {string} [parameters.newTier] the commitment tier to use for next + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' + * + * @param {string} [parameters.firewallAllowAzureIps] The current state of + * allowing or disallowing IPs originating within Azure through the firewall. + * If the firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * + * @param {object} [parameters.encryptionConfig] Used for rotation of user + * managed Key Vault keys. Can only be used to rotate a user managed encryption + * Key Vault key. + * + * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The updated + * Key Vault key to use in user managed key rotation. + * + * @param {string} + * [parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] The + * version of the user managed encryption key to update through a key rotation. + * + * @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 {DataLakeStoreAccount} - 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 DataLakeStoreAccount} 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, name, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginUpdate(resourceGroupName, name, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdate(resourceGroupName, name, parameters, options, optionalCallback); + } + } + + /** + * Deletes the specified Data Lake Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group that + * contains the Data Lake Store account. + * + * @param {string} name The name of the Data Lake Store account to delete. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified Data Lake Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group that + * contains the Data Lake Store account. + * + * @param {string} name The name of the Data Lake Store account to delete. + * + * @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. + */ + beginDeleteMethod(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * Lists the Data Lake Store accounts within a specific resource group. The + * response includes a link to the next page of results, if any. + * + * @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 the Data Lake Store accounts within a specific resource group. The + * response includes a link to the next page of results, if any. + * + * @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 {DataLakeStoreAccountListResult} - 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 DataLakeStoreAccountListResult} 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); + } + } + + /** + * Lists the Data Lake Store accounts within the subscription. The response + * includes a link to the next page of results, if any. + * + * @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 the Data Lake Store accounts within the subscription. The response + * includes a link to the next page of results, if any. + * + * @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 {DataLakeStoreAccountListResult} - 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 DataLakeStoreAccountListResult} 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 = Account; diff --git a/lib/services/datalake.Store/lib/dataLakeStore.js b/lib/services/datalake.Store/lib/dataLakeStore.js new file mode 100644 index 0000000000..dd17d35e84 --- /dev/null +++ b/lib/services/datalake.Store/lib/dataLakeStore.js @@ -0,0 +1,20 @@ +// +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +'use strict'; + +exports.DataLakeStoreAccountClient = require('./account/dataLakeStoreAccountManagementClient'); +exports.DataLakeStoreFileSystemClient = require('./filesystem/dataLakeStoreFileSystemManagementClient'); +exports = module.exports; \ No newline at end of file diff --git a/lib/services/datalake.Store/lib/datalakeStore.d.ts b/lib/services/datalake.Store/lib/datalakeStore.d.ts new file mode 100644 index 0000000000..71bd5cf725 --- /dev/null +++ b/lib/services/datalake.Store/lib/datalakeStore.d.ts @@ -0,0 +1,14 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + */ + +import DataLakeStoreAccountClient = require('./account/dataLakeStoreAccountManagementClient'); +import * as StoreAccountModels from './account/models'; + +import DataLakeStoreFileSystemClient = require('./filesystem/dataLakeStoreFileSystemManagementClient'); +import * as FileSystemModels from './filesystem/models'; + + +export { DataLakeStoreAccountClient, StoreAccountModels, DataLakeStoreFileSystemClient, FileSystemModels }; \ No newline at end of file From 3d76547225e30dafd6c625d70b9f71cfdcb4d5fc Mon Sep 17 00:00:00 2001 From: Dan Schulte Date: Thu, 15 Nov 2018 13:42:34 -0800 Subject: [PATCH 5/8] Regenerate azure-arm-datalake-store --- .../dataLakeStoreAccountUpdateParameters.js | 135 - .../dataLake.Store/lib/dataLakeStore.js | 20 - .../dataLake.Store/lib/datalakeStore.d.ts | 14 - .../lib/filesystem/models/aclStatusResult.js | 62 - .../models/adlsAccessControlException.js | 79 - .../models/adlsBadOffsetException.js | 79 - .../lib/filesystem/models/adlsError.js | 67 - .../models/adlsFileAlreadyExistsException.js | 78 - .../models/adlsFileNotFoundException.js | 78 - .../models/adlsIllegalArgumentException.js | 78 - .../filesystem/models/adlsRemoteException.js | 80 - .../filesystem/models/adlsRuntimeException.js | 79 - .../models/adlsSecurityException.js | 78 - .../models/adlsThrottledException.js | 79 - .../adlsUnsupportedOperationException.js | 78 - .../lib/filesystem/models/contentSummary.js | 80 - .../filesystem/models/contentSummaryResult.js | 62 - .../filesystem/models/fileOperationResult.js | 54 - .../filesystem/models/fileStatusProperties.js | 149 - .../lib/filesystem/models/fileStatusResult.js | 73 - .../lib/filesystem/models/fileStatuses.js | 62 - .../filesystem/models/fileStatusesResult.js | 57 - .../lib/filesystem/models/index.d.ts | 276 - .../lib/filesystem/models/index.js | 54 - .../lib/filesystem/operations/fileSystem.js | 5855 ----------------- .../lib/filesystem/operations/index.d.ts | 1758 ----- ...dataLakeStoreAccountManagementClient.d.ts} | 47 +- .../dataLakeStoreAccountManagementClient.js} | 39 +- .../account/models/capabilityInformation.js | 94 + .../models/checkNameAvailabilityParameters.js | 62 + .../createDataLakeStoreAccountParameters.js | 220 + ...createFirewallRuleWithAccountParameters.js | 73 + .../createOrUpdateFirewallRuleParameters.js | 64 + ...eateOrUpdateTrustedIdProviderParameters.js | 52 + ...ateOrUpdateVirtualNetworkRuleParameters.js | 52 + ...eTrustedIdProviderWithAccountParameters.js | 62 + ...VirtualNetworkRuleWithAccountParameters.js | 62 + .../account/models/dataLakeStoreAccount.js | 346 + .../models/dataLakeStoreAccountBasic.js | 156 + ...t.js => dataLakeStoreAccountListResult.js} | 22 +- .../dataLakeStoreAccountUpdateParameters.js | 135 - .../lib/account/models/encryptionConfig.js | 71 + .../lib/account/models/encryptionIdentity.js} | 43 +- .../lib/account/models/firewallRule.js | 94 + .../account/models/firewallRuleListResult.js} | 16 +- .../lib/account/models/index.d.ts | 730 ++ .../lib/account/models/index.js | 56 + .../lib/account/models/keyVaultMetaInfo.js | 71 + .../models/nameAvailabilityInformation.js | 74 + .../lib/account/models/operation.js | 78 + .../lib/account/models/operationDisplay.js | 80 + .../lib/account/models/operationListResult.js | 70 + .../lib/account/models/resource.js} | 75 +- .../{errorDetails.js => subResource.js} | 41 +- .../lib/account/models/trustedIdProvider.js} | 49 +- ...sult.js => trustedIdProviderListResult.js} | 16 +- .../updateDataLakeStoreAccountParameters.js | 184 + .../account/models/updateEncryptionConfig.js | 56 + .../models/updateFirewallRuleParameters.js | 64 + ...updateFirewallRuleWithAccountParameters.js | 73 + .../account/models/updateKeyVaultMetaInfo.js | 53 + .../updateTrustedIdProviderParameters.js | 52 + ...eTrustedIdProviderWithAccountParameters.js | 62 + .../updateVirtualNetworkRuleParameters.js | 52 + ...VirtualNetworkRuleWithAccountParameters.js | 62 + .../lib/account/models/virtualNetworkRule.js | 81 + .../models/virtualNetworkRuleListResult.js} | 22 +- .../lib/account/operations/account.js | 3465 ---------- .../lib/account/operations/accounts.js} | 2424 ++++--- .../lib/account/operations/firewallRules.js | 1539 +++++ .../lib/account/operations/index.d.ts | 2733 ++++++++ .../lib/account}/operations/index.js | 7 +- .../lib/account/operations/locations.js | 254 + .../lib/account/operations/operations.js | 237 + .../account/operations/trustedIdProviders.js | 1521 +++++ .../account/operations/virtualNetworkRules.js | 1518 +++++ .../datalake.Store/lib/dataLakeStore.js | 20 - .../datalake.Store/lib/datalakeStore.d.ts | 14 - 78 files changed, 12673 insertions(+), 14434 deletions(-) delete mode 100644 lib/services/dataLake.Store/lib/account/models/dataLakeStoreAccountUpdateParameters.js delete mode 100644 lib/services/dataLake.Store/lib/dataLakeStore.js delete mode 100644 lib/services/dataLake.Store/lib/datalakeStore.d.ts delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/aclStatusResult.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/adlsAccessControlException.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/adlsBadOffsetException.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/adlsError.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/adlsFileAlreadyExistsException.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/adlsFileNotFoundException.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/adlsIllegalArgumentException.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/adlsRemoteException.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/adlsRuntimeException.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/adlsSecurityException.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/adlsThrottledException.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/adlsUnsupportedOperationException.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/contentSummary.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/contentSummaryResult.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/fileOperationResult.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/fileStatusProperties.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/fileStatusResult.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/fileStatuses.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/fileStatusesResult.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/index.d.ts delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/index.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/operations/fileSystem.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/operations/index.d.ts rename lib/services/{dataLake.Store/lib/filesystem/dataLakeStoreFileSystemManagementClient.d.ts => datalake.Store/lib/account/dataLakeStoreAccountManagementClient.d.ts} (53%) rename lib/services/{dataLake.Store/lib/filesystem/dataLakeStoreFileSystemManagementClient.js => datalake.Store/lib/account/dataLakeStoreAccountManagementClient.js} (65%) create mode 100644 lib/services/datalake.Store/lib/account/models/capabilityInformation.js create mode 100644 lib/services/datalake.Store/lib/account/models/checkNameAvailabilityParameters.js create mode 100644 lib/services/datalake.Store/lib/account/models/createDataLakeStoreAccountParameters.js create mode 100644 lib/services/datalake.Store/lib/account/models/createFirewallRuleWithAccountParameters.js create mode 100644 lib/services/datalake.Store/lib/account/models/createOrUpdateFirewallRuleParameters.js create mode 100644 lib/services/datalake.Store/lib/account/models/createOrUpdateTrustedIdProviderParameters.js create mode 100644 lib/services/datalake.Store/lib/account/models/createOrUpdateVirtualNetworkRuleParameters.js create mode 100644 lib/services/datalake.Store/lib/account/models/createTrustedIdProviderWithAccountParameters.js create mode 100644 lib/services/datalake.Store/lib/account/models/createVirtualNetworkRuleWithAccountParameters.js create mode 100644 lib/services/datalake.Store/lib/account/models/dataLakeStoreAccount.js create mode 100644 lib/services/datalake.Store/lib/account/models/dataLakeStoreAccountBasic.js rename lib/services/datalake.Store/lib/account/models/{dataLakeStoreFirewallRuleListResult.js => dataLakeStoreAccountListResult.js} (62%) delete mode 100644 lib/services/datalake.Store/lib/account/models/dataLakeStoreAccountUpdateParameters.js create mode 100644 lib/services/datalake.Store/lib/account/models/encryptionConfig.js rename lib/services/{dataLake.Store/lib/account/models/errorDetails.js => datalake.Store/lib/account/models/encryptionIdentity.js} (51%) create mode 100644 lib/services/datalake.Store/lib/account/models/firewallRule.js rename lib/services/{dataLake.Store/lib/account/models/dataLakeStoreFirewallRuleListResult.js => datalake.Store/lib/account/models/firewallRuleListResult.js} (71%) create mode 100644 lib/services/datalake.Store/lib/account/models/index.d.ts create mode 100644 lib/services/datalake.Store/lib/account/models/index.js create mode 100644 lib/services/datalake.Store/lib/account/models/keyVaultMetaInfo.js create mode 100644 lib/services/datalake.Store/lib/account/models/nameAvailabilityInformation.js create mode 100644 lib/services/datalake.Store/lib/account/models/operation.js create mode 100644 lib/services/datalake.Store/lib/account/models/operationDisplay.js create mode 100644 lib/services/datalake.Store/lib/account/models/operationListResult.js rename lib/services/{dataLake.Store/lib/filesystem/models/aclStatus.js => datalake.Store/lib/account/models/resource.js} (52%) rename lib/services/datalake.Store/lib/account/models/{errorDetails.js => subResource.js} (55%) rename lib/services/{dataLake.Store/lib/filesystem/models/adlsIOException.js => datalake.Store/lib/account/models/trustedIdProvider.js} (50%) rename lib/services/datalake.Store/lib/account/models/{dataLakeStoreTrustedIdProviderListResult.js => trustedIdProviderListResult.js} (70%) create mode 100644 lib/services/datalake.Store/lib/account/models/updateDataLakeStoreAccountParameters.js create mode 100644 lib/services/datalake.Store/lib/account/models/updateEncryptionConfig.js create mode 100644 lib/services/datalake.Store/lib/account/models/updateFirewallRuleParameters.js create mode 100644 lib/services/datalake.Store/lib/account/models/updateFirewallRuleWithAccountParameters.js create mode 100644 lib/services/datalake.Store/lib/account/models/updateKeyVaultMetaInfo.js create mode 100644 lib/services/datalake.Store/lib/account/models/updateTrustedIdProviderParameters.js create mode 100644 lib/services/datalake.Store/lib/account/models/updateTrustedIdProviderWithAccountParameters.js create mode 100644 lib/services/datalake.Store/lib/account/models/updateVirtualNetworkRuleParameters.js create mode 100644 lib/services/datalake.Store/lib/account/models/updateVirtualNetworkRuleWithAccountParameters.js create mode 100644 lib/services/datalake.Store/lib/account/models/virtualNetworkRule.js rename lib/services/{dataLake.Store/lib/account/models/dataLakeStoreTrustedIdProviderListResult.js => datalake.Store/lib/account/models/virtualNetworkRuleListResult.js} (60%) delete mode 100644 lib/services/datalake.Store/lib/account/operations/account.js rename lib/services/{dataLake.Store/lib/account/operations/account.js => datalake.Store/lib/account/operations/accounts.js} (82%) create mode 100644 lib/services/datalake.Store/lib/account/operations/firewallRules.js create mode 100644 lib/services/datalake.Store/lib/account/operations/index.d.ts rename lib/services/{dataLake.Store/lib/filesystem => datalake.Store/lib/account}/operations/index.js (57%) create mode 100644 lib/services/datalake.Store/lib/account/operations/locations.js create mode 100644 lib/services/datalake.Store/lib/account/operations/operations.js create mode 100644 lib/services/datalake.Store/lib/account/operations/trustedIdProviders.js create mode 100644 lib/services/datalake.Store/lib/account/operations/virtualNetworkRules.js delete mode 100644 lib/services/datalake.Store/lib/dataLakeStore.js delete mode 100644 lib/services/datalake.Store/lib/datalakeStore.d.ts diff --git a/lib/services/dataLake.Store/lib/account/models/dataLakeStoreAccountUpdateParameters.js b/lib/services/dataLake.Store/lib/account/models/dataLakeStoreAccountUpdateParameters.js deleted file mode 100644 index 4d42bb7e94..0000000000 --- a/lib/services/dataLake.Store/lib/account/models/dataLakeStoreAccountUpdateParameters.js +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * 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'); - -/** - * Data Lake Store account information to update - * - */ -class DataLakeStoreAccountUpdateParameters { - /** - * Create a DataLakeStoreAccountUpdateParameters. - * @member {object} [tags] Resource tags - * @member {string} [firewallState] The current state of the IP address - * firewall for this Data Lake store account. Disabling the firewall does not - * remove existing rules, they will just be ignored until the firewall is - * re-enabled. Possible values include: 'Enabled', 'Disabled' - * @member {string} [trustedIdProviderState] The current state of the trusted - * identity provider feature for this Data Lake store account. Disabling - * trusted identity provider functionality does not remove the providers, - * they will just be ignored until this feature is re-enabled. Possible - * values include: 'Enabled', 'Disabled' - * @member {string} [defaultGroup] the default owner group for all new - * folders and files created in the Data Lake Store account. - * @member {string} [newTier] the commitment tier to use for next month. - * Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', - * 'Commitment_1PB', 'Commitment_5PB' - * @member {string} [firewallAllowAzureIps] The current state of allowing or - * disallowing IPs originating within Azure through the firewall. If the - * firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' - * @member {object} [encryptionConfig] Used for rotation of user managed Key - * Vault keys. Can only be used to rotate a user managed encryption Key Vault - * key. - * @member {object} [encryptionConfig.keyVaultMetaInfo] The updated Key Vault - * key to use in user managed key rotation. - * @member {string} [encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] - * The version of the user managed encryption key to update through a key - * rotation. - */ - constructor() { - } - - /** - * Defines the metadata of DataLakeStoreAccountUpdateParameters - * - * @returns {object} metadata of DataLakeStoreAccountUpdateParameters - * - */ - mapper() { - return { - required: false, - serializedName: 'DataLakeStoreAccountUpdateParameters', - type: { - name: 'Composite', - className: 'DataLakeStoreAccountUpdateParameters', - modelProperties: { - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - firewallState: { - required: false, - serializedName: 'properties.firewallState', - type: { - name: 'Enum', - allowedValues: [ 'Enabled', 'Disabled' ] - } - }, - trustedIdProviderState: { - required: false, - serializedName: 'properties.trustedIdProviderState', - type: { - name: 'Enum', - allowedValues: [ 'Enabled', 'Disabled' ] - } - }, - defaultGroup: { - required: false, - serializedName: 'properties.defaultGroup', - type: { - name: 'String' - } - }, - newTier: { - required: false, - serializedName: 'properties.newTier', - type: { - name: 'Enum', - allowedValues: [ 'Consumption', 'Commitment_1TB', 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', 'Commitment_5PB' ] - } - }, - firewallAllowAzureIps: { - required: false, - serializedName: 'properties.firewallAllowAzureIps', - type: { - name: 'Enum', - allowedValues: [ 'Enabled', 'Disabled' ] - } - }, - encryptionConfig: { - required: false, - serializedName: 'properties.encryptionConfig', - type: { - name: 'Composite', - className: 'UpdateEncryptionConfig' - } - } - } - } - }; - } -} - -module.exports = DataLakeStoreAccountUpdateParameters; diff --git a/lib/services/dataLake.Store/lib/dataLakeStore.js b/lib/services/dataLake.Store/lib/dataLakeStore.js deleted file mode 100644 index dd17d35e84..0000000000 --- a/lib/services/dataLake.Store/lib/dataLakeStore.js +++ /dev/null @@ -1,20 +0,0 @@ -// -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -'use strict'; - -exports.DataLakeStoreAccountClient = require('./account/dataLakeStoreAccountManagementClient'); -exports.DataLakeStoreFileSystemClient = require('./filesystem/dataLakeStoreFileSystemManagementClient'); -exports = module.exports; \ No newline at end of file diff --git a/lib/services/dataLake.Store/lib/datalakeStore.d.ts b/lib/services/dataLake.Store/lib/datalakeStore.d.ts deleted file mode 100644 index 71bd5cf725..0000000000 --- a/lib/services/dataLake.Store/lib/datalakeStore.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - */ - -import DataLakeStoreAccountClient = require('./account/dataLakeStoreAccountManagementClient'); -import * as StoreAccountModels from './account/models'; - -import DataLakeStoreFileSystemClient = require('./filesystem/dataLakeStoreFileSystemManagementClient'); -import * as FileSystemModels from './filesystem/models'; - - -export { DataLakeStoreAccountClient, StoreAccountModels, DataLakeStoreFileSystemClient, FileSystemModels }; \ No newline at end of file diff --git a/lib/services/dataLake.Store/lib/filesystem/models/aclStatusResult.js b/lib/services/dataLake.Store/lib/filesystem/models/aclStatusResult.js deleted file mode 100644 index 45076aa4ab..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/aclStatusResult.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Data Lake Store file or directory Access Control List information. - * - */ -class AclStatusResult { - /** - * Create a AclStatusResult. - * @property {object} [aclStatus] the AclStatus object for a given file or - * directory. - * @property {array} [aclStatus.entries] the list of ACLSpec entries on a - * file or directory. - * @property {string} [aclStatus.group] the group owner, an AAD Object ID. - * @property {string} [aclStatus.owner] the user owner, an AAD Object ID. - * @property {string} [aclStatus.permission] The octal representation of the - * unnamed user, mask and other permissions. - * @property {boolean} [aclStatus.stickyBit] the indicator of whether the - * sticky bit is on or off. - */ - constructor() { - } - - /** - * Defines the metadata of AclStatusResult - * - * @returns {object} metadata of AclStatusResult - * - */ - mapper() { - return { - required: false, - serializedName: 'AclStatusResult', - type: { - name: 'Composite', - className: 'AclStatusResult', - modelProperties: { - aclStatus: { - required: false, - serializedName: 'aclStatus', - type: { - name: 'Composite', - className: 'AclStatus' - } - } - } - } - }; - } -} - -module.exports = AclStatusResult; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/adlsAccessControlException.js b/lib/services/dataLake.Store/lib/filesystem/models/adlsAccessControlException.js deleted file mode 100644 index bd8dfb50b9..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/adlsAccessControlException.js +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * A WebHDFS exception thrown indicating that access is denied due to - * insufficient permissions. Thrown when a 403 error response code is returned - * (forbidden). - * - * @extends models['AdlsRemoteException'] - */ -class AdlsAccessControlException extends models['AdlsRemoteException'] { - /** - * Create a AdlsAccessControlException. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of AdlsAccessControlException - * - * @returns {object} metadata of AdlsAccessControlException - * - */ - mapper() { - return { - required: false, - serializedName: 'AccessControlException', - type: { - name: 'Composite', - polymorphicDiscriminator: { - serializedName: 'exception', - clientName: 'exception' - }, - uberParent: 'AdlsRemoteException', - className: 'AdlsAccessControlException', - modelProperties: { - javaClassName: { - required: false, - readOnly: true, - serializedName: 'javaClassName', - type: { - name: 'String' - } - }, - message: { - required: false, - readOnly: true, - serializedName: 'message', - type: { - name: 'String' - } - }, - exception: { - required: true, - serializedName: 'exception', - isPolymorphicDiscriminator: true, - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = AdlsAccessControlException; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/adlsBadOffsetException.js b/lib/services/dataLake.Store/lib/filesystem/models/adlsBadOffsetException.js deleted file mode 100644 index b37a11a3bb..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/adlsBadOffsetException.js +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * A WebHDFS exception thrown indicating the append or read is from a bad - * offset. Thrown when a 400 error response code is returned for append and - * open operations (Bad request). - * - * @extends models['AdlsRemoteException'] - */ -class AdlsBadOffsetException extends models['AdlsRemoteException'] { - /** - * Create a AdlsBadOffsetException. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of AdlsBadOffsetException - * - * @returns {object} metadata of AdlsBadOffsetException - * - */ - mapper() { - return { - required: false, - serializedName: 'BadOffsetException', - type: { - name: 'Composite', - polymorphicDiscriminator: { - serializedName: 'exception', - clientName: 'exception' - }, - uberParent: 'AdlsRemoteException', - className: 'AdlsBadOffsetException', - modelProperties: { - javaClassName: { - required: false, - readOnly: true, - serializedName: 'javaClassName', - type: { - name: 'String' - } - }, - message: { - required: false, - readOnly: true, - serializedName: 'message', - type: { - name: 'String' - } - }, - exception: { - required: true, - serializedName: 'exception', - isPolymorphicDiscriminator: true, - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = AdlsBadOffsetException; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/adlsError.js b/lib/services/dataLake.Store/lib/filesystem/models/adlsError.js deleted file mode 100644 index afee6cdaca..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/adlsError.js +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Data Lake Store filesystem error containing a specific WebHDFS exception. - * - */ -class AdlsError { - /** - * Create a AdlsError. - * @property {object} [remoteException] the object representing the actual - * WebHDFS exception being returned. - * @property {string} [remoteException.javaClassName] the full class package - * name for the exception thrown, such as - * 'java.lang.IllegalArgumentException'. - * @property {string} [remoteException.message] the message associated with - * the exception that was thrown, such as 'Invalid value for webhdfs - * parameter "permission":...'. - * @property {string} [remoteException.exception] Polymorphic Discriminator - */ - constructor() { - } - - /** - * Defines the metadata of AdlsError - * - * @returns {object} metadata of AdlsError - * - */ - mapper() { - return { - required: false, - serializedName: 'AdlsError', - type: { - name: 'Composite', - className: 'AdlsError', - modelProperties: { - remoteException: { - required: false, - readOnly: true, - serializedName: 'remoteException', - type: { - name: 'Composite', - polymorphicDiscriminator: { - serializedName: 'exception', - clientName: 'exception' - }, - uberParent: 'AdlsRemoteException', - className: 'AdlsRemoteException' - } - } - } - } - }; - } -} - -module.exports = AdlsError; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/adlsFileAlreadyExistsException.js b/lib/services/dataLake.Store/lib/filesystem/models/adlsFileAlreadyExistsException.js deleted file mode 100644 index 322a120690..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/adlsFileAlreadyExistsException.js +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * A WebHDFS exception thrown indicating the file or folder already exists. - * Thrown when a 403 error response code is returned (forbidden). - * - * @extends models['AdlsRemoteException'] - */ -class AdlsFileAlreadyExistsException extends models['AdlsRemoteException'] { - /** - * Create a AdlsFileAlreadyExistsException. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of AdlsFileAlreadyExistsException - * - * @returns {object} metadata of AdlsFileAlreadyExistsException - * - */ - mapper() { - return { - required: false, - serializedName: 'FileAlreadyExistsException', - type: { - name: 'Composite', - polymorphicDiscriminator: { - serializedName: 'exception', - clientName: 'exception' - }, - uberParent: 'AdlsRemoteException', - className: 'AdlsFileAlreadyExistsException', - modelProperties: { - javaClassName: { - required: false, - readOnly: true, - serializedName: 'javaClassName', - type: { - name: 'String' - } - }, - message: { - required: false, - readOnly: true, - serializedName: 'message', - type: { - name: 'String' - } - }, - exception: { - required: true, - serializedName: 'exception', - isPolymorphicDiscriminator: true, - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = AdlsFileAlreadyExistsException; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/adlsFileNotFoundException.js b/lib/services/dataLake.Store/lib/filesystem/models/adlsFileNotFoundException.js deleted file mode 100644 index fc7dedb0b7..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/adlsFileNotFoundException.js +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * A WebHDFS exception thrown indicating the file or folder could not be found. - * Thrown when a 404 error response code is returned (not found). - * - * @extends models['AdlsRemoteException'] - */ -class AdlsFileNotFoundException extends models['AdlsRemoteException'] { - /** - * Create a AdlsFileNotFoundException. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of AdlsFileNotFoundException - * - * @returns {object} metadata of AdlsFileNotFoundException - * - */ - mapper() { - return { - required: false, - serializedName: 'FileNotFoundException', - type: { - name: 'Composite', - polymorphicDiscriminator: { - serializedName: 'exception', - clientName: 'exception' - }, - uberParent: 'AdlsRemoteException', - className: 'AdlsFileNotFoundException', - modelProperties: { - javaClassName: { - required: false, - readOnly: true, - serializedName: 'javaClassName', - type: { - name: 'String' - } - }, - message: { - required: false, - readOnly: true, - serializedName: 'message', - type: { - name: 'String' - } - }, - exception: { - required: true, - serializedName: 'exception', - isPolymorphicDiscriminator: true, - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = AdlsFileNotFoundException; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/adlsIllegalArgumentException.js b/lib/services/dataLake.Store/lib/filesystem/models/adlsIllegalArgumentException.js deleted file mode 100644 index 3487ead2f7..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/adlsIllegalArgumentException.js +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * A WebHDFS exception thrown indicating that one more arguments is incorrect. - * Thrown when a 400 error response code is returned (bad request). - * - * @extends models['AdlsRemoteException'] - */ -class AdlsIllegalArgumentException extends models['AdlsRemoteException'] { - /** - * Create a AdlsIllegalArgumentException. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of AdlsIllegalArgumentException - * - * @returns {object} metadata of AdlsIllegalArgumentException - * - */ - mapper() { - return { - required: false, - serializedName: 'IllegalArgumentException', - type: { - name: 'Composite', - polymorphicDiscriminator: { - serializedName: 'exception', - clientName: 'exception' - }, - uberParent: 'AdlsRemoteException', - className: 'AdlsIllegalArgumentException', - modelProperties: { - javaClassName: { - required: false, - readOnly: true, - serializedName: 'javaClassName', - type: { - name: 'String' - } - }, - message: { - required: false, - readOnly: true, - serializedName: 'message', - type: { - name: 'String' - } - }, - exception: { - required: true, - serializedName: 'exception', - isPolymorphicDiscriminator: true, - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = AdlsIllegalArgumentException; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/adlsRemoteException.js b/lib/services/dataLake.Store/lib/filesystem/models/adlsRemoteException.js deleted file mode 100644 index 63bc60d088..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/adlsRemoteException.js +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Data Lake Store filesystem exception based on the WebHDFS definition for - * RemoteExceptions. This is a WebHDFS 'catch all' exception - * - */ -class AdlsRemoteException { - /** - * Create a AdlsRemoteException. - * @property {string} [javaClassName] the full class package name for the - * exception thrown, such as 'java.lang.IllegalArgumentException'. - * @property {string} [message] the message associated with the exception - * that was thrown, such as 'Invalid value for webhdfs parameter - * "permission":...'. - * @property {string} exception Polymorphic Discriminator - */ - constructor() { - } - - /** - * Defines the metadata of AdlsRemoteException - * - * @returns {object} metadata of AdlsRemoteException - * - */ - mapper() { - return { - required: false, - serializedName: 'AdlsRemoteException', - type: { - name: 'Composite', - polymorphicDiscriminator: { - serializedName: 'exception', - clientName: 'exception' - }, - uberParent: 'AdlsRemoteException', - className: 'AdlsRemoteException', - modelProperties: { - javaClassName: { - required: false, - readOnly: true, - serializedName: 'javaClassName', - type: { - name: 'String' - } - }, - message: { - required: false, - readOnly: true, - serializedName: 'message', - type: { - name: 'String' - } - }, - exception: { - required: true, - serializedName: 'exception', - isPolymorphicDiscriminator: true, - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = AdlsRemoteException; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/adlsRuntimeException.js b/lib/services/dataLake.Store/lib/filesystem/models/adlsRuntimeException.js deleted file mode 100644 index fa925f17ec..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/adlsRuntimeException.js +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * A WebHDFS exception thrown when an unexpected error occurs during an - * operation. Thrown when a 500 error response code is returned (Internal - * server error). - * - * @extends models['AdlsRemoteException'] - */ -class AdlsRuntimeException extends models['AdlsRemoteException'] { - /** - * Create a AdlsRuntimeException. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of AdlsRuntimeException - * - * @returns {object} metadata of AdlsRuntimeException - * - */ - mapper() { - return { - required: false, - serializedName: 'RuntimeException', - type: { - name: 'Composite', - polymorphicDiscriminator: { - serializedName: 'exception', - clientName: 'exception' - }, - uberParent: 'AdlsRemoteException', - className: 'AdlsRuntimeException', - modelProperties: { - javaClassName: { - required: false, - readOnly: true, - serializedName: 'javaClassName', - type: { - name: 'String' - } - }, - message: { - required: false, - readOnly: true, - serializedName: 'message', - type: { - name: 'String' - } - }, - exception: { - required: true, - serializedName: 'exception', - isPolymorphicDiscriminator: true, - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = AdlsRuntimeException; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/adlsSecurityException.js b/lib/services/dataLake.Store/lib/filesystem/models/adlsSecurityException.js deleted file mode 100644 index 7bef0f8275..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/adlsSecurityException.js +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * A WebHDFS exception thrown indicating that access is denied. Thrown when a - * 401 error response code is returned (Unauthorized). - * - * @extends models['AdlsRemoteException'] - */ -class AdlsSecurityException extends models['AdlsRemoteException'] { - /** - * Create a AdlsSecurityException. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of AdlsSecurityException - * - * @returns {object} metadata of AdlsSecurityException - * - */ - mapper() { - return { - required: false, - serializedName: 'SecurityException', - type: { - name: 'Composite', - polymorphicDiscriminator: { - serializedName: 'exception', - clientName: 'exception' - }, - uberParent: 'AdlsRemoteException', - className: 'AdlsSecurityException', - modelProperties: { - javaClassName: { - required: false, - readOnly: true, - serializedName: 'javaClassName', - type: { - name: 'String' - } - }, - message: { - required: false, - readOnly: true, - serializedName: 'message', - type: { - name: 'String' - } - }, - exception: { - required: true, - serializedName: 'exception', - isPolymorphicDiscriminator: true, - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = AdlsSecurityException; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/adlsThrottledException.js b/lib/services/dataLake.Store/lib/filesystem/models/adlsThrottledException.js deleted file mode 100644 index f06eca6765..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/adlsThrottledException.js +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * A WebHDFS exception thrown indicating that the request is being throttled. - * Reducing the number of requests or request size helps to mitigate this - * error. - * - * @extends models['AdlsRemoteException'] - */ -class AdlsThrottledException extends models['AdlsRemoteException'] { - /** - * Create a AdlsThrottledException. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of AdlsThrottledException - * - * @returns {object} metadata of AdlsThrottledException - * - */ - mapper() { - return { - required: false, - serializedName: 'ThrottledException', - type: { - name: 'Composite', - polymorphicDiscriminator: { - serializedName: 'exception', - clientName: 'exception' - }, - uberParent: 'AdlsRemoteException', - className: 'AdlsThrottledException', - modelProperties: { - javaClassName: { - required: false, - readOnly: true, - serializedName: 'javaClassName', - type: { - name: 'String' - } - }, - message: { - required: false, - readOnly: true, - serializedName: 'message', - type: { - name: 'String' - } - }, - exception: { - required: true, - serializedName: 'exception', - isPolymorphicDiscriminator: true, - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = AdlsThrottledException; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/adlsUnsupportedOperationException.js b/lib/services/dataLake.Store/lib/filesystem/models/adlsUnsupportedOperationException.js deleted file mode 100644 index 9bedfacb32..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/adlsUnsupportedOperationException.js +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * A WebHDFS exception thrown indicating that the requested operation is not - * supported. Thrown when a 400 error response code is returned (bad request). - * - * @extends models['AdlsRemoteException'] - */ -class AdlsUnsupportedOperationException extends models['AdlsRemoteException'] { - /** - * Create a AdlsUnsupportedOperationException. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of AdlsUnsupportedOperationException - * - * @returns {object} metadata of AdlsUnsupportedOperationException - * - */ - mapper() { - return { - required: false, - serializedName: 'UnsupportedOperationException', - type: { - name: 'Composite', - polymorphicDiscriminator: { - serializedName: 'exception', - clientName: 'exception' - }, - uberParent: 'AdlsRemoteException', - className: 'AdlsUnsupportedOperationException', - modelProperties: { - javaClassName: { - required: false, - readOnly: true, - serializedName: 'javaClassName', - type: { - name: 'String' - } - }, - message: { - required: false, - readOnly: true, - serializedName: 'message', - type: { - name: 'String' - } - }, - exception: { - required: true, - serializedName: 'exception', - isPolymorphicDiscriminator: true, - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = AdlsUnsupportedOperationException; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/contentSummary.js b/lib/services/dataLake.Store/lib/filesystem/models/contentSummary.js deleted file mode 100644 index 0a28148049..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/contentSummary.js +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Data Lake Store content summary information - * - */ -class ContentSummary { - /** - * Create a ContentSummary. - * @property {number} [directoryCount] the number of directories. - * @property {number} [fileCount] the number of files. - * @property {number} [length] the number of bytes used by the content. - * @property {number} [spaceConsumed] the disk space consumed by the content. - */ - constructor() { - } - - /** - * Defines the metadata of ContentSummary - * - * @returns {object} metadata of ContentSummary - * - */ - mapper() { - return { - required: false, - serializedName: 'ContentSummary', - type: { - name: 'Composite', - className: 'ContentSummary', - modelProperties: { - directoryCount: { - required: false, - readOnly: true, - serializedName: 'directoryCount', - type: { - name: 'Number' - } - }, - fileCount: { - required: false, - readOnly: true, - serializedName: 'fileCount', - type: { - name: 'Number' - } - }, - length: { - required: false, - readOnly: true, - serializedName: 'length', - type: { - name: 'Number' - } - }, - spaceConsumed: { - required: false, - readOnly: true, - serializedName: 'spaceConsumed', - type: { - name: 'Number' - } - } - } - } - }; - } -} - -module.exports = ContentSummary; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/contentSummaryResult.js b/lib/services/dataLake.Store/lib/filesystem/models/contentSummaryResult.js deleted file mode 100644 index 33569c05d6..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/contentSummaryResult.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Data Lake Store filesystem content summary information response. - * - */ -class ContentSummaryResult { - /** - * Create a ContentSummaryResult. - * @property {object} [contentSummary] the content summary for the specified - * path - * @property {number} [contentSummary.directoryCount] the number of - * directories. - * @property {number} [contentSummary.fileCount] the number of files. - * @property {number} [contentSummary.length] the number of bytes used by the - * content. - * @property {number} [contentSummary.spaceConsumed] the disk space consumed - * by the content. - */ - constructor() { - } - - /** - * Defines the metadata of ContentSummaryResult - * - * @returns {object} metadata of ContentSummaryResult - * - */ - mapper() { - return { - required: false, - serializedName: 'ContentSummaryResult', - type: { - name: 'Composite', - className: 'ContentSummaryResult', - modelProperties: { - contentSummary: { - required: false, - readOnly: true, - serializedName: 'contentSummary', - type: { - name: 'Composite', - className: 'ContentSummary' - } - } - } - } - }; - } -} - -module.exports = ContentSummaryResult; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/fileOperationResult.js b/lib/services/dataLake.Store/lib/filesystem/models/fileOperationResult.js deleted file mode 100644 index adab3af571..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/fileOperationResult.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * 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 result of the request or operation. - * - */ -class FileOperationResult { - /** - * Create a FileOperationResult. - * @property {boolean} [operationResult] the result of the operation or - * request. - */ - constructor() { - } - - /** - * Defines the metadata of FileOperationResult - * - * @returns {object} metadata of FileOperationResult - * - */ - mapper() { - return { - required: false, - serializedName: 'FileOperationResult', - type: { - name: 'Composite', - className: 'FileOperationResult', - modelProperties: { - operationResult: { - required: false, - readOnly: true, - serializedName: 'boolean', - type: { - name: 'Boolean' - } - } - } - } - }; - } -} - -module.exports = FileOperationResult; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/fileStatusProperties.js b/lib/services/dataLake.Store/lib/filesystem/models/fileStatusProperties.js deleted file mode 100644 index 73fed29d22..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/fileStatusProperties.js +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Data Lake Store file or directory information. - * - */ -class FileStatusProperties { - /** - * Create a FileStatusProperties. - * @property {number} [accessTime] the last access time as ticks since the - * epoch. - * @property {number} [blockSize] the block size for the file. - * @property {number} [expirationTime] Gets the expiration time, if any, as - * ticks since the epoch. If the value is 0 or DateTime.MaxValue there is no - * expiration. - * @property {string} [group] the group owner. - * @property {number} [length] the number of bytes in a file. - * @property {number} [modificationTime] the modification time as ticks since - * the epoch. - * @property {string} [owner] the user who is the owner. - * @property {string} [pathSuffix] the path suffix. - * @property {string} [permission] the permission represented as an string. - * @property {string} [type] the type of the path object. Possible values - * include: 'FILE', 'DIRECTORY' - * @property {boolean} [aclBit] flag to indicate if extended acls are enabled - */ - constructor() { - } - - /** - * Defines the metadata of FileStatusProperties - * - * @returns {object} metadata of FileStatusProperties - * - */ - mapper() { - return { - required: false, - serializedName: 'FileStatusProperties', - type: { - name: 'Composite', - className: 'FileStatusProperties', - modelProperties: { - accessTime: { - required: false, - readOnly: true, - serializedName: 'accessTime', - type: { - name: 'Number' - } - }, - blockSize: { - required: false, - readOnly: true, - serializedName: 'blockSize', - type: { - name: 'Number' - } - }, - expirationTime: { - required: false, - readOnly: true, - serializedName: 'msExpirationTime', - type: { - name: 'Number' - } - }, - group: { - required: false, - readOnly: true, - serializedName: 'group', - type: { - name: 'String' - } - }, - length: { - required: false, - readOnly: true, - serializedName: 'length', - type: { - name: 'Number' - } - }, - modificationTime: { - required: false, - readOnly: true, - serializedName: 'modificationTime', - type: { - name: 'Number' - } - }, - owner: { - required: false, - readOnly: true, - serializedName: 'owner', - type: { - name: 'String' - } - }, - pathSuffix: { - required: false, - readOnly: true, - serializedName: 'pathSuffix', - type: { - name: 'String' - } - }, - permission: { - required: false, - readOnly: true, - serializedName: 'permission', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'Enum', - allowedValues: [ 'FILE', 'DIRECTORY' ] - } - }, - aclBit: { - required: false, - readOnly: true, - serializedName: 'aclBit', - type: { - name: 'Boolean' - } - } - } - } - }; - } -} - -module.exports = FileStatusProperties; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/fileStatusResult.js b/lib/services/dataLake.Store/lib/filesystem/models/fileStatusResult.js deleted file mode 100644 index 5940e4c7a8..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/fileStatusResult.js +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Data Lake Store filesystem file status information response. - * - */ -class FileStatusResult { - /** - * Create a FileStatusResult. - * @property {object} [fileStatus] the file status object associated with the - * specified path. - * @property {number} [fileStatus.accessTime] the last access time as ticks - * since the epoch. - * @property {number} [fileStatus.blockSize] the block size for the file. - * @property {number} [fileStatus.expirationTime] Gets the expiration time, - * if any, as ticks since the epoch. If the value is 0 or DateTime.MaxValue - * there is no expiration. - * @property {string} [fileStatus.group] the group owner. - * @property {number} [fileStatus.length] the number of bytes in a file. - * @property {number} [fileStatus.modificationTime] the modification time as - * ticks since the epoch. - * @property {string} [fileStatus.owner] the user who is the owner. - * @property {string} [fileStatus.pathSuffix] the path suffix. - * @property {string} [fileStatus.permission] the permission represented as - * an string. - * @property {string} [fileStatus.type] the type of the path object. Possible - * values include: 'FILE', 'DIRECTORY' - * @property {boolean} [fileStatus.aclBit] flag to indicate if extended acls - * are enabled - */ - constructor() { - } - - /** - * Defines the metadata of FileStatusResult - * - * @returns {object} metadata of FileStatusResult - * - */ - mapper() { - return { - required: false, - serializedName: 'FileStatusResult', - type: { - name: 'Composite', - className: 'FileStatusResult', - modelProperties: { - fileStatus: { - required: false, - readOnly: true, - serializedName: 'fileStatus', - type: { - name: 'Composite', - className: 'FileStatusProperties' - } - } - } - } - }; - } -} - -module.exports = FileStatusResult; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/fileStatuses.js b/lib/services/dataLake.Store/lib/filesystem/models/fileStatuses.js deleted file mode 100644 index c73fa30d0b..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/fileStatuses.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Data Lake Store file status list information. - * - */ -class FileStatuses { - /** - * Create a FileStatuses. - * @property {array} [fileStatus] the object containing the list of - * properties of the files. - */ - constructor() { - } - - /** - * Defines the metadata of FileStatuses - * - * @returns {object} metadata of FileStatuses - * - */ - mapper() { - return { - required: false, - serializedName: 'FileStatuses', - type: { - name: 'Composite', - className: 'FileStatuses', - modelProperties: { - fileStatus: { - required: false, - readOnly: true, - serializedName: 'fileStatus', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'FileStatusPropertiesElementType', - type: { - name: 'Composite', - className: 'FileStatusProperties' - } - } - } - } - } - } - }; - } -} - -module.exports = FileStatuses; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/fileStatusesResult.js b/lib/services/dataLake.Store/lib/filesystem/models/fileStatusesResult.js deleted file mode 100644 index bff868c5f7..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/fileStatusesResult.js +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Data Lake Store filesystem file status list information response. - * - */ -class FileStatusesResult { - /** - * Create a FileStatusesResult. - * @property {object} [fileStatuses] the object representing the list of file - * statuses. - * @property {array} [fileStatuses.fileStatus] the object containing the list - * of properties of the files. - */ - constructor() { - } - - /** - * Defines the metadata of FileStatusesResult - * - * @returns {object} metadata of FileStatusesResult - * - */ - mapper() { - return { - required: false, - serializedName: 'FileStatusesResult', - type: { - name: 'Composite', - className: 'FileStatusesResult', - modelProperties: { - fileStatuses: { - required: false, - readOnly: true, - serializedName: 'fileStatuses', - type: { - name: 'Composite', - className: 'FileStatuses' - } - } - } - } - }; - } -} - -module.exports = FileStatusesResult; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/index.d.ts b/lib/services/dataLake.Store/lib/filesystem/models/index.d.ts deleted file mode 100644 index 2055076f20..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/index.d.ts +++ /dev/null @@ -1,276 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for 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, CloudError } from "ms-rest-azure"; -import * as moment from "moment"; - -export { - - BaseResource, - CloudError -}; - -/** - * The result of the request or operation. - */ -export interface FileOperationResult { - /** - * the result of the operation or request. - */ - readonly operationResult?: boolean; -} - -/** - * Data Lake Store file or directory Access Control List information. - */ -export interface AclStatus { - /** - * the list of ACLSpec entries on a file or directory. - */ - entries?: string[]; - /** - * the group owner, an AAD Object ID. - */ - group?: string; - /** - * the user owner, an AAD Object ID. - */ - owner?: string; - /** - * The octal representation of the unnamed user, mask and other permissions. - */ - permission?: string; - /** - * the indicator of whether the sticky bit is on or off. - */ - readonly stickyBit?: boolean; -} - -/** - * Data Lake Store file or directory Access Control List information. - */ -export interface AclStatusResult { - /** - * the AclStatus object for a given file or directory. - */ - aclStatus?: AclStatus; -} - -/** - * Data Lake Store content summary information - */ -export interface ContentSummary { - /** - * the number of directories. - */ - readonly directoryCount?: number; - /** - * the number of files. - */ - readonly fileCount?: number; - /** - * the number of bytes used by the content. - */ - readonly length?: number; - /** - * the disk space consumed by the content. - */ - readonly spaceConsumed?: number; -} - -/** - * Data Lake Store filesystem content summary information response. - */ -export interface ContentSummaryResult { - /** - * the content summary for the specified path - */ - readonly contentSummary?: ContentSummary; -} - -/** - * Data Lake Store file or directory information. - */ -export interface FileStatusProperties { - /** - * the last access time as ticks since the epoch. - */ - readonly accessTime?: number; - /** - * the block size for the file. - */ - readonly blockSize?: number; - /** - * Gets the expiration time, if any, as ticks since the epoch. If the value is 0 or - * DateTime.MaxValue there is no expiration. - */ - readonly expirationTime?: number; - /** - * the group owner. - */ - readonly group?: string; - /** - * the number of bytes in a file. - */ - readonly length?: number; - /** - * the modification time as ticks since the epoch. - */ - readonly modificationTime?: number; - /** - * the user who is the owner. - */ - readonly owner?: string; - /** - * the path suffix. - */ - readonly pathSuffix?: string; - /** - * the permission represented as an string. - */ - readonly permission?: string; - /** - * the type of the path object. Possible values include: 'FILE', 'DIRECTORY' - */ - readonly type?: string; - /** - * flag to indicate if extended acls are enabled - */ - readonly aclBit?: boolean; -} - -/** - * Data Lake Store file status list information. - */ -export interface FileStatuses { - /** - * the object containing the list of properties of the files. - */ - readonly fileStatus?: FileStatusProperties[]; -} - -/** - * Data Lake Store filesystem file status list information response. - */ -export interface FileStatusesResult { - /** - * the object representing the list of file statuses. - */ - readonly fileStatuses?: FileStatuses; -} - -/** - * Data Lake Store filesystem file status information response. - */ -export interface FileStatusResult { - /** - * the file status object associated with the specified path. - */ - readonly fileStatus?: FileStatusProperties; -} - -/** - * Data Lake Store filesystem exception based on the WebHDFS definition for RemoteExceptions. This - * is a WebHDFS 'catch all' exception - */ -export interface AdlsRemoteException { - /** - * the full class package name for the exception thrown, such as - * 'java.lang.IllegalArgumentException'. - */ - readonly javaClassName?: string; - /** - * the message associated with the exception that was thrown, such as 'Invalid value for webhdfs - * parameter "permission":...'. - */ - readonly message?: string; - /** - * Polymorphic Discriminator - */ - exception: string; -} - -/** - * A WebHDFS exception thrown indicating that one more arguments is incorrect. Thrown when a 400 - * error response code is returned (bad request). - */ -export interface AdlsIllegalArgumentException extends AdlsRemoteException { -} - -/** - * A WebHDFS exception thrown indicating that the requested operation is not supported. Thrown when - * a 400 error response code is returned (bad request). - */ -export interface AdlsUnsupportedOperationException extends AdlsRemoteException { -} - -/** - * A WebHDFS exception thrown indicating that access is denied. Thrown when a 401 error response - * code is returned (Unauthorized). - */ -export interface AdlsSecurityException extends AdlsRemoteException { -} - -/** - * A WebHDFS exception thrown indicating there was an IO (read or write) error. Thrown when a 403 - * error response code is returned (forbidden). - */ -export interface AdlsIOException extends AdlsRemoteException { -} - -/** - * A WebHDFS exception thrown indicating the file or folder could not be found. Thrown when a 404 - * error response code is returned (not found). - */ -export interface AdlsFileNotFoundException extends AdlsRemoteException { -} - -/** - * A WebHDFS exception thrown indicating the file or folder already exists. Thrown when a 403 error - * response code is returned (forbidden). - */ -export interface AdlsFileAlreadyExistsException extends AdlsRemoteException { -} - -/** - * A WebHDFS exception thrown indicating the append or read is from a bad offset. Thrown when a 400 - * error response code is returned for append and open operations (Bad request). - */ -export interface AdlsBadOffsetException extends AdlsRemoteException { -} - -/** - * A WebHDFS exception thrown when an unexpected error occurs during an operation. Thrown when a - * 500 error response code is returned (Internal server error). - */ -export interface AdlsRuntimeException extends AdlsRemoteException { -} - -/** - * A WebHDFS exception thrown indicating that access is denied due to insufficient permissions. - * Thrown when a 403 error response code is returned (forbidden). - */ -export interface AdlsAccessControlException extends AdlsRemoteException { -} - -/** - * A WebHDFS exception thrown indicating that the request is being throttled. Reducing the number - * of requests or request size helps to mitigate this error. - */ -export interface AdlsThrottledException extends AdlsRemoteException { -} - -/** - * Data Lake Store filesystem error containing a specific WebHDFS exception. - */ -export interface AdlsError { - /** - * the object representing the actual WebHDFS exception being returned. - */ - readonly remoteException?: AdlsRemoteException; -} diff --git a/lib/services/dataLake.Store/lib/filesystem/models/index.js b/lib/services/dataLake.Store/lib/filesystem/models/index.js deleted file mode 100644 index 010fcdf236..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/index.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * 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.FileOperationResult = require('./fileOperationResult'); -exports.AclStatus = require('./aclStatus'); -exports.AclStatusResult = require('./aclStatusResult'); -exports.ContentSummary = require('./contentSummary'); -exports.ContentSummaryResult = require('./contentSummaryResult'); -exports.FileStatusProperties = require('./fileStatusProperties'); -exports.FileStatuses = require('./fileStatuses'); -exports.FileStatusesResult = require('./fileStatusesResult'); -exports.FileStatusResult = require('./fileStatusResult'); -exports.AdlsRemoteException = require('./adlsRemoteException'); -exports.AdlsIllegalArgumentException = require('./adlsIllegalArgumentException'); -exports.AdlsUnsupportedOperationException = require('./adlsUnsupportedOperationException'); -exports.AdlsSecurityException = require('./adlsSecurityException'); -exports.AdlsIOException = require('./adlsIOException'); -exports.AdlsFileNotFoundException = require('./adlsFileNotFoundException'); -exports.AdlsFileAlreadyExistsException = require('./adlsFileAlreadyExistsException'); -exports.AdlsBadOffsetException = require('./adlsBadOffsetException'); -exports.AdlsRuntimeException = require('./adlsRuntimeException'); -exports.AdlsAccessControlException = require('./adlsAccessControlException'); -exports.AdlsThrottledException = require('./adlsThrottledException'); -exports.AdlsError = require('./adlsError'); -exports.discriminators = { - 'AdlsRemoteException.IllegalArgumentException' : exports.AdlsIllegalArgumentException, - 'AdlsRemoteException.UnsupportedOperationException' : exports.AdlsUnsupportedOperationException, - 'AdlsRemoteException.SecurityException' : exports.AdlsSecurityException, - 'AdlsRemoteException.IOException' : exports.AdlsIOException, - 'AdlsRemoteException.FileNotFoundException' : exports.AdlsFileNotFoundException, - 'AdlsRemoteException.FileAlreadyExistsException' : exports.AdlsFileAlreadyExistsException, - 'AdlsRemoteException.BadOffsetException' : exports.AdlsBadOffsetException, - 'AdlsRemoteException.RuntimeException' : exports.AdlsRuntimeException, - 'AdlsRemoteException.AccessControlException' : exports.AdlsAccessControlException, - 'AdlsRemoteException.ThrottledException' : exports.AdlsThrottledException, - 'AdlsRemoteException' : exports.AdlsRemoteException -}; diff --git a/lib/services/dataLake.Store/lib/filesystem/operations/fileSystem.js b/lib/services/dataLake.Store/lib/filesystem/operations/fileSystem.js deleted file mode 100644 index 2d288d3dc7..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/operations/fileSystem.js +++ /dev/null @@ -1,5855 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * 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; - -/** - * Sets or removes the expiration time on the specified file. This operation - * can only be executed against files. Folders are not supported. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file on which to set or remove the expiration time. - * - * @param {string} expiryOption Indicates the type of expiration to use for the - * file: 1. NeverExpire: ExpireTime is ignored. 2. RelativeToNow: ExpireTime is - * an integer in milliseconds representing the expiration date relative to when - * file expiration is updated. 3. RelativeToCreationDate: ExpireTime is an - * integer in milliseconds representing the expiration date relative to file - * creation. 4. Absolute: ExpireTime is an integer in milliseconds, as a Unix - * timestamp relative to 1/1/1970 00:00:00. Possible values include: - * 'NeverExpire', 'RelativeToNow', 'RelativeToCreationDate', 'Absolute' - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.expireTime] The time that the file will expire, - * corresponding to the ExpiryOption that was set. - * - * @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 _setFileExpiry(accountName, path, expiryOption, 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 expireTime = (options && options.expireTime !== undefined) ? options.expireTime : undefined; - let op = 'SETEXPIRY'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path cannot be null or undefined and it must be of type string.'); - } - if (expiryOption) { - let allowedValues = [ 'NeverExpire', 'RelativeToNow', 'RelativeToCreationDate', 'Absolute' ]; - if (!allowedValues.some( function(item) { return item === expiryOption; })) { - throw new Error(expiryOption + ' is not a valid value. The valid values are: ' + allowedValues); - } - } else { - throw new Error('expiryOption cannot be null or undefined.'); - } - if (expireTime !== null && expireTime !== undefined && typeof expireTime !== 'number') { - throw new Error('expireTime must be of type number.'); - } - 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('/') ? '' : '/') + 'WebHdfsExt/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - queryParameters.push('expiryOption=' + encodeURIComponent(expiryOption)); - if (expireTime !== null && expireTime !== undefined) { - queryParameters.push('expireTime=' + encodeURIComponent(expireTime.toString())); - } - queryParameters.push('op=' + encodeURIComponent(op)); - 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]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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); - }); -} - -/** - * Appends to the specified file, optionally first creating the file if it does - * not yet exist. This method supports multiple concurrent appends to the file. - * NOTE: The target must not contain data added by Create or normal (serial) - * Append. ConcurrentAppend and Append cannot be used interchangeably; once a - * target file has been modified using either of these append options, the - * other append option cannot be used on the target file. ConcurrentAppend does - * not guarantee order and can result in duplicated data landing in the target - * file. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file to which to append using concurrent append. - * - * @param {object} streamContents The file contents to include when appending - * to the file. The maximum content size is 4MB. For content larger than 4MB - * you must append the content in 4MB chunks. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.appendMode] Indicates the concurrent append call - * should create the file if it doesn't exist or just open the existing file - * for append. Possible values include: 'autocreate' - * - * @param {string} [options.syncFlag] Optionally indicates what to do after - * completion of the concurrent append. DATA indicates that more data will be - * sent immediately by the client, the file handle should remain open/locked, - * and file metadata (including file length, last modified time) should NOT get - * updated. METADATA indicates that more data will be sent immediately by the - * client, the file handle should remain open/locked, and file metadata should - * get updated. CLOSE indicates that the client is done sending data, the file - * handle should be closed/unlocked, and file metadata should get updated. - * Possible values include: 'DATA', 'METADATA', 'CLOSE' - * - * @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 _concurrentAppend(accountName, path, streamContents, 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 appendMode = (options && options.appendMode !== undefined) ? options.appendMode : undefined; - let syncFlag = (options && options.syncFlag !== undefined) ? options.syncFlag : 'DATA'; - let op = 'CONCURRENTAPPEND'; - let transferEncoding = 'chunked'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path cannot be null or undefined and it must be of type string.'); - } - if (streamContents === null || streamContents === undefined) { - throw new Error('streamContents cannot be null or undefined and it must be of type object.'); - } - if (appendMode) { - let allowedValues = [ 'autocreate' ]; - if (!allowedValues.some( function(item) { return item === appendMode; })) { - throw new Error(appendMode + ' is not a valid value. The valid values are: ' + allowedValues); - } - } - if (syncFlag) { - let allowedValues1 = [ 'DATA', 'METADATA', 'CLOSE' ]; - if (!allowedValues1.some( function(item) { return item === syncFlag; })) { - throw new Error(syncFlag + ' is not a valid value. The valid values are: ' + allowedValues1); - } - } - 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('/') ? '' : '/') + 'WebHdfsExt/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - if (appendMode !== null && appendMode !== undefined) { - queryParameters.push('appendMode=' + encodeURIComponent(appendMode)); - } - queryParameters.push('op=' + encodeURIComponent(op)); - if (syncFlag !== null && syncFlag !== undefined) { - queryParameters.push('syncFlag=' + encodeURIComponent(syncFlag)); - } - 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/octet-stream'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (transferEncoding !== undefined && transferEncoding !== null) { - httpRequest.headers['Transfer-Encoding'] = transferEncoding; - } - 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 = streamContents; - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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); - }); -} - -/** - * Checks if the specified access is available at the given path. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to check access. - * - * @param {string} fsaction File system operation read/write/execute in string - * form, matching regex pattern '[rwx-]{3}' - * - * @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 _checkAccess(accountName, path, fsaction, 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 op = 'CHECKACCESS'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path cannot be null or undefined and it must be of type string.'); - } - if (fsaction === null || fsaction === undefined || typeof fsaction.valueOf() !== 'string') { - throw new Error('fsaction 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 (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('/') ? '' : '/') + 'webhdfs/v1/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - queryParameters.push('fsaction=' + encodeURIComponent(fsaction)); - queryParameters.push('op=' + encodeURIComponent(op)); - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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 directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * directory to create. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.permission] Optional octal permission with which - * the directory should be created. - * - * @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 FileOperationResult} 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 _mkdirs(accountName, path, 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 permission = (options && options.permission !== undefined) ? options.permission : undefined; - let op = 'MKDIRS'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path cannot be null or undefined and it must be of type string.'); - } - if (permission !== null && permission !== undefined && typeof permission !== 'number') { - throw new Error('permission must be of type number.'); - } - 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('/') ? '' : '/') + 'webhdfs/v1/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - if (permission !== null && permission !== undefined) { - queryParameters.push('permission=' + encodeURIComponent(permission.toString())); - } - queryParameters.push('op=' + encodeURIComponent(op)); - 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]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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['FileOperationResult']().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); - }); -} - -/** - * Concatenates the list of source files into the destination file, removing - * all source files upon success. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * destination file resulting from the concatenation. - * - * @param {array} sources A list of comma separated Data Lake Store paths - * (starting with '/') of the files to concatenate, in the order in which they - * should be concatenated. - * - * @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 _concat(accountName, path, sources, 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 op = 'CONCAT'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path cannot be null or undefined and it must be of type string.'); - } - if (!Array.isArray(sources)) { - throw new Error('sources cannot be null or undefined and it must be of type array.'); - } - for (let i = 0; i < sources.length; i++) { - if (sources[i] !== null && sources[i] !== undefined && typeof sources[i].valueOf() !== 'string') { - throw new Error('sources[i] 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 (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('/') ? '' : '/') + 'webhdfs/v1/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - queryParameters.push('sources=' + encodeURIComponent(sources.join(','))); - queryParameters.push('op=' + encodeURIComponent(op)); - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'POST'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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); - }); -} - -/** - * Concatenates the list of source files into the destination file, deleting - * all source files upon success. This method accepts more source file paths - * than the Concat method. This method and the parameters it accepts are - * subject to change for usability in an upcoming version. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * destination file resulting from the concatenation. - * - * @param {object} streamContents A list of Data Lake Store paths (starting - * with '/') of the source files. Must be a comma-separated path list in the - * format: sources=/file/path/1.txt,/file/path/2.txt,/file/path/lastfile.csv - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.deleteSourceDirectory] Indicates that as an - * optimization instead of deleting each individual source stream, delete the - * source stream folder if all streams are in the same folder instead. This - * results in a substantial performance improvement when the only streams in - * the folder are part of the concatenation operation. WARNING: This includes - * the deletion of any other files that are not source files. Only set this to - * true when source files are the only files in the source directory. - * - * @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 _msConcat(accountName, path, streamContents, 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 deleteSourceDirectory = (options && options.deleteSourceDirectory !== undefined) ? options.deleteSourceDirectory : undefined; - let op = 'MSCONCAT'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path cannot be null or undefined and it must be of type string.'); - } - if (deleteSourceDirectory !== null && deleteSourceDirectory !== undefined && typeof deleteSourceDirectory !== 'boolean') { - throw new Error('deleteSourceDirectory must be of type boolean.'); - } - if (streamContents === null || streamContents === undefined) { - throw new Error('streamContents cannot be null or undefined and it must be of type object.'); - } - 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('/') ? '' : '/') + 'webhdfs/v1/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - if (deleteSourceDirectory !== null && deleteSourceDirectory !== undefined) { - queryParameters.push('deleteSourceDirectory=' + encodeURIComponent(deleteSourceDirectory.toString())); - } - queryParameters.push('op=' + encodeURIComponent(op)); - 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/octet-stream'; - 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 = streamContents; - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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); - }); -} - -/** - * Get the list of file status objects specified by the file path, with - * optional pagination parameters - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * directory to list. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.listSize] Gets or sets the number of items to - * return. Optional. - * - * @param {string} [options.listAfter] Gets or sets the item or lexographical - * index after which to begin returning results. For example, a file list of - * 'a','b','d' and listAfter='b' will return 'd', and a listAfter='c' will also - * return 'd'. Optional. - * - * @param {string} [options.listBefore] Gets or sets the item or lexographical - * index before which to begin returning results. For example, a file list of - * 'a','b','d' and listBefore='d' will return 'a','b', and a listBefore='c' - * will also return 'a','b'. Optional. - * - * @param {boolean} [options.tooId] An optional switch to return friendly names - * in place of owner and group. tooid=false returns friendly names instead of - * the AAD Object ID. Default value is true, returning AAD object IDs. - * - * @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 FileStatusesResult} 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 _listFileStatus(accountName, path, 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 listSize = (options && options.listSize !== undefined) ? options.listSize : undefined; - let listAfter = (options && options.listAfter !== undefined) ? options.listAfter : undefined; - let listBefore = (options && options.listBefore !== undefined) ? options.listBefore : undefined; - let tooId = (options && options.tooId !== undefined) ? options.tooId : undefined; - let op = 'LISTSTATUS'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path cannot be null or undefined and it must be of type string.'); - } - if (listSize !== null && listSize !== undefined && typeof listSize !== 'number') { - throw new Error('listSize must be of type number.'); - } - if (listAfter !== null && listAfter !== undefined && typeof listAfter.valueOf() !== 'string') { - throw new Error('listAfter must be of type string.'); - } - if (listBefore !== null && listBefore !== undefined && typeof listBefore.valueOf() !== 'string') { - throw new Error('listBefore must be of type string.'); - } - if (tooId !== null && tooId !== undefined && typeof tooId !== 'boolean') { - throw new Error('tooId must be of type boolean.'); - } - 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('/') ? '' : '/') + 'webhdfs/v1/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - if (listSize !== null && listSize !== undefined) { - queryParameters.push('listSize=' + encodeURIComponent(listSize.toString())); - } - if (listAfter !== null && listAfter !== undefined) { - queryParameters.push('listAfter=' + encodeURIComponent(listAfter)); - } - if (listBefore !== null && listBefore !== undefined) { - queryParameters.push('listBefore=' + encodeURIComponent(listBefore)); - } - if (tooId !== null && tooId !== undefined) { - queryParameters.push('tooId=' + encodeURIComponent(tooId.toString())); - } - queryParameters.push('op=' + encodeURIComponent(op)); - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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['FileStatusesResult']().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 the file content summary object specified by the file path. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file for which to retrieve the summary. - * - * @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 ContentSummaryResult} 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 _getContentSummary(accountName, path, 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 op = 'GETCONTENTSUMMARY'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path 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 (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('/') ? '' : '/') + 'webhdfs/v1/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - queryParameters.push('op=' + encodeURIComponent(op)); - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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['ContentSummaryResult']().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 the file status object specified by the file path. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to retrieve the status. - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.tooId] An optional switch to return friendly names - * in place of owner and group. tooid=false returns friendly names instead of - * the AAD Object ID. Default value is true, returning AAD object IDs. - * - * @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 FileStatusResult} 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 _getFileStatus(accountName, path, 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 tooId = (options && options.tooId !== undefined) ? options.tooId : undefined; - let op = 'GETFILESTATUS'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path cannot be null or undefined and it must be of type string.'); - } - if (tooId !== null && tooId !== undefined && typeof tooId !== 'boolean') { - throw new Error('tooId must be of type boolean.'); - } - 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('/') ? '' : '/') + 'webhdfs/v1/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - if (tooId !== null && tooId !== undefined) { - queryParameters.push('tooId=' + encodeURIComponent(tooId.toString())); - } - queryParameters.push('op=' + encodeURIComponent(op)); - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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['FileStatusResult']().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); - }); -} - -/** - * Opens and reads from the specified file. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file to open. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.length] The number of bytes that the server will - * attempt to retrieve. It will retrieve <= length bytes. - * - * @param {number} [options.offset] The byte offset to start reading data from. - * - * @param {uuid} [options.fileSessionId] Optional unique GUID per file - * indicating all the reads with the same fileSessionId are from the same - * client and same session. This will give a performance benefit. - * - * @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. - * - * {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 _open(accountName, path, 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 length = (options && options.length !== undefined) ? options.length : undefined; - let offset = (options && options.offset !== undefined) ? options.offset : undefined; - let fileSessionId = (options && options.fileSessionId !== undefined) ? options.fileSessionId : undefined; - let read = 'true'; - let op = 'OPEN'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path cannot be null or undefined and it must be of type string.'); - } - if (length !== null && length !== undefined && typeof length !== 'number') { - throw new Error('length must be of type number.'); - } - if (offset !== null && offset !== undefined && typeof offset !== 'number') { - throw new Error('offset must be of type number.'); - } - if (fileSessionId !== null && fileSessionId !== undefined && !(typeof fileSessionId.valueOf() === 'string' && msRest.isValidUuid(fileSessionId))) { - throw new Error('fileSessionId must be of type string and must be a valid uuid.'); - } - 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('/') ? '' : '/') + 'webhdfs/v1/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - if (length !== null && length !== undefined) { - queryParameters.push('length=' + encodeURIComponent(length.toString())); - } - if (offset !== null && offset !== undefined) { - queryParameters.push('offset=' + encodeURIComponent(offset.toString())); - } - if (fileSessionId !== null && fileSessionId !== undefined) { - queryParameters.push('fileSessionId=' + encodeURIComponent(fileSessionId.toString())); - } - queryParameters.push('read=' + encodeURIComponent(read)); - queryParameters.push('op=' + encodeURIComponent(op)); - 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 - httpRequest.streamedResponse = true; - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(`Unexpected status code: ${statusCode}`); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - if (responseBody !== undefined) 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 = response; - return callback(null, result, httpRequest, response); - }); -} - -/** - * Used for serial appends to the specified file. NOTE: The target must not - * contain data added by ConcurrentAppend. ConcurrentAppend and Append cannot - * be used interchangeably; once a target file has been modified using either - * of these append options, the other append option cannot be used on the - * target file. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file to which to append. - * - * @param {object} streamContents The file contents to include when appending - * to the file. The maximum content size is 4MB. For content larger than 4MB - * you must append the content in 4MB chunks. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.offset] The optional offset in the stream to begin - * the append operation. Default is to append at the end of the stream. - * - * @param {string} [options.syncFlag] Optionally indicates what to do after - * completion of the concurrent append. DATA indicates that more data will be - * sent immediately by the client, the file handle should remain open/locked, - * and file metadata (including file length, last modified time) should NOT get - * updated. METADATA indicates that more data will be sent immediately by the - * client, the file handle should remain open/locked, and file metadata should - * get updated. CLOSE indicates that the client is done sending data, the file - * handle should be closed/unlocked, and file metadata should get updated. - * Possible values include: 'DATA', 'METADATA', 'CLOSE' - * - * @param {uuid} [options.leaseId] Optional unique GUID per file to ensure - * single writer semantics, meaning that only clients that append to the file - * with the same leaseId will be allowed to do so. - * - * @param {uuid} [options.fileSessionId] Optional unique GUID per file - * indicating all the appends with the same fileSessionId are from the same - * client and same session. This will give a performance benefit when syncFlag - * is DATA or METADATA. - * - * @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 _append(accountName, path, streamContents, 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 offset = (options && options.offset !== undefined) ? options.offset : undefined; - let syncFlag = (options && options.syncFlag !== undefined) ? options.syncFlag : 'CLOSE'; - let leaseId = (options && options.leaseId !== undefined) ? options.leaseId : undefined; - let fileSessionId = (options && options.fileSessionId !== undefined) ? options.fileSessionId : undefined; - let appendParameter = 'true'; - let op = 'APPEND'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path cannot be null or undefined and it must be of type string.'); - } - if (streamContents === null || streamContents === undefined) { - throw new Error('streamContents cannot be null or undefined and it must be of type object.'); - } - if (offset !== null && offset !== undefined && typeof offset !== 'number') { - throw new Error('offset must be of type number.'); - } - if (syncFlag) { - let allowedValues = [ 'DATA', 'METADATA', 'CLOSE' ]; - if (!allowedValues.some( function(item) { return item === syncFlag; })) { - throw new Error(syncFlag + ' is not a valid value. The valid values are: ' + allowedValues); - } - } - if (leaseId !== null && leaseId !== undefined && !(typeof leaseId.valueOf() === 'string' && msRest.isValidUuid(leaseId))) { - throw new Error('leaseId must be of type string and must be a valid uuid.'); - } - if (fileSessionId !== null && fileSessionId !== undefined && !(typeof fileSessionId.valueOf() === 'string' && msRest.isValidUuid(fileSessionId))) { - throw new Error('fileSessionId must be of type string and must be a valid uuid.'); - } - 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('/') ? '' : '/') + 'webhdfs/v1/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - if (offset !== null && offset !== undefined) { - queryParameters.push('offset=' + encodeURIComponent(offset.toString())); - } - if (syncFlag !== null && syncFlag !== undefined) { - queryParameters.push('syncFlag=' + encodeURIComponent(syncFlag)); - } - if (leaseId !== null && leaseId !== undefined) { - queryParameters.push('leaseId=' + encodeURIComponent(leaseId.toString())); - } - if (fileSessionId !== null && fileSessionId !== undefined) { - queryParameters.push('fileSessionId=' + encodeURIComponent(fileSessionId.toString())); - } - queryParameters.push('append=' + encodeURIComponent(appendParameter)); - queryParameters.push('op=' + encodeURIComponent(op)); - 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/octet-stream'; - 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 = streamContents; - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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 file with optionally specified content. NOTE: If content is - * provided, the resulting file cannot be modified using ConcurrentAppend. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file to create. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.streamContents] The file contents to include when - * creating the file. This parameter is optional, resulting in an empty file if - * not specified. The maximum content size is 4MB. For content larger than - * 4MB you must append the content in 4MB chunks. - * - * @param {boolean} [options.overwrite] The indication of if the file should be - * overwritten. - * - * @param {string} [options.syncFlag] Optionally indicates what to do after - * completion of the create. DATA indicates that more data will be sent - * immediately by the client, the file handle should remain open/locked, and - * file metadata (including file length, last modified time) should NOT get - * updated. METADATA indicates that more data will be sent immediately by the - * client, the file handle should remain open/locked, and file metadata should - * get updated. CLOSE indicates that the client is done sending data, the file - * handle should be closed/unlocked, and file metadata should get updated. - * Possible values include: 'DATA', 'METADATA', 'CLOSE' - * - * @param {uuid} [options.leaseId] Optional unique GUID per file to ensure - * single writer semantics, meaning that only clients that append to the file - * with the same leaseId will be allowed to do so. - * - * @param {number} [options.permission] The octal representation of the unnamed - * user, mask and other permissions that should be set for the file when - * created. If not specified, it inherits these from the container. - * - * @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 _create(accountName, path, 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 streamContents = (options && options.streamContents !== undefined) ? options.streamContents : undefined; - let overwrite = (options && options.overwrite !== undefined) ? options.overwrite : undefined; - let syncFlag = (options && options.syncFlag !== undefined) ? options.syncFlag : 'CLOSE'; - let leaseId = (options && options.leaseId !== undefined) ? options.leaseId : undefined; - let permission = (options && options.permission !== undefined) ? options.permission : undefined; - let write = 'true'; - let op = 'CREATE'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path cannot be null or undefined and it must be of type string.'); - } - if (streamContents !== null && streamContents !== undefined && typeof streamContents.valueOf() !== 'object') { - throw new Error('streamContents must be of type object.'); - } - if (overwrite !== null && overwrite !== undefined && typeof overwrite !== 'boolean') { - throw new Error('overwrite must be of type boolean.'); - } - if (syncFlag) { - let allowedValues = [ 'DATA', 'METADATA', 'CLOSE' ]; - if (!allowedValues.some( function(item) { return item === syncFlag; })) { - throw new Error(syncFlag + ' is not a valid value. The valid values are: ' + allowedValues); - } - } - if (leaseId !== null && leaseId !== undefined && !(typeof leaseId.valueOf() === 'string' && msRest.isValidUuid(leaseId))) { - throw new Error('leaseId must be of type string and must be a valid uuid.'); - } - if (permission !== null && permission !== undefined && typeof permission !== 'number') { - throw new Error('permission must be of type number.'); - } - 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('/') ? '' : '/') + 'webhdfs/v1/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - if (overwrite !== null && overwrite !== undefined) { - queryParameters.push('overwrite=' + encodeURIComponent(overwrite.toString())); - } - if (syncFlag !== null && syncFlag !== undefined) { - queryParameters.push('syncFlag=' + encodeURIComponent(syncFlag)); - } - if (leaseId !== null && leaseId !== undefined) { - queryParameters.push('leaseId=' + encodeURIComponent(leaseId.toString())); - } - if (permission !== null && permission !== undefined) { - queryParameters.push('permission=' + encodeURIComponent(permission.toString())); - } - queryParameters.push('write=' + encodeURIComponent(write)); - queryParameters.push('op=' + encodeURIComponent(op)); - 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/octet-stream'; - 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 = streamContents; - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 201) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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); - }); -} - -/** - * Sets the Access Control List (ACL) for a file or folder. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory on which to set the ACL. - * - * @param {string} aclspec The ACL spec included in ACL creation operations in - * the format '[default:]user|group|other::r|-w|-x|-' - * - * @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 _setAcl(accountName, path, aclspec, 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 op = 'SETACL'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path cannot be null or undefined and it must be of type string.'); - } - if (aclspec === null || aclspec === undefined || typeof aclspec.valueOf() !== 'string') { - throw new Error('aclspec 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 (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('/') ? '' : '/') + 'webhdfs/v1/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - queryParameters.push('aclspec=' + encodeURIComponent(aclspec)); - queryParameters.push('op=' + encodeURIComponent(op)); - 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]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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); - }); -} - -/** - * Modifies existing Access Control List (ACL) entries on a file or folder. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory with the ACL being modified. - * - * @param {string} aclspec The ACL specification included in ACL modification - * operations in the format '[default:]user|group|other::r|-w|-x|-' - * - * @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 _modifyAclEntries(accountName, path, aclspec, 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 op = 'MODIFYACLENTRIES'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path cannot be null or undefined and it must be of type string.'); - } - if (aclspec === null || aclspec === undefined || typeof aclspec.valueOf() !== 'string') { - throw new Error('aclspec 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 (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('/') ? '' : '/') + 'webhdfs/v1/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - queryParameters.push('aclspec=' + encodeURIComponent(aclspec)); - queryParameters.push('op=' + encodeURIComponent(op)); - 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]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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); - }); -} - -/** - * Removes existing Access Control List (ACL) entries for a file or folder. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory with the ACL being removed. - * - * @param {string} aclspec The ACL spec included in ACL removal operations in - * the format '[default:]user|group|other' - * - * @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 _removeAclEntries(accountName, path, aclspec, 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 op = 'REMOVEACLENTRIES'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path cannot be null or undefined and it must be of type string.'); - } - if (aclspec === null || aclspec === undefined || typeof aclspec.valueOf() !== 'string') { - throw new Error('aclspec 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 (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('/') ? '' : '/') + 'webhdfs/v1/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - queryParameters.push('aclspec=' + encodeURIComponent(aclspec)); - queryParameters.push('op=' + encodeURIComponent(op)); - 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]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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); - }); -} - -/** - * Removes the existing Default Access Control List (ACL) of the specified - * directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * directory with the default ACL being removed. - * - * @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 _removeDefaultAcl(accountName, path, 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 op = 'REMOVEDEFAULTACL'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path 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 (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('/') ? '' : '/') + 'webhdfs/v1/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - queryParameters.push('op=' + encodeURIComponent(op)); - 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]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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); - }); -} - -/** - * Removes the existing Access Control List (ACL) of the specified file or - * directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory with the ACL being removed. - * - * @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 _removeAcl(accountName, path, 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 op = 'REMOVEACL'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path 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 (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('/') ? '' : '/') + 'webhdfs/v1/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - queryParameters.push('op=' + encodeURIComponent(op)); - 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]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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); - }); -} - -/** - * Gets Access Control List (ACL) entries for the specified file or directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to get the ACL. - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.tooId] An optional switch to return friendly names - * in place of object ID for ACL entries. tooid=false returns friendly names - * instead of the AAD Object ID. Default value is true, returning AAD object - * IDs. - * - * @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 AclStatusResult} 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 _getAclStatus(accountName, path, 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 tooId = (options && options.tooId !== undefined) ? options.tooId : undefined; - let op = 'GETACLSTATUS'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path cannot be null or undefined and it must be of type string.'); - } - if (tooId !== null && tooId !== undefined && typeof tooId !== 'boolean') { - throw new Error('tooId must be of type boolean.'); - } - 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('/') ? '' : '/') + 'webhdfs/v1/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - if (tooId !== null && tooId !== undefined) { - queryParameters.push('tooId=' + encodeURIComponent(tooId.toString())); - } - queryParameters.push('op=' + encodeURIComponent(op)); - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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['AclStatusResult']().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 the requested file or directory, optionally recursively. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory to delete. - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.recursive] The optional switch indicating if the - * delete should be recursive - * - * @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 FileOperationResult} 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 _deleteMethod(accountName, path, 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 recursive = (options && options.recursive !== undefined) ? options.recursive : undefined; - let op = 'DELETE'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path cannot be null or undefined and it must be of type string.'); - } - if (recursive !== null && recursive !== undefined && typeof recursive !== 'boolean') { - throw new Error('recursive must be of type boolean.'); - } - 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('/') ? '' : '/') + 'webhdfs/v1/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - if (recursive !== null && recursive !== undefined) { - queryParameters.push('recursive=' + encodeURIComponent(recursive.toString())); - } - queryParameters.push('op=' + encodeURIComponent(op)); - 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 !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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['FileOperationResult']().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); - }); -} - -/** - * Rename a file or directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory to move/rename. - * - * @param {string} destination The path to move/rename the file or folder to - * - * @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 FileOperationResult} 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 _rename(accountName, path, destination, 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 op = 'RENAME'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path cannot be null or undefined and it must be of type string.'); - } - if (destination === null || destination === undefined || typeof destination.valueOf() !== 'string') { - throw new Error('destination 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 (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('/') ? '' : '/') + 'webhdfs/v1/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - queryParameters.push('destination=' + encodeURIComponent(destination)); - queryParameters.push('op=' + encodeURIComponent(op)); - 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]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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['FileOperationResult']().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); - }); -} - -/** - * Sets the owner of a file or directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to set the owner. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.owner] The AAD Object ID of the user owner of the - * file or directory. If empty, the property will remain unchanged. - * - * @param {string} [options.group] The AAD Object ID of the group owner of the - * file or directory. If empty, the property will remain unchanged. - * - * @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 _setOwner(accountName, path, 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 owner = (options && options.owner !== undefined) ? options.owner : undefined; - let group = (options && options.group !== undefined) ? options.group : undefined; - let op = 'SETOWNER'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path cannot be null or undefined and it must be of type string.'); - } - if (owner !== null && owner !== undefined && typeof owner.valueOf() !== 'string') { - throw new Error('owner must be of type string.'); - } - if (group !== null && group !== undefined && typeof group.valueOf() !== 'string') { - throw new Error('group 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 (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('/') ? '' : '/') + 'webhdfs/v1/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - if (owner !== null && owner !== undefined) { - queryParameters.push('owner=' + encodeURIComponent(owner)); - } - if (group !== null && group !== undefined) { - queryParameters.push('group=' + encodeURIComponent(group)); - } - queryParameters.push('op=' + encodeURIComponent(op)); - 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]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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); - }); -} - -/** - * Sets the permission of the file or folder. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to set the permission. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.permission] A string representation of the - * permission (i.e 'rwx'). If empty, this property remains unchanged. - * - * @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 _setPermission(accountName, path, 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 permission = (options && options.permission !== undefined) ? options.permission : undefined; - let op = 'SETPERMISSION'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path cannot be null or undefined and it must be of type string.'); - } - if (permission !== null && permission !== undefined && typeof permission.valueOf() !== 'string') { - throw new Error('permission 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 (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('/') ? '' : '/') + 'webhdfs/v1/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - if (permission !== null && permission !== undefined) { - queryParameters.push('permission=' + encodeURIComponent(permission)); - } - queryParameters.push('op=' + encodeURIComponent(op)); - 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]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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); - }); -} - -/** Class representing a FileSystem. */ -class FileSystem { - /** - * Create a FileSystem. - * @param {DataLakeStoreFileSystemManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._setFileExpiry = _setFileExpiry; - this._concurrentAppend = _concurrentAppend; - this._checkAccess = _checkAccess; - this._mkdirs = _mkdirs; - this._concat = _concat; - this._msConcat = _msConcat; - this._listFileStatus = _listFileStatus; - this._getContentSummary = _getContentSummary; - this._getFileStatus = _getFileStatus; - this._open = _open; - this._append = _append; - this._create = _create; - this._setAcl = _setAcl; - this._modifyAclEntries = _modifyAclEntries; - this._removeAclEntries = _removeAclEntries; - this._removeDefaultAcl = _removeDefaultAcl; - this._removeAcl = _removeAcl; - this._getAclStatus = _getAclStatus; - this._deleteMethod = _deleteMethod; - this._rename = _rename; - this._setOwner = _setOwner; - this._setPermission = _setPermission; - } - - /** - * Sets or removes the expiration time on the specified file. This operation - * can only be executed against files. Folders are not supported. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file on which to set or remove the expiration time. - * - * @param {string} expiryOption Indicates the type of expiration to use for the - * file: 1. NeverExpire: ExpireTime is ignored. 2. RelativeToNow: ExpireTime is - * an integer in milliseconds representing the expiration date relative to when - * file expiration is updated. 3. RelativeToCreationDate: ExpireTime is an - * integer in milliseconds representing the expiration date relative to file - * creation. 4. Absolute: ExpireTime is an integer in milliseconds, as a Unix - * timestamp relative to 1/1/1970 00:00:00. Possible values include: - * 'NeverExpire', 'RelativeToNow', 'RelativeToCreationDate', 'Absolute' - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.expireTime] The time that the file will expire, - * corresponding to the ExpiryOption that was set. - * - * @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. - */ - setFileExpiryWithHttpOperationResponse(accountName, path, expiryOption, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._setFileExpiry(accountName, path, expiryOption, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Sets or removes the expiration time on the specified file. This operation - * can only be executed against files. Folders are not supported. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file on which to set or remove the expiration time. - * - * @param {string} expiryOption Indicates the type of expiration to use for the - * file: 1. NeverExpire: ExpireTime is ignored. 2. RelativeToNow: ExpireTime is - * an integer in milliseconds representing the expiration date relative to when - * file expiration is updated. 3. RelativeToCreationDate: ExpireTime is an - * integer in milliseconds representing the expiration date relative to file - * creation. 4. Absolute: ExpireTime is an integer in milliseconds, as a Unix - * timestamp relative to 1/1/1970 00:00:00. Possible values include: - * 'NeverExpire', 'RelativeToNow', 'RelativeToCreationDate', 'Absolute' - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.expireTime] The time that the file will expire, - * corresponding to the ExpiryOption that was set. - * - * @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. - */ - setFileExpiry(accountName, path, expiryOption, 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._setFileExpiry(accountName, path, expiryOption, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._setFileExpiry(accountName, path, expiryOption, options, optionalCallback); - } - } - - /** - * Appends to the specified file, optionally first creating the file if it does - * not yet exist. This method supports multiple concurrent appends to the file. - * NOTE: The target must not contain data added by Create or normal (serial) - * Append. ConcurrentAppend and Append cannot be used interchangeably; once a - * target file has been modified using either of these append options, the - * other append option cannot be used on the target file. ConcurrentAppend does - * not guarantee order and can result in duplicated data landing in the target - * file. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file to which to append using concurrent append. - * - * @param {object} streamContents The file contents to include when appending - * to the file. The maximum content size is 4MB. For content larger than 4MB - * you must append the content in 4MB chunks. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.appendMode] Indicates the concurrent append call - * should create the file if it doesn't exist or just open the existing file - * for append. Possible values include: 'autocreate' - * - * @param {string} [options.syncFlag] Optionally indicates what to do after - * completion of the concurrent append. DATA indicates that more data will be - * sent immediately by the client, the file handle should remain open/locked, - * and file metadata (including file length, last modified time) should NOT get - * updated. METADATA indicates that more data will be sent immediately by the - * client, the file handle should remain open/locked, and file metadata should - * get updated. CLOSE indicates that the client is done sending data, the file - * handle should be closed/unlocked, and file metadata should get updated. - * Possible values include: 'DATA', 'METADATA', 'CLOSE' - * - * @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. - */ - concurrentAppendWithHttpOperationResponse(accountName, path, streamContents, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._concurrentAppend(accountName, path, streamContents, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Appends to the specified file, optionally first creating the file if it does - * not yet exist. This method supports multiple concurrent appends to the file. - * NOTE: The target must not contain data added by Create or normal (serial) - * Append. ConcurrentAppend and Append cannot be used interchangeably; once a - * target file has been modified using either of these append options, the - * other append option cannot be used on the target file. ConcurrentAppend does - * not guarantee order and can result in duplicated data landing in the target - * file. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file to which to append using concurrent append. - * - * @param {object} streamContents The file contents to include when appending - * to the file. The maximum content size is 4MB. For content larger than 4MB - * you must append the content in 4MB chunks. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.appendMode] Indicates the concurrent append call - * should create the file if it doesn't exist or just open the existing file - * for append. Possible values include: 'autocreate' - * - * @param {string} [options.syncFlag] Optionally indicates what to do after - * completion of the concurrent append. DATA indicates that more data will be - * sent immediately by the client, the file handle should remain open/locked, - * and file metadata (including file length, last modified time) should NOT get - * updated. METADATA indicates that more data will be sent immediately by the - * client, the file handle should remain open/locked, and file metadata should - * get updated. CLOSE indicates that the client is done sending data, the file - * handle should be closed/unlocked, and file metadata should get updated. - * Possible values include: 'DATA', 'METADATA', 'CLOSE' - * - * @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. - */ - concurrentAppend(accountName, path, streamContents, 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._concurrentAppend(accountName, path, streamContents, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._concurrentAppend(accountName, path, streamContents, options, optionalCallback); - } - } - - /** - * Checks if the specified access is available at the given path. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to check access. - * - * @param {string} fsaction File system operation read/write/execute in string - * form, matching regex pattern '[rwx-]{3}' - * - * @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. - */ - checkAccessWithHttpOperationResponse(accountName, path, fsaction, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._checkAccess(accountName, path, fsaction, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Checks if the specified access is available at the given path. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to check access. - * - * @param {string} fsaction File system operation read/write/execute in string - * form, matching regex pattern '[rwx-]{3}' - * - * @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. - */ - checkAccess(accountName, path, fsaction, 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._checkAccess(accountName, path, fsaction, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._checkAccess(accountName, path, fsaction, options, optionalCallback); - } - } - - /** - * Creates a directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * directory to create. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.permission] Optional octal permission with which - * the directory should be created. - * - * @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. - */ - mkdirsWithHttpOperationResponse(accountName, path, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._mkdirs(accountName, path, 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 directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * directory to create. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.permission] Optional octal permission with which - * the directory should be created. - * - * @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 {FileOperationResult} - 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 FileOperationResult} 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. - */ - mkdirs(accountName, path, 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._mkdirs(accountName, path, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._mkdirs(accountName, path, options, optionalCallback); - } - } - - /** - * Concatenates the list of source files into the destination file, removing - * all source files upon success. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * destination file resulting from the concatenation. - * - * @param {array} sources A list of comma separated Data Lake Store paths - * (starting with '/') of the files to concatenate, in the order in which they - * should be concatenated. - * - * @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. - */ - concatWithHttpOperationResponse(accountName, path, sources, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._concat(accountName, path, sources, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Concatenates the list of source files into the destination file, removing - * all source files upon success. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * destination file resulting from the concatenation. - * - * @param {array} sources A list of comma separated Data Lake Store paths - * (starting with '/') of the files to concatenate, in the order in which they - * should be concatenated. - * - * @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. - */ - concat(accountName, path, sources, 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._concat(accountName, path, sources, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._concat(accountName, path, sources, options, optionalCallback); - } - } - - /** - * Concatenates the list of source files into the destination file, deleting - * all source files upon success. This method accepts more source file paths - * than the Concat method. This method and the parameters it accepts are - * subject to change for usability in an upcoming version. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * destination file resulting from the concatenation. - * - * @param {object} streamContents A list of Data Lake Store paths (starting - * with '/') of the source files. Must be a comma-separated path list in the - * format: sources=/file/path/1.txt,/file/path/2.txt,/file/path/lastfile.csv - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.deleteSourceDirectory] Indicates that as an - * optimization instead of deleting each individual source stream, delete the - * source stream folder if all streams are in the same folder instead. This - * results in a substantial performance improvement when the only streams in - * the folder are part of the concatenation operation. WARNING: This includes - * the deletion of any other files that are not source files. Only set this to - * true when source files are the only files in the source directory. - * - * @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. - */ - msConcatWithHttpOperationResponse(accountName, path, streamContents, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._msConcat(accountName, path, streamContents, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Concatenates the list of source files into the destination file, deleting - * all source files upon success. This method accepts more source file paths - * than the Concat method. This method and the parameters it accepts are - * subject to change for usability in an upcoming version. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * destination file resulting from the concatenation. - * - * @param {object} streamContents A list of Data Lake Store paths (starting - * with '/') of the source files. Must be a comma-separated path list in the - * format: sources=/file/path/1.txt,/file/path/2.txt,/file/path/lastfile.csv - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.deleteSourceDirectory] Indicates that as an - * optimization instead of deleting each individual source stream, delete the - * source stream folder if all streams are in the same folder instead. This - * results in a substantial performance improvement when the only streams in - * the folder are part of the concatenation operation. WARNING: This includes - * the deletion of any other files that are not source files. Only set this to - * true when source files are the only files in the source directory. - * - * @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. - */ - msConcat(accountName, path, streamContents, 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._msConcat(accountName, path, streamContents, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._msConcat(accountName, path, streamContents, options, optionalCallback); - } - } - - /** - * Get the list of file status objects specified by the file path, with - * optional pagination parameters - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * directory to list. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.listSize] Gets or sets the number of items to - * return. Optional. - * - * @param {string} [options.listAfter] Gets or sets the item or lexographical - * index after which to begin returning results. For example, a file list of - * 'a','b','d' and listAfter='b' will return 'd', and a listAfter='c' will also - * return 'd'. Optional. - * - * @param {string} [options.listBefore] Gets or sets the item or lexographical - * index before which to begin returning results. For example, a file list of - * 'a','b','d' and listBefore='d' will return 'a','b', and a listBefore='c' - * will also return 'a','b'. Optional. - * - * @param {boolean} [options.tooId] An optional switch to return friendly names - * in place of owner and group. tooid=false returns friendly names instead of - * the AAD Object ID. Default value is true, returning AAD object IDs. - * - * @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. - */ - listFileStatusWithHttpOperationResponse(accountName, path, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listFileStatus(accountName, path, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Get the list of file status objects specified by the file path, with - * optional pagination parameters - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * directory to list. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.listSize] Gets or sets the number of items to - * return. Optional. - * - * @param {string} [options.listAfter] Gets or sets the item or lexographical - * index after which to begin returning results. For example, a file list of - * 'a','b','d' and listAfter='b' will return 'd', and a listAfter='c' will also - * return 'd'. Optional. - * - * @param {string} [options.listBefore] Gets or sets the item or lexographical - * index before which to begin returning results. For example, a file list of - * 'a','b','d' and listBefore='d' will return 'a','b', and a listBefore='c' - * will also return 'a','b'. Optional. - * - * @param {boolean} [options.tooId] An optional switch to return friendly names - * in place of owner and group. tooid=false returns friendly names instead of - * the AAD Object ID. Default value is true, returning AAD object IDs. - * - * @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 {FileStatusesResult} - 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 FileStatusesResult} 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. - */ - listFileStatus(accountName, path, 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._listFileStatus(accountName, path, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listFileStatus(accountName, path, options, optionalCallback); - } - } - - /** - * Gets the file content summary object specified by the file path. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file for which to retrieve the summary. - * - * @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. - */ - getContentSummaryWithHttpOperationResponse(accountName, path, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getContentSummary(accountName, path, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Gets the file content summary object specified by the file path. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file for which to retrieve the summary. - * - * @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 {ContentSummaryResult} - 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 ContentSummaryResult} 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. - */ - getContentSummary(accountName, path, 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._getContentSummary(accountName, path, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getContentSummary(accountName, path, options, optionalCallback); - } - } - - /** - * Get the file status object specified by the file path. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to retrieve the status. - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.tooId] An optional switch to return friendly names - * in place of owner and group. tooid=false returns friendly names instead of - * the AAD Object ID. Default value is true, returning AAD object IDs. - * - * @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. - */ - getFileStatusWithHttpOperationResponse(accountName, path, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getFileStatus(accountName, path, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Get the file status object specified by the file path. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to retrieve the status. - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.tooId] An optional switch to return friendly names - * in place of owner and group. tooid=false returns friendly names instead of - * the AAD Object ID. Default value is true, returning AAD object IDs. - * - * @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 {FileStatusResult} - 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 FileStatusResult} 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. - */ - getFileStatus(accountName, path, 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._getFileStatus(accountName, path, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getFileStatus(accountName, path, options, optionalCallback); - } - } - - /** - * Opens and reads from the specified file. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file to open. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.length] The number of bytes that the server will - * attempt to retrieve. It will retrieve <= length bytes. - * - * @param {number} [options.offset] The byte offset to start reading data from. - * - * @param {uuid} [options.fileSessionId] Optional unique GUID per file - * indicating all the reads with the same fileSessionId are from the same - * client and same session. This will give a performance benefit. - * - * @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. - */ - openWithHttpOperationResponse(accountName, path, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._open(accountName, path, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Opens and reads from the specified file. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file to open. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.length] The number of bytes that the server will - * attempt to retrieve. It will retrieve <= length bytes. - * - * @param {number} [options.offset] The byte offset to start reading data from. - * - * @param {uuid} [options.fileSessionId] Optional unique GUID per file - * indicating all the reads with the same fileSessionId are from the same - * client and same session. This will give a performance benefit. - * - * @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 {Object} - 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. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - open(accountName, path, 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._open(accountName, path, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._open(accountName, path, options, optionalCallback); - } - } - - /** - * Used for serial appends to the specified file. NOTE: The target must not - * contain data added by ConcurrentAppend. ConcurrentAppend and Append cannot - * be used interchangeably; once a target file has been modified using either - * of these append options, the other append option cannot be used on the - * target file. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file to which to append. - * - * @param {object} streamContents The file contents to include when appending - * to the file. The maximum content size is 4MB. For content larger than 4MB - * you must append the content in 4MB chunks. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.offset] The optional offset in the stream to begin - * the append operation. Default is to append at the end of the stream. - * - * @param {string} [options.syncFlag] Optionally indicates what to do after - * completion of the concurrent append. DATA indicates that more data will be - * sent immediately by the client, the file handle should remain open/locked, - * and file metadata (including file length, last modified time) should NOT get - * updated. METADATA indicates that more data will be sent immediately by the - * client, the file handle should remain open/locked, and file metadata should - * get updated. CLOSE indicates that the client is done sending data, the file - * handle should be closed/unlocked, and file metadata should get updated. - * Possible values include: 'DATA', 'METADATA', 'CLOSE' - * - * @param {uuid} [options.leaseId] Optional unique GUID per file to ensure - * single writer semantics, meaning that only clients that append to the file - * with the same leaseId will be allowed to do so. - * - * @param {uuid} [options.fileSessionId] Optional unique GUID per file - * indicating all the appends with the same fileSessionId are from the same - * client and same session. This will give a performance benefit when syncFlag - * is DATA or METADATA. - * - * @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. - */ - appendWithHttpOperationResponse(accountName, path, streamContents, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._append(accountName, path, streamContents, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Used for serial appends to the specified file. NOTE: The target must not - * contain data added by ConcurrentAppend. ConcurrentAppend and Append cannot - * be used interchangeably; once a target file has been modified using either - * of these append options, the other append option cannot be used on the - * target file. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file to which to append. - * - * @param {object} streamContents The file contents to include when appending - * to the file. The maximum content size is 4MB. For content larger than 4MB - * you must append the content in 4MB chunks. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.offset] The optional offset in the stream to begin - * the append operation. Default is to append at the end of the stream. - * - * @param {string} [options.syncFlag] Optionally indicates what to do after - * completion of the concurrent append. DATA indicates that more data will be - * sent immediately by the client, the file handle should remain open/locked, - * and file metadata (including file length, last modified time) should NOT get - * updated. METADATA indicates that more data will be sent immediately by the - * client, the file handle should remain open/locked, and file metadata should - * get updated. CLOSE indicates that the client is done sending data, the file - * handle should be closed/unlocked, and file metadata should get updated. - * Possible values include: 'DATA', 'METADATA', 'CLOSE' - * - * @param {uuid} [options.leaseId] Optional unique GUID per file to ensure - * single writer semantics, meaning that only clients that append to the file - * with the same leaseId will be allowed to do so. - * - * @param {uuid} [options.fileSessionId] Optional unique GUID per file - * indicating all the appends with the same fileSessionId are from the same - * client and same session. This will give a performance benefit when syncFlag - * is DATA or METADATA. - * - * @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. - */ - append(accountName, path, streamContents, 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._append(accountName, path, streamContents, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._append(accountName, path, streamContents, options, optionalCallback); - } - } - - /** - * Creates a file with optionally specified content. NOTE: If content is - * provided, the resulting file cannot be modified using ConcurrentAppend. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file to create. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.streamContents] The file contents to include when - * creating the file. This parameter is optional, resulting in an empty file if - * not specified. The maximum content size is 4MB. For content larger than - * 4MB you must append the content in 4MB chunks. - * - * @param {boolean} [options.overwrite] The indication of if the file should be - * overwritten. - * - * @param {string} [options.syncFlag] Optionally indicates what to do after - * completion of the create. DATA indicates that more data will be sent - * immediately by the client, the file handle should remain open/locked, and - * file metadata (including file length, last modified time) should NOT get - * updated. METADATA indicates that more data will be sent immediately by the - * client, the file handle should remain open/locked, and file metadata should - * get updated. CLOSE indicates that the client is done sending data, the file - * handle should be closed/unlocked, and file metadata should get updated. - * Possible values include: 'DATA', 'METADATA', 'CLOSE' - * - * @param {uuid} [options.leaseId] Optional unique GUID per file to ensure - * single writer semantics, meaning that only clients that append to the file - * with the same leaseId will be allowed to do so. - * - * @param {number} [options.permission] The octal representation of the unnamed - * user, mask and other permissions that should be set for the file when - * created. If not specified, it inherits these from the container. - * - * @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(accountName, path, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._create(accountName, path, 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 file with optionally specified content. NOTE: If content is - * provided, the resulting file cannot be modified using ConcurrentAppend. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file to create. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.streamContents] The file contents to include when - * creating the file. This parameter is optional, resulting in an empty file if - * not specified. The maximum content size is 4MB. For content larger than - * 4MB you must append the content in 4MB chunks. - * - * @param {boolean} [options.overwrite] The indication of if the file should be - * overwritten. - * - * @param {string} [options.syncFlag] Optionally indicates what to do after - * completion of the create. DATA indicates that more data will be sent - * immediately by the client, the file handle should remain open/locked, and - * file metadata (including file length, last modified time) should NOT get - * updated. METADATA indicates that more data will be sent immediately by the - * client, the file handle should remain open/locked, and file metadata should - * get updated. CLOSE indicates that the client is done sending data, the file - * handle should be closed/unlocked, and file metadata should get updated. - * Possible values include: 'DATA', 'METADATA', 'CLOSE' - * - * @param {uuid} [options.leaseId] Optional unique GUID per file to ensure - * single writer semantics, meaning that only clients that append to the file - * with the same leaseId will be allowed to do so. - * - * @param {number} [options.permission] The octal representation of the unnamed - * user, mask and other permissions that should be set for the file when - * created. If not specified, it inherits these from the container. - * - * @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. - */ - create(accountName, path, 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(accountName, path, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._create(accountName, path, options, optionalCallback); - } - } - - /** - * Sets the Access Control List (ACL) for a file or folder. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory on which to set the ACL. - * - * @param {string} aclspec The ACL spec included in ACL creation operations in - * the format '[default:]user|group|other::r|-w|-x|-' - * - * @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. - */ - setAclWithHttpOperationResponse(accountName, path, aclspec, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._setAcl(accountName, path, aclspec, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Sets the Access Control List (ACL) for a file or folder. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory on which to set the ACL. - * - * @param {string} aclspec The ACL spec included in ACL creation operations in - * the format '[default:]user|group|other::r|-w|-x|-' - * - * @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. - */ - setAcl(accountName, path, aclspec, 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._setAcl(accountName, path, aclspec, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._setAcl(accountName, path, aclspec, options, optionalCallback); - } - } - - /** - * Modifies existing Access Control List (ACL) entries on a file or folder. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory with the ACL being modified. - * - * @param {string} aclspec The ACL specification included in ACL modification - * operations in the format '[default:]user|group|other::r|-w|-x|-' - * - * @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. - */ - modifyAclEntriesWithHttpOperationResponse(accountName, path, aclspec, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._modifyAclEntries(accountName, path, aclspec, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Modifies existing Access Control List (ACL) entries on a file or folder. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory with the ACL being modified. - * - * @param {string} aclspec The ACL specification included in ACL modification - * operations in the format '[default:]user|group|other::r|-w|-x|-' - * - * @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. - */ - modifyAclEntries(accountName, path, aclspec, 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._modifyAclEntries(accountName, path, aclspec, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._modifyAclEntries(accountName, path, aclspec, options, optionalCallback); - } - } - - /** - * Removes existing Access Control List (ACL) entries for a file or folder. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory with the ACL being removed. - * - * @param {string} aclspec The ACL spec included in ACL removal operations in - * the format '[default:]user|group|other' - * - * @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. - */ - removeAclEntriesWithHttpOperationResponse(accountName, path, aclspec, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._removeAclEntries(accountName, path, aclspec, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Removes existing Access Control List (ACL) entries for a file or folder. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory with the ACL being removed. - * - * @param {string} aclspec The ACL spec included in ACL removal operations in - * the format '[default:]user|group|other' - * - * @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. - */ - removeAclEntries(accountName, path, aclspec, 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._removeAclEntries(accountName, path, aclspec, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._removeAclEntries(accountName, path, aclspec, options, optionalCallback); - } - } - - /** - * Removes the existing Default Access Control List (ACL) of the specified - * directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * directory with the default ACL being removed. - * - * @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. - */ - removeDefaultAclWithHttpOperationResponse(accountName, path, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._removeDefaultAcl(accountName, path, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Removes the existing Default Access Control List (ACL) of the specified - * directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * directory with the default ACL being removed. - * - * @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. - */ - removeDefaultAcl(accountName, path, 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._removeDefaultAcl(accountName, path, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._removeDefaultAcl(accountName, path, options, optionalCallback); - } - } - - /** - * Removes the existing Access Control List (ACL) of the specified file or - * directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory with the ACL being removed. - * - * @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. - */ - removeAclWithHttpOperationResponse(accountName, path, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._removeAcl(accountName, path, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Removes the existing Access Control List (ACL) of the specified file or - * directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory with the ACL being removed. - * - * @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. - */ - removeAcl(accountName, path, 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._removeAcl(accountName, path, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._removeAcl(accountName, path, options, optionalCallback); - } - } - - /** - * Gets Access Control List (ACL) entries for the specified file or directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to get the ACL. - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.tooId] An optional switch to return friendly names - * in place of object ID for ACL entries. tooid=false returns friendly names - * instead of the AAD Object ID. Default value is true, returning AAD object - * IDs. - * - * @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. - */ - getAclStatusWithHttpOperationResponse(accountName, path, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getAclStatus(accountName, path, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Gets Access Control List (ACL) entries for the specified file or directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to get the ACL. - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.tooId] An optional switch to return friendly names - * in place of object ID for ACL entries. tooid=false returns friendly names - * instead of the AAD Object ID. Default value is true, returning AAD object - * IDs. - * - * @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 {AclStatusResult} - 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 AclStatusResult} 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. - */ - getAclStatus(accountName, path, 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._getAclStatus(accountName, path, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getAclStatus(accountName, path, options, optionalCallback); - } - } - - /** - * Deletes the requested file or directory, optionally recursively. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory to delete. - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.recursive] The optional switch indicating if the - * delete should be recursive - * - * @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(accountName, path, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(accountName, path, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the requested file or directory, optionally recursively. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory to delete. - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.recursive] The optional switch indicating if the - * delete should be recursive - * - * @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 {FileOperationResult} - 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 FileOperationResult} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(accountName, path, 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(accountName, path, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(accountName, path, options, optionalCallback); - } - } - - /** - * Rename a file or directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory to move/rename. - * - * @param {string} destination The path to move/rename the file or folder to - * - * @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. - */ - renameWithHttpOperationResponse(accountName, path, destination, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._rename(accountName, path, destination, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Rename a file or directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory to move/rename. - * - * @param {string} destination The path to move/rename the file or folder to - * - * @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 {FileOperationResult} - 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 FileOperationResult} 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. - */ - rename(accountName, path, destination, 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._rename(accountName, path, destination, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._rename(accountName, path, destination, options, optionalCallback); - } - } - - /** - * Sets the owner of a file or directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to set the owner. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.owner] The AAD Object ID of the user owner of the - * file or directory. If empty, the property will remain unchanged. - * - * @param {string} [options.group] The AAD Object ID of the group owner of the - * file or directory. If empty, the property will remain unchanged. - * - * @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. - */ - setOwnerWithHttpOperationResponse(accountName, path, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._setOwner(accountName, path, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Sets the owner of a file or directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to set the owner. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.owner] The AAD Object ID of the user owner of the - * file or directory. If empty, the property will remain unchanged. - * - * @param {string} [options.group] The AAD Object ID of the group owner of the - * file or directory. If empty, the property will remain unchanged. - * - * @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. - */ - setOwner(accountName, path, 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._setOwner(accountName, path, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._setOwner(accountName, path, options, optionalCallback); - } - } - - /** - * Sets the permission of the file or folder. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to set the permission. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.permission] A string representation of the - * permission (i.e 'rwx'). If empty, this property remains unchanged. - * - * @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. - */ - setPermissionWithHttpOperationResponse(accountName, path, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._setPermission(accountName, path, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Sets the permission of the file or folder. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to set the permission. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.permission] A string representation of the - * permission (i.e 'rwx'). If empty, this property remains unchanged. - * - * @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. - */ - setPermission(accountName, path, 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._setPermission(accountName, path, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._setPermission(accountName, path, options, optionalCallback); - } - } - -} - -module.exports = FileSystem; diff --git a/lib/services/dataLake.Store/lib/filesystem/operations/index.d.ts b/lib/services/dataLake.Store/lib/filesystem/operations/index.d.ts deleted file mode 100644 index cd17fe23fc..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/operations/index.d.ts +++ /dev/null @@ -1,1758 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * 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 stream from 'stream'; -import * as models from '../models'; - - -/** - * @class - * FileSystem - * __NOTE__: An instance of this class is automatically created for an - * instance of the DataLakeStoreFileSystemManagementClient. - */ -export interface FileSystem { - - - /** - * Sets or removes the expiration time on the specified file. This operation - * can only be executed against files. Folders are not supported. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file on which to set or remove the expiration time. - * - * @param {string} expiryOption Indicates the type of expiration to use for the - * file: 1. NeverExpire: ExpireTime is ignored. 2. RelativeToNow: ExpireTime is - * an integer in milliseconds representing the expiration date relative to when - * file expiration is updated. 3. RelativeToCreationDate: ExpireTime is an - * integer in milliseconds representing the expiration date relative to file - * creation. 4. Absolute: ExpireTime is an integer in milliseconds, as a Unix - * timestamp relative to 1/1/1970 00:00:00. Possible values include: - * 'NeverExpire', 'RelativeToNow', 'RelativeToCreationDate', 'Absolute' - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.expireTime] The time that the file will expire, - * corresponding to the ExpiryOption that was set. - * - * @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. - */ - setFileExpiryWithHttpOperationResponse(accountName: string, path: string, expiryOption: string, options?: { expireTime? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Sets or removes the expiration time on the specified file. This operation - * can only be executed against files. Folders are not supported. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file on which to set or remove the expiration time. - * - * @param {string} expiryOption Indicates the type of expiration to use for the - * file: 1. NeverExpire: ExpireTime is ignored. 2. RelativeToNow: ExpireTime is - * an integer in milliseconds representing the expiration date relative to when - * file expiration is updated. 3. RelativeToCreationDate: ExpireTime is an - * integer in milliseconds representing the expiration date relative to file - * creation. 4. Absolute: ExpireTime is an integer in milliseconds, as a Unix - * timestamp relative to 1/1/1970 00:00:00. Possible values include: - * 'NeverExpire', 'RelativeToNow', 'RelativeToCreationDate', 'Absolute' - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.expireTime] The time that the file will expire, - * corresponding to the ExpiryOption that was set. - * - * @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. - */ - setFileExpiry(accountName: string, path: string, expiryOption: string, options?: { expireTime? : number, customHeaders? : { [headerName: string]: string; } }): Promise; - setFileExpiry(accountName: string, path: string, expiryOption: string, callback: ServiceCallback): void; - setFileExpiry(accountName: string, path: string, expiryOption: string, options: { expireTime? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Appends to the specified file, optionally first creating the file if it does - * not yet exist. This method supports multiple concurrent appends to the file. - * NOTE: The target must not contain data added by Create or normal (serial) - * Append. ConcurrentAppend and Append cannot be used interchangeably; once a - * target file has been modified using either of these append options, the - * other append option cannot be used on the target file. ConcurrentAppend does - * not guarantee order and can result in duplicated data landing in the target - * file. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file to which to append using concurrent append. - * - * @param {object} streamContents The file contents to include when appending - * to the file. The maximum content size is 4MB. For content larger than 4MB - * you must append the content in 4MB chunks. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.appendMode] Indicates the concurrent append call - * should create the file if it doesn't exist or just open the existing file - * for append. Possible values include: 'autocreate' - * - * @param {string} [options.syncFlag] Optionally indicates what to do after - * completion of the concurrent append. DATA indicates that more data will be - * sent immediately by the client, the file handle should remain open/locked, - * and file metadata (including file length, last modified time) should NOT get - * updated. METADATA indicates that more data will be sent immediately by the - * client, the file handle should remain open/locked, and file metadata should - * get updated. CLOSE indicates that the client is done sending data, the file - * handle should be closed/unlocked, and file metadata should get updated. - * Possible values include: 'DATA', 'METADATA', 'CLOSE' - * - * @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. - */ - concurrentAppendWithHttpOperationResponse(accountName: string, path: string, streamContents: stream.Readable, options?: { appendMode? : string, syncFlag? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Appends to the specified file, optionally first creating the file if it does - * not yet exist. This method supports multiple concurrent appends to the file. - * NOTE: The target must not contain data added by Create or normal (serial) - * Append. ConcurrentAppend and Append cannot be used interchangeably; once a - * target file has been modified using either of these append options, the - * other append option cannot be used on the target file. ConcurrentAppend does - * not guarantee order and can result in duplicated data landing in the target - * file. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file to which to append using concurrent append. - * - * @param {object} streamContents The file contents to include when appending - * to the file. The maximum content size is 4MB. For content larger than 4MB - * you must append the content in 4MB chunks. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.appendMode] Indicates the concurrent append call - * should create the file if it doesn't exist or just open the existing file - * for append. Possible values include: 'autocreate' - * - * @param {string} [options.syncFlag] Optionally indicates what to do after - * completion of the concurrent append. DATA indicates that more data will be - * sent immediately by the client, the file handle should remain open/locked, - * and file metadata (including file length, last modified time) should NOT get - * updated. METADATA indicates that more data will be sent immediately by the - * client, the file handle should remain open/locked, and file metadata should - * get updated. CLOSE indicates that the client is done sending data, the file - * handle should be closed/unlocked, and file metadata should get updated. - * Possible values include: 'DATA', 'METADATA', 'CLOSE' - * - * @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. - */ - concurrentAppend(accountName: string, path: string, streamContents: stream.Readable, options?: { appendMode? : string, syncFlag? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - concurrentAppend(accountName: string, path: string, streamContents: stream.Readable, callback: ServiceCallback): void; - concurrentAppend(accountName: string, path: string, streamContents: stream.Readable, options: { appendMode? : string, syncFlag? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Checks if the specified access is available at the given path. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to check access. - * - * @param {string} fsaction File system operation read/write/execute in string - * form, matching regex pattern '[rwx-]{3}' - * - * @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. - */ - checkAccessWithHttpOperationResponse(accountName: string, path: string, fsaction: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Checks if the specified access is available at the given path. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to check access. - * - * @param {string} fsaction File system operation read/write/execute in string - * form, matching regex pattern '[rwx-]{3}' - * - * @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. - */ - checkAccess(accountName: string, path: string, fsaction: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - checkAccess(accountName: string, path: string, fsaction: string, callback: ServiceCallback): void; - checkAccess(accountName: string, path: string, fsaction: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates a directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * directory to create. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.permission] Optional octal permission with which - * the directory should be created. - * - * @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. - */ - mkdirsWithHttpOperationResponse(accountName: string, path: string, options?: { permission? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates a directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * directory to create. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.permission] Optional octal permission with which - * the directory should be created. - * - * @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 {FileOperationResult} - 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. - * - * {FileOperationResult} [result] - The deserialized result object if an error did not occur. - * See {@link FileOperationResult} 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. - */ - mkdirs(accountName: string, path: string, options?: { permission? : number, customHeaders? : { [headerName: string]: string; } }): Promise; - mkdirs(accountName: string, path: string, callback: ServiceCallback): void; - mkdirs(accountName: string, path: string, options: { permission? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Concatenates the list of source files into the destination file, removing - * all source files upon success. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * destination file resulting from the concatenation. - * - * @param {array} sources A list of comma separated Data Lake Store paths - * (starting with '/') of the files to concatenate, in the order in which they - * should be concatenated. - * - * @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. - */ - concatWithHttpOperationResponse(accountName: string, path: string, sources: string[], options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Concatenates the list of source files into the destination file, removing - * all source files upon success. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * destination file resulting from the concatenation. - * - * @param {array} sources A list of comma separated Data Lake Store paths - * (starting with '/') of the files to concatenate, in the order in which they - * should be concatenated. - * - * @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. - */ - concat(accountName: string, path: string, sources: string[], options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - concat(accountName: string, path: string, sources: string[], callback: ServiceCallback): void; - concat(accountName: string, path: string, sources: string[], options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Concatenates the list of source files into the destination file, deleting - * all source files upon success. This method accepts more source file paths - * than the Concat method. This method and the parameters it accepts are - * subject to change for usability in an upcoming version. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * destination file resulting from the concatenation. - * - * @param {object} streamContents A list of Data Lake Store paths (starting - * with '/') of the source files. Must be a comma-separated path list in the - * format: sources=/file/path/1.txt,/file/path/2.txt,/file/path/lastfile.csv - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.deleteSourceDirectory] Indicates that as an - * optimization instead of deleting each individual source stream, delete the - * source stream folder if all streams are in the same folder instead. This - * results in a substantial performance improvement when the only streams in - * the folder are part of the concatenation operation. WARNING: This includes - * the deletion of any other files that are not source files. Only set this to - * true when source files are the only files in the source directory. - * - * @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. - */ - msConcatWithHttpOperationResponse(accountName: string, path: string, streamContents: stream.Readable, options?: { deleteSourceDirectory? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Concatenates the list of source files into the destination file, deleting - * all source files upon success. This method accepts more source file paths - * than the Concat method. This method and the parameters it accepts are - * subject to change for usability in an upcoming version. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * destination file resulting from the concatenation. - * - * @param {object} streamContents A list of Data Lake Store paths (starting - * with '/') of the source files. Must be a comma-separated path list in the - * format: sources=/file/path/1.txt,/file/path/2.txt,/file/path/lastfile.csv - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.deleteSourceDirectory] Indicates that as an - * optimization instead of deleting each individual source stream, delete the - * source stream folder if all streams are in the same folder instead. This - * results in a substantial performance improvement when the only streams in - * the folder are part of the concatenation operation. WARNING: This includes - * the deletion of any other files that are not source files. Only set this to - * true when source files are the only files in the source directory. - * - * @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. - */ - msConcat(accountName: string, path: string, streamContents: stream.Readable, options?: { deleteSourceDirectory? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; - msConcat(accountName: string, path: string, streamContents: stream.Readable, callback: ServiceCallback): void; - msConcat(accountName: string, path: string, streamContents: stream.Readable, options: { deleteSourceDirectory? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Get the list of file status objects specified by the file path, with - * optional pagination parameters - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * directory to list. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.listSize] Gets or sets the number of items to - * return. Optional. - * - * @param {string} [options.listAfter] Gets or sets the item or lexographical - * index after which to begin returning results. For example, a file list of - * 'a','b','d' and listAfter='b' will return 'd', and a listAfter='c' will also - * return 'd'. Optional. - * - * @param {string} [options.listBefore] Gets or sets the item or lexographical - * index before which to begin returning results. For example, a file list of - * 'a','b','d' and listBefore='d' will return 'a','b', and a listBefore='c' - * will also return 'a','b'. Optional. - * - * @param {boolean} [options.tooId] An optional switch to return friendly names - * in place of owner and group. tooid=false returns friendly names instead of - * the AAD Object ID. Default value is true, returning AAD object IDs. - * - * @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. - */ - listFileStatusWithHttpOperationResponse(accountName: string, path: string, options?: { listSize? : number, listAfter? : string, listBefore? : string, tooId? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Get the list of file status objects specified by the file path, with - * optional pagination parameters - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * directory to list. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.listSize] Gets or sets the number of items to - * return. Optional. - * - * @param {string} [options.listAfter] Gets or sets the item or lexographical - * index after which to begin returning results. For example, a file list of - * 'a','b','d' and listAfter='b' will return 'd', and a listAfter='c' will also - * return 'd'. Optional. - * - * @param {string} [options.listBefore] Gets or sets the item or lexographical - * index before which to begin returning results. For example, a file list of - * 'a','b','d' and listBefore='d' will return 'a','b', and a listBefore='c' - * will also return 'a','b'. Optional. - * - * @param {boolean} [options.tooId] An optional switch to return friendly names - * in place of owner and group. tooid=false returns friendly names instead of - * the AAD Object ID. Default value is true, returning AAD object IDs. - * - * @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 {FileStatusesResult} - 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. - * - * {FileStatusesResult} [result] - The deserialized result object if an error did not occur. - * See {@link FileStatusesResult} 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. - */ - listFileStatus(accountName: string, path: string, options?: { listSize? : number, listAfter? : string, listBefore? : string, tooId? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; - listFileStatus(accountName: string, path: string, callback: ServiceCallback): void; - listFileStatus(accountName: string, path: string, options: { listSize? : number, listAfter? : string, listBefore? : string, tooId? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the file content summary object specified by the file path. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file for which to retrieve the summary. - * - * @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. - */ - getContentSummaryWithHttpOperationResponse(accountName: string, path: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the file content summary object specified by the file path. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file for which to retrieve the summary. - * - * @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 {ContentSummaryResult} - 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. - * - * {ContentSummaryResult} [result] - The deserialized result object if an error did not occur. - * See {@link ContentSummaryResult} 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. - */ - getContentSummary(accountName: string, path: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getContentSummary(accountName: string, path: string, callback: ServiceCallback): void; - getContentSummary(accountName: string, path: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Get the file status object specified by the file path. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to retrieve the status. - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.tooId] An optional switch to return friendly names - * in place of owner and group. tooid=false returns friendly names instead of - * the AAD Object ID. Default value is true, returning AAD object IDs. - * - * @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. - */ - getFileStatusWithHttpOperationResponse(accountName: string, path: string, options?: { tooId? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Get the file status object specified by the file path. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to retrieve the status. - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.tooId] An optional switch to return friendly names - * in place of owner and group. tooid=false returns friendly names instead of - * the AAD Object ID. Default value is true, returning AAD object IDs. - * - * @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 {FileStatusResult} - 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. - * - * {FileStatusResult} [result] - The deserialized result object if an error did not occur. - * See {@link FileStatusResult} 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. - */ - getFileStatus(accountName: string, path: string, options?: { tooId? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; - getFileStatus(accountName: string, path: string, callback: ServiceCallback): void; - getFileStatus(accountName: string, path: string, options: { tooId? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Opens and reads from the specified file. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file to open. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.length] The number of bytes that the server will - * attempt to retrieve. It will retrieve <= length bytes. - * - * @param {number} [options.offset] The byte offset to start reading data from. - * - * @param {uuid} [options.fileSessionId] Optional unique GUID per file - * indicating all the reads with the same fileSessionId are from the same - * client and same session. This will give a performance benefit. - * - * @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. - */ - openWithHttpOperationResponse(accountName: string, path: string, options?: { length? : number, offset? : number, fileSessionId? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Opens and reads from the specified file. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file to open. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.length] The number of bytes that the server will - * attempt to retrieve. It will retrieve <= length bytes. - * - * @param {number} [options.offset] The byte offset to start reading data from. - * - * @param {uuid} [options.fileSessionId] Optional unique GUID per file - * indicating all the reads with the same fileSessionId are from the same - * client and same session. This will give a performance benefit. - * - * @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 {Object} - 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. - * - * {Object} [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. - */ - open(accountName: string, path: string, options?: { length? : number, offset? : number, fileSessionId? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - open(accountName: string, path: string, callback: ServiceCallback): void; - open(accountName: string, path: string, options: { length? : number, offset? : number, fileSessionId? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Used for serial appends to the specified file. NOTE: The target must not - * contain data added by ConcurrentAppend. ConcurrentAppend and Append cannot - * be used interchangeably; once a target file has been modified using either - * of these append options, the other append option cannot be used on the - * target file. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file to which to append. - * - * @param {object} streamContents The file contents to include when appending - * to the file. The maximum content size is 4MB. For content larger than 4MB - * you must append the content in 4MB chunks. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.offset] The optional offset in the stream to begin - * the append operation. Default is to append at the end of the stream. - * - * @param {string} [options.syncFlag] Optionally indicates what to do after - * completion of the concurrent append. DATA indicates that more data will be - * sent immediately by the client, the file handle should remain open/locked, - * and file metadata (including file length, last modified time) should NOT get - * updated. METADATA indicates that more data will be sent immediately by the - * client, the file handle should remain open/locked, and file metadata should - * get updated. CLOSE indicates that the client is done sending data, the file - * handle should be closed/unlocked, and file metadata should get updated. - * Possible values include: 'DATA', 'METADATA', 'CLOSE' - * - * @param {uuid} [options.leaseId] Optional unique GUID per file to ensure - * single writer semantics, meaning that only clients that append to the file - * with the same leaseId will be allowed to do so. - * - * @param {uuid} [options.fileSessionId] Optional unique GUID per file - * indicating all the appends with the same fileSessionId are from the same - * client and same session. This will give a performance benefit when syncFlag - * is DATA or METADATA. - * - * @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. - */ - appendWithHttpOperationResponse(accountName: string, path: string, streamContents: stream.Readable, options?: { offset? : number, syncFlag? : string, leaseId? : string, fileSessionId? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Used for serial appends to the specified file. NOTE: The target must not - * contain data added by ConcurrentAppend. ConcurrentAppend and Append cannot - * be used interchangeably; once a target file has been modified using either - * of these append options, the other append option cannot be used on the - * target file. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file to which to append. - * - * @param {object} streamContents The file contents to include when appending - * to the file. The maximum content size is 4MB. For content larger than 4MB - * you must append the content in 4MB chunks. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.offset] The optional offset in the stream to begin - * the append operation. Default is to append at the end of the stream. - * - * @param {string} [options.syncFlag] Optionally indicates what to do after - * completion of the concurrent append. DATA indicates that more data will be - * sent immediately by the client, the file handle should remain open/locked, - * and file metadata (including file length, last modified time) should NOT get - * updated. METADATA indicates that more data will be sent immediately by the - * client, the file handle should remain open/locked, and file metadata should - * get updated. CLOSE indicates that the client is done sending data, the file - * handle should be closed/unlocked, and file metadata should get updated. - * Possible values include: 'DATA', 'METADATA', 'CLOSE' - * - * @param {uuid} [options.leaseId] Optional unique GUID per file to ensure - * single writer semantics, meaning that only clients that append to the file - * with the same leaseId will be allowed to do so. - * - * @param {uuid} [options.fileSessionId] Optional unique GUID per file - * indicating all the appends with the same fileSessionId are from the same - * client and same session. This will give a performance benefit when syncFlag - * is DATA or METADATA. - * - * @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. - */ - append(accountName: string, path: string, streamContents: stream.Readable, options?: { offset? : number, syncFlag? : string, leaseId? : string, fileSessionId? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - append(accountName: string, path: string, streamContents: stream.Readable, callback: ServiceCallback): void; - append(accountName: string, path: string, streamContents: stream.Readable, options: { offset? : number, syncFlag? : string, leaseId? : string, fileSessionId? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates a file with optionally specified content. NOTE: If content is - * provided, the resulting file cannot be modified using ConcurrentAppend. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file to create. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.streamContents] The file contents to include when - * creating the file. This parameter is optional, resulting in an empty file if - * not specified. The maximum content size is 4MB. For content larger than - * 4MB you must append the content in 4MB chunks. - * - * @param {boolean} [options.overwrite] The indication of if the file should be - * overwritten. - * - * @param {string} [options.syncFlag] Optionally indicates what to do after - * completion of the create. DATA indicates that more data will be sent - * immediately by the client, the file handle should remain open/locked, and - * file metadata (including file length, last modified time) should NOT get - * updated. METADATA indicates that more data will be sent immediately by the - * client, the file handle should remain open/locked, and file metadata should - * get updated. CLOSE indicates that the client is done sending data, the file - * handle should be closed/unlocked, and file metadata should get updated. - * Possible values include: 'DATA', 'METADATA', 'CLOSE' - * - * @param {uuid} [options.leaseId] Optional unique GUID per file to ensure - * single writer semantics, meaning that only clients that append to the file - * with the same leaseId will be allowed to do so. - * - * @param {number} [options.permission] The octal representation of the unnamed - * user, mask and other permissions that should be set for the file when - * created. If not specified, it inherits these from the container. - * - * @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(accountName: string, path: string, options?: { streamContents? : stream.Readable, overwrite? : boolean, syncFlag? : string, leaseId? : string, permission? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates a file with optionally specified content. NOTE: If content is - * provided, the resulting file cannot be modified using ConcurrentAppend. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file to create. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.streamContents] The file contents to include when - * creating the file. This parameter is optional, resulting in an empty file if - * not specified. The maximum content size is 4MB. For content larger than - * 4MB you must append the content in 4MB chunks. - * - * @param {boolean} [options.overwrite] The indication of if the file should be - * overwritten. - * - * @param {string} [options.syncFlag] Optionally indicates what to do after - * completion of the create. DATA indicates that more data will be sent - * immediately by the client, the file handle should remain open/locked, and - * file metadata (including file length, last modified time) should NOT get - * updated. METADATA indicates that more data will be sent immediately by the - * client, the file handle should remain open/locked, and file metadata should - * get updated. CLOSE indicates that the client is done sending data, the file - * handle should be closed/unlocked, and file metadata should get updated. - * Possible values include: 'DATA', 'METADATA', 'CLOSE' - * - * @param {uuid} [options.leaseId] Optional unique GUID per file to ensure - * single writer semantics, meaning that only clients that append to the file - * with the same leaseId will be allowed to do so. - * - * @param {number} [options.permission] The octal representation of the unnamed - * user, mask and other permissions that should be set for the file when - * created. If not specified, it inherits these from the container. - * - * @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. - */ - create(accountName: string, path: string, options?: { streamContents? : stream.Readable, overwrite? : boolean, syncFlag? : string, leaseId? : string, permission? : number, customHeaders? : { [headerName: string]: string; } }): Promise; - create(accountName: string, path: string, callback: ServiceCallback): void; - create(accountName: string, path: string, options: { streamContents? : stream.Readable, overwrite? : boolean, syncFlag? : string, leaseId? : string, permission? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Sets the Access Control List (ACL) for a file or folder. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory on which to set the ACL. - * - * @param {string} aclspec The ACL spec included in ACL creation operations in - * the format '[default:]user|group|other::r|-w|-x|-' - * - * @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. - */ - setAclWithHttpOperationResponse(accountName: string, path: string, aclspec: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Sets the Access Control List (ACL) for a file or folder. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory on which to set the ACL. - * - * @param {string} aclspec The ACL spec included in ACL creation operations in - * the format '[default:]user|group|other::r|-w|-x|-' - * - * @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. - */ - setAcl(accountName: string, path: string, aclspec: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - setAcl(accountName: string, path: string, aclspec: string, callback: ServiceCallback): void; - setAcl(accountName: string, path: string, aclspec: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Modifies existing Access Control List (ACL) entries on a file or folder. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory with the ACL being modified. - * - * @param {string} aclspec The ACL specification included in ACL modification - * operations in the format '[default:]user|group|other::r|-w|-x|-' - * - * @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. - */ - modifyAclEntriesWithHttpOperationResponse(accountName: string, path: string, aclspec: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Modifies existing Access Control List (ACL) entries on a file or folder. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory with the ACL being modified. - * - * @param {string} aclspec The ACL specification included in ACL modification - * operations in the format '[default:]user|group|other::r|-w|-x|-' - * - * @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. - */ - modifyAclEntries(accountName: string, path: string, aclspec: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - modifyAclEntries(accountName: string, path: string, aclspec: string, callback: ServiceCallback): void; - modifyAclEntries(accountName: string, path: string, aclspec: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Removes existing Access Control List (ACL) entries for a file or folder. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory with the ACL being removed. - * - * @param {string} aclspec The ACL spec included in ACL removal operations in - * the format '[default:]user|group|other' - * - * @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. - */ - removeAclEntriesWithHttpOperationResponse(accountName: string, path: string, aclspec: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Removes existing Access Control List (ACL) entries for a file or folder. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory with the ACL being removed. - * - * @param {string} aclspec The ACL spec included in ACL removal operations in - * the format '[default:]user|group|other' - * - * @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. - */ - removeAclEntries(accountName: string, path: string, aclspec: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - removeAclEntries(accountName: string, path: string, aclspec: string, callback: ServiceCallback): void; - removeAclEntries(accountName: string, path: string, aclspec: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Removes the existing Default Access Control List (ACL) of the specified - * directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * directory with the default ACL being removed. - * - * @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. - */ - removeDefaultAclWithHttpOperationResponse(accountName: string, path: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Removes the existing Default Access Control List (ACL) of the specified - * directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * directory with the default ACL being removed. - * - * @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. - */ - removeDefaultAcl(accountName: string, path: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - removeDefaultAcl(accountName: string, path: string, callback: ServiceCallback): void; - removeDefaultAcl(accountName: string, path: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Removes the existing Access Control List (ACL) of the specified file or - * directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory with the ACL being removed. - * - * @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. - */ - removeAclWithHttpOperationResponse(accountName: string, path: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Removes the existing Access Control List (ACL) of the specified file or - * directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory with the ACL being removed. - * - * @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. - */ - removeAcl(accountName: string, path: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - removeAcl(accountName: string, path: string, callback: ServiceCallback): void; - removeAcl(accountName: string, path: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets Access Control List (ACL) entries for the specified file or directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to get the ACL. - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.tooId] An optional switch to return friendly names - * in place of object ID for ACL entries. tooid=false returns friendly names - * instead of the AAD Object ID. Default value is true, returning AAD object - * IDs. - * - * @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. - */ - getAclStatusWithHttpOperationResponse(accountName: string, path: string, options?: { tooId? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets Access Control List (ACL) entries for the specified file or directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to get the ACL. - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.tooId] An optional switch to return friendly names - * in place of object ID for ACL entries. tooid=false returns friendly names - * instead of the AAD Object ID. Default value is true, returning AAD object - * IDs. - * - * @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 {AclStatusResult} - 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. - * - * {AclStatusResult} [result] - The deserialized result object if an error did not occur. - * See {@link AclStatusResult} 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. - */ - getAclStatus(accountName: string, path: string, options?: { tooId? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; - getAclStatus(accountName: string, path: string, callback: ServiceCallback): void; - getAclStatus(accountName: string, path: string, options: { tooId? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the requested file or directory, optionally recursively. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory to delete. - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.recursive] The optional switch indicating if the - * delete should be recursive - * - * @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(accountName: string, path: string, options?: { recursive? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the requested file or directory, optionally recursively. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory to delete. - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.recursive] The optional switch indicating if the - * delete should be recursive - * - * @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 {FileOperationResult} - 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. - * - * {FileOperationResult} [result] - The deserialized result object if an error did not occur. - * See {@link FileOperationResult} 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. - */ - deleteMethod(accountName: string, path: string, options?: { recursive? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(accountName: string, path: string, callback: ServiceCallback): void; - deleteMethod(accountName: string, path: string, options: { recursive? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Rename a file or directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory to move/rename. - * - * @param {string} destination The path to move/rename the file or folder to - * - * @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. - */ - renameWithHttpOperationResponse(accountName: string, path: string, destination: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Rename a file or directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory to move/rename. - * - * @param {string} destination The path to move/rename the file or folder to - * - * @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 {FileOperationResult} - 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. - * - * {FileOperationResult} [result] - The deserialized result object if an error did not occur. - * See {@link FileOperationResult} 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. - */ - rename(accountName: string, path: string, destination: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - rename(accountName: string, path: string, destination: string, callback: ServiceCallback): void; - rename(accountName: string, path: string, destination: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Sets the owner of a file or directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to set the owner. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.owner] The AAD Object ID of the user owner of the - * file or directory. If empty, the property will remain unchanged. - * - * @param {string} [options.group] The AAD Object ID of the group owner of the - * file or directory. If empty, the property will remain unchanged. - * - * @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. - */ - setOwnerWithHttpOperationResponse(accountName: string, path: string, options?: { owner? : string, group? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Sets the owner of a file or directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to set the owner. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.owner] The AAD Object ID of the user owner of the - * file or directory. If empty, the property will remain unchanged. - * - * @param {string} [options.group] The AAD Object ID of the group owner of the - * file or directory. If empty, the property will remain unchanged. - * - * @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. - */ - setOwner(accountName: string, path: string, options?: { owner? : string, group? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - setOwner(accountName: string, path: string, callback: ServiceCallback): void; - setOwner(accountName: string, path: string, options: { owner? : string, group? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Sets the permission of the file or folder. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to set the permission. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.permission] A string representation of the - * permission (i.e 'rwx'). If empty, this property remains unchanged. - * - * @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. - */ - setPermissionWithHttpOperationResponse(accountName: string, path: string, options?: { permission? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Sets the permission of the file or folder. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to set the permission. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.permission] A string representation of the - * permission (i.e 'rwx'). If empty, this property remains unchanged. - * - * @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. - */ - setPermission(accountName: string, path: string, options?: { permission? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - setPermission(accountName: string, path: string, callback: ServiceCallback): void; - setPermission(accountName: string, path: string, options: { permission? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} diff --git a/lib/services/dataLake.Store/lib/filesystem/dataLakeStoreFileSystemManagementClient.d.ts b/lib/services/datalake.Store/lib/account/dataLakeStoreAccountManagementClient.d.ts similarity index 53% rename from lib/services/dataLake.Store/lib/filesystem/dataLakeStoreFileSystemManagementClient.d.ts rename to lib/services/datalake.Store/lib/account/dataLakeStoreAccountManagementClient.d.ts index 6096d849da..511c8934ee 100644 --- a/lib/services/dataLake.Store/lib/filesystem/dataLakeStoreFileSystemManagementClient.d.ts +++ b/lib/services/datalake.Store/lib/account/dataLakeStoreAccountManagementClient.d.ts @@ -13,36 +13,18 @@ import { AzureServiceClient, AzureServiceClientOptions } from 'ms-rest-azure'; import * as models from "./models"; import * as operations from "./operations"; -/** - * DataLakeStoreFileSystemManagementClientOptions for DataLakeStoreFileSystemManagementClient. - */ -declare interface DataLakeStoreFileSystemManagementClientOptions extends AzureServiceClientOptions { - /** - * @property {string} [adlsFileSystemDnsSuffix] - Gets the URI used as the base for all cloud service requests. - */ - adlsFileSystemDnsSuffix?: string; - /** - * @property {string} [acceptLanguage] - The preferred language for the response. - */ - acceptLanguage?: string; - /** - * @property {number} [longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. - */ - longRunningOperationRetryTimeout?: number; - /** - * @property {boolean} [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. - */ - generateClientRequestId?: boolean; -} - -export default class DataLakeStoreFileSystemManagementClient extends AzureServiceClient { +export default class DataLakeStoreAccountManagementClient extends AzureServiceClient { /** - * Initializes a new instance of the DataLakeStoreFileSystemManagementClient class. + * Initializes a new instance of the DataLakeStoreAccountManagementClient class. * @constructor * * @class * @param {credentials} credentials - Credentials needed for the client to connect to Azure. * + * @param {string} subscriptionId - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @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 @@ -52,8 +34,6 @@ export default class DataLakeStoreFileSystemManagementClient extends AzureServic * * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy * - * @param {string} [options.adlsFileSystemDnsSuffix] - Gets the URI used as the base for all cloud service requests. - * * @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. @@ -61,13 +41,13 @@ export default class DataLakeStoreFileSystemManagementClient extends AzureServic * @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, options?: DataLakeStoreFileSystemManagementClientOptions); + constructor(credentials: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions); credentials: ServiceClientCredentials; - apiVersion: string; + subscriptionId: string; - adlsFileSystemDnsSuffix: string; + apiVersion: string; acceptLanguage: string; @@ -76,7 +56,12 @@ export default class DataLakeStoreFileSystemManagementClient extends AzureServic generateClientRequestId: boolean; // Operation groups - fileSystem: operations.FileSystem; + accounts: operations.Accounts; + firewallRules: operations.FirewallRules; + virtualNetworkRules: operations.VirtualNetworkRules; + trustedIdProviders: operations.TrustedIdProviders; + operations: operations.Operations; + locations: operations.Locations; } -export { DataLakeStoreFileSystemManagementClient, models as DataLakeStoreFileSystemManagementModels }; +export { DataLakeStoreAccountManagementClient, models as DataLakeStoreAccountManagementModels }; diff --git a/lib/services/dataLake.Store/lib/filesystem/dataLakeStoreFileSystemManagementClient.js b/lib/services/datalake.Store/lib/account/dataLakeStoreAccountManagementClient.js similarity index 65% rename from lib/services/dataLake.Store/lib/filesystem/dataLakeStoreFileSystemManagementClient.js rename to lib/services/datalake.Store/lib/account/dataLakeStoreAccountManagementClient.js index f1518f7367..9ccf8f3e43 100644 --- a/lib/services/dataLake.Store/lib/filesystem/dataLakeStoreFileSystemManagementClient.js +++ b/lib/services/datalake.Store/lib/account/dataLakeStoreAccountManagementClient.js @@ -22,43 +22,47 @@ const models = require('./models'); const operations = require('./operations'); -/** Class representing a DataLakeStoreFileSystemManagementClient. */ -class DataLakeStoreFileSystemManagementClient extends ServiceClient { +/** Class representing a DataLakeStoreAccountManagementClient. */ +class DataLakeStoreAccountManagementClient extends ServiceClient { /** - * Create a DataLakeStoreFileSystemManagementClient. + * Create a DataLakeStoreAccountManagementClient. * @param {credentials} credentials - Credentials needed for the client to connect to Azure. + * @param {string} subscriptionId - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * @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.adlsFileSystemDnsSuffix] - Gets the URI used as the base for all cloud service requests. * @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, options) { + 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 = '2016-11-01'; - this.adlsFileSystemDnsSuffix = 'azuredatalakestore.net'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; - this.baseUri = 'https://{accountName}.{adlsFileSystemDnsSuffix}'; + 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.adlsFileSystemDnsSuffix !== null && options.adlsFileSystemDnsSuffix !== undefined) { - this.adlsFileSystemDnsSuffix = options.adlsFileSystemDnsSuffix; - } if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { this.acceptLanguage = options.acceptLanguage; } @@ -68,14 +72,19 @@ class DataLakeStoreFileSystemManagementClient extends ServiceClient { if(options.generateClientRequestId !== null && options.generateClientRequestId !== undefined) { this.generateClientRequestId = options.generateClientRequestId; } - this.fileSystem = new operations.FileSystem(this); + this.accounts = new operations.Accounts(this); + this.firewallRules = new operations.FirewallRules(this); + this.virtualNetworkRules = new operations.VirtualNetworkRules(this); + this.trustedIdProviders = new operations.TrustedIdProviders(this); + this.operations = new operations.Operations(this); + this.locations = new operations.Locations(this); this.models = models; msRest.addSerializationMixin(this); } } -module.exports = DataLakeStoreFileSystemManagementClient; -module.exports['default'] = DataLakeStoreFileSystemManagementClient; -module.exports.DataLakeStoreFileSystemManagementClient = DataLakeStoreFileSystemManagementClient; -module.exports.DataLakeStoreFileSystemManagementModels = models; +module.exports = DataLakeStoreAccountManagementClient; +module.exports['default'] = DataLakeStoreAccountManagementClient; +module.exports.DataLakeStoreAccountManagementClient = DataLakeStoreAccountManagementClient; +module.exports.DataLakeStoreAccountManagementModels = models; diff --git a/lib/services/datalake.Store/lib/account/models/capabilityInformation.js b/lib/services/datalake.Store/lib/account/models/capabilityInformation.js new file mode 100644 index 0000000000..91f6238c31 --- /dev/null +++ b/lib/services/datalake.Store/lib/account/models/capabilityInformation.js @@ -0,0 +1,94 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Subscription-level properties and limits for Data Lake Store. + * + */ +class CapabilityInformation { + /** + * Create a CapabilityInformation. + * @property {uuid} [subscriptionId] The subscription credentials that + * uniquely identifies the subscription. + * @property {string} [state] The subscription state. Possible values + * include: 'Registered', 'Suspended', 'Deleted', 'Unregistered', 'Warned' + * @property {number} [maxAccountCount] The maximum supported number of + * accounts under this subscription. + * @property {number} [accountCount] The current number of accounts under + * this subscription. + * @property {boolean} [migrationState] The Boolean value of true or false to + * indicate the maintenance state. + */ + constructor() { + } + + /** + * Defines the metadata of CapabilityInformation + * + * @returns {object} metadata of CapabilityInformation + * + */ + mapper() { + return { + required: false, + serializedName: 'CapabilityInformation', + type: { + name: 'Composite', + className: 'CapabilityInformation', + modelProperties: { + subscriptionId: { + required: false, + readOnly: true, + serializedName: 'subscriptionId', + type: { + name: 'String' + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'String' + } + }, + maxAccountCount: { + required: false, + readOnly: true, + serializedName: 'maxAccountCount', + type: { + name: 'Number' + } + }, + accountCount: { + required: false, + readOnly: true, + serializedName: 'accountCount', + type: { + name: 'Number' + } + }, + migrationState: { + required: false, + readOnly: true, + serializedName: 'migrationState', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = CapabilityInformation; diff --git a/lib/services/datalake.Store/lib/account/models/checkNameAvailabilityParameters.js b/lib/services/datalake.Store/lib/account/models/checkNameAvailabilityParameters.js new file mode 100644 index 0000000000..75d3d41123 --- /dev/null +++ b/lib/services/datalake.Store/lib/account/models/checkNameAvailabilityParameters.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'; + +/** + * Data Lake Store account name availability check parameters. + * + */ +class CheckNameAvailabilityParameters { + /** + * Create a CheckNameAvailabilityParameters. + * @property {string} name The Data Lake Store name to check availability + * for. + */ + constructor() { + } + + /** + * Defines the metadata of CheckNameAvailabilityParameters + * + * @returns {object} metadata of CheckNameAvailabilityParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'CheckNameAvailabilityParameters', + type: { + name: 'Composite', + className: 'CheckNameAvailabilityParameters', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: true, + isConstant: true, + serializedName: 'type', + defaultValue: 'Microsoft.DataLakeStore/accounts', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CheckNameAvailabilityParameters; diff --git a/lib/services/datalake.Store/lib/account/models/createDataLakeStoreAccountParameters.js b/lib/services/datalake.Store/lib/account/models/createDataLakeStoreAccountParameters.js new file mode 100644 index 0000000000..7f0785b7d1 --- /dev/null +++ b/lib/services/datalake.Store/lib/account/models/createDataLakeStoreAccountParameters.js @@ -0,0 +1,220 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Class representing a CreateDataLakeStoreAccountParameters. + */ +class CreateDataLakeStoreAccountParameters { + /** + * Create a CreateDataLakeStoreAccountParameters. + * @property {string} location The resource location. + * @property {object} [tags] The resource tags. + * @property {object} [identity] The Key Vault encryption identity, if any. + * @property {uuid} [identity.principalId] The principal identifier + * associated with the encryption. + * @property {uuid} [identity.tenantId] The tenant identifier associated with + * the encryption. + * @property {string} [defaultGroup] The default owner group for all new + * folders and files created in the Data Lake Store account. + * @property {object} [encryptionConfig] The Key Vault encryption + * configuration. + * @property {string} [encryptionConfig.type] The type of encryption + * configuration being used. Currently the only supported types are + * 'UserManaged' and 'ServiceManaged'. Possible values include: + * 'UserManaged', 'ServiceManaged' + * @property {object} [encryptionConfig.keyVaultMetaInfo] The Key Vault + * information for connecting to user managed encryption keys. + * @property {string} [encryptionConfig.keyVaultMetaInfo.keyVaultResourceId] + * The resource identifier for the user managed Key Vault being used to + * encrypt. + * @property {string} [encryptionConfig.keyVaultMetaInfo.encryptionKeyName] + * The name of the user managed encryption key. + * @property {string} + * [encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] The version of + * the user managed encryption key. + * @property {string} [encryptionState] The current state of encryption for + * this Data Lake Store account. Possible values include: 'Enabled', + * 'Disabled' + * @property {array} [firewallRules] The list of firewall rules associated + * with this Data Lake Store account. + * @property {array} [virtualNetworkRules] The list of virtual network rules + * associated with this Data Lake Store account. + * @property {string} [firewallState] The current state of the IP address + * firewall for this Data Lake Store account. Possible values include: + * 'Enabled', 'Disabled' + * @property {string} [firewallAllowAzureIps] The current state of allowing + * or disallowing IPs originating within Azure through the firewall. If the + * firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * @property {array} [trustedIdProviders] The list of trusted identity + * providers associated with this Data Lake Store account. + * @property {string} [trustedIdProviderState] The current state of the + * trusted identity provider feature for this Data Lake Store account. + * Possible values include: 'Enabled', 'Disabled' + * @property {string} [newTier] The commitment tier to use for next month. + * Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', + * 'Commitment_1PB', 'Commitment_5PB' + */ + constructor() { + } + + /** + * Defines the metadata of CreateDataLakeStoreAccountParameters + * + * @returns {object} metadata of CreateDataLakeStoreAccountParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'CreateDataLakeStoreAccountParameters', + type: { + name: 'Composite', + className: 'CreateDataLakeStoreAccountParameters', + 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' + } + } + } + }, + identity: { + required: false, + serializedName: 'identity', + type: { + name: 'Composite', + className: 'EncryptionIdentity' + } + }, + defaultGroup: { + required: false, + serializedName: 'properties.defaultGroup', + type: { + name: 'String' + } + }, + encryptionConfig: { + required: false, + serializedName: 'properties.encryptionConfig', + type: { + name: 'Composite', + className: 'EncryptionConfig' + } + }, + encryptionState: { + required: false, + serializedName: 'properties.encryptionState', + type: { + name: 'Enum', + allowedValues: [ 'Enabled', 'Disabled' ] + } + }, + firewallRules: { + required: false, + serializedName: 'properties.firewallRules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CreateFirewallRuleWithAccountParametersElementType', + type: { + name: 'Composite', + className: 'CreateFirewallRuleWithAccountParameters' + } + } + } + }, + virtualNetworkRules: { + required: false, + serializedName: 'properties.virtualNetworkRules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CreateVirtualNetworkRuleWithAccountParametersElementType', + type: { + name: 'Composite', + className: 'CreateVirtualNetworkRuleWithAccountParameters' + } + } + } + }, + firewallState: { + required: false, + serializedName: 'properties.firewallState', + type: { + name: 'Enum', + allowedValues: [ 'Enabled', 'Disabled' ] + } + }, + firewallAllowAzureIps: { + required: false, + serializedName: 'properties.firewallAllowAzureIps', + type: { + name: 'Enum', + allowedValues: [ 'Enabled', 'Disabled' ] + } + }, + trustedIdProviders: { + required: false, + serializedName: 'properties.trustedIdProviders', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CreateTrustedIdProviderWithAccountParametersElementType', + type: { + name: 'Composite', + className: 'CreateTrustedIdProviderWithAccountParameters' + } + } + } + }, + trustedIdProviderState: { + required: false, + serializedName: 'properties.trustedIdProviderState', + type: { + name: 'Enum', + allowedValues: [ 'Enabled', 'Disabled' ] + } + }, + newTier: { + required: false, + serializedName: 'properties.newTier', + type: { + name: 'Enum', + allowedValues: [ 'Consumption', 'Commitment_1TB', 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', 'Commitment_5PB' ] + } + } + } + } + }; + } +} + +module.exports = CreateDataLakeStoreAccountParameters; diff --git a/lib/services/datalake.Store/lib/account/models/createFirewallRuleWithAccountParameters.js b/lib/services/datalake.Store/lib/account/models/createFirewallRuleWithAccountParameters.js new file mode 100644 index 0000000000..5f32dd7dfd --- /dev/null +++ b/lib/services/datalake.Store/lib/account/models/createFirewallRuleWithAccountParameters.js @@ -0,0 +1,73 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The parameters used to create a new firewall rule while creating a new Data + * Lake Store account. + * + */ +class CreateFirewallRuleWithAccountParameters { + /** + * Create a CreateFirewallRuleWithAccountParameters. + * @property {string} name The unique name of the firewall rule to create. + * @property {string} startIpAddress The start IP address for the firewall + * rule. This can be either ipv4 or ipv6. Start and End should be in the same + * protocol. + * @property {string} endIpAddress The end IP address for the firewall rule. + * This can be either ipv4 or ipv6. Start and End should be in the same + * protocol. + */ + constructor() { + } + + /** + * Defines the metadata of CreateFirewallRuleWithAccountParameters + * + * @returns {object} metadata of CreateFirewallRuleWithAccountParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'CreateFirewallRuleWithAccountParameters', + type: { + name: 'Composite', + className: 'CreateFirewallRuleWithAccountParameters', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + startIpAddress: { + required: true, + serializedName: 'properties.startIpAddress', + type: { + name: 'String' + } + }, + endIpAddress: { + required: true, + serializedName: 'properties.endIpAddress', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CreateFirewallRuleWithAccountParameters; diff --git a/lib/services/datalake.Store/lib/account/models/createOrUpdateFirewallRuleParameters.js b/lib/services/datalake.Store/lib/account/models/createOrUpdateFirewallRuleParameters.js new file mode 100644 index 0000000000..4a6377313c --- /dev/null +++ b/lib/services/datalake.Store/lib/account/models/createOrUpdateFirewallRuleParameters.js @@ -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. + */ + +'use strict'; + +/** + * The parameters used to create a new firewall rule. + * + */ +class CreateOrUpdateFirewallRuleParameters { + /** + * Create a CreateOrUpdateFirewallRuleParameters. + * @property {string} startIpAddress The start IP address for the firewall + * rule. This can be either ipv4 or ipv6. Start and End should be in the same + * protocol. + * @property {string} endIpAddress The end IP address for the firewall rule. + * This can be either ipv4 or ipv6. Start and End should be in the same + * protocol. + */ + constructor() { + } + + /** + * Defines the metadata of CreateOrUpdateFirewallRuleParameters + * + * @returns {object} metadata of CreateOrUpdateFirewallRuleParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'CreateOrUpdateFirewallRuleParameters', + type: { + name: 'Composite', + className: 'CreateOrUpdateFirewallRuleParameters', + modelProperties: { + startIpAddress: { + required: true, + serializedName: 'properties.startIpAddress', + type: { + name: 'String' + } + }, + endIpAddress: { + required: true, + serializedName: 'properties.endIpAddress', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CreateOrUpdateFirewallRuleParameters; diff --git a/lib/services/datalake.Store/lib/account/models/createOrUpdateTrustedIdProviderParameters.js b/lib/services/datalake.Store/lib/account/models/createOrUpdateTrustedIdProviderParameters.js new file mode 100644 index 0000000000..798a68d2ac --- /dev/null +++ b/lib/services/datalake.Store/lib/account/models/createOrUpdateTrustedIdProviderParameters.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'; + +/** + * The parameters used to create a new trusted identity provider. + * + */ +class CreateOrUpdateTrustedIdProviderParameters { + /** + * Create a CreateOrUpdateTrustedIdProviderParameters. + * @property {string} idProvider The URL of this trusted identity provider. + */ + constructor() { + } + + /** + * Defines the metadata of CreateOrUpdateTrustedIdProviderParameters + * + * @returns {object} metadata of CreateOrUpdateTrustedIdProviderParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'CreateOrUpdateTrustedIdProviderParameters', + type: { + name: 'Composite', + className: 'CreateOrUpdateTrustedIdProviderParameters', + modelProperties: { + idProvider: { + required: true, + serializedName: 'properties.idProvider', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CreateOrUpdateTrustedIdProviderParameters; diff --git a/lib/services/datalake.Store/lib/account/models/createOrUpdateVirtualNetworkRuleParameters.js b/lib/services/datalake.Store/lib/account/models/createOrUpdateVirtualNetworkRuleParameters.js new file mode 100644 index 0000000000..1ed1da8530 --- /dev/null +++ b/lib/services/datalake.Store/lib/account/models/createOrUpdateVirtualNetworkRuleParameters.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'; + +/** + * The parameters used to create a new virtual network rule. + * + */ +class CreateOrUpdateVirtualNetworkRuleParameters { + /** + * Create a CreateOrUpdateVirtualNetworkRuleParameters. + * @property {string} subnetId The resource identifier for the subnet. + */ + constructor() { + } + + /** + * Defines the metadata of CreateOrUpdateVirtualNetworkRuleParameters + * + * @returns {object} metadata of CreateOrUpdateVirtualNetworkRuleParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'CreateOrUpdateVirtualNetworkRuleParameters', + type: { + name: 'Composite', + className: 'CreateOrUpdateVirtualNetworkRuleParameters', + modelProperties: { + subnetId: { + required: true, + serializedName: 'properties.subnetId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CreateOrUpdateVirtualNetworkRuleParameters; diff --git a/lib/services/datalake.Store/lib/account/models/createTrustedIdProviderWithAccountParameters.js b/lib/services/datalake.Store/lib/account/models/createTrustedIdProviderWithAccountParameters.js new file mode 100644 index 0000000000..4e00e3d635 --- /dev/null +++ b/lib/services/datalake.Store/lib/account/models/createTrustedIdProviderWithAccountParameters.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'; + +/** + * The parameters used to create a new trusted identity provider while creating + * a new Data Lake Store account. + * + */ +class CreateTrustedIdProviderWithAccountParameters { + /** + * Create a CreateTrustedIdProviderWithAccountParameters. + * @property {string} name The unique name of the trusted identity provider + * to create. + * @property {string} idProvider The URL of this trusted identity provider. + */ + constructor() { + } + + /** + * Defines the metadata of CreateTrustedIdProviderWithAccountParameters + * + * @returns {object} metadata of CreateTrustedIdProviderWithAccountParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'CreateTrustedIdProviderWithAccountParameters', + type: { + name: 'Composite', + className: 'CreateTrustedIdProviderWithAccountParameters', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + idProvider: { + required: true, + serializedName: 'properties.idProvider', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CreateTrustedIdProviderWithAccountParameters; diff --git a/lib/services/datalake.Store/lib/account/models/createVirtualNetworkRuleWithAccountParameters.js b/lib/services/datalake.Store/lib/account/models/createVirtualNetworkRuleWithAccountParameters.js new file mode 100644 index 0000000000..5c86448d28 --- /dev/null +++ b/lib/services/datalake.Store/lib/account/models/createVirtualNetworkRuleWithAccountParameters.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'; + +/** + * The parameters used to create a new virtual network rule while creating a + * new Data Lake Store account. + * + */ +class CreateVirtualNetworkRuleWithAccountParameters { + /** + * Create a CreateVirtualNetworkRuleWithAccountParameters. + * @property {string} name The unique name of the virtual network rule to + * create. + * @property {string} subnetId The resource identifier for the subnet. + */ + constructor() { + } + + /** + * Defines the metadata of CreateVirtualNetworkRuleWithAccountParameters + * + * @returns {object} metadata of CreateVirtualNetworkRuleWithAccountParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'CreateVirtualNetworkRuleWithAccountParameters', + type: { + name: 'Composite', + className: 'CreateVirtualNetworkRuleWithAccountParameters', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + subnetId: { + required: true, + serializedName: 'properties.subnetId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CreateVirtualNetworkRuleWithAccountParameters; diff --git a/lib/services/datalake.Store/lib/account/models/dataLakeStoreAccount.js b/lib/services/datalake.Store/lib/account/models/dataLakeStoreAccount.js new file mode 100644 index 0000000000..cac3fd0983 --- /dev/null +++ b/lib/services/datalake.Store/lib/account/models/dataLakeStoreAccount.js @@ -0,0 +1,346 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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'); + +/** + * Data Lake Store account information. + * + * @extends models['Resource'] + */ +class DataLakeStoreAccount extends models['Resource'] { + /** + * Create a DataLakeStoreAccount. + * @property {object} [identity] The Key Vault encryption identity, if any. + * @property {uuid} [identity.principalId] The principal identifier + * associated with the encryption. + * @property {uuid} [identity.tenantId] The tenant identifier associated with + * the encryption. + * @property {uuid} [accountId] The unique identifier associated with this + * Data Lake Store account. + * @property {string} [provisioningState] The provisioning status of the Data + * Lake Store account. Possible values include: 'Failed', 'Creating', + * 'Running', 'Succeeded', 'Patching', 'Suspending', 'Resuming', 'Deleting', + * 'Deleted', 'Undeleting', 'Canceled' + * @property {string} [state] The state of the Data Lake Store account. + * Possible values include: 'Active', 'Suspended' + * @property {date} [creationTime] The account creation time. + * @property {date} [lastModifiedTime] The account last modified time. + * @property {string} [endpoint] The full CName endpoint for this account. + * @property {string} [defaultGroup] The default owner group for all new + * folders and files created in the Data Lake Store account. + * @property {object} [encryptionConfig] The Key Vault encryption + * configuration. + * @property {string} [encryptionConfig.type] The type of encryption + * configuration being used. Currently the only supported types are + * 'UserManaged' and 'ServiceManaged'. Possible values include: + * 'UserManaged', 'ServiceManaged' + * @property {object} [encryptionConfig.keyVaultMetaInfo] The Key Vault + * information for connecting to user managed encryption keys. + * @property {string} [encryptionConfig.keyVaultMetaInfo.keyVaultResourceId] + * The resource identifier for the user managed Key Vault being used to + * encrypt. + * @property {string} [encryptionConfig.keyVaultMetaInfo.encryptionKeyName] + * The name of the user managed encryption key. + * @property {string} + * [encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] The version of + * the user managed encryption key. + * @property {string} [encryptionState] The current state of encryption for + * this Data Lake Store account. Possible values include: 'Enabled', + * 'Disabled' + * @property {string} [encryptionProvisioningState] The current state of + * encryption provisioning for this Data Lake Store account. Possible values + * include: 'Creating', 'Succeeded' + * @property {array} [firewallRules] The list of firewall rules associated + * with this Data Lake Store account. + * @property {array} [virtualNetworkRules] The list of virtual network rules + * associated with this Data Lake Store account. + * @property {string} [firewallState] The current state of the IP address + * firewall for this Data Lake Store account. Possible values include: + * 'Enabled', 'Disabled' + * @property {string} [firewallAllowAzureIps] The current state of allowing + * or disallowing IPs originating within Azure through the firewall. If the + * firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * @property {array} [trustedIdProviders] The list of trusted identity + * providers associated with this Data Lake Store account. + * @property {string} [trustedIdProviderState] The current state of the + * trusted identity provider feature for this Data Lake Store account. + * Possible values include: 'Enabled', 'Disabled' + * @property {string} [newTier] The commitment tier to use for next month. + * Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', + * 'Commitment_1PB', 'Commitment_5PB' + * @property {string} [currentTier] The commitment tier in use for the + * current month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', + * 'Commitment_1PB', 'Commitment_5PB' + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DataLakeStoreAccount + * + * @returns {object} metadata of DataLakeStoreAccount + * + */ + mapper() { + return { + required: false, + serializedName: 'DataLakeStoreAccount', + type: { + name: 'Composite', + className: 'DataLakeStoreAccount', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + readOnly: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + readOnly: true, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + identity: { + required: false, + readOnly: true, + serializedName: 'identity', + type: { + name: 'Composite', + className: 'EncryptionIdentity' + } + }, + accountId: { + required: false, + readOnly: true, + serializedName: 'properties.accountId', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'Enum', + allowedValues: [ 'Failed', 'Creating', 'Running', 'Succeeded', 'Patching', 'Suspending', 'Resuming', 'Deleting', 'Deleted', 'Undeleting', 'Canceled' ] + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'properties.state', + type: { + name: 'Enum', + allowedValues: [ 'Active', 'Suspended' ] + } + }, + creationTime: { + required: false, + readOnly: true, + serializedName: 'properties.creationTime', + type: { + name: 'DateTime' + } + }, + lastModifiedTime: { + required: false, + readOnly: true, + serializedName: 'properties.lastModifiedTime', + type: { + name: 'DateTime' + } + }, + endpoint: { + required: false, + readOnly: true, + serializedName: 'properties.endpoint', + type: { + name: 'String' + } + }, + defaultGroup: { + required: false, + readOnly: true, + serializedName: 'properties.defaultGroup', + type: { + name: 'String' + } + }, + encryptionConfig: { + required: false, + readOnly: true, + serializedName: 'properties.encryptionConfig', + type: { + name: 'Composite', + className: 'EncryptionConfig' + } + }, + encryptionState: { + required: false, + readOnly: true, + serializedName: 'properties.encryptionState', + type: { + name: 'Enum', + allowedValues: [ 'Enabled', 'Disabled' ] + } + }, + encryptionProvisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.encryptionProvisioningState', + type: { + name: 'Enum', + allowedValues: [ 'Creating', 'Succeeded' ] + } + }, + firewallRules: { + required: false, + readOnly: true, + serializedName: 'properties.firewallRules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'FirewallRuleElementType', + type: { + name: 'Composite', + className: 'FirewallRule' + } + } + } + }, + virtualNetworkRules: { + required: false, + readOnly: true, + serializedName: 'properties.virtualNetworkRules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualNetworkRuleElementType', + type: { + name: 'Composite', + className: 'VirtualNetworkRule' + } + } + } + }, + firewallState: { + required: false, + readOnly: true, + serializedName: 'properties.firewallState', + type: { + name: 'Enum', + allowedValues: [ 'Enabled', 'Disabled' ] + } + }, + firewallAllowAzureIps: { + required: false, + readOnly: true, + serializedName: 'properties.firewallAllowAzureIps', + type: { + name: 'Enum', + allowedValues: [ 'Enabled', 'Disabled' ] + } + }, + trustedIdProviders: { + required: false, + readOnly: true, + serializedName: 'properties.trustedIdProviders', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'TrustedIdProviderElementType', + type: { + name: 'Composite', + className: 'TrustedIdProvider' + } + } + } + }, + trustedIdProviderState: { + required: false, + readOnly: true, + serializedName: 'properties.trustedIdProviderState', + type: { + name: 'Enum', + allowedValues: [ 'Enabled', 'Disabled' ] + } + }, + newTier: { + required: false, + readOnly: true, + serializedName: 'properties.newTier', + type: { + name: 'Enum', + allowedValues: [ 'Consumption', 'Commitment_1TB', 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', 'Commitment_5PB' ] + } + }, + currentTier: { + required: false, + readOnly: true, + serializedName: 'properties.currentTier', + type: { + name: 'Enum', + allowedValues: [ 'Consumption', 'Commitment_1TB', 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', 'Commitment_5PB' ] + } + } + } + } + }; + } +} + +module.exports = DataLakeStoreAccount; diff --git a/lib/services/datalake.Store/lib/account/models/dataLakeStoreAccountBasic.js b/lib/services/datalake.Store/lib/account/models/dataLakeStoreAccountBasic.js new file mode 100644 index 0000000000..e829771eeb --- /dev/null +++ b/lib/services/datalake.Store/lib/account/models/dataLakeStoreAccountBasic.js @@ -0,0 +1,156 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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'); + +/** + * Basic Data Lake Store account information, returned on list calls. + * + * @extends models['Resource'] + */ +class DataLakeStoreAccountBasic extends models['Resource'] { + /** + * Create a DataLakeStoreAccountBasic. + * @property {uuid} [accountId] The unique identifier associated with this + * Data Lake Store account. + * @property {string} [provisioningState] The provisioning status of the Data + * Lake Store account. Possible values include: 'Failed', 'Creating', + * 'Running', 'Succeeded', 'Patching', 'Suspending', 'Resuming', 'Deleting', + * 'Deleted', 'Undeleting', 'Canceled' + * @property {string} [state] The state of the Data Lake Store account. + * Possible values include: 'Active', 'Suspended' + * @property {date} [creationTime] The account creation time. + * @property {date} [lastModifiedTime] The account last modified time. + * @property {string} [endpoint] The full CName endpoint for this account. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DataLakeStoreAccountBasic + * + * @returns {object} metadata of DataLakeStoreAccountBasic + * + */ + mapper() { + return { + required: false, + serializedName: 'DataLakeStoreAccountBasic', + type: { + name: 'Composite', + className: 'DataLakeStoreAccountBasic', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + readOnly: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + readOnly: true, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + accountId: { + required: false, + readOnly: true, + serializedName: 'properties.accountId', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'Enum', + allowedValues: [ 'Failed', 'Creating', 'Running', 'Succeeded', 'Patching', 'Suspending', 'Resuming', 'Deleting', 'Deleted', 'Undeleting', 'Canceled' ] + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'properties.state', + type: { + name: 'Enum', + allowedValues: [ 'Active', 'Suspended' ] + } + }, + creationTime: { + required: false, + readOnly: true, + serializedName: 'properties.creationTime', + type: { + name: 'DateTime' + } + }, + lastModifiedTime: { + required: false, + readOnly: true, + serializedName: 'properties.lastModifiedTime', + type: { + name: 'DateTime' + } + }, + endpoint: { + required: false, + readOnly: true, + serializedName: 'properties.endpoint', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DataLakeStoreAccountBasic; diff --git a/lib/services/datalake.Store/lib/account/models/dataLakeStoreFirewallRuleListResult.js b/lib/services/datalake.Store/lib/account/models/dataLakeStoreAccountListResult.js similarity index 62% rename from lib/services/datalake.Store/lib/account/models/dataLakeStoreFirewallRuleListResult.js rename to lib/services/datalake.Store/lib/account/models/dataLakeStoreAccountListResult.js index 97def422ae..7b0f0f80a0 100644 --- a/lib/services/datalake.Store/lib/account/models/dataLakeStoreFirewallRuleListResult.js +++ b/lib/services/datalake.Store/lib/account/models/dataLakeStoreAccountListResult.js @@ -11,30 +11,30 @@ 'use strict'; /** - * Data Lake Store firewall rule list information. + * Data Lake Store account list information response. */ -class DataLakeStoreFirewallRuleListResult extends Array { +class DataLakeStoreAccountListResult extends Array { /** - * Create a DataLakeStoreFirewallRuleListResult. - * @member {string} [nextLink] the link (url) to the next page of results. + * Create a DataLakeStoreAccountListResult. + * @property {string} [nextLink] The link (url) to the next page of results. */ constructor() { super(); } /** - * Defines the metadata of DataLakeStoreFirewallRuleListResult + * Defines the metadata of DataLakeStoreAccountListResult * - * @returns {object} metadata of DataLakeStoreFirewallRuleListResult + * @returns {object} metadata of DataLakeStoreAccountListResult * */ mapper() { return { required: false, - serializedName: 'DataLakeStoreFirewallRuleListResult', + serializedName: 'DataLakeStoreAccountListResult', type: { name: 'Composite', - className: 'DataLakeStoreFirewallRuleListResult', + className: 'DataLakeStoreAccountListResult', modelProperties: { value: { required: false, @@ -44,10 +44,10 @@ class DataLakeStoreFirewallRuleListResult extends Array { name: 'Sequence', element: { required: false, - serializedName: 'FirewallRuleElementType', + serializedName: 'DataLakeStoreAccountBasicElementType', type: { name: 'Composite', - className: 'FirewallRule' + className: 'DataLakeStoreAccountBasic' } } } @@ -66,4 +66,4 @@ class DataLakeStoreFirewallRuleListResult extends Array { } } -module.exports = DataLakeStoreFirewallRuleListResult; +module.exports = DataLakeStoreAccountListResult; diff --git a/lib/services/datalake.Store/lib/account/models/dataLakeStoreAccountUpdateParameters.js b/lib/services/datalake.Store/lib/account/models/dataLakeStoreAccountUpdateParameters.js deleted file mode 100644 index 4d42bb7e94..0000000000 --- a/lib/services/datalake.Store/lib/account/models/dataLakeStoreAccountUpdateParameters.js +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * 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'); - -/** - * Data Lake Store account information to update - * - */ -class DataLakeStoreAccountUpdateParameters { - /** - * Create a DataLakeStoreAccountUpdateParameters. - * @member {object} [tags] Resource tags - * @member {string} [firewallState] The current state of the IP address - * firewall for this Data Lake store account. Disabling the firewall does not - * remove existing rules, they will just be ignored until the firewall is - * re-enabled. Possible values include: 'Enabled', 'Disabled' - * @member {string} [trustedIdProviderState] The current state of the trusted - * identity provider feature for this Data Lake store account. Disabling - * trusted identity provider functionality does not remove the providers, - * they will just be ignored until this feature is re-enabled. Possible - * values include: 'Enabled', 'Disabled' - * @member {string} [defaultGroup] the default owner group for all new - * folders and files created in the Data Lake Store account. - * @member {string} [newTier] the commitment tier to use for next month. - * Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', - * 'Commitment_1PB', 'Commitment_5PB' - * @member {string} [firewallAllowAzureIps] The current state of allowing or - * disallowing IPs originating within Azure through the firewall. If the - * firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' - * @member {object} [encryptionConfig] Used for rotation of user managed Key - * Vault keys. Can only be used to rotate a user managed encryption Key Vault - * key. - * @member {object} [encryptionConfig.keyVaultMetaInfo] The updated Key Vault - * key to use in user managed key rotation. - * @member {string} [encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] - * The version of the user managed encryption key to update through a key - * rotation. - */ - constructor() { - } - - /** - * Defines the metadata of DataLakeStoreAccountUpdateParameters - * - * @returns {object} metadata of DataLakeStoreAccountUpdateParameters - * - */ - mapper() { - return { - required: false, - serializedName: 'DataLakeStoreAccountUpdateParameters', - type: { - name: 'Composite', - className: 'DataLakeStoreAccountUpdateParameters', - modelProperties: { - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - firewallState: { - required: false, - serializedName: 'properties.firewallState', - type: { - name: 'Enum', - allowedValues: [ 'Enabled', 'Disabled' ] - } - }, - trustedIdProviderState: { - required: false, - serializedName: 'properties.trustedIdProviderState', - type: { - name: 'Enum', - allowedValues: [ 'Enabled', 'Disabled' ] - } - }, - defaultGroup: { - required: false, - serializedName: 'properties.defaultGroup', - type: { - name: 'String' - } - }, - newTier: { - required: false, - serializedName: 'properties.newTier', - type: { - name: 'Enum', - allowedValues: [ 'Consumption', 'Commitment_1TB', 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', 'Commitment_5PB' ] - } - }, - firewallAllowAzureIps: { - required: false, - serializedName: 'properties.firewallAllowAzureIps', - type: { - name: 'Enum', - allowedValues: [ 'Enabled', 'Disabled' ] - } - }, - encryptionConfig: { - required: false, - serializedName: 'properties.encryptionConfig', - type: { - name: 'Composite', - className: 'UpdateEncryptionConfig' - } - } - } - } - }; - } -} - -module.exports = DataLakeStoreAccountUpdateParameters; diff --git a/lib/services/datalake.Store/lib/account/models/encryptionConfig.js b/lib/services/datalake.Store/lib/account/models/encryptionConfig.js new file mode 100644 index 0000000000..5c853d8d45 --- /dev/null +++ b/lib/services/datalake.Store/lib/account/models/encryptionConfig.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'; + +/** + * The encryption configuration for the account. + * + */ +class EncryptionConfig { + /** + * Create a EncryptionConfig. + * @property {string} type The type of encryption configuration being used. + * Currently the only supported types are 'UserManaged' and 'ServiceManaged'. + * Possible values include: 'UserManaged', 'ServiceManaged' + * @property {object} [keyVaultMetaInfo] The Key Vault information for + * connecting to user managed encryption keys. + * @property {string} [keyVaultMetaInfo.keyVaultResourceId] The resource + * identifier for the user managed Key Vault being used to encrypt. + * @property {string} [keyVaultMetaInfo.encryptionKeyName] The name of the + * user managed encryption key. + * @property {string} [keyVaultMetaInfo.encryptionKeyVersion] The version of + * the user managed encryption key. + */ + constructor() { + } + + /** + * Defines the metadata of EncryptionConfig + * + * @returns {object} metadata of EncryptionConfig + * + */ + mapper() { + return { + required: false, + serializedName: 'EncryptionConfig', + type: { + name: 'Composite', + className: 'EncryptionConfig', + modelProperties: { + type: { + required: true, + serializedName: 'type', + type: { + name: 'Enum', + allowedValues: [ 'UserManaged', 'ServiceManaged' ] + } + }, + keyVaultMetaInfo: { + required: false, + serializedName: 'keyVaultMetaInfo', + type: { + name: 'Composite', + className: 'KeyVaultMetaInfo' + } + } + } + } + }; + } +} + +module.exports = EncryptionConfig; diff --git a/lib/services/dataLake.Store/lib/account/models/errorDetails.js b/lib/services/datalake.Store/lib/account/models/encryptionIdentity.js similarity index 51% rename from lib/services/dataLake.Store/lib/account/models/errorDetails.js rename to lib/services/datalake.Store/lib/account/models/encryptionIdentity.js index 0054072586..319cac9cc2 100644 --- a/lib/services/dataLake.Store/lib/account/models/errorDetails.js +++ b/lib/services/datalake.Store/lib/account/models/encryptionIdentity.js @@ -11,56 +11,55 @@ 'use strict'; /** - * Data Lake Store error details information + * The encryption identity properties. * */ -class ErrorDetails { +class EncryptionIdentity { /** - * Create a ErrorDetails. - * @member {string} [code] the HTTP status code or error code associated with - * this error - * @member {string} [message] the error message localized based on - * Accept-Language - * @member {string} [target] the target of the particular error (for example, - * the name of the property in error). + * Create a EncryptionIdentity. + * @property {uuid} [principalId] The principal identifier associated with + * the encryption. + * @property {uuid} [tenantId] The tenant identifier associated with the + * encryption. */ constructor() { } /** - * Defines the metadata of ErrorDetails + * Defines the metadata of EncryptionIdentity * - * @returns {object} metadata of ErrorDetails + * @returns {object} metadata of EncryptionIdentity * */ mapper() { return { required: false, - serializedName: 'ErrorDetails', + serializedName: 'EncryptionIdentity', type: { name: 'Composite', - className: 'ErrorDetails', + className: 'EncryptionIdentity', modelProperties: { - code: { - required: false, - readOnly: true, - serializedName: 'code', + type: { + required: true, + isConstant: true, + serializedName: 'type', + defaultValue: 'SystemAssigned', type: { name: 'String' } }, - message: { + principalId: { required: false, readOnly: true, - serializedName: 'message', + serializedName: 'principalId', type: { name: 'String' } }, - target: { + tenantId: { required: false, readOnly: true, - serializedName: 'target', + serializedName: 'tenantId', type: { name: 'String' } @@ -71,4 +70,4 @@ class ErrorDetails { } } -module.exports = ErrorDetails; +module.exports = EncryptionIdentity; diff --git a/lib/services/datalake.Store/lib/account/models/firewallRule.js b/lib/services/datalake.Store/lib/account/models/firewallRule.js new file mode 100644 index 0000000000..7d0ef1165a --- /dev/null +++ b/lib/services/datalake.Store/lib/account/models/firewallRule.js @@ -0,0 +1,94 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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'); + +/** + * Data Lake Store firewall rule information. + * + * @extends models['SubResource'] + */ +class FirewallRule extends models['SubResource'] { + /** + * Create a FirewallRule. + * @property {string} [startIpAddress] The start IP address for the firewall + * rule. This can be either ipv4 or ipv6. Start and End should be in the same + * protocol. + * @property {string} [endIpAddress] The end IP address for the firewall + * rule. This can be either ipv4 or ipv6. Start and End should be in the same + * protocol. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of FirewallRule + * + * @returns {object} metadata of FirewallRule + * + */ + mapper() { + return { + required: false, + serializedName: 'FirewallRule', + type: { + name: 'Composite', + className: 'FirewallRule', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + startIpAddress: { + required: false, + readOnly: true, + serializedName: 'properties.startIpAddress', + type: { + name: 'String' + } + }, + endIpAddress: { + required: false, + readOnly: true, + serializedName: 'properties.endIpAddress', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = FirewallRule; diff --git a/lib/services/dataLake.Store/lib/account/models/dataLakeStoreFirewallRuleListResult.js b/lib/services/datalake.Store/lib/account/models/firewallRuleListResult.js similarity index 71% rename from lib/services/dataLake.Store/lib/account/models/dataLakeStoreFirewallRuleListResult.js rename to lib/services/datalake.Store/lib/account/models/firewallRuleListResult.js index 97def422ae..4d58768f46 100644 --- a/lib/services/dataLake.Store/lib/account/models/dataLakeStoreFirewallRuleListResult.js +++ b/lib/services/datalake.Store/lib/account/models/firewallRuleListResult.js @@ -13,28 +13,28 @@ /** * Data Lake Store firewall rule list information. */ -class DataLakeStoreFirewallRuleListResult extends Array { +class FirewallRuleListResult extends Array { /** - * Create a DataLakeStoreFirewallRuleListResult. - * @member {string} [nextLink] the link (url) to the next page of results. + * Create a FirewallRuleListResult. + * @property {string} [nextLink] The link (url) to the next page of results. */ constructor() { super(); } /** - * Defines the metadata of DataLakeStoreFirewallRuleListResult + * Defines the metadata of FirewallRuleListResult * - * @returns {object} metadata of DataLakeStoreFirewallRuleListResult + * @returns {object} metadata of FirewallRuleListResult * */ mapper() { return { required: false, - serializedName: 'DataLakeStoreFirewallRuleListResult', + serializedName: 'FirewallRuleListResult', type: { name: 'Composite', - className: 'DataLakeStoreFirewallRuleListResult', + className: 'FirewallRuleListResult', modelProperties: { value: { required: false, @@ -66,4 +66,4 @@ class DataLakeStoreFirewallRuleListResult extends Array { } } -module.exports = DataLakeStoreFirewallRuleListResult; +module.exports = FirewallRuleListResult; diff --git a/lib/services/datalake.Store/lib/account/models/index.d.ts b/lib/services/datalake.Store/lib/account/models/index.d.ts new file mode 100644 index 0000000000..b843bfd5b5 --- /dev/null +++ b/lib/services/datalake.Store/lib/account/models/index.d.ts @@ -0,0 +1,730 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for 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, CloudError } from "ms-rest-azure"; +import * as moment from "moment"; + +export { + + BaseResource, + CloudError +}; + +/** + * The resource model definition. + */ +export interface Resource extends BaseResource { + /** + * The resource identifier. + */ + readonly id?: string; + /** + * The resource name. + */ + readonly name?: string; + /** + * The resource type. + */ + readonly type?: string; + /** + * The resource location. + */ + readonly location?: string; + /** + * The resource tags. + */ + readonly tags?: { [propertyName: string]: string }; +} + +/** + * The resource model definition for a nested resource. + */ +export interface SubResource extends BaseResource { + /** + * The resource identifier. + */ + readonly id?: string; + /** + * The resource name. + */ + readonly name?: string; + /** + * The resource type. + */ + readonly type?: string; +} + +/** + * The encryption identity properties. + */ +export interface EncryptionIdentity { + /** + * The principal identifier associated with the encryption. + */ + readonly principalId?: string; + /** + * The tenant identifier associated with the encryption. + */ + readonly tenantId?: string; +} + +/** + * Metadata information used by account encryption. + */ +export interface KeyVaultMetaInfo { + /** + * The resource identifier for the user managed Key Vault being used to encrypt. + */ + keyVaultResourceId: string; + /** + * The name of the user managed encryption key. + */ + encryptionKeyName: string; + /** + * The version of the user managed encryption key. + */ + encryptionKeyVersion: string; +} + +/** + * The encryption configuration for the account. + */ +export interface EncryptionConfig { + /** + * The type of encryption configuration being used. Currently the only supported types are + * 'UserManaged' and 'ServiceManaged'. Possible values include: 'UserManaged', 'ServiceManaged' + */ + type: string; + /** + * The Key Vault information for connecting to user managed encryption keys. + */ + keyVaultMetaInfo?: KeyVaultMetaInfo; +} + +/** + * Data Lake Store firewall rule information. + */ +export interface FirewallRule extends SubResource { + /** + * The start IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End + * should be in the same protocol. + */ + readonly startIpAddress?: string; + /** + * The end IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End + * should be in the same protocol. + */ + readonly endIpAddress?: string; +} + +/** + * Data Lake Store virtual network rule information. + */ +export interface VirtualNetworkRule extends SubResource { + /** + * The resource identifier for the subnet. + */ + readonly subnetId?: string; +} + +/** + * Data Lake Store trusted identity provider information. + */ +export interface TrustedIdProvider extends SubResource { + /** + * The URL of this trusted identity provider. + */ + readonly idProvider?: string; +} + +/** + * Data Lake Store account information. + */ +export interface DataLakeStoreAccount extends Resource { + /** + * The Key Vault encryption identity, if any. + */ + readonly identity?: EncryptionIdentity; + /** + * The unique identifier associated with this Data Lake Store account. + */ + readonly accountId?: string; + /** + * The provisioning status of the Data Lake Store account. Possible values include: 'Failed', + * 'Creating', 'Running', 'Succeeded', 'Patching', 'Suspending', 'Resuming', 'Deleting', + * 'Deleted', 'Undeleting', 'Canceled' + */ + readonly provisioningState?: string; + /** + * The state of the Data Lake Store account. Possible values include: 'Active', 'Suspended' + */ + readonly state?: string; + /** + * The account creation time. + */ + readonly creationTime?: Date; + /** + * The account last modified time. + */ + readonly lastModifiedTime?: Date; + /** + * The full CName endpoint for this account. + */ + readonly endpoint?: string; + /** + * The default owner group for all new folders and files created in the Data Lake Store account. + */ + readonly defaultGroup?: string; + /** + * The Key Vault encryption configuration. + */ + readonly encryptionConfig?: EncryptionConfig; + /** + * The current state of encryption for this Data Lake Store account. Possible values include: + * 'Enabled', 'Disabled' + */ + readonly encryptionState?: string; + /** + * The current state of encryption provisioning for this Data Lake Store account. Possible values + * include: 'Creating', 'Succeeded' + */ + readonly encryptionProvisioningState?: string; + /** + * The list of firewall rules associated with this Data Lake Store account. + */ + readonly firewallRules?: FirewallRule[]; + /** + * The list of virtual network rules associated with this Data Lake Store account. + */ + readonly virtualNetworkRules?: VirtualNetworkRule[]; + /** + * The current state of the IP address firewall for this Data Lake Store account. Possible values + * include: 'Enabled', 'Disabled' + */ + readonly firewallState?: string; + /** + * The current state of allowing or disallowing IPs originating within Azure through the + * firewall. If the firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + */ + readonly firewallAllowAzureIps?: string; + /** + * The list of trusted identity providers associated with this Data Lake Store account. + */ + readonly trustedIdProviders?: TrustedIdProvider[]; + /** + * The current state of the trusted identity provider feature for this Data Lake Store account. + * Possible values include: 'Enabled', 'Disabled' + */ + readonly trustedIdProviderState?: string; + /** + * The commitment tier to use for next month. Possible values include: 'Consumption', + * 'Commitment_1TB', 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' + */ + readonly newTier?: string; + /** + * The commitment tier in use for the current month. Possible values include: 'Consumption', + * 'Commitment_1TB', 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' + */ + readonly currentTier?: string; +} + +/** + * Basic Data Lake Store account information, returned on list calls. + */ +export interface DataLakeStoreAccountBasic extends Resource { + /** + * The unique identifier associated with this Data Lake Store account. + */ + readonly accountId?: string; + /** + * The provisioning status of the Data Lake Store account. Possible values include: 'Failed', + * 'Creating', 'Running', 'Succeeded', 'Patching', 'Suspending', 'Resuming', 'Deleting', + * 'Deleted', 'Undeleting', 'Canceled' + */ + readonly provisioningState?: string; + /** + * The state of the Data Lake Store account. Possible values include: 'Active', 'Suspended' + */ + readonly state?: string; + /** + * The account creation time. + */ + readonly creationTime?: Date; + /** + * The account last modified time. + */ + readonly lastModifiedTime?: Date; + /** + * The full CName endpoint for this account. + */ + readonly endpoint?: string; +} + +/** + * The display information for a particular operation. + */ +export interface OperationDisplay { + /** + * The resource provider of the operation. + */ + readonly provider?: string; + /** + * The resource type of the operation. + */ + readonly resource?: string; + /** + * A friendly name of the operation. + */ + readonly operation?: string; + /** + * A friendly description of the operation. + */ + readonly description?: string; +} + +/** + * An available operation for Data Lake Store. + */ +export interface Operation { + /** + * The name of the operation. + */ + readonly name?: string; + /** + * The display information for the operation. + */ + display?: OperationDisplay; + /** + * The intended executor of the operation. Possible values include: 'user', 'system', + * 'user,system' + */ + readonly origin?: string; +} + +/** + * The list of available operations for Data Lake Store. + */ +export interface OperationListResult { + /** + * The results of the list operation. + */ + readonly value?: Operation[]; + /** + * The link (url) to the next page of results. + */ + readonly nextLink?: string; +} + +/** + * Subscription-level properties and limits for Data Lake Store. + */ +export interface CapabilityInformation { + /** + * The subscription credentials that uniquely identifies the subscription. + */ + readonly subscriptionId?: string; + /** + * The subscription state. Possible values include: 'Registered', 'Suspended', 'Deleted', + * 'Unregistered', 'Warned' + */ + readonly state?: string; + /** + * The maximum supported number of accounts under this subscription. + */ + readonly maxAccountCount?: number; + /** + * The current number of accounts under this subscription. + */ + readonly accountCount?: number; + /** + * The Boolean value of true or false to indicate the maintenance state. + */ + readonly migrationState?: boolean; +} + +/** + * Data Lake Store account name availability result information. + */ +export interface NameAvailabilityInformation { + /** + * The Boolean value of true or false to indicate whether the Data Lake Store account name is + * available or not. + */ + readonly nameAvailable?: boolean; + /** + * The reason why the Data Lake Store account name is not available, if nameAvailable is false. + */ + readonly reason?: string; + /** + * The message describing why the Data Lake Store account name is not available, if nameAvailable + * is false. + */ + readonly message?: string; +} + +/** + * The parameters used to create a new firewall rule while creating a new Data Lake Store account. + */ +export interface CreateFirewallRuleWithAccountParameters { + /** + * The unique name of the firewall rule to create. + */ + name: string; + /** + * The start IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End + * should be in the same protocol. + */ + startIpAddress: string; + /** + * The end IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End + * should be in the same protocol. + */ + endIpAddress: string; +} + +/** + * The parameters used to create a new virtual network rule while creating a new Data Lake Store + * account. + */ +export interface CreateVirtualNetworkRuleWithAccountParameters { + /** + * The unique name of the virtual network rule to create. + */ + name: string; + /** + * The resource identifier for the subnet. + */ + subnetId: string; +} + +/** + * The parameters used to create a new trusted identity provider while creating a new Data Lake + * Store account. + */ +export interface CreateTrustedIdProviderWithAccountParameters { + /** + * The unique name of the trusted identity provider to create. + */ + name: string; + /** + * The URL of this trusted identity provider. + */ + idProvider: string; +} + +export interface CreateDataLakeStoreAccountParameters { + /** + * The resource location. + */ + location: string; + /** + * The resource tags. + */ + tags?: { [propertyName: string]: string }; + /** + * The Key Vault encryption identity, if any. + */ + identity?: EncryptionIdentity; + /** + * The default owner group for all new folders and files created in the Data Lake Store account. + */ + defaultGroup?: string; + /** + * The Key Vault encryption configuration. + */ + encryptionConfig?: EncryptionConfig; + /** + * The current state of encryption for this Data Lake Store account. Possible values include: + * 'Enabled', 'Disabled' + */ + encryptionState?: string; + /** + * The list of firewall rules associated with this Data Lake Store account. + */ + firewallRules?: CreateFirewallRuleWithAccountParameters[]; + /** + * The list of virtual network rules associated with this Data Lake Store account. + */ + virtualNetworkRules?: CreateVirtualNetworkRuleWithAccountParameters[]; + /** + * The current state of the IP address firewall for this Data Lake Store account. Possible values + * include: 'Enabled', 'Disabled' + */ + firewallState?: string; + /** + * The current state of allowing or disallowing IPs originating within Azure through the + * firewall. If the firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + */ + firewallAllowAzureIps?: string; + /** + * The list of trusted identity providers associated with this Data Lake Store account. + */ + trustedIdProviders?: CreateTrustedIdProviderWithAccountParameters[]; + /** + * The current state of the trusted identity provider feature for this Data Lake Store account. + * Possible values include: 'Enabled', 'Disabled' + */ + trustedIdProviderState?: string; + /** + * The commitment tier to use for next month. Possible values include: 'Consumption', + * 'Commitment_1TB', 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' + */ + newTier?: string; +} + +/** + * The Key Vault update information used for user managed key rotation. +*/ +export interface UpdateKeyVaultMetaInfo { + /** + * The version of the user managed encryption key to update through a key rotation. + */ + encryptionKeyVersion?: string; +} + +/** + * The encryption configuration used to update a user managed Key Vault key. +*/ +export interface UpdateEncryptionConfig { + /** + * The updated Key Vault key to use in user managed key rotation. + */ + keyVaultMetaInfo?: UpdateKeyVaultMetaInfo; +} + +/** + * The parameters used to update a firewall rule while updating a Data Lake Store account. +*/ +export interface UpdateFirewallRuleWithAccountParameters { + /** + * The unique name of the firewall rule to update. + */ + name: string; + /** + * The start IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End + * should be in the same protocol. + */ + startIpAddress?: string; + /** + * The end IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End + * should be in the same protocol. + */ + endIpAddress?: string; +} + +/** + * The parameters used to update a virtual network rule while updating a Data Lake Store account. +*/ +export interface UpdateVirtualNetworkRuleWithAccountParameters { + /** + * The unique name of the virtual network rule to update. + */ + name: string; + /** + * The resource identifier for the subnet. + */ + subnetId?: string; +} + +/** + * The parameters used to update a trusted identity provider while updating a Data Lake Store + * account. +*/ +export interface UpdateTrustedIdProviderWithAccountParameters { + /** + * The unique name of the trusted identity provider to update. + */ + name: string; + /** + * The URL of this trusted identity provider. + */ + idProvider?: string; +} + +/** + * Data Lake Store account information to update. +*/ +export interface UpdateDataLakeStoreAccountParameters { + /** + * Resource tags + */ + tags?: { [propertyName: string]: string }; + /** + * The default owner group for all new folders and files created in the Data Lake Store account. + */ + defaultGroup?: string; + /** + * Used for rotation of user managed Key Vault keys. Can only be used to rotate a user managed + * encryption Key Vault key. + */ + encryptionConfig?: UpdateEncryptionConfig; + /** + * The list of firewall rules associated with this Data Lake Store account. + */ + firewallRules?: UpdateFirewallRuleWithAccountParameters[]; + /** + * The list of virtual network rules associated with this Data Lake Store account. + */ + virtualNetworkRules?: UpdateVirtualNetworkRuleWithAccountParameters[]; + /** + * The current state of the IP address firewall for this Data Lake Store account. Disabling the + * firewall does not remove existing rules, they will just be ignored until the firewall is + * re-enabled. Possible values include: 'Enabled', 'Disabled' + */ + firewallState?: string; + /** + * The current state of allowing or disallowing IPs originating within Azure through the + * firewall. If the firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + */ + firewallAllowAzureIps?: string; + /** + * The list of trusted identity providers associated with this Data Lake Store account. + */ + trustedIdProviders?: UpdateTrustedIdProviderWithAccountParameters[]; + /** + * The current state of the trusted identity provider feature for this Data Lake Store account. + * Disabling trusted identity provider functionality does not remove the providers, they will + * just be ignored until this feature is re-enabled. Possible values include: 'Enabled', + * 'Disabled' + */ + trustedIdProviderState?: string; + /** + * The commitment tier to use for next month. Possible values include: 'Consumption', + * 'Commitment_1TB', 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' + */ + newTier?: string; +} + +/** + * The parameters used to create a new firewall rule. +*/ +export interface CreateOrUpdateFirewallRuleParameters { + /** + * The start IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End + * should be in the same protocol. + */ + startIpAddress: string; + /** + * The end IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End + * should be in the same protocol. + */ + endIpAddress: string; +} + +/** + * The parameters used to update a firewall rule. +*/ +export interface UpdateFirewallRuleParameters { + /** + * The start IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End + * should be in the same protocol. + */ + startIpAddress?: string; + /** + * The end IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End + * should be in the same protocol. + */ + endIpAddress?: string; +} + +/** + * The parameters used to create a new virtual network rule. +*/ +export interface CreateOrUpdateVirtualNetworkRuleParameters { + /** + * The resource identifier for the subnet. + */ + subnetId: string; +} + +/** + * The parameters used to update a virtual network rule. +*/ +export interface UpdateVirtualNetworkRuleParameters { + /** + * The resource identifier for the subnet. + */ + subnetId?: string; +} + +/** + * The parameters used to create a new trusted identity provider. +*/ +export interface CreateOrUpdateTrustedIdProviderParameters { + /** + * The URL of this trusted identity provider. + */ + idProvider: string; +} + +/** + * The parameters used to update a trusted identity provider. +*/ +export interface UpdateTrustedIdProviderParameters { + /** + * The URL of this trusted identity provider. + */ + idProvider?: string; +} + +/** + * Data Lake Store account name availability check parameters. +*/ +export interface CheckNameAvailabilityParameters { + /** + * The Data Lake Store name to check availability for. + */ + name: string; +} + +/** + * Data Lake Store account list information response. +*/ +export interface DataLakeStoreAccountListResult extends Array { + /** + * The link (url) to the next page of results. + */ + readonly nextLink?: string; +} + +/** + * Data Lake Store firewall rule list information. +*/ +export interface FirewallRuleListResult extends Array { + /** + * The link (url) to the next page of results. + */ + readonly nextLink?: string; +} + +/** + * Data Lake Store virtual network rule list information. +*/ +export interface VirtualNetworkRuleListResult extends Array { + /** + * The link (url) to the next page of results. + */ + readonly nextLink?: string; +} + +/** + * Data Lake Store trusted identity provider list information. +*/ +export interface TrustedIdProviderListResult extends Array { + /** + * The link (url) to the next page of results. + */ + readonly nextLink?: string; +} diff --git a/lib/services/datalake.Store/lib/account/models/index.js b/lib/services/datalake.Store/lib/account/models/index.js new file mode 100644 index 0000000000..41fe88ad1d --- /dev/null +++ b/lib/services/datalake.Store/lib/account/models/index.js @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +/* jshint latedef:false */ +/* jshint forin:false */ +/* jshint noempty:false */ + +'use strict'; + +var msRestAzure = require('ms-rest-azure'); + +exports.BaseResource = msRestAzure.BaseResource; +exports.CloudError = msRestAzure.CloudError; +exports.Resource = require('./resource'); +exports.SubResource = require('./subResource'); +exports.EncryptionIdentity = require('./encryptionIdentity'); +exports.KeyVaultMetaInfo = require('./keyVaultMetaInfo'); +exports.EncryptionConfig = require('./encryptionConfig'); +exports.FirewallRule = require('./firewallRule'); +exports.VirtualNetworkRule = require('./virtualNetworkRule'); +exports.TrustedIdProvider = require('./trustedIdProvider'); +exports.DataLakeStoreAccount = require('./dataLakeStoreAccount'); +exports.DataLakeStoreAccountBasic = require('./dataLakeStoreAccountBasic'); +exports.OperationDisplay = require('./operationDisplay'); +exports.Operation = require('./operation'); +exports.OperationListResult = require('./operationListResult'); +exports.CapabilityInformation = require('./capabilityInformation'); +exports.NameAvailabilityInformation = require('./nameAvailabilityInformation'); +exports.CreateFirewallRuleWithAccountParameters = require('./createFirewallRuleWithAccountParameters'); +exports.CreateVirtualNetworkRuleWithAccountParameters = require('./createVirtualNetworkRuleWithAccountParameters'); +exports.CreateTrustedIdProviderWithAccountParameters = require('./createTrustedIdProviderWithAccountParameters'); +exports.CreateDataLakeStoreAccountParameters = require('./createDataLakeStoreAccountParameters'); +exports.UpdateKeyVaultMetaInfo = require('./updateKeyVaultMetaInfo'); +exports.UpdateEncryptionConfig = require('./updateEncryptionConfig'); +exports.UpdateFirewallRuleWithAccountParameters = require('./updateFirewallRuleWithAccountParameters'); +exports.UpdateVirtualNetworkRuleWithAccountParameters = require('./updateVirtualNetworkRuleWithAccountParameters'); +exports.UpdateTrustedIdProviderWithAccountParameters = require('./updateTrustedIdProviderWithAccountParameters'); +exports.UpdateDataLakeStoreAccountParameters = require('./updateDataLakeStoreAccountParameters'); +exports.CreateOrUpdateFirewallRuleParameters = require('./createOrUpdateFirewallRuleParameters'); +exports.UpdateFirewallRuleParameters = require('./updateFirewallRuleParameters'); +exports.CreateOrUpdateVirtualNetworkRuleParameters = require('./createOrUpdateVirtualNetworkRuleParameters'); +exports.UpdateVirtualNetworkRuleParameters = require('./updateVirtualNetworkRuleParameters'); +exports.CreateOrUpdateTrustedIdProviderParameters = require('./createOrUpdateTrustedIdProviderParameters'); +exports.UpdateTrustedIdProviderParameters = require('./updateTrustedIdProviderParameters'); +exports.CheckNameAvailabilityParameters = require('./checkNameAvailabilityParameters'); +exports.DataLakeStoreAccountListResult = require('./dataLakeStoreAccountListResult'); +exports.FirewallRuleListResult = require('./firewallRuleListResult'); +exports.VirtualNetworkRuleListResult = require('./virtualNetworkRuleListResult'); +exports.TrustedIdProviderListResult = require('./trustedIdProviderListResult'); diff --git a/lib/services/datalake.Store/lib/account/models/keyVaultMetaInfo.js b/lib/services/datalake.Store/lib/account/models/keyVaultMetaInfo.js new file mode 100644 index 0000000000..b7ef991b1b --- /dev/null +++ b/lib/services/datalake.Store/lib/account/models/keyVaultMetaInfo.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'; + +/** + * Metadata information used by account encryption. + * + */ +class KeyVaultMetaInfo { + /** + * Create a KeyVaultMetaInfo. + * @property {string} keyVaultResourceId The resource identifier for the user + * managed Key Vault being used to encrypt. + * @property {string} encryptionKeyName The name of the user managed + * encryption key. + * @property {string} encryptionKeyVersion The version of the user managed + * encryption key. + */ + constructor() { + } + + /** + * Defines the metadata of KeyVaultMetaInfo + * + * @returns {object} metadata of KeyVaultMetaInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'KeyVaultMetaInfo', + type: { + name: 'Composite', + className: 'KeyVaultMetaInfo', + modelProperties: { + keyVaultResourceId: { + required: true, + serializedName: 'keyVaultResourceId', + type: { + name: 'String' + } + }, + encryptionKeyName: { + required: true, + serializedName: 'encryptionKeyName', + type: { + name: 'String' + } + }, + encryptionKeyVersion: { + required: true, + serializedName: 'encryptionKeyVersion', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = KeyVaultMetaInfo; diff --git a/lib/services/datalake.Store/lib/account/models/nameAvailabilityInformation.js b/lib/services/datalake.Store/lib/account/models/nameAvailabilityInformation.js new file mode 100644 index 0000000000..7dce5c958e --- /dev/null +++ b/lib/services/datalake.Store/lib/account/models/nameAvailabilityInformation.js @@ -0,0 +1,74 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Data Lake Store account name availability result information. + * + */ +class NameAvailabilityInformation { + /** + * Create a NameAvailabilityInformation. + * @property {boolean} [nameAvailable] The Boolean value of true or false to + * indicate whether the Data Lake Store account name is available or not. + * @property {string} [reason] The reason why the Data Lake Store account + * name is not available, if nameAvailable is false. + * @property {string} [message] The message describing why the Data Lake + * Store account name is not available, if nameAvailable is false. + */ + constructor() { + } + + /** + * Defines the metadata of NameAvailabilityInformation + * + * @returns {object} metadata of NameAvailabilityInformation + * + */ + mapper() { + return { + required: false, + serializedName: 'NameAvailabilityInformation', + type: { + name: 'Composite', + className: 'NameAvailabilityInformation', + modelProperties: { + nameAvailable: { + required: false, + readOnly: true, + serializedName: 'nameAvailable', + type: { + name: 'Boolean' + } + }, + reason: { + required: false, + readOnly: true, + serializedName: 'reason', + type: { + name: 'String' + } + }, + message: { + required: false, + readOnly: true, + serializedName: 'message', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = NameAvailabilityInformation; diff --git a/lib/services/datalake.Store/lib/account/models/operation.js b/lib/services/datalake.Store/lib/account/models/operation.js new file mode 100644 index 0000000000..20cf249b59 --- /dev/null +++ b/lib/services/datalake.Store/lib/account/models/operation.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'; + +/** + * An available operation for Data Lake Store. + * + */ +class Operation { + /** + * Create a Operation. + * @property {string} [name] The name of the operation. + * @property {object} [display] The display information for the operation. + * @property {string} [display.provider] The resource provider of the + * operation. + * @property {string} [display.resource] The resource type of the operation. + * @property {string} [display.operation] A friendly name of the operation. + * @property {string} [display.description] A friendly description of the + * operation. + * @property {string} [origin] The intended executor of the operation. + * Possible values include: '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: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + display: { + required: false, + serializedName: 'display', + type: { + name: 'Composite', + className: 'OperationDisplay' + } + }, + origin: { + required: false, + readOnly: true, + serializedName: 'origin', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Operation; diff --git a/lib/services/datalake.Store/lib/account/models/operationDisplay.js b/lib/services/datalake.Store/lib/account/models/operationDisplay.js new file mode 100644 index 0000000000..b8a3b4e0d5 --- /dev/null +++ b/lib/services/datalake.Store/lib/account/models/operationDisplay.js @@ -0,0 +1,80 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The display information for a particular operation. + * + */ +class OperationDisplay { + /** + * Create a OperationDisplay. + * @property {string} [provider] The resource provider of the operation. + * @property {string} [resource] The resource type of the operation. + * @property {string} [operation] A friendly name of the operation. + * @property {string} [description] A friendly description of the operation. + */ + 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, + readOnly: true, + serializedName: 'provider', + type: { + name: 'String' + } + }, + resource: { + required: false, + readOnly: true, + serializedName: 'resource', + type: { + name: 'String' + } + }, + operation: { + required: false, + readOnly: true, + serializedName: 'operation', + type: { + name: 'String' + } + }, + description: { + required: false, + readOnly: true, + serializedName: 'description', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = OperationDisplay; diff --git a/lib/services/datalake.Store/lib/account/models/operationListResult.js b/lib/services/datalake.Store/lib/account/models/operationListResult.js new file mode 100644 index 0000000000..aa44e8a0a2 --- /dev/null +++ b/lib/services/datalake.Store/lib/account/models/operationListResult.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'; + +/** + * The list of available operations for Data Lake Store. + * + */ +class OperationListResult { + /** + * Create a OperationListResult. + * @property {array} [value] The results of the list operation. + * @property {string} [nextLink] The link (url) to the next page of results. + */ + constructor() { + } + + /** + * Defines the metadata of OperationListResult + * + * @returns {object} metadata of OperationListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'OperationListResult', + type: { + name: 'Composite', + className: 'OperationListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'OperationElementType', + type: { + name: 'Composite', + className: 'Operation' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = OperationListResult; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/aclStatus.js b/lib/services/datalake.Store/lib/account/models/resource.js similarity index 52% rename from lib/services/dataLake.Store/lib/filesystem/models/aclStatus.js rename to lib/services/datalake.Store/lib/account/models/resource.js index 5c33de6971..7cd91c5c05 100644 --- a/lib/services/dataLake.Store/lib/filesystem/models/aclStatus.js +++ b/lib/services/datalake.Store/lib/account/models/resource.js @@ -10,80 +10,85 @@ 'use strict'; +const models = require('./index'); + /** - * Data Lake Store file or directory Access Control List information. + * The resource model definition. * + * @extends models['BaseResource'] */ -class AclStatus { +class Resource extends models['BaseResource'] { /** - * Create a AclStatus. - * @property {array} [entries] the list of ACLSpec entries on a file or - * directory. - * @property {string} [group] the group owner, an AAD Object ID. - * @property {string} [owner] the user owner, an AAD Object ID. - * @property {string} [permission] The octal representation of the unnamed - * user, mask and other permissions. - * @property {boolean} [stickyBit] the indicator of whether the sticky bit is - * on or off. + * Create a Resource. + * @property {string} [id] The resource identifier. + * @property {string} [name] The resource name. + * @property {string} [type] The resource type. + * @property {string} [location] The resource location. + * @property {object} [tags] The resource tags. */ constructor() { + super(); } /** - * Defines the metadata of AclStatus + * Defines the metadata of Resource * - * @returns {object} metadata of AclStatus + * @returns {object} metadata of Resource * */ mapper() { return { required: false, - serializedName: 'AclStatus', + serializedName: 'Resource', type: { name: 'Composite', - className: 'AclStatus', + className: 'Resource', modelProperties: { - entries: { + id: { required: false, - serializedName: 'entries', + readOnly: true, + serializedName: 'id', type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } + name: 'String' } }, - group: { + name: { required: false, - serializedName: 'group', + readOnly: true, + serializedName: 'name', type: { name: 'String' } }, - owner: { + type: { required: false, - serializedName: 'owner', + readOnly: true, + serializedName: 'type', type: { name: 'String' } }, - permission: { + location: { required: false, - serializedName: 'permission', + readOnly: true, + serializedName: 'location', type: { name: 'String' } }, - stickyBit: { + tags: { required: false, readOnly: true, - serializedName: 'stickyBit', + serializedName: 'tags', type: { - name: 'Boolean' + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } } } } @@ -92,4 +97,4 @@ class AclStatus { } } -module.exports = AclStatus; +module.exports = Resource; diff --git a/lib/services/datalake.Store/lib/account/models/errorDetails.js b/lib/services/datalake.Store/lib/account/models/subResource.js similarity index 55% rename from lib/services/datalake.Store/lib/account/models/errorDetails.js rename to lib/services/datalake.Store/lib/account/models/subResource.js index 0054072586..5684e40ed8 100644 --- a/lib/services/datalake.Store/lib/account/models/errorDetails.js +++ b/lib/services/datalake.Store/lib/account/models/subResource.js @@ -10,57 +10,58 @@ 'use strict'; +const models = require('./index'); + /** - * Data Lake Store error details information + * The resource model definition for a nested resource. * + * @extends models['BaseResource'] */ -class ErrorDetails { +class SubResource extends models['BaseResource'] { /** - * Create a ErrorDetails. - * @member {string} [code] the HTTP status code or error code associated with - * this error - * @member {string} [message] the error message localized based on - * Accept-Language - * @member {string} [target] the target of the particular error (for example, - * the name of the property in error). + * Create a SubResource. + * @property {string} [id] The resource identifier. + * @property {string} [name] The resource name. + * @property {string} [type] The resource type. */ constructor() { + super(); } /** - * Defines the metadata of ErrorDetails + * Defines the metadata of SubResource * - * @returns {object} metadata of ErrorDetails + * @returns {object} metadata of SubResource * */ mapper() { return { required: false, - serializedName: 'ErrorDetails', + serializedName: 'SubResource', type: { name: 'Composite', - className: 'ErrorDetails', + className: 'SubResource', modelProperties: { - code: { + id: { required: false, readOnly: true, - serializedName: 'code', + serializedName: 'id', type: { name: 'String' } }, - message: { + name: { required: false, readOnly: true, - serializedName: 'message', + serializedName: 'name', type: { name: 'String' } }, - target: { + type: { required: false, readOnly: true, - serializedName: 'target', + serializedName: 'type', type: { name: 'String' } @@ -71,4 +72,4 @@ class ErrorDetails { } } -module.exports = ErrorDetails; +module.exports = SubResource; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/adlsIOException.js b/lib/services/datalake.Store/lib/account/models/trustedIdProvider.js similarity index 50% rename from lib/services/dataLake.Store/lib/filesystem/models/adlsIOException.js rename to lib/services/datalake.Store/lib/account/models/trustedIdProvider.js index 144d991c95..0060534f65 100644 --- a/lib/services/dataLake.Store/lib/filesystem/models/adlsIOException.js +++ b/lib/services/datalake.Store/lib/account/models/trustedIdProvider.js @@ -13,58 +13,61 @@ const models = require('./index'); /** - * A WebHDFS exception thrown indicating there was an IO (read or write) error. - * Thrown when a 403 error response code is returned (forbidden). + * Data Lake Store trusted identity provider information. * - * @extends models['AdlsRemoteException'] + * @extends models['SubResource'] */ -class AdlsIOException extends models['AdlsRemoteException'] { +class TrustedIdProvider extends models['SubResource'] { /** - * Create a AdlsIOException. + * Create a TrustedIdProvider. + * @property {string} [idProvider] The URL of this trusted identity provider. */ constructor() { super(); } /** - * Defines the metadata of AdlsIOException + * Defines the metadata of TrustedIdProvider * - * @returns {object} metadata of AdlsIOException + * @returns {object} metadata of TrustedIdProvider * */ mapper() { return { required: false, - serializedName: 'IOException', + serializedName: 'TrustedIdProvider', type: { name: 'Composite', - polymorphicDiscriminator: { - serializedName: 'exception', - clientName: 'exception' - }, - uberParent: 'AdlsRemoteException', - className: 'AdlsIOException', + className: 'TrustedIdProvider', modelProperties: { - javaClassName: { + id: { required: false, readOnly: true, - serializedName: 'javaClassName', + serializedName: 'id', type: { name: 'String' } }, - message: { + name: { required: false, readOnly: true, - serializedName: 'message', + serializedName: 'name', type: { name: 'String' } }, - exception: { - required: true, - serializedName: 'exception', - isPolymorphicDiscriminator: true, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + idProvider: { + required: false, + readOnly: true, + serializedName: 'properties.idProvider', type: { name: 'String' } @@ -75,4 +78,4 @@ class AdlsIOException extends models['AdlsRemoteException'] { } } -module.exports = AdlsIOException; +module.exports = TrustedIdProvider; diff --git a/lib/services/datalake.Store/lib/account/models/dataLakeStoreTrustedIdProviderListResult.js b/lib/services/datalake.Store/lib/account/models/trustedIdProviderListResult.js similarity index 70% rename from lib/services/datalake.Store/lib/account/models/dataLakeStoreTrustedIdProviderListResult.js rename to lib/services/datalake.Store/lib/account/models/trustedIdProviderListResult.js index 4eba13e18d..a16de5c343 100644 --- a/lib/services/datalake.Store/lib/account/models/dataLakeStoreTrustedIdProviderListResult.js +++ b/lib/services/datalake.Store/lib/account/models/trustedIdProviderListResult.js @@ -13,28 +13,28 @@ /** * Data Lake Store trusted identity provider list information. */ -class DataLakeStoreTrustedIdProviderListResult extends Array { +class TrustedIdProviderListResult extends Array { /** - * Create a DataLakeStoreTrustedIdProviderListResult. - * @member {string} [nextLink] the link (url) to the next page of results. + * Create a TrustedIdProviderListResult. + * @property {string} [nextLink] The link (url) to the next page of results. */ constructor() { super(); } /** - * Defines the metadata of DataLakeStoreTrustedIdProviderListResult + * Defines the metadata of TrustedIdProviderListResult * - * @returns {object} metadata of DataLakeStoreTrustedIdProviderListResult + * @returns {object} metadata of TrustedIdProviderListResult * */ mapper() { return { required: false, - serializedName: 'DataLakeStoreTrustedIdProviderListResult', + serializedName: 'TrustedIdProviderListResult', type: { name: 'Composite', - className: 'DataLakeStoreTrustedIdProviderListResult', + className: 'TrustedIdProviderListResult', modelProperties: { value: { required: false, @@ -66,4 +66,4 @@ class DataLakeStoreTrustedIdProviderListResult extends Array { } } -module.exports = DataLakeStoreTrustedIdProviderListResult; +module.exports = TrustedIdProviderListResult; diff --git a/lib/services/datalake.Store/lib/account/models/updateDataLakeStoreAccountParameters.js b/lib/services/datalake.Store/lib/account/models/updateDataLakeStoreAccountParameters.js new file mode 100644 index 0000000000..be4f6e9b79 --- /dev/null +++ b/lib/services/datalake.Store/lib/account/models/updateDataLakeStoreAccountParameters.js @@ -0,0 +1,184 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Data Lake Store account information to update. + * + */ +class UpdateDataLakeStoreAccountParameters { + /** + * Create a UpdateDataLakeStoreAccountParameters. + * @property {object} [tags] Resource tags + * @property {string} [defaultGroup] The default owner group for all new + * folders and files created in the Data Lake Store account. + * @property {object} [encryptionConfig] Used for rotation of user managed + * Key Vault keys. Can only be used to rotate a user managed encryption Key + * Vault key. + * @property {object} [encryptionConfig.keyVaultMetaInfo] The updated Key + * Vault key to use in user managed key rotation. + * @property {string} + * [encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] The version of + * the user managed encryption key to update through a key rotation. + * @property {array} [firewallRules] The list of firewall rules associated + * with this Data Lake Store account. + * @property {array} [virtualNetworkRules] The list of virtual network rules + * associated with this Data Lake Store account. + * @property {string} [firewallState] The current state of the IP address + * firewall for this Data Lake Store account. Disabling the firewall does not + * remove existing rules, they will just be ignored until the firewall is + * re-enabled. Possible values include: 'Enabled', 'Disabled' + * @property {string} [firewallAllowAzureIps] The current state of allowing + * or disallowing IPs originating within Azure through the firewall. If the + * firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * @property {array} [trustedIdProviders] The list of trusted identity + * providers associated with this Data Lake Store account. + * @property {string} [trustedIdProviderState] The current state of the + * trusted identity provider feature for this Data Lake Store account. + * Disabling trusted identity provider functionality does not remove the + * providers, they will just be ignored until this feature is re-enabled. + * Possible values include: 'Enabled', 'Disabled' + * @property {string} [newTier] The commitment tier to use for next month. + * Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', + * 'Commitment_1PB', 'Commitment_5PB' + */ + constructor() { + } + + /** + * Defines the metadata of UpdateDataLakeStoreAccountParameters + * + * @returns {object} metadata of UpdateDataLakeStoreAccountParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'UpdateDataLakeStoreAccountParameters', + type: { + name: 'Composite', + className: 'UpdateDataLakeStoreAccountParameters', + modelProperties: { + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + defaultGroup: { + required: false, + serializedName: 'properties.defaultGroup', + type: { + name: 'String' + } + }, + encryptionConfig: { + required: false, + serializedName: 'properties.encryptionConfig', + type: { + name: 'Composite', + className: 'UpdateEncryptionConfig' + } + }, + firewallRules: { + required: false, + serializedName: 'properties.firewallRules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'UpdateFirewallRuleWithAccountParametersElementType', + type: { + name: 'Composite', + className: 'UpdateFirewallRuleWithAccountParameters' + } + } + } + }, + virtualNetworkRules: { + required: false, + serializedName: 'properties.virtualNetworkRules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'UpdateVirtualNetworkRuleWithAccountParametersElementType', + type: { + name: 'Composite', + className: 'UpdateVirtualNetworkRuleWithAccountParameters' + } + } + } + }, + firewallState: { + required: false, + serializedName: 'properties.firewallState', + type: { + name: 'Enum', + allowedValues: [ 'Enabled', 'Disabled' ] + } + }, + firewallAllowAzureIps: { + required: false, + serializedName: 'properties.firewallAllowAzureIps', + type: { + name: 'Enum', + allowedValues: [ 'Enabled', 'Disabled' ] + } + }, + trustedIdProviders: { + required: false, + serializedName: 'properties.trustedIdProviders', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'UpdateTrustedIdProviderWithAccountParametersElementType', + type: { + name: 'Composite', + className: 'UpdateTrustedIdProviderWithAccountParameters' + } + } + } + }, + trustedIdProviderState: { + required: false, + serializedName: 'properties.trustedIdProviderState', + type: { + name: 'Enum', + allowedValues: [ 'Enabled', 'Disabled' ] + } + }, + newTier: { + required: false, + serializedName: 'properties.newTier', + type: { + name: 'Enum', + allowedValues: [ 'Consumption', 'Commitment_1TB', 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', 'Commitment_5PB' ] + } + } + } + } + }; + } +} + +module.exports = UpdateDataLakeStoreAccountParameters; diff --git a/lib/services/datalake.Store/lib/account/models/updateEncryptionConfig.js b/lib/services/datalake.Store/lib/account/models/updateEncryptionConfig.js new file mode 100644 index 0000000000..2611688583 --- /dev/null +++ b/lib/services/datalake.Store/lib/account/models/updateEncryptionConfig.js @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 encryption configuration used to update a user managed Key Vault key. + * + */ +class UpdateEncryptionConfig { + /** + * Create a UpdateEncryptionConfig. + * @property {object} [keyVaultMetaInfo] The updated Key Vault key to use in + * user managed key rotation. + * @property {string} [keyVaultMetaInfo.encryptionKeyVersion] The version of + * the user managed encryption key to update through a key rotation. + */ + constructor() { + } + + /** + * Defines the metadata of UpdateEncryptionConfig + * + * @returns {object} metadata of UpdateEncryptionConfig + * + */ + mapper() { + return { + required: false, + serializedName: 'UpdateEncryptionConfig', + type: { + name: 'Composite', + className: 'UpdateEncryptionConfig', + modelProperties: { + keyVaultMetaInfo: { + required: false, + serializedName: 'keyVaultMetaInfo', + type: { + name: 'Composite', + className: 'UpdateKeyVaultMetaInfo' + } + } + } + } + }; + } +} + +module.exports = UpdateEncryptionConfig; diff --git a/lib/services/datalake.Store/lib/account/models/updateFirewallRuleParameters.js b/lib/services/datalake.Store/lib/account/models/updateFirewallRuleParameters.js new file mode 100644 index 0000000000..343233da2e --- /dev/null +++ b/lib/services/datalake.Store/lib/account/models/updateFirewallRuleParameters.js @@ -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. + */ + +'use strict'; + +/** + * The parameters used to update a firewall rule. + * + */ +class UpdateFirewallRuleParameters { + /** + * Create a UpdateFirewallRuleParameters. + * @property {string} [startIpAddress] The start IP address for the firewall + * rule. This can be either ipv4 or ipv6. Start and End should be in the same + * protocol. + * @property {string} [endIpAddress] The end IP address for the firewall + * rule. This can be either ipv4 or ipv6. Start and End should be in the same + * protocol. + */ + constructor() { + } + + /** + * Defines the metadata of UpdateFirewallRuleParameters + * + * @returns {object} metadata of UpdateFirewallRuleParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'UpdateFirewallRuleParameters', + type: { + name: 'Composite', + className: 'UpdateFirewallRuleParameters', + modelProperties: { + startIpAddress: { + required: false, + serializedName: 'properties.startIpAddress', + type: { + name: 'String' + } + }, + endIpAddress: { + required: false, + serializedName: 'properties.endIpAddress', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = UpdateFirewallRuleParameters; diff --git a/lib/services/datalake.Store/lib/account/models/updateFirewallRuleWithAccountParameters.js b/lib/services/datalake.Store/lib/account/models/updateFirewallRuleWithAccountParameters.js new file mode 100644 index 0000000000..a7199c79db --- /dev/null +++ b/lib/services/datalake.Store/lib/account/models/updateFirewallRuleWithAccountParameters.js @@ -0,0 +1,73 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The parameters used to update a firewall rule while updating a Data Lake + * Store account. + * + */ +class UpdateFirewallRuleWithAccountParameters { + /** + * Create a UpdateFirewallRuleWithAccountParameters. + * @property {string} name The unique name of the firewall rule to update. + * @property {string} [startIpAddress] The start IP address for the firewall + * rule. This can be either ipv4 or ipv6. Start and End should be in the same + * protocol. + * @property {string} [endIpAddress] The end IP address for the firewall + * rule. This can be either ipv4 or ipv6. Start and End should be in the same + * protocol. + */ + constructor() { + } + + /** + * Defines the metadata of UpdateFirewallRuleWithAccountParameters + * + * @returns {object} metadata of UpdateFirewallRuleWithAccountParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'UpdateFirewallRuleWithAccountParameters', + type: { + name: 'Composite', + className: 'UpdateFirewallRuleWithAccountParameters', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + startIpAddress: { + required: false, + serializedName: 'properties.startIpAddress', + type: { + name: 'String' + } + }, + endIpAddress: { + required: false, + serializedName: 'properties.endIpAddress', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = UpdateFirewallRuleWithAccountParameters; diff --git a/lib/services/datalake.Store/lib/account/models/updateKeyVaultMetaInfo.js b/lib/services/datalake.Store/lib/account/models/updateKeyVaultMetaInfo.js new file mode 100644 index 0000000000..812de14bd1 --- /dev/null +++ b/lib/services/datalake.Store/lib/account/models/updateKeyVaultMetaInfo.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'; + +/** + * The Key Vault update information used for user managed key rotation. + * + */ +class UpdateKeyVaultMetaInfo { + /** + * Create a UpdateKeyVaultMetaInfo. + * @property {string} [encryptionKeyVersion] The version of the user managed + * encryption key to update through a key rotation. + */ + constructor() { + } + + /** + * Defines the metadata of UpdateKeyVaultMetaInfo + * + * @returns {object} metadata of UpdateKeyVaultMetaInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'UpdateKeyVaultMetaInfo', + type: { + name: 'Composite', + className: 'UpdateKeyVaultMetaInfo', + modelProperties: { + encryptionKeyVersion: { + required: false, + serializedName: 'encryptionKeyVersion', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = UpdateKeyVaultMetaInfo; diff --git a/lib/services/datalake.Store/lib/account/models/updateTrustedIdProviderParameters.js b/lib/services/datalake.Store/lib/account/models/updateTrustedIdProviderParameters.js new file mode 100644 index 0000000000..03247b4ba6 --- /dev/null +++ b/lib/services/datalake.Store/lib/account/models/updateTrustedIdProviderParameters.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'; + +/** + * The parameters used to update a trusted identity provider. + * + */ +class UpdateTrustedIdProviderParameters { + /** + * Create a UpdateTrustedIdProviderParameters. + * @property {string} [idProvider] The URL of this trusted identity provider. + */ + constructor() { + } + + /** + * Defines the metadata of UpdateTrustedIdProviderParameters + * + * @returns {object} metadata of UpdateTrustedIdProviderParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'UpdateTrustedIdProviderParameters', + type: { + name: 'Composite', + className: 'UpdateTrustedIdProviderParameters', + modelProperties: { + idProvider: { + required: false, + serializedName: 'properties.idProvider', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = UpdateTrustedIdProviderParameters; diff --git a/lib/services/datalake.Store/lib/account/models/updateTrustedIdProviderWithAccountParameters.js b/lib/services/datalake.Store/lib/account/models/updateTrustedIdProviderWithAccountParameters.js new file mode 100644 index 0000000000..a3f4e62611 --- /dev/null +++ b/lib/services/datalake.Store/lib/account/models/updateTrustedIdProviderWithAccountParameters.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'; + +/** + * The parameters used to update a trusted identity provider while updating a + * Data Lake Store account. + * + */ +class UpdateTrustedIdProviderWithAccountParameters { + /** + * Create a UpdateTrustedIdProviderWithAccountParameters. + * @property {string} name The unique name of the trusted identity provider + * to update. + * @property {string} [idProvider] The URL of this trusted identity provider. + */ + constructor() { + } + + /** + * Defines the metadata of UpdateTrustedIdProviderWithAccountParameters + * + * @returns {object} metadata of UpdateTrustedIdProviderWithAccountParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'UpdateTrustedIdProviderWithAccountParameters', + type: { + name: 'Composite', + className: 'UpdateTrustedIdProviderWithAccountParameters', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + idProvider: { + required: false, + serializedName: 'properties.idProvider', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = UpdateTrustedIdProviderWithAccountParameters; diff --git a/lib/services/datalake.Store/lib/account/models/updateVirtualNetworkRuleParameters.js b/lib/services/datalake.Store/lib/account/models/updateVirtualNetworkRuleParameters.js new file mode 100644 index 0000000000..6bcf060d0c --- /dev/null +++ b/lib/services/datalake.Store/lib/account/models/updateVirtualNetworkRuleParameters.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'; + +/** + * The parameters used to update a virtual network rule. + * + */ +class UpdateVirtualNetworkRuleParameters { + /** + * Create a UpdateVirtualNetworkRuleParameters. + * @property {string} [subnetId] The resource identifier for the subnet. + */ + constructor() { + } + + /** + * Defines the metadata of UpdateVirtualNetworkRuleParameters + * + * @returns {object} metadata of UpdateVirtualNetworkRuleParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'UpdateVirtualNetworkRuleParameters', + type: { + name: 'Composite', + className: 'UpdateVirtualNetworkRuleParameters', + modelProperties: { + subnetId: { + required: false, + serializedName: 'properties.subnetId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = UpdateVirtualNetworkRuleParameters; diff --git a/lib/services/datalake.Store/lib/account/models/updateVirtualNetworkRuleWithAccountParameters.js b/lib/services/datalake.Store/lib/account/models/updateVirtualNetworkRuleWithAccountParameters.js new file mode 100644 index 0000000000..3b0a7fc162 --- /dev/null +++ b/lib/services/datalake.Store/lib/account/models/updateVirtualNetworkRuleWithAccountParameters.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'; + +/** + * The parameters used to update a virtual network rule while updating a Data + * Lake Store account. + * + */ +class UpdateVirtualNetworkRuleWithAccountParameters { + /** + * Create a UpdateVirtualNetworkRuleWithAccountParameters. + * @property {string} name The unique name of the virtual network rule to + * update. + * @property {string} [subnetId] The resource identifier for the subnet. + */ + constructor() { + } + + /** + * Defines the metadata of UpdateVirtualNetworkRuleWithAccountParameters + * + * @returns {object} metadata of UpdateVirtualNetworkRuleWithAccountParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'UpdateVirtualNetworkRuleWithAccountParameters', + type: { + name: 'Composite', + className: 'UpdateVirtualNetworkRuleWithAccountParameters', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + subnetId: { + required: false, + serializedName: 'properties.subnetId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = UpdateVirtualNetworkRuleWithAccountParameters; diff --git a/lib/services/datalake.Store/lib/account/models/virtualNetworkRule.js b/lib/services/datalake.Store/lib/account/models/virtualNetworkRule.js new file mode 100644 index 0000000000..a79a9903dd --- /dev/null +++ b/lib/services/datalake.Store/lib/account/models/virtualNetworkRule.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'); + +/** + * Data Lake Store virtual network rule information. + * + * @extends models['SubResource'] + */ +class VirtualNetworkRule extends models['SubResource'] { + /** + * Create a VirtualNetworkRule. + * @property {string} [subnetId] The resource identifier for the subnet. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VirtualNetworkRule + * + * @returns {object} metadata of VirtualNetworkRule + * + */ + mapper() { + return { + required: false, + serializedName: 'VirtualNetworkRule', + type: { + name: 'Composite', + className: 'VirtualNetworkRule', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + subnetId: { + required: false, + readOnly: true, + serializedName: 'properties.subnetId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VirtualNetworkRule; diff --git a/lib/services/dataLake.Store/lib/account/models/dataLakeStoreTrustedIdProviderListResult.js b/lib/services/datalake.Store/lib/account/models/virtualNetworkRuleListResult.js similarity index 60% rename from lib/services/dataLake.Store/lib/account/models/dataLakeStoreTrustedIdProviderListResult.js rename to lib/services/datalake.Store/lib/account/models/virtualNetworkRuleListResult.js index 4eba13e18d..77bb8276cc 100644 --- a/lib/services/dataLake.Store/lib/account/models/dataLakeStoreTrustedIdProviderListResult.js +++ b/lib/services/datalake.Store/lib/account/models/virtualNetworkRuleListResult.js @@ -11,30 +11,30 @@ 'use strict'; /** - * Data Lake Store trusted identity provider list information. + * Data Lake Store virtual network rule list information. */ -class DataLakeStoreTrustedIdProviderListResult extends Array { +class VirtualNetworkRuleListResult extends Array { /** - * Create a DataLakeStoreTrustedIdProviderListResult. - * @member {string} [nextLink] the link (url) to the next page of results. + * Create a VirtualNetworkRuleListResult. + * @property {string} [nextLink] The link (url) to the next page of results. */ constructor() { super(); } /** - * Defines the metadata of DataLakeStoreTrustedIdProviderListResult + * Defines the metadata of VirtualNetworkRuleListResult * - * @returns {object} metadata of DataLakeStoreTrustedIdProviderListResult + * @returns {object} metadata of VirtualNetworkRuleListResult * */ mapper() { return { required: false, - serializedName: 'DataLakeStoreTrustedIdProviderListResult', + serializedName: 'VirtualNetworkRuleListResult', type: { name: 'Composite', - className: 'DataLakeStoreTrustedIdProviderListResult', + className: 'VirtualNetworkRuleListResult', modelProperties: { value: { required: false, @@ -44,10 +44,10 @@ class DataLakeStoreTrustedIdProviderListResult extends Array { name: 'Sequence', element: { required: false, - serializedName: 'TrustedIdProviderElementType', + serializedName: 'VirtualNetworkRuleElementType', type: { name: 'Composite', - className: 'TrustedIdProvider' + className: 'VirtualNetworkRule' } } } @@ -66,4 +66,4 @@ class DataLakeStoreTrustedIdProviderListResult extends Array { } } -module.exports = DataLakeStoreTrustedIdProviderListResult; +module.exports = VirtualNetworkRuleListResult; diff --git a/lib/services/datalake.Store/lib/account/operations/account.js b/lib/services/datalake.Store/lib/account/operations/account.js deleted file mode 100644 index 5df69b2cad..0000000000 --- a/lib/services/datalake.Store/lib/account/operations/account.js +++ /dev/null @@ -1,3465 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * 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; - - -/** - * Creates the specified Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} name The name of the Data Lake Store account to create. - * - * @param {object} parameters Parameters supplied to create the Data Lake Store - * account. - * - * @param {object} [parameters.identity] The Key Vault encryption identity, if - * any. - * - * @param {string} [parameters.encryptionState] The current state of encryption - * for this Data Lake store account. Possible values include: 'Enabled', - * 'Disabled' - * - * @param {object} [parameters.encryptionConfig] The Key Vault encryption - * configuration. - * - * @param {string} parameters.encryptionConfig.type The type of encryption - * configuration being used. Currently the only supported types are - * 'UserManaged' and 'ServiceManaged'. Possible values include: 'UserManaged', - * 'ServiceManaged' - * - * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The Key Vault - * information for connecting to user managed encryption keys. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.keyVaultResourceId The resource - * identifier for the user managed Key Vault being used to encrypt. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyName The name of - * the user managed encryption key. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion The - * version of the user managed encryption key. - * - * @param {string} [parameters.firewallState] The current state of the IP - * address firewall for this Data Lake store account. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {array} [parameters.firewallRules] The list of firewall rules - * associated with this Data Lake store account. - * - * @param {string} [parameters.trustedIdProviderState] The current state of the - * trusted identity provider feature for this Data Lake store account. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {array} [parameters.trustedIdProviders] The list of trusted identity - * providers associated with this Data Lake store account. - * - * @param {string} [parameters.defaultGroup] the default owner group for all - * new folders and files created in the Data Lake Store account. - * - * @param {string} [parameters.newTier] the commitment tier to use for next - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' - * - * @param {string} [parameters.firewallAllowAzureIps] The current state of - * allowing or disallowing IPs originating within Azure through the firewall. - * If the firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {string} parameters.location Resource location - * - * @param {object} [parameters.tags] Resource tags - * - * @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 DataLakeStoreAccount} 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, name, parameters, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - - if (!callback) { - throw new Error('callback cannot be null.'); - } - - // Send request - this.beginCreate(resourceGroupName, name, parameters, 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['DataLakeStoreAccount']().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 specified Data Lake Store account information. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} name The name of the Data Lake Store account to update. - * - * @param {object} parameters Parameters supplied to update the Data Lake Store - * account. - * - * @param {object} [parameters.tags] Resource tags - * - * @param {string} [parameters.firewallState] The current state of the IP - * address firewall for this Data Lake store account. Disabling the firewall - * does not remove existing rules, they will just be ignored until the firewall - * is re-enabled. Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.trustedIdProviderState] The current state of the - * trusted identity provider feature for this Data Lake store account. - * Disabling trusted identity provider functionality does not remove the - * providers, they will just be ignored until this feature is re-enabled. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.defaultGroup] the default owner group for all - * new folders and files created in the Data Lake Store account. - * - * @param {string} [parameters.newTier] the commitment tier to use for next - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' - * - * @param {string} [parameters.firewallAllowAzureIps] The current state of - * allowing or disallowing IPs originating within Azure through the firewall. - * If the firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {object} [parameters.encryptionConfig] Used for rotation of user - * managed Key Vault keys. Can only be used to rotate a user managed encryption - * Key Vault key. - * - * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The updated - * Key Vault key to use in user managed key rotation. - * - * @param {string} - * [parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] The - * version of the user managed encryption key to update through a key rotation. - * - * @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 DataLakeStoreAccount} 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, name, parameters, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - - if (!callback) { - throw new Error('callback cannot be null.'); - } - - // Send request - this.beginUpdate(resourceGroupName, name, parameters, 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['DataLakeStoreAccount']().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 the specified Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} name The name of the Data Lake Store account to delete. - * - * @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, name, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - - if (!callback) { - throw new Error('callback cannot be null.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, name, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Gets the specified Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} name The name of the Data Lake Store account to retrieve. - * - * @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 DataLakeStoreAccount} 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, name, 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 (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 (name === null || name === undefined || typeof name.valueOf() !== 'string') { - throw new Error('name 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{name}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - 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['DataLakeStoreAccount']().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); - }); -} - -/** - * Attempts to enable a user managed Key Vault for encryption of the specified - * Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account to - * attempt to enable the Key Vault for. - * - * @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 _enableKeyVault(resourceGroupName, accountName, 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 (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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/enableKeyVault'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - 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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Lists the Data Lake Store accounts within a specific resource group. The - * response includes a link to the next page of results, if any. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account(s). - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData filter. Optional. - * - * @param {number} [options.top] The number of items to return. Optional. - * - * @param {number} [options.skip] The number of items to skip over before - * returning elements. Optional. - * - * @param {string} [options.select] OData Select statement. Limits the - * properties on each entry to just those requested, e.g. - * Categories?$select=CategoryName,Description. Optional. - * - * @param {string} [options.orderby] OrderBy clause. One or more - * comma-separated expressions with an optional "asc" (the default) or "desc" - * depending on the order you'd like the values sorted, e.g. - * Categories?$orderby=CategoryName desc. Optional. - * - * @param {boolean} [options.count] A Boolean value of true or false to request - * a count of the matching resources included with the resources in the - * response, e.g. Categories?$count=true. Optional. - * - * @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 DataLakeStoreAccountListResult} 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 filter = (options && options.filter !== undefined) ? options.filter : undefined; - let top = (options && options.top !== undefined) ? options.top : undefined; - let skip = (options && options.skip !== undefined) ? options.skip : undefined; - let select = (options && options.select !== undefined) ? options.select : undefined; - let orderby = (options && options.orderby !== undefined) ? options.orderby : undefined; - let count = (options && options.count !== undefined) ? options.count : undefined; - // Validate - try { - 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 (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { - throw new Error('filter must be of type string.'); - } - if (top !== null && top !== undefined && typeof top !== 'number') { - throw new Error('top must be of type number.'); - } - if (top !== null && top !== undefined) { - if (top < 1) - { - throw new Error('"top" should satisfy the constraint - "InclusiveMinimum": 1'); - } - } - if (skip !== null && skip !== undefined && typeof skip !== 'number') { - throw new Error('skip must be of type number.'); - } - if (skip !== null && skip !== undefined) { - if (skip < 1) - { - throw new Error('"skip" should satisfy the constraint - "InclusiveMinimum": 1'); - } - } - if (select !== null && select !== undefined && typeof select.valueOf() !== 'string') { - throw new Error('select must be of type string.'); - } - if (orderby !== null && orderby !== undefined && typeof orderby.valueOf() !== 'string') { - throw new Error('orderby must be of type string.'); - } - if (count !== null && count !== undefined && typeof count !== 'boolean') { - throw new Error('count must be of type boolean.'); - } - 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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - if (filter !== null && filter !== undefined) { - queryParameters.push('$filter=' + encodeURIComponent(filter)); - } - if (top !== null && top !== undefined) { - queryParameters.push('$top=' + encodeURIComponent(top.toString())); - } - if (skip !== null && skip !== undefined) { - queryParameters.push('$skip=' + encodeURIComponent(skip.toString())); - } - if (select !== null && select !== undefined) { - queryParameters.push('$select=' + encodeURIComponent(select)); - } - if (orderby !== null && orderby !== undefined) { - queryParameters.push('$orderby=' + encodeURIComponent(orderby)); - } - if (count !== null && count !== undefined) { - queryParameters.push('$count=' + encodeURIComponent(count.toString())); - } - 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['DataLakeStoreAccountListResult']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Lists the Data Lake Store accounts within the subscription. The response - * includes a link to the next page of results, if any. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData filter. Optional. - * - * @param {number} [options.top] The number of items to return. Optional. - * - * @param {number} [options.skip] The number of items to skip over before - * returning elements. Optional. - * - * @param {string} [options.select] OData Select statement. Limits the - * properties on each entry to just those requested, e.g. - * Categories?$select=CategoryName,Description. Optional. - * - * @param {string} [options.orderby] OrderBy clause. One or more - * comma-separated expressions with an optional "asc" (the default) or "desc" - * depending on the order you'd like the values sorted, e.g. - * Categories?$orderby=CategoryName desc. Optional. - * - * @param {boolean} [options.count] The Boolean value of true or false to - * request a count of the matching resources included with the resources in the - * response, e.g. Categories?$count=true. Optional. - * - * @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 DataLakeStoreAccountListResult} 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 filter = (options && options.filter !== undefined) ? options.filter : undefined; - let top = (options && options.top !== undefined) ? options.top : undefined; - let skip = (options && options.skip !== undefined) ? options.skip : undefined; - let select = (options && options.select !== undefined) ? options.select : undefined; - let orderby = (options && options.orderby !== undefined) ? options.orderby : undefined; - let count = (options && options.count !== undefined) ? options.count : undefined; - // Validate - try { - if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { - throw new Error('filter must be of type string.'); - } - if (top !== null && top !== undefined && typeof top !== 'number') { - throw new Error('top must be of type number.'); - } - if (top !== null && top !== undefined) { - if (top < 1) - { - throw new Error('"top" should satisfy the constraint - "InclusiveMinimum": 1'); - } - } - if (skip !== null && skip !== undefined && typeof skip !== 'number') { - throw new Error('skip must be of type number.'); - } - if (skip !== null && skip !== undefined) { - if (skip < 1) - { - throw new Error('"skip" should satisfy the constraint - "InclusiveMinimum": 1'); - } - } - if (select !== null && select !== undefined && typeof select.valueOf() !== 'string') { - throw new Error('select must be of type string.'); - } - if (orderby !== null && orderby !== undefined && typeof orderby.valueOf() !== 'string') { - throw new Error('orderby must be of type string.'); - } - if (count !== null && count !== undefined && typeof count !== 'boolean') { - throw new Error('count must be of type boolean.'); - } - 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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.DataLakeStore/accounts'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - if (filter !== null && filter !== undefined) { - queryParameters.push('$filter=' + encodeURIComponent(filter)); - } - if (top !== null && top !== undefined) { - queryParameters.push('$top=' + encodeURIComponent(top.toString())); - } - if (skip !== null && skip !== undefined) { - queryParameters.push('$skip=' + encodeURIComponent(skip.toString())); - } - if (select !== null && select !== undefined) { - queryParameters.push('$select=' + encodeURIComponent(select)); - } - if (orderby !== null && orderby !== undefined) { - queryParameters.push('$orderby=' + encodeURIComponent(orderby)); - } - if (count !== null && count !== undefined) { - queryParameters.push('$count=' + encodeURIComponent(count.toString())); - } - 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['DataLakeStoreAccountListResult']().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 the specified Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} name The name of the Data Lake Store account to create. - * - * @param {object} parameters Parameters supplied to create the Data Lake Store - * account. - * - * @param {object} [parameters.identity] The Key Vault encryption identity, if - * any. - * - * @param {string} [parameters.encryptionState] The current state of encryption - * for this Data Lake store account. Possible values include: 'Enabled', - * 'Disabled' - * - * @param {object} [parameters.encryptionConfig] The Key Vault encryption - * configuration. - * - * @param {string} parameters.encryptionConfig.type The type of encryption - * configuration being used. Currently the only supported types are - * 'UserManaged' and 'ServiceManaged'. Possible values include: 'UserManaged', - * 'ServiceManaged' - * - * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The Key Vault - * information for connecting to user managed encryption keys. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.keyVaultResourceId The resource - * identifier for the user managed Key Vault being used to encrypt. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyName The name of - * the user managed encryption key. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion The - * version of the user managed encryption key. - * - * @param {string} [parameters.firewallState] The current state of the IP - * address firewall for this Data Lake store account. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {array} [parameters.firewallRules] The list of firewall rules - * associated with this Data Lake store account. - * - * @param {string} [parameters.trustedIdProviderState] The current state of the - * trusted identity provider feature for this Data Lake store account. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {array} [parameters.trustedIdProviders] The list of trusted identity - * providers associated with this Data Lake store account. - * - * @param {string} [parameters.defaultGroup] the default owner group for all - * new folders and files created in the Data Lake Store account. - * - * @param {string} [parameters.newTier] the commitment tier to use for next - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' - * - * @param {string} [parameters.firewallAllowAzureIps] The current state of - * allowing or disallowing IPs originating within Azure through the firewall. - * If the firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {string} parameters.location Resource location - * - * @param {object} [parameters.tags] Resource tags - * - * @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 DataLakeStoreAccount} 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, name, parameters, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - if (parameters === null || parameters === undefined) - { - parameters = {}; - } - // Validate - try { - 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 (name === null || name === undefined || typeof name.valueOf() !== 'string') { - throw new Error('name cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - if (this.client.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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{name}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - 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 (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['DataLakeStoreAccount']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - 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['DataLakeStoreAccount']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DataLakeStoreAccount']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Updates the specified Data Lake Store account information. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} name The name of the Data Lake Store account to update. - * - * @param {object} parameters Parameters supplied to update the Data Lake Store - * account. - * - * @param {object} [parameters.tags] Resource tags - * - * @param {string} [parameters.firewallState] The current state of the IP - * address firewall for this Data Lake store account. Disabling the firewall - * does not remove existing rules, they will just be ignored until the firewall - * is re-enabled. Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.trustedIdProviderState] The current state of the - * trusted identity provider feature for this Data Lake store account. - * Disabling trusted identity provider functionality does not remove the - * providers, they will just be ignored until this feature is re-enabled. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.defaultGroup] the default owner group for all - * new folders and files created in the Data Lake Store account. - * - * @param {string} [parameters.newTier] the commitment tier to use for next - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' - * - * @param {string} [parameters.firewallAllowAzureIps] The current state of - * allowing or disallowing IPs originating within Azure through the firewall. - * If the firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {object} [parameters.encryptionConfig] Used for rotation of user - * managed Key Vault keys. Can only be used to rotate a user managed encryption - * Key Vault key. - * - * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The updated - * Key Vault key to use in user managed key rotation. - * - * @param {string} - * [parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] The - * version of the user managed encryption key to update through a key rotation. - * - * @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 DataLakeStoreAccount} 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, name, parameters, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - // Validate - try { - 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 (name === null || name === undefined || typeof name.valueOf() !== 'string') { - throw new Error('name cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - if (this.client.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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{name}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - 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 (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['DataLakeStoreAccountUpdateParameters']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - 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['DataLakeStoreAccount']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DataLakeStoreAccount']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Deletes the specified Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} name The name of the Data Lake Store account to delete. - * - * @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 _beginDeleteMethod(resourceGroupName, name, 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 (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 (name === null || name === undefined || typeof name.valueOf() !== 'string') { - throw new Error('name 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{name}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - 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 !== 200 && statusCode !== 202 && statusCode !== 204) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - 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); - }); -} - -/** - * Lists the Data Lake Store accounts within a specific resource group. The - * response includes a link to the next page of results, if any. - * - * @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 DataLakeStoreAccountListResult} 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['DataLakeStoreAccountListResult']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Lists the Data Lake Store accounts within the subscription. The response - * includes a link to the next page of results, if any. - * - * @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 DataLakeStoreAccountListResult} 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['DataLakeStoreAccountListResult']().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 Account. */ -class Account { - /** - * Create a Account. - * @param {DataLakeStoreAccountManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._create = _create; - this._update = _update; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._enableKeyVault = _enableKeyVault; - this._listByResourceGroup = _listByResourceGroup; - this._list = _list; - this._beginCreate = _beginCreate; - this._beginUpdate = _beginUpdate; - this._beginDeleteMethod = _beginDeleteMethod; - this._listByResourceGroupNext = _listByResourceGroupNext; - this._listNext = _listNext; - } - - /** - * Creates the specified Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} name The name of the Data Lake Store account to create. - * - * @param {object} parameters Parameters supplied to create the Data Lake Store - * account. - * - * @param {object} [parameters.identity] The Key Vault encryption identity, if - * any. - * - * @param {string} [parameters.encryptionState] The current state of encryption - * for this Data Lake store account. Possible values include: 'Enabled', - * 'Disabled' - * - * @param {object} [parameters.encryptionConfig] The Key Vault encryption - * configuration. - * - * @param {string} parameters.encryptionConfig.type The type of encryption - * configuration being used. Currently the only supported types are - * 'UserManaged' and 'ServiceManaged'. Possible values include: 'UserManaged', - * 'ServiceManaged' - * - * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The Key Vault - * information for connecting to user managed encryption keys. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.keyVaultResourceId The resource - * identifier for the user managed Key Vault being used to encrypt. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyName The name of - * the user managed encryption key. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion The - * version of the user managed encryption key. - * - * @param {string} [parameters.firewallState] The current state of the IP - * address firewall for this Data Lake store account. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {array} [parameters.firewallRules] The list of firewall rules - * associated with this Data Lake store account. - * - * @param {string} [parameters.trustedIdProviderState] The current state of the - * trusted identity provider feature for this Data Lake store account. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {array} [parameters.trustedIdProviders] The list of trusted identity - * providers associated with this Data Lake store account. - * - * @param {string} [parameters.defaultGroup] the default owner group for all - * new folders and files created in the Data Lake Store account. - * - * @param {string} [parameters.newTier] the commitment tier to use for next - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' - * - * @param {string} [parameters.firewallAllowAzureIps] The current state of - * allowing or disallowing IPs originating within Azure through the firewall. - * If the firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {string} parameters.location Resource location - * - * @param {object} [parameters.tags] Resource tags - * - * @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, name, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._create(resourceGroupName, name, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates the specified Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} name The name of the Data Lake Store account to create. - * - * @param {object} parameters Parameters supplied to create the Data Lake Store - * account. - * - * @param {object} [parameters.identity] The Key Vault encryption identity, if - * any. - * - * @param {string} [parameters.encryptionState] The current state of encryption - * for this Data Lake store account. Possible values include: 'Enabled', - * 'Disabled' - * - * @param {object} [parameters.encryptionConfig] The Key Vault encryption - * configuration. - * - * @param {string} parameters.encryptionConfig.type The type of encryption - * configuration being used. Currently the only supported types are - * 'UserManaged' and 'ServiceManaged'. Possible values include: 'UserManaged', - * 'ServiceManaged' - * - * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The Key Vault - * information for connecting to user managed encryption keys. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.keyVaultResourceId The resource - * identifier for the user managed Key Vault being used to encrypt. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyName The name of - * the user managed encryption key. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion The - * version of the user managed encryption key. - * - * @param {string} [parameters.firewallState] The current state of the IP - * address firewall for this Data Lake store account. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {array} [parameters.firewallRules] The list of firewall rules - * associated with this Data Lake store account. - * - * @param {string} [parameters.trustedIdProviderState] The current state of the - * trusted identity provider feature for this Data Lake store account. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {array} [parameters.trustedIdProviders] The list of trusted identity - * providers associated with this Data Lake store account. - * - * @param {string} [parameters.defaultGroup] the default owner group for all - * new folders and files created in the Data Lake Store account. - * - * @param {string} [parameters.newTier] the commitment tier to use for next - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' - * - * @param {string} [parameters.firewallAllowAzureIps] The current state of - * allowing or disallowing IPs originating within Azure through the firewall. - * If the firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {string} parameters.location Resource location - * - * @param {object} [parameters.tags] Resource tags - * - * @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 {DataLakeStoreAccount} - 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 DataLakeStoreAccount} 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, name, parameters, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._create(resourceGroupName, name, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._create(resourceGroupName, name, parameters, options, optionalCallback); - } - } - - /** - * Updates the specified Data Lake Store account information. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} name The name of the Data Lake Store account to update. - * - * @param {object} parameters Parameters supplied to update the Data Lake Store - * account. - * - * @param {object} [parameters.tags] Resource tags - * - * @param {string} [parameters.firewallState] The current state of the IP - * address firewall for this Data Lake store account. Disabling the firewall - * does not remove existing rules, they will just be ignored until the firewall - * is re-enabled. Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.trustedIdProviderState] The current state of the - * trusted identity provider feature for this Data Lake store account. - * Disabling trusted identity provider functionality does not remove the - * providers, they will just be ignored until this feature is re-enabled. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.defaultGroup] the default owner group for all - * new folders and files created in the Data Lake Store account. - * - * @param {string} [parameters.newTier] the commitment tier to use for next - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' - * - * @param {string} [parameters.firewallAllowAzureIps] The current state of - * allowing or disallowing IPs originating within Azure through the firewall. - * If the firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {object} [parameters.encryptionConfig] Used for rotation of user - * managed Key Vault keys. Can only be used to rotate a user managed encryption - * Key Vault key. - * - * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The updated - * Key Vault key to use in user managed key rotation. - * - * @param {string} - * [parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] The - * version of the user managed encryption key to update through a key rotation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - updateWithHttpOperationResponse(resourceGroupName, name, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._update(resourceGroupName, name, parameters, 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 specified Data Lake Store account information. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} name The name of the Data Lake Store account to update. - * - * @param {object} parameters Parameters supplied to update the Data Lake Store - * account. - * - * @param {object} [parameters.tags] Resource tags - * - * @param {string} [parameters.firewallState] The current state of the IP - * address firewall for this Data Lake store account. Disabling the firewall - * does not remove existing rules, they will just be ignored until the firewall - * is re-enabled. Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.trustedIdProviderState] The current state of the - * trusted identity provider feature for this Data Lake store account. - * Disabling trusted identity provider functionality does not remove the - * providers, they will just be ignored until this feature is re-enabled. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.defaultGroup] the default owner group for all - * new folders and files created in the Data Lake Store account. - * - * @param {string} [parameters.newTier] the commitment tier to use for next - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' - * - * @param {string} [parameters.firewallAllowAzureIps] The current state of - * allowing or disallowing IPs originating within Azure through the firewall. - * If the firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {object} [parameters.encryptionConfig] Used for rotation of user - * managed Key Vault keys. Can only be used to rotate a user managed encryption - * Key Vault key. - * - * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The updated - * Key Vault key to use in user managed key rotation. - * - * @param {string} - * [parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] The - * version of the user managed encryption key to update through a key rotation. - * - * @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 {DataLakeStoreAccount} - 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 DataLakeStoreAccount} 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, name, parameters, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._update(resourceGroupName, name, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._update(resourceGroupName, name, parameters, options, optionalCallback); - } - } - - /** - * Deletes the specified Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} name The name of the Data Lake Store account to delete. - * - * @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, name, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, name, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} name The name of the Data Lake Store account to delete. - * - * @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, name, 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, name, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, name, options, optionalCallback); - } - } - - /** - * Gets the specified Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} name The name of the Data Lake Store account to retrieve. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - getWithHttpOperationResponse(resourceGroupName, name, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, name, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Gets the specified Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} name The name of the Data Lake Store account to retrieve. - * - * @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 {DataLakeStoreAccount} - 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 DataLakeStoreAccount} 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, name, 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, name, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, name, options, optionalCallback); - } - } - - /** - * Attempts to enable a user managed Key Vault for encryption of the specified - * Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account to - * attempt to enable the Key Vault for. - * - * @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. - */ - enableKeyVaultWithHttpOperationResponse(resourceGroupName, accountName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._enableKeyVault(resourceGroupName, accountName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Attempts to enable a user managed Key Vault for encryption of the specified - * Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} accountName The name of the Data Lake Store account to - * attempt to enable the Key Vault for. - * - * @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. - */ - enableKeyVault(resourceGroupName, accountName, 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._enableKeyVault(resourceGroupName, accountName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._enableKeyVault(resourceGroupName, accountName, options, optionalCallback); - } - } - - /** - * Lists the Data Lake Store accounts within a specific resource group. The - * response includes a link to the next page of results, if any. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account(s). - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData filter. Optional. - * - * @param {number} [options.top] The number of items to return. Optional. - * - * @param {number} [options.skip] The number of items to skip over before - * returning elements. Optional. - * - * @param {string} [options.select] OData Select statement. Limits the - * properties on each entry to just those requested, e.g. - * Categories?$select=CategoryName,Description. Optional. - * - * @param {string} [options.orderby] OrderBy clause. One or more - * comma-separated expressions with an optional "asc" (the default) or "desc" - * depending on the order you'd like the values sorted, e.g. - * Categories?$orderby=CategoryName desc. Optional. - * - * @param {boolean} [options.count] A Boolean value of true or false to request - * a count of the matching resources included with the resources in the - * response, e.g. Categories?$count=true. Optional. - * - * @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 the Data Lake Store accounts within a specific resource group. The - * response includes a link to the next page of results, if any. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account(s). - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData filter. Optional. - * - * @param {number} [options.top] The number of items to return. Optional. - * - * @param {number} [options.skip] The number of items to skip over before - * returning elements. Optional. - * - * @param {string} [options.select] OData Select statement. Limits the - * properties on each entry to just those requested, e.g. - * Categories?$select=CategoryName,Description. Optional. - * - * @param {string} [options.orderby] OrderBy clause. One or more - * comma-separated expressions with an optional "asc" (the default) or "desc" - * depending on the order you'd like the values sorted, e.g. - * Categories?$orderby=CategoryName desc. Optional. - * - * @param {boolean} [options.count] A Boolean value of true or false to request - * a count of the matching resources included with the resources in the - * response, e.g. Categories?$count=true. Optional. - * - * @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 {DataLakeStoreAccountListResult} - 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 DataLakeStoreAccountListResult} 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); - } - } - - /** - * Lists the Data Lake Store accounts within the subscription. The response - * includes a link to the next page of results, if any. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData filter. Optional. - * - * @param {number} [options.top] The number of items to return. Optional. - * - * @param {number} [options.skip] The number of items to skip over before - * returning elements. Optional. - * - * @param {string} [options.select] OData Select statement. Limits the - * properties on each entry to just those requested, e.g. - * Categories?$select=CategoryName,Description. Optional. - * - * @param {string} [options.orderby] OrderBy clause. One or more - * comma-separated expressions with an optional "asc" (the default) or "desc" - * depending on the order you'd like the values sorted, e.g. - * Categories?$orderby=CategoryName desc. Optional. - * - * @param {boolean} [options.count] The Boolean value of true or false to - * request a count of the matching resources included with the resources in the - * response, e.g. Categories?$count=true. Optional. - * - * @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 the Data Lake Store accounts within the subscription. The response - * includes a link to the next page of results, if any. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData filter. Optional. - * - * @param {number} [options.top] The number of items to return. Optional. - * - * @param {number} [options.skip] The number of items to skip over before - * returning elements. Optional. - * - * @param {string} [options.select] OData Select statement. Limits the - * properties on each entry to just those requested, e.g. - * Categories?$select=CategoryName,Description. Optional. - * - * @param {string} [options.orderby] OrderBy clause. One or more - * comma-separated expressions with an optional "asc" (the default) or "desc" - * depending on the order you'd like the values sorted, e.g. - * Categories?$orderby=CategoryName desc. Optional. - * - * @param {boolean} [options.count] The Boolean value of true or false to - * request a count of the matching resources included with the resources in the - * response, e.g. Categories?$count=true. Optional. - * - * @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 {DataLakeStoreAccountListResult} - 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 DataLakeStoreAccountListResult} 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); - } - } - - /** - * Creates the specified Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} name The name of the Data Lake Store account to create. - * - * @param {object} parameters Parameters supplied to create the Data Lake Store - * account. - * - * @param {object} [parameters.identity] The Key Vault encryption identity, if - * any. - * - * @param {string} [parameters.encryptionState] The current state of encryption - * for this Data Lake store account. Possible values include: 'Enabled', - * 'Disabled' - * - * @param {object} [parameters.encryptionConfig] The Key Vault encryption - * configuration. - * - * @param {string} parameters.encryptionConfig.type The type of encryption - * configuration being used. Currently the only supported types are - * 'UserManaged' and 'ServiceManaged'. Possible values include: 'UserManaged', - * 'ServiceManaged' - * - * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The Key Vault - * information for connecting to user managed encryption keys. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.keyVaultResourceId The resource - * identifier for the user managed Key Vault being used to encrypt. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyName The name of - * the user managed encryption key. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion The - * version of the user managed encryption key. - * - * @param {string} [parameters.firewallState] The current state of the IP - * address firewall for this Data Lake store account. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {array} [parameters.firewallRules] The list of firewall rules - * associated with this Data Lake store account. - * - * @param {string} [parameters.trustedIdProviderState] The current state of the - * trusted identity provider feature for this Data Lake store account. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {array} [parameters.trustedIdProviders] The list of trusted identity - * providers associated with this Data Lake store account. - * - * @param {string} [parameters.defaultGroup] the default owner group for all - * new folders and files created in the Data Lake Store account. - * - * @param {string} [parameters.newTier] the commitment tier to use for next - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' - * - * @param {string} [parameters.firewallAllowAzureIps] The current state of - * allowing or disallowing IPs originating within Azure through the firewall. - * If the firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {string} parameters.location Resource location - * - * @param {object} [parameters.tags] Resource tags - * - * @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, name, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreate(resourceGroupName, name, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates the specified Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} name The name of the Data Lake Store account to create. - * - * @param {object} parameters Parameters supplied to create the Data Lake Store - * account. - * - * @param {object} [parameters.identity] The Key Vault encryption identity, if - * any. - * - * @param {string} [parameters.encryptionState] The current state of encryption - * for this Data Lake store account. Possible values include: 'Enabled', - * 'Disabled' - * - * @param {object} [parameters.encryptionConfig] The Key Vault encryption - * configuration. - * - * @param {string} parameters.encryptionConfig.type The type of encryption - * configuration being used. Currently the only supported types are - * 'UserManaged' and 'ServiceManaged'. Possible values include: 'UserManaged', - * 'ServiceManaged' - * - * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The Key Vault - * information for connecting to user managed encryption keys. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.keyVaultResourceId The resource - * identifier for the user managed Key Vault being used to encrypt. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyName The name of - * the user managed encryption key. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion The - * version of the user managed encryption key. - * - * @param {string} [parameters.firewallState] The current state of the IP - * address firewall for this Data Lake store account. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {array} [parameters.firewallRules] The list of firewall rules - * associated with this Data Lake store account. - * - * @param {string} [parameters.trustedIdProviderState] The current state of the - * trusted identity provider feature for this Data Lake store account. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {array} [parameters.trustedIdProviders] The list of trusted identity - * providers associated with this Data Lake store account. - * - * @param {string} [parameters.defaultGroup] the default owner group for all - * new folders and files created in the Data Lake Store account. - * - * @param {string} [parameters.newTier] the commitment tier to use for next - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' - * - * @param {string} [parameters.firewallAllowAzureIps] The current state of - * allowing or disallowing IPs originating within Azure through the firewall. - * If the firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {string} parameters.location Resource location - * - * @param {object} [parameters.tags] Resource tags - * - * @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 {DataLakeStoreAccount} - 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 DataLakeStoreAccount} 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, name, parameters, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._beginCreate(resourceGroupName, name, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreate(resourceGroupName, name, parameters, options, optionalCallback); - } - } - - /** - * Updates the specified Data Lake Store account information. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} name The name of the Data Lake Store account to update. - * - * @param {object} parameters Parameters supplied to update the Data Lake Store - * account. - * - * @param {object} [parameters.tags] Resource tags - * - * @param {string} [parameters.firewallState] The current state of the IP - * address firewall for this Data Lake store account. Disabling the firewall - * does not remove existing rules, they will just be ignored until the firewall - * is re-enabled. Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.trustedIdProviderState] The current state of the - * trusted identity provider feature for this Data Lake store account. - * Disabling trusted identity provider functionality does not remove the - * providers, they will just be ignored until this feature is re-enabled. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.defaultGroup] the default owner group for all - * new folders and files created in the Data Lake Store account. - * - * @param {string} [parameters.newTier] the commitment tier to use for next - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' - * - * @param {string} [parameters.firewallAllowAzureIps] The current state of - * allowing or disallowing IPs originating within Azure through the firewall. - * If the firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {object} [parameters.encryptionConfig] Used for rotation of user - * managed Key Vault keys. Can only be used to rotate a user managed encryption - * Key Vault key. - * - * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The updated - * Key Vault key to use in user managed key rotation. - * - * @param {string} - * [parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] The - * version of the user managed encryption key to update through a key rotation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - beginUpdateWithHttpOperationResponse(resourceGroupName, name, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginUpdate(resourceGroupName, name, parameters, 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 specified Data Lake Store account information. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} name The name of the Data Lake Store account to update. - * - * @param {object} parameters Parameters supplied to update the Data Lake Store - * account. - * - * @param {object} [parameters.tags] Resource tags - * - * @param {string} [parameters.firewallState] The current state of the IP - * address firewall for this Data Lake store account. Disabling the firewall - * does not remove existing rules, they will just be ignored until the firewall - * is re-enabled. Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.trustedIdProviderState] The current state of the - * trusted identity provider feature for this Data Lake store account. - * Disabling trusted identity provider functionality does not remove the - * providers, they will just be ignored until this feature is re-enabled. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.defaultGroup] the default owner group for all - * new folders and files created in the Data Lake Store account. - * - * @param {string} [parameters.newTier] the commitment tier to use for next - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' - * - * @param {string} [parameters.firewallAllowAzureIps] The current state of - * allowing or disallowing IPs originating within Azure through the firewall. - * If the firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {object} [parameters.encryptionConfig] Used for rotation of user - * managed Key Vault keys. Can only be used to rotate a user managed encryption - * Key Vault key. - * - * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The updated - * Key Vault key to use in user managed key rotation. - * - * @param {string} - * [parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] The - * version of the user managed encryption key to update through a key rotation. - * - * @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 {DataLakeStoreAccount} - 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 DataLakeStoreAccount} 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, name, parameters, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._beginUpdate(resourceGroupName, name, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginUpdate(resourceGroupName, name, parameters, options, optionalCallback); - } - } - - /** - * Deletes the specified Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} name The name of the Data Lake Store account to delete. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, name, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, name, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} name The name of the Data Lake Store account to delete. - * - * @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. - */ - beginDeleteMethod(resourceGroupName, name, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, name, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, name, options, optionalCallback); - } - } - - /** - * Lists the Data Lake Store accounts within a specific resource group. The - * response includes a link to the next page of results, if any. - * - * @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 the Data Lake Store accounts within a specific resource group. The - * response includes a link to the next page of results, if any. - * - * @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 {DataLakeStoreAccountListResult} - 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 DataLakeStoreAccountListResult} 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); - } - } - - /** - * Lists the Data Lake Store accounts within the subscription. The response - * includes a link to the next page of results, if any. - * - * @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 the Data Lake Store accounts within the subscription. The response - * includes a link to the next page of results, if any. - * - * @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 {DataLakeStoreAccountListResult} - 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 DataLakeStoreAccountListResult} 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 = Account; diff --git a/lib/services/dataLake.Store/lib/account/operations/account.js b/lib/services/datalake.Store/lib/account/operations/accounts.js similarity index 82% rename from lib/services/dataLake.Store/lib/account/operations/account.js rename to lib/services/datalake.Store/lib/account/operations/accounts.js index 5df69b2cad..3cfcbf8577 100644 --- a/lib/services/dataLake.Store/lib/account/operations/account.js +++ b/lib/services/datalake.Store/lib/account/operations/accounts.js @@ -14,80 +14,242 @@ const msRest = require('ms-rest'); const msRestAzure = require('ms-rest-azure'); const WebResource = msRest.WebResource; - /** - * Creates the specified Data Lake Store account. + * Lists the Data Lake Store accounts within the subscription. The response + * includes a link to the next page of results, if any. * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. + * @param {object} [options] Optional Parameters. * - * @param {string} name The name of the Data Lake Store account to create. + * @param {string} [options.filter] OData filter. Optional. * - * @param {object} parameters Parameters supplied to create the Data Lake Store - * account. + * @param {number} [options.top] The number of items to return. Optional. * - * @param {object} [parameters.identity] The Key Vault encryption identity, if - * any. + * @param {number} [options.skip] The number of items to skip over before + * returning elements. Optional. * - * @param {string} [parameters.encryptionState] The current state of encryption - * for this Data Lake store account. Possible values include: 'Enabled', - * 'Disabled' + * @param {string} [options.select] OData Select statement. Limits the + * properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. * - * @param {object} [parameters.encryptionConfig] The Key Vault encryption - * configuration. + * @param {string} [options.orderby] OrderBy clause. One or more + * comma-separated expressions with an optional "asc" (the default) or "desc" + * depending on the order you'd like the values sorted, e.g. + * Categories?$orderby=CategoryName desc. Optional. * - * @param {string} parameters.encryptionConfig.type The type of encryption - * configuration being used. Currently the only supported types are - * 'UserManaged' and 'ServiceManaged'. Possible values include: 'UserManaged', - * 'ServiceManaged' + * @param {boolean} [options.count] The Boolean value of true or false to + * request a count of the matching resources included with the resources in the + * response, e.g. Categories?$count=true. Optional. * - * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The Key Vault - * information for connecting to user managed encryption keys. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.keyVaultResourceId The resource - * identifier for the user managed Key Vault being used to encrypt. + * @param {function} callback - The callback. * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyName The name of - * the user managed encryption key. + * @returns {function} callback(err, result, request, response) * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion The - * version of the user managed encryption key. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {string} [parameters.firewallState] The current state of the IP - * address firewall for this Data Lake store account. Possible values include: - * 'Enabled', 'Disabled' + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DataLakeStoreAccountListResult} for more + * information. * - * @param {array} [parameters.firewallRules] The list of firewall rules - * associated with this Data Lake store account. + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [parameters.trustedIdProviderState] The current state of the - * trusted identity provider feature for this Data Lake store account. Possible - * values include: 'Enabled', 'Disabled' + * {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 filter = (options && options.filter !== undefined) ? options.filter : undefined; + let top = (options && options.top !== undefined) ? options.top : undefined; + let skip = (options && options.skip !== undefined) ? options.skip : undefined; + let select = (options && options.select !== undefined) ? options.select : undefined; + let orderby = (options && options.orderby !== undefined) ? options.orderby : undefined; + let count = (options && options.count !== undefined) ? options.count : 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 (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter must be of type string.'); + } + if (top !== null && top !== undefined && typeof top !== 'number') { + throw new Error('top must be of type number.'); + } + if (top !== null && top !== undefined) { + if (top < 1) + { + throw new Error('"top" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + if (skip !== null && skip !== undefined && typeof skip !== 'number') { + throw new Error('skip must be of type number.'); + } + if (skip !== null && skip !== undefined) { + if (skip < 1) + { + throw new Error('"skip" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + if (select !== null && select !== undefined && typeof select.valueOf() !== 'string') { + throw new Error('select must be of type string.'); + } + if (orderby !== null && orderby !== undefined && typeof orderby.valueOf() !== 'string') { + throw new Error('orderby must be of type string.'); + } + if (count !== null && count !== undefined && typeof count !== 'boolean') { + throw new Error('count must be of type boolean.'); + } + 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}/providers/Microsoft.DataLakeStore/accounts'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + encodeURIComponent(filter)); + } + if (top !== null && top !== undefined) { + queryParameters.push('$top=' + encodeURIComponent(top.toString())); + } + if (skip !== null && skip !== undefined) { + queryParameters.push('$skip=' + encodeURIComponent(skip.toString())); + } + if (select !== null && select !== undefined) { + queryParameters.push('$select=' + encodeURIComponent(select)); + } + if (orderby !== null && orderby !== undefined) { + queryParameters.push('$orderby=' + encodeURIComponent(orderby)); + } + if (count !== null && count !== undefined) { + queryParameters.push('$count=' + encodeURIComponent(count.toString())); + } + 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['DataLakeStoreAccountListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists the Data Lake Store accounts within a specific resource group. The + * response includes a link to the next page of results, if any. * - * @param {array} [parameters.trustedIdProviders] The list of trusted identity - * providers associated with this Data Lake store account. + * @param {string} resourceGroupName The name of the Azure resource group. * - * @param {string} [parameters.defaultGroup] the default owner group for all - * new folders and files created in the Data Lake Store account. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.newTier] the commitment tier to use for next - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' + * @param {string} [options.filter] OData filter. Optional. * - * @param {string} [parameters.firewallAllowAzureIps] The current state of - * allowing or disallowing IPs originating within Azure through the firewall. - * If the firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' + * @param {number} [options.top] The number of items to return. Optional. * - * @param {string} parameters.location Resource location + * @param {number} [options.skip] The number of items to skip over before + * returning elements. Optional. * - * @param {object} [parameters.tags] Resource tags + * @param {string} [options.select] OData Select statement. Limits the + * properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. * - * @param {object} [options] Optional Parameters. + * @param {string} [options.orderby] OrderBy clause. One or more + * comma-separated expressions with an optional "asc" (the default) or "desc" + * depending on the order you'd like the values sorted, e.g. + * Categories?$orderby=CategoryName desc. Optional. + * + * @param {boolean} [options.count] A Boolean value of true or false to request + * a count of the matching resources included with the resources in the + * response, e.g. Categories?$count=true. Optional. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -99,50 +261,169 @@ const WebResource = msRest.WebResource; * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DataLakeStoreAccount} for more information. + * See {@link DataLakeStoreAccountListResult} 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, name, parameters, options, callback) { +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 filter = (options && options.filter !== undefined) ? options.filter : undefined; + let top = (options && options.top !== undefined) ? options.top : undefined; + let skip = (options && options.skip !== undefined) ? options.skip : undefined; + let select = (options && options.select !== undefined) ? options.select : undefined; + let orderby = (options && options.orderby !== undefined) ? options.orderby : undefined; + let count = (options && options.count !== undefined) ? options.count : 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 (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter must be of type string.'); + } + if (top !== null && top !== undefined && typeof top !== 'number') { + throw new Error('top must be of type number.'); + } + if (top !== null && top !== undefined) { + if (top < 1) + { + throw new Error('"top" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + if (skip !== null && skip !== undefined && typeof skip !== 'number') { + throw new Error('skip must be of type number.'); + } + if (skip !== null && skip !== undefined) { + if (skip < 1) + { + throw new Error('"skip" should satisfy the constraint - "InclusiveMinimum": 1'); + } + } + if (select !== null && select !== undefined && typeof select.valueOf() !== 'string') { + throw new Error('select must be of type string.'); + } + if (orderby !== null && orderby !== undefined && typeof orderby.valueOf() !== 'string') { + throw new Error('orderby must be of type string.'); + } + if (count !== null && count !== undefined && typeof count !== 'boolean') { + throw new Error('count must be of type boolean.'); + } + 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); + } - // Send request - this.beginCreate(resourceGroupName, name, parameters, 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; + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + let queryParameters = []; + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + encodeURIComponent(filter)); + } + if (top !== null && top !== undefined) { + queryParameters.push('$top=' + encodeURIComponent(top.toString())); + } + if (skip !== null && skip !== undefined) { + queryParameters.push('$skip=' + encodeURIComponent(skip.toString())); + } + if (select !== null && select !== undefined) { + queryParameters.push('$select=' + encodeURIComponent(select)); + } + if (orderby !== null && orderby !== undefined) { + queryParameters.push('$orderby=' + encodeURIComponent(orderby)); + } + if (count !== null && count !== undefined) { + queryParameters.push('$count=' + encodeURIComponent(count.toString())); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; + // 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; - - // Deserialize Response + 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['DataLakeStoreAccount']().mapper(); + let resultMapper = new client.models['DataLakeStoreAccountListResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -151,60 +432,86 @@ function _create(resourceGroupName, name, parameters, options, callback) { deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } + } - return callback(null, result, httpRequest, response); - }); + return callback(null, result, httpRequest, response); }); } /** - * Updates the specified Data Lake Store account information. + * Creates the specified Data Lake Store account. * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. + * @param {string} resourceGroupName The name of the Azure resource group. * - * @param {string} name The name of the Data Lake Store account to update. + * @param {string} accountName The name of the Data Lake Store account. * - * @param {object} parameters Parameters supplied to update the Data Lake Store + * @param {object} parameters Parameters supplied to create the Data Lake Store * account. * - * @param {object} [parameters.tags] Resource tags + * @param {string} parameters.location The resource location. * - * @param {string} [parameters.firewallState] The current state of the IP - * address firewall for this Data Lake store account. Disabling the firewall - * does not remove existing rules, they will just be ignored until the firewall - * is re-enabled. Possible values include: 'Enabled', 'Disabled' + * @param {object} [parameters.tags] The resource tags. * - * @param {string} [parameters.trustedIdProviderState] The current state of the - * trusted identity provider feature for this Data Lake store account. - * Disabling trusted identity provider functionality does not remove the - * providers, they will just be ignored until this feature is re-enabled. - * Possible values include: 'Enabled', 'Disabled' + * @param {object} [parameters.identity] The Key Vault encryption identity, if + * any. * - * @param {string} [parameters.defaultGroup] the default owner group for all + * @param {string} [parameters.defaultGroup] The default owner group for all * new folders and files created in the Data Lake Store account. * - * @param {string} [parameters.newTier] the commitment tier to use for next - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' + * @param {object} [parameters.encryptionConfig] The Key Vault encryption + * configuration. + * + * @param {string} parameters.encryptionConfig.type The type of encryption + * configuration being used. Currently the only supported types are + * 'UserManaged' and 'ServiceManaged'. Possible values include: 'UserManaged', + * 'ServiceManaged' + * + * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The Key Vault + * information for connecting to user managed encryption keys. + * + * @param {string} + * parameters.encryptionConfig.keyVaultMetaInfo.keyVaultResourceId The resource + * identifier for the user managed Key Vault being used to encrypt. + * + * @param {string} + * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyName The name of + * the user managed encryption key. + * + * @param {string} + * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion The + * version of the user managed encryption key. + * + * @param {string} [parameters.encryptionState] The current state of encryption + * for this Data Lake Store account. Possible values include: 'Enabled', + * 'Disabled' + * + * @param {array} [parameters.firewallRules] The list of firewall rules + * associated with this Data Lake Store account. + * + * @param {array} [parameters.virtualNetworkRules] The list of virtual network + * rules associated with this Data Lake Store account. + * + * @param {string} [parameters.firewallState] The current state of the IP + * address firewall for this Data Lake Store account. Possible values include: + * 'Enabled', 'Disabled' * * @param {string} [parameters.firewallAllowAzureIps] The current state of * allowing or disallowing IPs originating within Azure through the firewall. * If the firewall is disabled, this is not enforced. Possible values include: * 'Enabled', 'Disabled' * - * @param {object} [parameters.encryptionConfig] Used for rotation of user - * managed Key Vault keys. Can only be used to rotate a user managed encryption - * Key Vault key. + * @param {array} [parameters.trustedIdProviders] The list of trusted identity + * providers associated with this Data Lake Store account. * - * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The updated - * Key Vault key to use in user managed key rotation. + * @param {string} [parameters.trustedIdProviderState] The current state of the + * trusted identity provider feature for this Data Lake Store account. Possible + * values include: 'Enabled', 'Disabled' * - * @param {string} - * [parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] The - * version of the user managed encryption key to update through a key rotation. + * @param {string} [parameters.newTier] The commitment tier to use for next + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' * * @param {object} [options] Optional Parameters. * @@ -224,7 +531,7 @@ function _create(resourceGroupName, name, parameters, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _update(resourceGroupName, name, parameters, options, callback) { +function _create(resourceGroupName, accountName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -237,7 +544,7 @@ function _update(resourceGroupName, name, parameters, options, callback) { } // Send request - this.beginUpdate(resourceGroupName, name, parameters, options, (err, parsedResult, httpRequest, response) => { + this.beginCreate(resourceGroupName, accountName, parameters, options, (err, parsedResult, httpRequest, response) => { if (err) return callback(err); let initialResult = new msRest.HttpOperationResponse(); @@ -276,77 +583,12 @@ function _update(resourceGroupName, name, parameters, options, callback) { }); } - -/** - * Deletes the specified Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} name The name of the Data Lake Store account to delete. - * - * @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, name, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - - if (!callback) { - throw new Error('callback cannot be null.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, name, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - /** * Gets the specified Data Lake Store account. * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. + * @param {string} resourceGroupName The name of the Azure resource group. * - * @param {string} name The name of the Data Lake Store account to retrieve. + * @param {string} accountName The name of the Data Lake Store account. * * @param {object} [options] Optional Parameters. * @@ -366,7 +608,7 @@ function _deleteMethod(resourceGroupName, name, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _get(resourceGroupName, name, options, callback) { +function _get(resourceGroupName, accountName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -378,18 +620,18 @@ function _get(resourceGroupName, name, options, callback) { } // Validate try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (name === null || name === undefined || typeof name.valueOf() !== 'string') { - throw new Error('name cannot be null or undefined and it must be of type string.'); + if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -399,10 +641,10 @@ function _get(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{name}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { @@ -480,21 +722,146 @@ function _get(resourceGroupName, name, options, callback) { deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } - } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Updates the specified Data Lake Store account information. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {object} parameters Parameters supplied to update the Data Lake Store + * account. + * + * @param {object} [parameters.tags] Resource tags + * + * @param {string} [parameters.defaultGroup] The default owner group for all + * new folders and files created in the Data Lake Store account. + * + * @param {object} [parameters.encryptionConfig] Used for rotation of user + * managed Key Vault keys. Can only be used to rotate a user managed encryption + * Key Vault key. + * + * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The updated + * Key Vault key to use in user managed key rotation. + * + * @param {string} + * [parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] The + * version of the user managed encryption key to update through a key rotation. + * + * @param {array} [parameters.firewallRules] The list of firewall rules + * associated with this Data Lake Store account. + * + * @param {array} [parameters.virtualNetworkRules] The list of virtual network + * rules associated with this Data Lake Store account. + * + * @param {string} [parameters.firewallState] The current state of the IP + * address firewall for this Data Lake Store account. Disabling the firewall + * does not remove existing rules, they will just be ignored until the firewall + * is re-enabled. Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.firewallAllowAzureIps] The current state of + * allowing or disallowing IPs originating within Azure through the firewall. + * If the firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * + * @param {array} [parameters.trustedIdProviders] The list of trusted identity + * providers associated with this Data Lake Store account. + * + * @param {string} [parameters.trustedIdProviderState] The current state of the + * trusted identity provider feature for this Data Lake Store account. + * Disabling trusted identity provider functionality does not remove the + * providers, they will just be ignored until this feature is re-enabled. + * Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.newTier] The commitment tier to use for next + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' + * + * @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 DataLakeStoreAccount} 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, accountName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginUpdate(resourceGroupName, accountName, parameters, 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['DataLakeStoreAccount']().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); + return callback(null, result, httpRequest, response); + }); }); } + /** - * Attempts to enable a user managed Key Vault for encryption of the specified - * Data Lake Store account. + * Deletes the specified Data Lake Store account. * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. + * @param {string} resourceGroupName The name of the Azure resource group. * - * @param {string} accountName The name of the Data Lake Store account to - * attempt to enable the Key Vault for. + * @param {string} accountName The name of the Data Lake Store account. * * @param {object} [options] Optional Parameters. * @@ -513,137 +880,53 @@ function _get(resourceGroupName, name, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _enableKeyVault(resourceGroupName, accountName, options, callback) { +function _deleteMethod(resourceGroupName, accountName, 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 (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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/enableKeyVault'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } + // Send request + this.beginDeleteMethod(resourceGroupName, accountName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); - // 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); + 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; - 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); + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); }); } /** - * Lists the Data Lake Store accounts within a specific resource group. The - * response includes a link to the next page of results, if any. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account(s). - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData filter. Optional. - * - * @param {number} [options.top] The number of items to return. Optional. - * - * @param {number} [options.skip] The number of items to skip over before - * returning elements. Optional. + * Attempts to enable a user managed Key Vault for encryption of the specified + * Data Lake Store account. * - * @param {string} [options.select] OData Select statement. Limits the - * properties on each entry to just those requested, e.g. - * Categories?$select=CategoryName,Description. Optional. + * @param {string} resourceGroupName The name of the Azure resource group. * - * @param {string} [options.orderby] OrderBy clause. One or more - * comma-separated expressions with an optional "asc" (the default) or "desc" - * depending on the order you'd like the values sorted, e.g. - * Categories?$orderby=CategoryName desc. Optional. + * @param {string} accountName The name of the Data Lake Store account. * - * @param {boolean} [options.count] A Boolean value of true or false to request - * a count of the matching resources included with the resources in the - * response, e.g. Categories?$count=true. Optional. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -654,15 +937,13 @@ function _enableKeyVault(resourceGroupName, accountName, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DataLakeStoreAccountListResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listByResourceGroup(resourceGroupName, options, callback) { +function _enableKeyVault(resourceGroupName, accountName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -672,53 +953,20 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let top = (options && options.top !== undefined) ? options.top : undefined; - let skip = (options && options.skip !== undefined) ? options.skip : undefined; - let select = (options && options.select !== undefined) ? options.select : undefined; - let orderby = (options && options.orderby !== undefined) ? options.orderby : undefined; - let count = (options && options.count !== undefined) ? options.count : 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 (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { - throw new Error('filter must be of type string.'); - } - if (top !== null && top !== undefined && typeof top !== 'number') { - throw new Error('top must be of type number.'); - } - if (top !== null && top !== undefined) { - if (top < 1) - { - throw new Error('"top" should satisfy the constraint - "InclusiveMinimum": 1'); - } - } - if (skip !== null && skip !== undefined && typeof skip !== 'number') { - throw new Error('skip must be of type number.'); - } - if (skip !== null && skip !== undefined) { - if (skip < 1) - { - throw new Error('"skip" should satisfy the constraint - "InclusiveMinimum": 1'); - } - } - if (select !== null && select !== undefined && typeof select.valueOf() !== 'string') { - throw new Error('select must be of type string.'); - } - if (orderby !== null && orderby !== undefined && typeof orderby.valueOf() !== 'string') { - throw new Error('orderby must be of type string.'); - } - if (count !== null && count !== undefined && typeof count !== 'boolean') { - throw new Error('count must be of type boolean.'); + if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -728,28 +976,11 @@ function _listByResourceGroup(resourceGroupName, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}/enableKeyVault'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); let queryParameters = []; - if (filter !== null && filter !== undefined) { - queryParameters.push('$filter=' + encodeURIComponent(filter)); - } - if (top !== null && top !== undefined) { - queryParameters.push('$top=' + encodeURIComponent(top.toString())); - } - if (skip !== null && skip !== undefined) { - queryParameters.push('$skip=' + encodeURIComponent(skip.toString())); - } - if (select !== null && select !== undefined) { - queryParameters.push('$select=' + encodeURIComponent(select)); - } - if (orderby !== null && orderby !== undefined) { - queryParameters.push('$orderby=' + encodeURIComponent(orderby)); - } - if (count !== null && count !== undefined) { - queryParameters.push('$count=' + encodeURIComponent(count.toString())); - } queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); @@ -757,7 +988,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -810,53 +1041,23 @@ function _listByResourceGroup(resourceGroupName, options, callback) { // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DataLakeStoreAccountListResult']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); } /** - * Lists the Data Lake Store accounts within the subscription. The response - * includes a link to the next page of results, if any. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData filter. Optional. + * Checks whether the specified account name is available or taken. * - * @param {number} [options.top] The number of items to return. Optional. - * - * @param {number} [options.skip] The number of items to skip over before - * returning elements. Optional. + * @param {string} location The resource location without whitespace. * - * @param {string} [options.select] OData Select statement. Limits the - * properties on each entry to just those requested, e.g. - * Categories?$select=CategoryName,Description. Optional. + * @param {object} parameters Parameters supplied to check the Data Lake Store + * account name availability. * - * @param {string} [options.orderby] OrderBy clause. One or more - * comma-separated expressions with an optional "asc" (the default) or "desc" - * depending on the order you'd like the values sorted, e.g. - * Categories?$orderby=CategoryName desc. Optional. + * @param {string} parameters.name The Data Lake Store name to check + * availability for. * - * @param {boolean} [options.count] The Boolean value of true or false to - * request a count of the matching resources included with the resources in the - * response, e.g. Categories?$count=true. Optional. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -868,14 +1069,14 @@ function _listByResourceGroup(resourceGroupName, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DataLakeStoreAccountListResult} for more + * See {@link NameAvailabilityInformation} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _list(options, callback) { +function _checkNameAvailability(location, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -885,50 +1086,24 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let top = (options && options.top !== undefined) ? options.top : undefined; - let skip = (options && options.skip !== undefined) ? options.skip : undefined; - let select = (options && options.select !== undefined) ? options.select : undefined; - let orderby = (options && options.orderby !== undefined) ? options.orderby : undefined; - let count = (options && options.count !== undefined) ? options.count : undefined; + if (parameters === null || parameters === undefined) + { + parameters = {}; + } // Validate try { - if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { - throw new Error('filter must be of type string.'); - } - if (top !== null && top !== undefined && typeof top !== 'number') { - throw new Error('top must be of type number.'); - } - if (top !== null && top !== undefined) { - if (top < 1) - { - throw new Error('"top" should satisfy the constraint - "InclusiveMinimum": 1'); - } - } - if (skip !== null && skip !== undefined && typeof skip !== 'number') { - throw new Error('skip must be of type number.'); - } - if (skip !== null && skip !== undefined) { - if (skip < 1) - { - throw new Error('"skip" should satisfy the constraint - "InclusiveMinimum": 1'); - } - } - if (select !== null && select !== undefined && typeof select.valueOf() !== 'string') { - throw new Error('select must be of type string.'); + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (orderby !== null && orderby !== undefined && typeof orderby.valueOf() !== 'string') { - throw new Error('orderby 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 (count !== null && count !== undefined && typeof count !== 'boolean') { - throw new Error('count must be of type boolean.'); + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); } 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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -938,27 +1113,10 @@ function _list(options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.DataLakeStore/accounts'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.DataLakeStore/locations/{location}/checkNameAvailability'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{location}', encodeURIComponent(location)); let queryParameters = []; - if (filter !== null && filter !== undefined) { - queryParameters.push('$filter=' + encodeURIComponent(filter)); - } - if (top !== null && top !== undefined) { - queryParameters.push('$top=' + encodeURIComponent(top.toString())); - } - if (skip !== null && skip !== undefined) { - queryParameters.push('$skip=' + encodeURIComponent(skip.toString())); - } - if (select !== null && select !== undefined) { - queryParameters.push('$select=' + encodeURIComponent(select)); - } - if (orderby !== null && orderby !== undefined) { - queryParameters.push('$orderby=' + encodeURIComponent(orderby)); - } - if (count !== null && count !== undefined) { - queryParameters.push('$count=' + encodeURIComponent(count.toString())); - } queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); @@ -966,7 +1124,7 @@ function _list(options, callback) { // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -984,7 +1142,21 @@ function _list(options, callback) { } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['CheckNameAvailabilityParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -1026,7 +1198,7 @@ function _list(options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DataLakeStoreAccountListResult']().mapper(); + let resultMapper = new client.models['NameAvailabilityInformation']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1044,20 +1216,22 @@ function _list(options, callback) { /** * Creates the specified Data Lake Store account. * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. + * @param {string} resourceGroupName The name of the Azure resource group. * - * @param {string} name The name of the Data Lake Store account to create. + * @param {string} accountName The name of the Data Lake Store account. * * @param {object} parameters Parameters supplied to create the Data Lake Store * account. * + * @param {string} parameters.location The resource location. + * + * @param {object} [parameters.tags] The resource tags. + * * @param {object} [parameters.identity] The Key Vault encryption identity, if * any. * - * @param {string} [parameters.encryptionState] The current state of encryption - * for this Data Lake store account. Possible values include: 'Enabled', - * 'Disabled' + * @param {string} [parameters.defaultGroup] The default owner group for all + * new folders and files created in the Data Lake Store account. * * @param {object} [parameters.encryptionConfig] The Key Vault encryption * configuration. @@ -1082,36 +1256,36 @@ function _list(options, callback) { * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion The * version of the user managed encryption key. * - * @param {string} [parameters.firewallState] The current state of the IP - * address firewall for this Data Lake store account. Possible values include: - * 'Enabled', 'Disabled' + * @param {string} [parameters.encryptionState] The current state of encryption + * for this Data Lake Store account. Possible values include: 'Enabled', + * 'Disabled' * * @param {array} [parameters.firewallRules] The list of firewall rules - * associated with this Data Lake store account. - * - * @param {string} [parameters.trustedIdProviderState] The current state of the - * trusted identity provider feature for this Data Lake store account. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {array} [parameters.trustedIdProviders] The list of trusted identity - * providers associated with this Data Lake store account. + * associated with this Data Lake Store account. * - * @param {string} [parameters.defaultGroup] the default owner group for all - * new folders and files created in the Data Lake Store account. + * @param {array} [parameters.virtualNetworkRules] The list of virtual network + * rules associated with this Data Lake Store account. * - * @param {string} [parameters.newTier] the commitment tier to use for next - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' + * @param {string} [parameters.firewallState] The current state of the IP + * address firewall for this Data Lake Store account. Possible values include: + * 'Enabled', 'Disabled' * * @param {string} [parameters.firewallAllowAzureIps] The current state of * allowing or disallowing IPs originating within Azure through the firewall. * If the firewall is disabled, this is not enforced. Possible values include: * 'Enabled', 'Disabled' * - * @param {string} parameters.location Resource location + * @param {array} [parameters.trustedIdProviders] The list of trusted identity + * providers associated with this Data Lake Store account. * - * @param {object} [parameters.tags] Resource tags + * @param {string} [parameters.trustedIdProviderState] The current state of the + * trusted identity provider feature for this Data Lake Store account. Possible + * values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.newTier] The commitment tier to use for next + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' * * @param {object} [options] Optional Parameters. * @@ -1131,7 +1305,7 @@ function _list(options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginCreate(resourceGroupName, name, parameters, options, callback) { +function _beginCreate(resourceGroupName, accountName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1147,11 +1321,14 @@ function _beginCreate(resourceGroupName, name, parameters, options, callback) { } // Validate try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (name === null || name === undefined || typeof name.valueOf() !== 'string') { - throw new Error('name cannot be null or undefined and it must be of type string.'); + if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); } if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); @@ -1159,9 +1336,6 @@ function _beginCreate(resourceGroupName, name, parameters, options, callback) { 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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1171,10 +1345,10 @@ function _beginCreate(resourceGroupName, name, parameters, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{name}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { @@ -1206,7 +1380,7 @@ function _beginCreate(resourceGroupName, name, parameters, options, callback) { let requestModel = null; try { if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['DataLakeStoreAccount']().mapper(); + let requestModelMapper = new client.models['CreateDataLakeStoreAccountParameters']().mapper(); requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); requestContent = JSON.stringify(requestModel); } @@ -1292,40 +1466,18 @@ function _beginCreate(resourceGroupName, name, parameters, options, callback) { /** * Updates the specified Data Lake Store account information. * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. + * @param {string} resourceGroupName The name of the Azure resource group. * - * @param {string} name The name of the Data Lake Store account to update. + * @param {string} accountName The name of the Data Lake Store account. * * @param {object} parameters Parameters supplied to update the Data Lake Store * account. * * @param {object} [parameters.tags] Resource tags * - * @param {string} [parameters.firewallState] The current state of the IP - * address firewall for this Data Lake store account. Disabling the firewall - * does not remove existing rules, they will just be ignored until the firewall - * is re-enabled. Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.trustedIdProviderState] The current state of the - * trusted identity provider feature for this Data Lake store account. - * Disabling trusted identity provider functionality does not remove the - * providers, they will just be ignored until this feature is re-enabled. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.defaultGroup] the default owner group for all + * @param {string} [parameters.defaultGroup] The default owner group for all * new folders and files created in the Data Lake Store account. * - * @param {string} [parameters.newTier] the commitment tier to use for next - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' - * - * @param {string} [parameters.firewallAllowAzureIps] The current state of - * allowing or disallowing IPs originating within Azure through the firewall. - * If the firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' - * * @param {object} [parameters.encryptionConfig] Used for rotation of user * managed Key Vault keys. Can only be used to rotate a user managed encryption * Key Vault key. @@ -1337,6 +1489,36 @@ function _beginCreate(resourceGroupName, name, parameters, options, callback) { * [parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] The * version of the user managed encryption key to update through a key rotation. * + * @param {array} [parameters.firewallRules] The list of firewall rules + * associated with this Data Lake Store account. + * + * @param {array} [parameters.virtualNetworkRules] The list of virtual network + * rules associated with this Data Lake Store account. + * + * @param {string} [parameters.firewallState] The current state of the IP + * address firewall for this Data Lake Store account. Disabling the firewall + * does not remove existing rules, they will just be ignored until the firewall + * is re-enabled. Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.firewallAllowAzureIps] The current state of + * allowing or disallowing IPs originating within Azure through the firewall. + * If the firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * + * @param {array} [parameters.trustedIdProviders] The list of trusted identity + * providers associated with this Data Lake Store account. + * + * @param {string} [parameters.trustedIdProviderState] The current state of the + * trusted identity provider feature for this Data Lake Store account. + * Disabling trusted identity provider functionality does not remove the + * providers, they will just be ignored until this feature is re-enabled. + * Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.newTier] The commitment tier to use for next + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1355,7 +1537,7 @@ function _beginCreate(resourceGroupName, name, parameters, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginUpdate(resourceGroupName, name, parameters, options, callback) { +function _beginUpdate(resourceGroupName, accountName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1367,11 +1549,14 @@ function _beginUpdate(resourceGroupName, name, parameters, options, callback) { } // Validate try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (name === null || name === undefined || typeof name.valueOf() !== 'string') { - throw new Error('name cannot be null or undefined and it must be of type string.'); + if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); } if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); @@ -1379,9 +1564,6 @@ function _beginUpdate(resourceGroupName, name, parameters, options, callback) { 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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1391,10 +1573,10 @@ function _beginUpdate(resourceGroupName, name, parameters, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{name}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { @@ -1426,7 +1608,7 @@ function _beginUpdate(resourceGroupName, name, parameters, options, callback) { let requestModel = null; try { if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['DataLakeStoreAccountUpdateParameters']().mapper(); + let requestModelMapper = new client.models['UpdateDataLakeStoreAccountParameters']().mapper(); requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); requestContent = JSON.stringify(requestModel); } @@ -1442,7 +1624,7 @@ function _beginUpdate(resourceGroupName, name, parameters, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1504,6 +1686,23 @@ function _beginUpdate(resourceGroupName, name, parameters, options, callback) { return callback(deserializationError1); } } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DataLakeStoreAccount']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError2 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError2.request = msRest.stripRequest(httpRequest); + deserializationError2.response = msRest.stripResponse(response); + return callback(deserializationError2); + } + } return callback(null, result, httpRequest, response); }); @@ -1512,10 +1711,9 @@ function _beginUpdate(resourceGroupName, name, parameters, options, callback) { /** * Deletes the specified Data Lake Store account. * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. + * @param {string} resourceGroupName The name of the Azure resource group. * - * @param {string} name The name of the Data Lake Store account to delete. + * @param {string} accountName The name of the Data Lake Store account. * * @param {object} [options] Optional Parameters. * @@ -1534,7 +1732,7 @@ function _beginUpdate(resourceGroupName, name, parameters, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginDeleteMethod(resourceGroupName, name, options, callback) { +function _beginDeleteMethod(resourceGroupName, accountName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1546,18 +1744,18 @@ function _beginDeleteMethod(resourceGroupName, name, options, callback) { } // Validate try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (name === null || name === undefined || typeof name.valueOf() !== 'string') { - throw new Error('name cannot be null or undefined and it must be of type string.'); + if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1567,10 +1765,10 @@ function _beginDeleteMethod(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{name}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/{accountName}'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { @@ -1638,8 +1836,8 @@ function _beginDeleteMethod(resourceGroupName, name, options, callback) { } /** - * Lists the Data Lake Store accounts within a specific resource group. The - * response includes a link to the next page of results, if any. + * Lists the Data Lake Store accounts within the subscription. The response + * includes a link to the next page of results, if any. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -1663,7 +1861,7 @@ function _beginDeleteMethod(resourceGroupName, name, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listByResourceGroupNext(nextPageLink, options, callback) { +function _listNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1767,8 +1965,8 @@ function _listByResourceGroupNext(nextPageLink, options, callback) { } /** - * Lists the Data Lake Store accounts within the subscription. The response - * includes a link to the next page of results, if any. + * Lists the Data Lake Store accounts within a specific resource group. The + * response includes a link to the next page of results, if any. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -1792,7 +1990,7 @@ function _listByResourceGroupNext(nextPageLink, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listNext(nextPageLink, options, callback) { +function _listByResourceGroupNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1895,116 +2093,192 @@ function _listNext(nextPageLink, options, callback) { }); } -/** Class representing a Account. */ -class Account { +/** Class representing a Accounts. */ +class Accounts { /** - * Create a Account. + * Create a Accounts. * @param {DataLakeStoreAccountManagementClient} client Reference to the service client. */ - constructor(client) { - this.client = client; - this._create = _create; - this._update = _update; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._enableKeyVault = _enableKeyVault; - this._listByResourceGroup = _listByResourceGroup; - this._list = _list; - this._beginCreate = _beginCreate; - this._beginUpdate = _beginUpdate; - this._beginDeleteMethod = _beginDeleteMethod; - this._listByResourceGroupNext = _listByResourceGroupNext; - this._listNext = _listNext; + constructor(client) { + this.client = client; + this._list = _list; + this._listByResourceGroup = _listByResourceGroup; + this._create = _create; + this._get = _get; + this._update = _update; + this._deleteMethod = _deleteMethod; + this._enableKeyVault = _enableKeyVault; + this._checkNameAvailability = _checkNameAvailability; + this._beginCreate = _beginCreate; + this._beginUpdate = _beginUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._listNext = _listNext; + this._listByResourceGroupNext = _listByResourceGroupNext; + } + + /** + * Lists the Data Lake Store accounts within the subscription. The response + * includes a link to the next page of results, if any. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] OData filter. Optional. + * + * @param {number} [options.top] The number of items to return. Optional. + * + * @param {number} [options.skip] The number of items to skip over before + * returning elements. Optional. + * + * @param {string} [options.select] OData Select statement. Limits the + * properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. + * + * @param {string} [options.orderby] OrderBy clause. One or more + * comma-separated expressions with an optional "asc" (the default) or "desc" + * depending on the order you'd like the values sorted, e.g. + * Categories?$orderby=CategoryName desc. Optional. + * + * @param {boolean} [options.count] The Boolean value of true or false to + * request a count of the matching resources included with the resources in the + * response, e.g. Categories?$count=true. Optional. + * + * @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; + }); + }); } /** - * Creates the specified Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. + * Lists the Data Lake Store accounts within the subscription. The response + * includes a link to the next page of results, if any. * - * @param {string} name The name of the Data Lake Store account to create. + * @param {object} [options] Optional Parameters. * - * @param {object} parameters Parameters supplied to create the Data Lake Store - * account. + * @param {string} [options.filter] OData filter. Optional. * - * @param {object} [parameters.identity] The Key Vault encryption identity, if - * any. + * @param {number} [options.top] The number of items to return. Optional. * - * @param {string} [parameters.encryptionState] The current state of encryption - * for this Data Lake store account. Possible values include: 'Enabled', - * 'Disabled' + * @param {number} [options.skip] The number of items to skip over before + * returning elements. Optional. * - * @param {object} [parameters.encryptionConfig] The Key Vault encryption - * configuration. + * @param {string} [options.select] OData Select statement. Limits the + * properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. * - * @param {string} parameters.encryptionConfig.type The type of encryption - * configuration being used. Currently the only supported types are - * 'UserManaged' and 'ServiceManaged'. Possible values include: 'UserManaged', - * 'ServiceManaged' + * @param {string} [options.orderby] OrderBy clause. One or more + * comma-separated expressions with an optional "asc" (the default) or "desc" + * depending on the order you'd like the values sorted, e.g. + * Categories?$orderby=CategoryName desc. Optional. * - * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The Key Vault - * information for connecting to user managed encryption keys. + * @param {boolean} [options.count] The Boolean value of true or false to + * request a count of the matching resources included with the resources in the + * response, e.g. Categories?$count=true. Optional. * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.keyVaultResourceId The resource - * identifier for the user managed Key Vault being used to encrypt. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyName The name of - * the user managed encryption key. + * @param {function} [optionalCallback] - The optional callback. * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion The - * version of the user managed encryption key. + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. * - * @param {string} [parameters.firewallState] The current state of the IP - * address firewall for this Data Lake store account. Possible values include: - * 'Enabled', 'Disabled' + * {Promise} A promise is returned * - * @param {array} [parameters.firewallRules] The list of firewall rules - * associated with this Data Lake store account. + * @resolve {DataLakeStoreAccountListResult} - The deserialized result object. * - * @param {string} [parameters.trustedIdProviderState] The current state of the - * trusted identity provider feature for this Data Lake store account. Possible - * values include: 'Enabled', 'Disabled' + * @reject {Error} - The error object. * - * @param {array} [parameters.trustedIdProviders] The list of trusted identity - * providers associated with this Data Lake store account. + * {function} optionalCallback(err, result, request, response) * - * @param {string} [parameters.defaultGroup] the default owner group for all - * new folders and files created in the Data Lake Store account. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {string} [parameters.newTier] the commitment tier to use for next - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DataLakeStoreAccountListResult} for more + * information. * - * @param {string} [parameters.firewallAllowAzureIps] The current state of - * allowing or disallowing IPs originating within Azure through the firewall. - * If the firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {string} parameters.location Resource location + * {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 the Data Lake Store accounts within a specific resource group. The + * response includes a link to the next page of results, if any. * - * @param {object} [parameters.tags] Resource tags + * @param {string} resourceGroupName The name of the Azure resource group. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.filter] OData filter. Optional. + * + * @param {number} [options.top] The number of items to return. Optional. + * + * @param {number} [options.skip] The number of items to skip over before + * returning elements. Optional. + * + * @param {string} [options.select] OData Select statement. Limits the + * properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. + * + * @param {string} [options.orderby] OrderBy clause. One or more + * comma-separated expressions with an optional "asc" (the default) or "desc" + * depending on the order you'd like the values sorted, e.g. + * Categories?$orderby=CategoryName desc. Optional. + * + * @param {boolean} [options.count] A Boolean value of true or false to request + * a count of the matching resources included with the resources in the + * response, e.g. Categories?$count=true. Optional. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - createWithHttpOperationResponse(resourceGroupName, name, parameters, options) { + listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._create(resourceGroupName, name, parameters, options, (err, result, request, response) => { + self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -2015,78 +2289,32 @@ class Account { } /** - * Creates the specified Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. - * - * @param {string} name The name of the Data Lake Store account to create. - * - * @param {object} parameters Parameters supplied to create the Data Lake Store - * account. - * - * @param {object} [parameters.identity] The Key Vault encryption identity, if - * any. - * - * @param {string} [parameters.encryptionState] The current state of encryption - * for this Data Lake store account. Possible values include: 'Enabled', - * 'Disabled' - * - * @param {object} [parameters.encryptionConfig] The Key Vault encryption - * configuration. - * - * @param {string} parameters.encryptionConfig.type The type of encryption - * configuration being used. Currently the only supported types are - * 'UserManaged' and 'ServiceManaged'. Possible values include: 'UserManaged', - * 'ServiceManaged' - * - * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The Key Vault - * information for connecting to user managed encryption keys. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.keyVaultResourceId The resource - * identifier for the user managed Key Vault being used to encrypt. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyName The name of - * the user managed encryption key. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion The - * version of the user managed encryption key. - * - * @param {string} [parameters.firewallState] The current state of the IP - * address firewall for this Data Lake store account. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {array} [parameters.firewallRules] The list of firewall rules - * associated with this Data Lake store account. + * Lists the Data Lake Store accounts within a specific resource group. The + * response includes a link to the next page of results, if any. * - * @param {string} [parameters.trustedIdProviderState] The current state of the - * trusted identity provider feature for this Data Lake store account. Possible - * values include: 'Enabled', 'Disabled' + * @param {string} resourceGroupName The name of the Azure resource group. * - * @param {array} [parameters.trustedIdProviders] The list of trusted identity - * providers associated with this Data Lake store account. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.defaultGroup] the default owner group for all - * new folders and files created in the Data Lake Store account. + * @param {string} [options.filter] OData filter. Optional. * - * @param {string} [parameters.newTier] the commitment tier to use for next - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' + * @param {number} [options.top] The number of items to return. Optional. * - * @param {string} [parameters.firewallAllowAzureIps] The current state of - * allowing or disallowing IPs originating within Azure through the firewall. - * If the firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' + * @param {number} [options.skip] The number of items to skip over before + * returning elements. Optional. * - * @param {string} parameters.location Resource location + * @param {string} [options.select] OData Select statement. Limits the + * properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. * - * @param {object} [parameters.tags] Resource tags + * @param {string} [options.orderby] OrderBy clause. One or more + * comma-separated expressions with an optional "asc" (the default) or "desc" + * depending on the order you'd like the values sorted, e.g. + * Categories?$orderby=CategoryName desc. Optional. * - * @param {object} [options] Optional Parameters. + * @param {boolean} [options.count] A Boolean value of true or false to request + * a count of the matching resources included with the resources in the + * response, e.g. Categories?$count=true. Optional. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -2098,7 +2326,7 @@ class Account { * * {Promise} A promise is returned * - * @resolve {DataLakeStoreAccount} - The deserialized result object. + * @resolve {DataLakeStoreAccountListResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -2107,13 +2335,14 @@ class Account { * {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 DataLakeStoreAccount} for more information. + * See {@link DataLakeStoreAccountListResult} 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, name, parameters, options, optionalCallback) { + listByResourceGroup(resourceGroupName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -2122,64 +2351,90 @@ class Account { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._create(resourceGroupName, name, parameters, options, (err, result, request, response) => { + self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._create(resourceGroupName, name, parameters, options, optionalCallback); + return self._listByResourceGroup(resourceGroupName, options, optionalCallback); } } /** - * Updates the specified Data Lake Store account information. + * Creates the specified Data Lake Store account. * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. + * @param {string} resourceGroupName The name of the Azure resource group. * - * @param {string} name The name of the Data Lake Store account to update. + * @param {string} accountName The name of the Data Lake Store account. * - * @param {object} parameters Parameters supplied to update the Data Lake Store + * @param {object} parameters Parameters supplied to create the Data Lake Store * account. * - * @param {object} [parameters.tags] Resource tags + * @param {string} parameters.location The resource location. + * + * @param {object} [parameters.tags] The resource tags. + * + * @param {object} [parameters.identity] The Key Vault encryption identity, if + * any. + * + * @param {string} [parameters.defaultGroup] The default owner group for all + * new folders and files created in the Data Lake Store account. + * + * @param {object} [parameters.encryptionConfig] The Key Vault encryption + * configuration. + * + * @param {string} parameters.encryptionConfig.type The type of encryption + * configuration being used. Currently the only supported types are + * 'UserManaged' and 'ServiceManaged'. Possible values include: 'UserManaged', + * 'ServiceManaged' + * + * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The Key Vault + * information for connecting to user managed encryption keys. + * + * @param {string} + * parameters.encryptionConfig.keyVaultMetaInfo.keyVaultResourceId The resource + * identifier for the user managed Key Vault being used to encrypt. + * + * @param {string} + * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyName The name of + * the user managed encryption key. + * + * @param {string} + * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion The + * version of the user managed encryption key. * - * @param {string} [parameters.firewallState] The current state of the IP - * address firewall for this Data Lake store account. Disabling the firewall - * does not remove existing rules, they will just be ignored until the firewall - * is re-enabled. Possible values include: 'Enabled', 'Disabled' + * @param {string} [parameters.encryptionState] The current state of encryption + * for this Data Lake Store account. Possible values include: 'Enabled', + * 'Disabled' * - * @param {string} [parameters.trustedIdProviderState] The current state of the - * trusted identity provider feature for this Data Lake store account. - * Disabling trusted identity provider functionality does not remove the - * providers, they will just be ignored until this feature is re-enabled. - * Possible values include: 'Enabled', 'Disabled' + * @param {array} [parameters.firewallRules] The list of firewall rules + * associated with this Data Lake Store account. * - * @param {string} [parameters.defaultGroup] the default owner group for all - * new folders and files created in the Data Lake Store account. + * @param {array} [parameters.virtualNetworkRules] The list of virtual network + * rules associated with this Data Lake Store account. * - * @param {string} [parameters.newTier] the commitment tier to use for next - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' + * @param {string} [parameters.firewallState] The current state of the IP + * address firewall for this Data Lake Store account. Possible values include: + * 'Enabled', 'Disabled' * * @param {string} [parameters.firewallAllowAzureIps] The current state of * allowing or disallowing IPs originating within Azure through the firewall. * If the firewall is disabled, this is not enforced. Possible values include: * 'Enabled', 'Disabled' * - * @param {object} [parameters.encryptionConfig] Used for rotation of user - * managed Key Vault keys. Can only be used to rotate a user managed encryption - * Key Vault key. + * @param {array} [parameters.trustedIdProviders] The list of trusted identity + * providers associated with this Data Lake Store account. * - * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The updated - * Key Vault key to use in user managed key rotation. + * @param {string} [parameters.trustedIdProviderState] The current state of the + * trusted identity provider feature for this Data Lake Store account. Possible + * values include: 'Enabled', 'Disabled' * - * @param {string} - * [parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] The - * version of the user managed encryption key to update through a key rotation. + * @param {string} [parameters.newTier] The commitment tier to use for next + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' * * @param {object} [options] Optional Parameters. * @@ -2192,11 +2447,11 @@ class Account { * * @reject {Error} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName, name, parameters, options) { + createWithHttpOperationResponse(resourceGroupName, accountName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._update(resourceGroupName, name, parameters, options, (err, result, request, response) => { + self._create(resourceGroupName, accountName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -2207,52 +2462,78 @@ class Account { } /** - * Updates the specified Data Lake Store account information. + * Creates the specified Data Lake Store account. * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. + * @param {string} resourceGroupName The name of the Azure resource group. * - * @param {string} name The name of the Data Lake Store account to update. + * @param {string} accountName The name of the Data Lake Store account. * - * @param {object} parameters Parameters supplied to update the Data Lake Store + * @param {object} parameters Parameters supplied to create the Data Lake Store * account. * - * @param {object} [parameters.tags] Resource tags + * @param {string} parameters.location The resource location. * - * @param {string} [parameters.firewallState] The current state of the IP - * address firewall for this Data Lake store account. Disabling the firewall - * does not remove existing rules, they will just be ignored until the firewall - * is re-enabled. Possible values include: 'Enabled', 'Disabled' + * @param {object} [parameters.tags] The resource tags. * - * @param {string} [parameters.trustedIdProviderState] The current state of the - * trusted identity provider feature for this Data Lake store account. - * Disabling trusted identity provider functionality does not remove the - * providers, they will just be ignored until this feature is re-enabled. - * Possible values include: 'Enabled', 'Disabled' + * @param {object} [parameters.identity] The Key Vault encryption identity, if + * any. * - * @param {string} [parameters.defaultGroup] the default owner group for all + * @param {string} [parameters.defaultGroup] The default owner group for all * new folders and files created in the Data Lake Store account. * - * @param {string} [parameters.newTier] the commitment tier to use for next - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' + * @param {object} [parameters.encryptionConfig] The Key Vault encryption + * configuration. + * + * @param {string} parameters.encryptionConfig.type The type of encryption + * configuration being used. Currently the only supported types are + * 'UserManaged' and 'ServiceManaged'. Possible values include: 'UserManaged', + * 'ServiceManaged' + * + * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The Key Vault + * information for connecting to user managed encryption keys. + * + * @param {string} + * parameters.encryptionConfig.keyVaultMetaInfo.keyVaultResourceId The resource + * identifier for the user managed Key Vault being used to encrypt. + * + * @param {string} + * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyName The name of + * the user managed encryption key. + * + * @param {string} + * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion The + * version of the user managed encryption key. + * + * @param {string} [parameters.encryptionState] The current state of encryption + * for this Data Lake Store account. Possible values include: 'Enabled', + * 'Disabled' + * + * @param {array} [parameters.firewallRules] The list of firewall rules + * associated with this Data Lake Store account. + * + * @param {array} [parameters.virtualNetworkRules] The list of virtual network + * rules associated with this Data Lake Store account. + * + * @param {string} [parameters.firewallState] The current state of the IP + * address firewall for this Data Lake Store account. Possible values include: + * 'Enabled', 'Disabled' * * @param {string} [parameters.firewallAllowAzureIps] The current state of * allowing or disallowing IPs originating within Azure through the firewall. * If the firewall is disabled, this is not enforced. Possible values include: * 'Enabled', 'Disabled' * - * @param {object} [parameters.encryptionConfig] Used for rotation of user - * managed Key Vault keys. Can only be used to rotate a user managed encryption - * Key Vault key. + * @param {array} [parameters.trustedIdProviders] The list of trusted identity + * providers associated with this Data Lake Store account. * - * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The updated - * Key Vault key to use in user managed key rotation. + * @param {string} [parameters.trustedIdProviderState] The current state of the + * trusted identity provider feature for this Data Lake Store account. Possible + * values include: 'Enabled', 'Disabled' * - * @param {string} - * [parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] The - * version of the user managed encryption key to update through a key rotation. + * @param {string} [parameters.newTier] The commitment tier to use for next + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' * * @param {object} [options] Optional Parameters. * @@ -2281,7 +2562,7 @@ class Account { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName, name, parameters, options, optionalCallback) { + create(resourceGroupName, accountName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -2290,24 +2571,23 @@ class Account { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._update(resourceGroupName, name, parameters, options, (err, result, request, response) => { + self._create(resourceGroupName, accountName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._update(resourceGroupName, name, parameters, options, optionalCallback); + return self._create(resourceGroupName, accountName, parameters, options, optionalCallback); } } /** - * Deletes the specified Data Lake Store account. + * Gets the specified Data Lake Store account. * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. + * @param {string} resourceGroupName The name of the Azure resource group. * - * @param {string} name The name of the Data Lake Store account to delete. + * @param {string} accountName The name of the Data Lake Store account. * * @param {object} [options] Optional Parameters. * @@ -2316,15 +2596,15 @@ class Account { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName, name, options) { + getWithHttpOperationResponse(resourceGroupName, accountName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, name, options, (err, result, request, response) => { + self._get(resourceGroupName, accountName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -2335,12 +2615,11 @@ class Account { } /** - * Deletes the specified Data Lake Store account. + * Gets the specified Data Lake Store account. * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. + * @param {string} resourceGroupName The name of the Azure resource group. * - * @param {string} name The name of the Data Lake Store account to delete. + * @param {string} accountName The name of the Data Lake Store account. * * @param {object} [options] Optional Parameters. * @@ -2354,7 +2633,7 @@ class Account { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {DataLakeStoreAccount} - The deserialized result object. * * @reject {Error} - The error object. * @@ -2362,13 +2641,14 @@ class Account { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DataLakeStoreAccount} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName, name, options, optionalCallback) { + get(resourceGroupName, accountName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -2377,24 +2657,72 @@ class Account { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, name, options, (err, result, request, response) => { + self._get(resourceGroupName, accountName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteMethod(resourceGroupName, name, options, optionalCallback); + return self._get(resourceGroupName, accountName, options, optionalCallback); } } /** - * Gets the specified Data Lake Store account. + * Updates the specified Data Lake Store account information. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {object} parameters Parameters supplied to update the Data Lake Store + * account. + * + * @param {object} [parameters.tags] Resource tags + * + * @param {string} [parameters.defaultGroup] The default owner group for all + * new folders and files created in the Data Lake Store account. + * + * @param {object} [parameters.encryptionConfig] Used for rotation of user + * managed Key Vault keys. Can only be used to rotate a user managed encryption + * Key Vault key. + * + * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The updated + * Key Vault key to use in user managed key rotation. + * + * @param {string} + * [parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] The + * version of the user managed encryption key to update through a key rotation. + * + * @param {array} [parameters.firewallRules] The list of firewall rules + * associated with this Data Lake Store account. + * + * @param {array} [parameters.virtualNetworkRules] The list of virtual network + * rules associated with this Data Lake Store account. + * + * @param {string} [parameters.firewallState] The current state of the IP + * address firewall for this Data Lake Store account. Disabling the firewall + * does not remove existing rules, they will just be ignored until the firewall + * is re-enabled. Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.firewallAllowAzureIps] The current state of + * allowing or disallowing IPs originating within Azure through the firewall. + * If the firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * + * @param {array} [parameters.trustedIdProviders] The list of trusted identity + * providers associated with this Data Lake Store account. * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. + * @param {string} [parameters.trustedIdProviderState] The current state of the + * trusted identity provider feature for this Data Lake Store account. + * Disabling trusted identity provider functionality does not remove the + * providers, they will just be ignored until this feature is re-enabled. + * Possible values include: 'Enabled', 'Disabled' * - * @param {string} name The name of the Data Lake Store account to retrieve. + * @param {string} [parameters.newTier] The commitment tier to use for next + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' * * @param {object} [options] Optional Parameters. * @@ -2407,11 +2735,11 @@ class Account { * * @reject {Error} - The error object. */ - getWithHttpOperationResponse(resourceGroupName, name, options) { + updateWithHttpOperationResponse(resourceGroupName, accountName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._get(resourceGroupName, name, options, (err, result, request, response) => { + self._update(resourceGroupName, accountName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -2422,12 +2750,60 @@ class Account { } /** - * Gets the specified Data Lake Store account. + * Updates the specified Data Lake Store account information. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {object} parameters Parameters supplied to update the Data Lake Store + * account. + * + * @param {object} [parameters.tags] Resource tags + * + * @param {string} [parameters.defaultGroup] The default owner group for all + * new folders and files created in the Data Lake Store account. + * + * @param {object} [parameters.encryptionConfig] Used for rotation of user + * managed Key Vault keys. Can only be used to rotate a user managed encryption + * Key Vault key. + * + * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The updated + * Key Vault key to use in user managed key rotation. + * + * @param {string} + * [parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] The + * version of the user managed encryption key to update through a key rotation. + * + * @param {array} [parameters.firewallRules] The list of firewall rules + * associated with this Data Lake Store account. * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. + * @param {array} [parameters.virtualNetworkRules] The list of virtual network + * rules associated with this Data Lake Store account. + * + * @param {string} [parameters.firewallState] The current state of the IP + * address firewall for this Data Lake Store account. Disabling the firewall + * does not remove existing rules, they will just be ignored until the firewall + * is re-enabled. Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.firewallAllowAzureIps] The current state of + * allowing or disallowing IPs originating within Azure through the firewall. + * If the firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * + * @param {array} [parameters.trustedIdProviders] The list of trusted identity + * providers associated with this Data Lake Store account. + * + * @param {string} [parameters.trustedIdProviderState] The current state of the + * trusted identity provider feature for this Data Lake Store account. + * Disabling trusted identity provider functionality does not remove the + * providers, they will just be ignored until this feature is re-enabled. + * Possible values include: 'Enabled', 'Disabled' * - * @param {string} name The name of the Data Lake Store account to retrieve. + * @param {string} [parameters.newTier] The commitment tier to use for next + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' * * @param {object} [options] Optional Parameters. * @@ -2456,7 +2832,7 @@ class Account { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName, name, options, optionalCallback) { + update(resourceGroupName, accountName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -2465,26 +2841,23 @@ class Account { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._get(resourceGroupName, name, options, (err, result, request, response) => { + self._update(resourceGroupName, accountName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._get(resourceGroupName, name, options, optionalCallback); + return self._update(resourceGroupName, accountName, parameters, options, optionalCallback); } } /** - * Attempts to enable a user managed Key Vault for encryption of the specified - * Data Lake Store account. + * Deletes the specified Data Lake Store account. * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. + * @param {string} resourceGroupName The name of the Azure resource group. * - * @param {string} accountName The name of the Data Lake Store account to - * attempt to enable the Key Vault for. + * @param {string} accountName The name of the Data Lake Store account. * * @param {object} [options] Optional Parameters. * @@ -2497,11 +2870,11 @@ class Account { * * @reject {Error} - The error object. */ - enableKeyVaultWithHttpOperationResponse(resourceGroupName, accountName, options) { + deleteMethodWithHttpOperationResponse(resourceGroupName, accountName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._enableKeyVault(resourceGroupName, accountName, options, (err, result, request, response) => { + self._deleteMethod(resourceGroupName, accountName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -2512,14 +2885,11 @@ class Account { } /** - * Attempts to enable a user managed Key Vault for encryption of the specified - * Data Lake Store account. + * Deletes the specified Data Lake Store account. * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. + * @param {string} resourceGroupName The name of the Azure resource group. * - * @param {string} accountName The name of the Data Lake Store account to - * attempt to enable the Key Vault for. + * @param {string} accountName The name of the Data Lake Store account. * * @param {object} [options] Optional Parameters. * @@ -2547,7 +2917,7 @@ class Account { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - enableKeyVault(resourceGroupName, accountName, options, optionalCallback) { + deleteMethod(resourceGroupName, accountName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -2556,97 +2926,59 @@ class Account { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._enableKeyVault(resourceGroupName, accountName, options, (err, result, request, response) => { + self._deleteMethod(resourceGroupName, accountName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._enableKeyVault(resourceGroupName, accountName, options, optionalCallback); + return self._deleteMethod(resourceGroupName, accountName, options, optionalCallback); } } /** - * Lists the Data Lake Store accounts within a specific resource group. The - * response includes a link to the next page of results, if any. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account(s). - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData filter. Optional. - * - * @param {number} [options.top] The number of items to return. Optional. - * - * @param {number} [options.skip] The number of items to skip over before - * returning elements. Optional. + * Attempts to enable a user managed Key Vault for encryption of the specified + * Data Lake Store account. * - * @param {string} [options.select] OData Select statement. Limits the - * properties on each entry to just those requested, e.g. - * Categories?$select=CategoryName,Description. Optional. + * @param {string} resourceGroupName The name of the Azure resource group. * - * @param {string} [options.orderby] OrderBy clause. One or more - * comma-separated expressions with an optional "asc" (the default) or "desc" - * depending on the order you'd like the values sorted, e.g. - * Categories?$orderby=CategoryName desc. Optional. + * @param {string} accountName The name of the Data Lake Store account. * - * @param {boolean} [options.count] A Boolean value of true or false to request - * a count of the matching resources included with the resources in the - * response, e.g. Categories?$count=true. Optional. + * @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. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { + enableKeyVaultWithHttpOperationResponse(resourceGroupName, accountName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + self._enableKeyVault(resourceGroupName, accountName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists the Data Lake Store accounts within a specific resource group. The - * response includes a link to the next page of results, if any. - * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account(s). - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData filter. Optional. - * - * @param {number} [options.top] The number of items to return. Optional. - * - * @param {number} [options.skip] The number of items to skip over before - * returning elements. Optional. + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Attempts to enable a user managed Key Vault for encryption of the specified + * Data Lake Store account. * - * @param {string} [options.select] OData Select statement. Limits the - * properties on each entry to just those requested, e.g. - * Categories?$select=CategoryName,Description. Optional. + * @param {string} resourceGroupName The name of the Azure resource group. * - * @param {string} [options.orderby] OrderBy clause. One or more - * comma-separated expressions with an optional "asc" (the default) or "desc" - * depending on the order you'd like the values sorted, e.g. - * Categories?$orderby=CategoryName desc. Optional. + * @param {string} accountName The name of the Data Lake Store account. * - * @param {boolean} [options.count] A Boolean value of true or false to request - * a count of the matching resources included with the resources in the - * response, e.g. Categories?$count=true. Optional. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -2658,7 +2990,7 @@ class Account { * * {Promise} A promise is returned * - * @resolve {DataLakeStoreAccountListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -2666,15 +2998,13 @@ class Account { * * {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 DataLakeStoreAccountListResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listByResourceGroup(resourceGroupName, options, optionalCallback) { + enableKeyVault(resourceGroupName, accountName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -2683,57 +3013,44 @@ class Account { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + self._enableKeyVault(resourceGroupName, accountName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listByResourceGroup(resourceGroupName, options, optionalCallback); + return self._enableKeyVault(resourceGroupName, accountName, options, optionalCallback); } } /** - * Lists the Data Lake Store accounts within the subscription. The response - * includes a link to the next page of results, if any. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData filter. Optional. - * - * @param {number} [options.top] The number of items to return. Optional. + * Checks whether the specified account name is available or taken. * - * @param {number} [options.skip] The number of items to skip over before - * returning elements. Optional. + * @param {string} location The resource location without whitespace. * - * @param {string} [options.select] OData Select statement. Limits the - * properties on each entry to just those requested, e.g. - * Categories?$select=CategoryName,Description. Optional. + * @param {object} parameters Parameters supplied to check the Data Lake Store + * account name availability. * - * @param {string} [options.orderby] OrderBy clause. One or more - * comma-separated expressions with an optional "asc" (the default) or "desc" - * depending on the order you'd like the values sorted, e.g. - * Categories?$orderby=CategoryName desc. Optional. + * @param {string} parameters.name The Data Lake Store name to check + * availability for. * - * @param {boolean} [options.count] The Boolean value of true or false to - * request a count of the matching resources included with the resources in the - * response, e.g. Categories?$count=true. Optional. + * @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. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - listWithHttpOperationResponse(options) { + checkNameAvailabilityWithHttpOperationResponse(location, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._list(options, (err, result, request, response) => { + self._checkNameAvailability(location, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -2744,30 +3061,17 @@ class Account { } /** - * Lists the Data Lake Store accounts within the subscription. The response - * includes a link to the next page of results, if any. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData filter. Optional. - * - * @param {number} [options.top] The number of items to return. Optional. + * Checks whether the specified account name is available or taken. * - * @param {number} [options.skip] The number of items to skip over before - * returning elements. Optional. + * @param {string} location The resource location without whitespace. * - * @param {string} [options.select] OData Select statement. Limits the - * properties on each entry to just those requested, e.g. - * Categories?$select=CategoryName,Description. Optional. + * @param {object} parameters Parameters supplied to check the Data Lake Store + * account name availability. * - * @param {string} [options.orderby] OrderBy clause. One or more - * comma-separated expressions with an optional "asc" (the default) or "desc" - * depending on the order you'd like the values sorted, e.g. - * Categories?$orderby=CategoryName desc. Optional. + * @param {string} parameters.name The Data Lake Store name to check + * availability for. * - * @param {boolean} [options.count] The Boolean value of true or false to - * request a count of the matching resources included with the resources in the - * response, e.g. Categories?$count=true. Optional. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -2779,7 +3083,7 @@ class Account { * * {Promise} A promise is returned * - * @resolve {DataLakeStoreAccountListResult} - The deserialized result object. + * @resolve {NameAvailabilityInformation} - The deserialized result object. * * @reject {Error} - The error object. * @@ -2788,14 +3092,14 @@ class Account { * {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 DataLakeStoreAccountListResult} for more + * See {@link NameAvailabilityInformation} 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) { + checkNameAvailability(location, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -2804,34 +3108,36 @@ class Account { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._list(options, (err, result, request, response) => { + self._checkNameAvailability(location, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._list(options, optionalCallback); + return self._checkNameAvailability(location, parameters, options, optionalCallback); } } /** * Creates the specified Data Lake Store account. * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. + * @param {string} resourceGroupName The name of the Azure resource group. * - * @param {string} name The name of the Data Lake Store account to create. + * @param {string} accountName The name of the Data Lake Store account. * * @param {object} parameters Parameters supplied to create the Data Lake Store * account. * + * @param {string} parameters.location The resource location. + * + * @param {object} [parameters.tags] The resource tags. + * * @param {object} [parameters.identity] The Key Vault encryption identity, if * any. * - * @param {string} [parameters.encryptionState] The current state of encryption - * for this Data Lake store account. Possible values include: 'Enabled', - * 'Disabled' + * @param {string} [parameters.defaultGroup] The default owner group for all + * new folders and files created in the Data Lake Store account. * * @param {object} [parameters.encryptionConfig] The Key Vault encryption * configuration. @@ -2856,36 +3162,36 @@ class Account { * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion The * version of the user managed encryption key. * - * @param {string} [parameters.firewallState] The current state of the IP - * address firewall for this Data Lake store account. Possible values include: - * 'Enabled', 'Disabled' + * @param {string} [parameters.encryptionState] The current state of encryption + * for this Data Lake Store account. Possible values include: 'Enabled', + * 'Disabled' * * @param {array} [parameters.firewallRules] The list of firewall rules - * associated with this Data Lake store account. - * - * @param {string} [parameters.trustedIdProviderState] The current state of the - * trusted identity provider feature for this Data Lake store account. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {array} [parameters.trustedIdProviders] The list of trusted identity - * providers associated with this Data Lake store account. + * associated with this Data Lake Store account. * - * @param {string} [parameters.defaultGroup] the default owner group for all - * new folders and files created in the Data Lake Store account. + * @param {array} [parameters.virtualNetworkRules] The list of virtual network + * rules associated with this Data Lake Store account. * - * @param {string} [parameters.newTier] the commitment tier to use for next - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' + * @param {string} [parameters.firewallState] The current state of the IP + * address firewall for this Data Lake Store account. Possible values include: + * 'Enabled', 'Disabled' * * @param {string} [parameters.firewallAllowAzureIps] The current state of * allowing or disallowing IPs originating within Azure through the firewall. * If the firewall is disabled, this is not enforced. Possible values include: * 'Enabled', 'Disabled' * - * @param {string} parameters.location Resource location + * @param {array} [parameters.trustedIdProviders] The list of trusted identity + * providers associated with this Data Lake Store account. * - * @param {object} [parameters.tags] Resource tags + * @param {string} [parameters.trustedIdProviderState] The current state of the + * trusted identity provider feature for this Data Lake Store account. Possible + * values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.newTier] The commitment tier to use for next + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' * * @param {object} [options] Optional Parameters. * @@ -2898,11 +3204,11 @@ class Account { * * @reject {Error} - The error object. */ - beginCreateWithHttpOperationResponse(resourceGroupName, name, parameters, options) { + beginCreateWithHttpOperationResponse(resourceGroupName, accountName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginCreate(resourceGroupName, name, parameters, options, (err, result, request, response) => { + self._beginCreate(resourceGroupName, accountName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -2915,20 +3221,22 @@ class Account { /** * Creates the specified Data Lake Store account. * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. + * @param {string} resourceGroupName The name of the Azure resource group. * - * @param {string} name The name of the Data Lake Store account to create. + * @param {string} accountName The name of the Data Lake Store account. * * @param {object} parameters Parameters supplied to create the Data Lake Store * account. * + * @param {string} parameters.location The resource location. + * + * @param {object} [parameters.tags] The resource tags. + * * @param {object} [parameters.identity] The Key Vault encryption identity, if * any. * - * @param {string} [parameters.encryptionState] The current state of encryption - * for this Data Lake store account. Possible values include: 'Enabled', - * 'Disabled' + * @param {string} [parameters.defaultGroup] The default owner group for all + * new folders and files created in the Data Lake Store account. * * @param {object} [parameters.encryptionConfig] The Key Vault encryption * configuration. @@ -2953,36 +3261,36 @@ class Account { * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion The * version of the user managed encryption key. * - * @param {string} [parameters.firewallState] The current state of the IP - * address firewall for this Data Lake store account. Possible values include: - * 'Enabled', 'Disabled' + * @param {string} [parameters.encryptionState] The current state of encryption + * for this Data Lake Store account. Possible values include: 'Enabled', + * 'Disabled' * * @param {array} [parameters.firewallRules] The list of firewall rules - * associated with this Data Lake store account. - * - * @param {string} [parameters.trustedIdProviderState] The current state of the - * trusted identity provider feature for this Data Lake store account. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {array} [parameters.trustedIdProviders] The list of trusted identity - * providers associated with this Data Lake store account. + * associated with this Data Lake Store account. * - * @param {string} [parameters.defaultGroup] the default owner group for all - * new folders and files created in the Data Lake Store account. + * @param {array} [parameters.virtualNetworkRules] The list of virtual network + * rules associated with this Data Lake Store account. * - * @param {string} [parameters.newTier] the commitment tier to use for next - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' + * @param {string} [parameters.firewallState] The current state of the IP + * address firewall for this Data Lake Store account. Possible values include: + * 'Enabled', 'Disabled' * * @param {string} [parameters.firewallAllowAzureIps] The current state of * allowing or disallowing IPs originating within Azure through the firewall. * If the firewall is disabled, this is not enforced. Possible values include: * 'Enabled', 'Disabled' * - * @param {string} parameters.location Resource location + * @param {array} [parameters.trustedIdProviders] The list of trusted identity + * providers associated with this Data Lake Store account. * - * @param {object} [parameters.tags] Resource tags + * @param {string} [parameters.trustedIdProviderState] The current state of the + * trusted identity provider feature for this Data Lake Store account. Possible + * values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.newTier] The commitment tier to use for next + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' * * @param {object} [options] Optional Parameters. * @@ -3011,7 +3319,7 @@ class Account { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginCreate(resourceGroupName, name, parameters, options, optionalCallback) { + beginCreate(resourceGroupName, accountName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -3020,54 +3328,32 @@ class Account { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginCreate(resourceGroupName, name, parameters, options, (err, result, request, response) => { + self._beginCreate(resourceGroupName, accountName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginCreate(resourceGroupName, name, parameters, options, optionalCallback); + return self._beginCreate(resourceGroupName, accountName, parameters, options, optionalCallback); } } /** * Updates the specified Data Lake Store account information. * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. + * @param {string} resourceGroupName The name of the Azure resource group. * - * @param {string} name The name of the Data Lake Store account to update. + * @param {string} accountName The name of the Data Lake Store account. * * @param {object} parameters Parameters supplied to update the Data Lake Store * account. * * @param {object} [parameters.tags] Resource tags * - * @param {string} [parameters.firewallState] The current state of the IP - * address firewall for this Data Lake store account. Disabling the firewall - * does not remove existing rules, they will just be ignored until the firewall - * is re-enabled. Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.trustedIdProviderState] The current state of the - * trusted identity provider feature for this Data Lake store account. - * Disabling trusted identity provider functionality does not remove the - * providers, they will just be ignored until this feature is re-enabled. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.defaultGroup] the default owner group for all + * @param {string} [parameters.defaultGroup] The default owner group for all * new folders and files created in the Data Lake Store account. * - * @param {string} [parameters.newTier] the commitment tier to use for next - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' - * - * @param {string} [parameters.firewallAllowAzureIps] The current state of - * allowing or disallowing IPs originating within Azure through the firewall. - * If the firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' - * * @param {object} [parameters.encryptionConfig] Used for rotation of user * managed Key Vault keys. Can only be used to rotate a user managed encryption * Key Vault key. @@ -3079,6 +3365,36 @@ class Account { * [parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] The * version of the user managed encryption key to update through a key rotation. * + * @param {array} [parameters.firewallRules] The list of firewall rules + * associated with this Data Lake Store account. + * + * @param {array} [parameters.virtualNetworkRules] The list of virtual network + * rules associated with this Data Lake Store account. + * + * @param {string} [parameters.firewallState] The current state of the IP + * address firewall for this Data Lake Store account. Disabling the firewall + * does not remove existing rules, they will just be ignored until the firewall + * is re-enabled. Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.firewallAllowAzureIps] The current state of + * allowing or disallowing IPs originating within Azure through the firewall. + * If the firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * + * @param {array} [parameters.trustedIdProviders] The list of trusted identity + * providers associated with this Data Lake Store account. + * + * @param {string} [parameters.trustedIdProviderState] The current state of the + * trusted identity provider feature for this Data Lake Store account. + * Disabling trusted identity provider functionality does not remove the + * providers, they will just be ignored until this feature is re-enabled. + * Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.newTier] The commitment tier to use for next + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3090,11 +3406,11 @@ class Account { * * @reject {Error} - The error object. */ - beginUpdateWithHttpOperationResponse(resourceGroupName, name, parameters, options) { + beginUpdateWithHttpOperationResponse(resourceGroupName, accountName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginUpdate(resourceGroupName, name, parameters, options, (err, result, request, response) => { + self._beginUpdate(resourceGroupName, accountName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -3107,40 +3423,18 @@ class Account { /** * Updates the specified Data Lake Store account information. * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. + * @param {string} resourceGroupName The name of the Azure resource group. * - * @param {string} name The name of the Data Lake Store account to update. + * @param {string} accountName The name of the Data Lake Store account. * * @param {object} parameters Parameters supplied to update the Data Lake Store * account. * * @param {object} [parameters.tags] Resource tags * - * @param {string} [parameters.firewallState] The current state of the IP - * address firewall for this Data Lake store account. Disabling the firewall - * does not remove existing rules, they will just be ignored until the firewall - * is re-enabled. Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.trustedIdProviderState] The current state of the - * trusted identity provider feature for this Data Lake store account. - * Disabling trusted identity provider functionality does not remove the - * providers, they will just be ignored until this feature is re-enabled. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.defaultGroup] the default owner group for all + * @param {string} [parameters.defaultGroup] The default owner group for all * new folders and files created in the Data Lake Store account. * - * @param {string} [parameters.newTier] the commitment tier to use for next - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' - * - * @param {string} [parameters.firewallAllowAzureIps] The current state of - * allowing or disallowing IPs originating within Azure through the firewall. - * If the firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' - * * @param {object} [parameters.encryptionConfig] Used for rotation of user * managed Key Vault keys. Can only be used to rotate a user managed encryption * Key Vault key. @@ -3152,6 +3446,36 @@ class Account { * [parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] The * version of the user managed encryption key to update through a key rotation. * + * @param {array} [parameters.firewallRules] The list of firewall rules + * associated with this Data Lake Store account. + * + * @param {array} [parameters.virtualNetworkRules] The list of virtual network + * rules associated with this Data Lake Store account. + * + * @param {string} [parameters.firewallState] The current state of the IP + * address firewall for this Data Lake Store account. Disabling the firewall + * does not remove existing rules, they will just be ignored until the firewall + * is re-enabled. Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.firewallAllowAzureIps] The current state of + * allowing or disallowing IPs originating within Azure through the firewall. + * If the firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * + * @param {array} [parameters.trustedIdProviders] The list of trusted identity + * providers associated with this Data Lake Store account. + * + * @param {string} [parameters.trustedIdProviderState] The current state of the + * trusted identity provider feature for this Data Lake Store account. + * Disabling trusted identity provider functionality does not remove the + * providers, they will just be ignored until this feature is re-enabled. + * Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.newTier] The commitment tier to use for next + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3179,7 +3503,7 @@ class Account { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginUpdate(resourceGroupName, name, parameters, options, optionalCallback) { + beginUpdate(resourceGroupName, accountName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -3188,24 +3512,23 @@ class Account { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginUpdate(resourceGroupName, name, parameters, options, (err, result, request, response) => { + self._beginUpdate(resourceGroupName, accountName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginUpdate(resourceGroupName, name, parameters, options, optionalCallback); + return self._beginUpdate(resourceGroupName, accountName, parameters, options, optionalCallback); } } /** * Deletes the specified Data Lake Store account. * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. + * @param {string} resourceGroupName The name of the Azure resource group. * - * @param {string} name The name of the Data Lake Store account to delete. + * @param {string} accountName The name of the Data Lake Store account. * * @param {object} [options] Optional Parameters. * @@ -3218,11 +3541,11 @@ class Account { * * @reject {Error} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, name, options) { + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, accountName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, name, options, (err, result, request, response) => { + self._beginDeleteMethod(resourceGroupName, accountName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -3235,10 +3558,9 @@ class Account { /** * Deletes the specified Data Lake Store account. * - * @param {string} resourceGroupName The name of the Azure resource group that - * contains the Data Lake Store account. + * @param {string} resourceGroupName The name of the Azure resource group. * - * @param {string} name The name of the Data Lake Store account to delete. + * @param {string} accountName The name of the Data Lake Store account. * * @param {object} [options] Optional Parameters. * @@ -3266,7 +3588,7 @@ class Account { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginDeleteMethod(resourceGroupName, name, options, optionalCallback) { + beginDeleteMethod(resourceGroupName, accountName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -3275,20 +3597,20 @@ class Account { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, name, options, (err, result, request, response) => { + self._beginDeleteMethod(resourceGroupName, accountName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginDeleteMethod(resourceGroupName, name, options, optionalCallback); + return self._beginDeleteMethod(resourceGroupName, accountName, options, optionalCallback); } } /** - * Lists the Data Lake Store accounts within a specific resource group. The - * response includes a link to the next page of results, if any. + * Lists the Data Lake Store accounts within the subscription. The response + * includes a link to the next page of results, if any. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -3304,11 +3626,11 @@ class Account { * * @reject {Error} - The error object. */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { + listNextWithHttpOperationResponse(nextPageLink, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -3319,8 +3641,8 @@ class Account { } /** - * Lists the Data Lake Store accounts within a specific resource group. The - * response includes a link to the next page of results, if any. + * Lists the Data Lake Store accounts within the subscription. The response + * includes a link to the next page of results, if any. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -3353,7 +3675,7 @@ class Account { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listByResourceGroupNext(nextPageLink, options, optionalCallback) { + listNext(nextPageLink, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -3362,20 +3684,20 @@ class Account { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); + return self._listNext(nextPageLink, options, optionalCallback); } } /** - * Lists the Data Lake Store accounts within the subscription. The response - * includes a link to the next page of results, if any. + * Lists the Data Lake Store accounts within a specific resource group. The + * response includes a link to the next page of results, if any. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -3391,11 +3713,11 @@ class Account { * * @reject {Error} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink, options) { + listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listNext(nextPageLink, options, (err, result, request, response) => { + self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -3406,8 +3728,8 @@ class Account { } /** - * Lists the Data Lake Store accounts within the subscription. The response - * includes a link to the next page of results, if any. + * Lists the Data Lake Store accounts within a specific resource group. The + * response includes a link to the next page of results, if any. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -3440,7 +3762,7 @@ class Account { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink, options, optionalCallback) { + listByResourceGroupNext(nextPageLink, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -3449,17 +3771,17 @@ class Account { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listNext(nextPageLink, options, (err, result, request, response) => { + self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listNext(nextPageLink, options, optionalCallback); + return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); } } } -module.exports = Account; +module.exports = Accounts; diff --git a/lib/services/datalake.Store/lib/account/operations/firewallRules.js b/lib/services/datalake.Store/lib/account/operations/firewallRules.js new file mode 100644 index 0000000000..77a5d3988b --- /dev/null +++ b/lib/services/datalake.Store/lib/account/operations/firewallRules.js @@ -0,0 +1,1539 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 the Data Lake Store firewall rules within the specified Data Lake + * Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @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 FirewallRuleListResult} 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 _listByAccount(resourceGroupName, accountName, 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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName 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 (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.DataLakeStore/accounts/{accountName}/firewallRules'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); + 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['FirewallRuleListResult']().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 or updates the specified firewall rule. During update, the firewall + * rule with the specified name will be replaced with this new firewall rule. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} firewallRuleName The name of the firewall rule to create or + * update. + * + * @param {object} parameters Parameters supplied to create or update the + * firewall rule. + * + * @param {string} parameters.startIpAddress The start IP address for the + * firewall rule. This can be either ipv4 or ipv6. Start and End should be in + * the same protocol. + * + * @param {string} parameters.endIpAddress The end IP address for the firewall + * rule. This can be either ipv4 or ipv6. Start and End should be in the same + * protocol. + * + * @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 FirewallRule} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, accountName, firewallRuleName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // 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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (firewallRuleName === null || firewallRuleName === undefined || typeof firewallRuleName.valueOf() !== 'string') { + throw new Error('firewallRuleName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.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.DataLakeStore/accounts/{accountName}/firewallRules/{firewallRuleName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); + requestUrl = requestUrl.replace('{firewallRuleName}', encodeURIComponent(firewallRuleName)); + 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 (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['CreateOrUpdateFirewallRuleParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + 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['FirewallRule']().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 the specified Data Lake Store firewall rule. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} firewallRuleName The name of the firewall rule to retrieve. + * + * @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 FirewallRule} 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, accountName, firewallRuleName, 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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (firewallRuleName === null || firewallRuleName === undefined || typeof firewallRuleName.valueOf() !== 'string') { + throw new Error('firewallRuleName 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 (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.DataLakeStore/accounts/{accountName}/firewallRules/{firewallRuleName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); + requestUrl = requestUrl.replace('{firewallRuleName}', encodeURIComponent(firewallRuleName)); + 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['FirewallRule']().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 specified firewall rule. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} firewallRuleName The name of the firewall rule to update. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.parameters] Parameters supplied to update the + * firewall rule. + * + * @param {string} [options.parameters.startIpAddress] The start IP address for + * the firewall rule. This can be either ipv4 or ipv6. Start and End should be + * in the same protocol. + * + * @param {string} [options.parameters.endIpAddress] The end IP address for the + * firewall rule. This can be either ipv4 or ipv6. Start and End should be in + * the same protocol. + * + * @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 FirewallRule} 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, accountName, firewallRuleName, 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 parameters = (options && options.parameters !== undefined) ? options.parameters : 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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (firewallRuleName === null || firewallRuleName === undefined || typeof firewallRuleName.valueOf() !== 'string') { + throw new Error('firewallRuleName 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 (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.DataLakeStore/accounts/{accountName}/firewallRules/{firewallRuleName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); + requestUrl = requestUrl.replace('{firewallRuleName}', encodeURIComponent(firewallRuleName)); + 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 (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['UpdateFirewallRuleParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + 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['FirewallRule']().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 the specified firewall rule from the specified Data Lake Store + * account. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} firewallRuleName The name of the firewall rule to delete. + * + * @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, accountName, firewallRuleName, 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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (firewallRuleName === null || firewallRuleName === undefined || typeof firewallRuleName.valueOf() !== 'string') { + throw new Error('firewallRuleName 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 (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.DataLakeStore/accounts/{accountName}/firewallRules/{firewallRuleName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); + requestUrl = requestUrl.replace('{firewallRuleName}', encodeURIComponent(firewallRuleName)); + 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 !== 200 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + 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); + }); +} + +/** + * Lists the Data Lake Store firewall rules within the specified Data Lake + * Store account. + * + * @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 FirewallRuleListResult} 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 _listByAccountNext(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['FirewallRuleListResult']().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 FirewallRules. */ +class FirewallRules { + /** + * Create a FirewallRules. + * @param {DataLakeStoreAccountManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._listByAccount = _listByAccount; + this._createOrUpdate = _createOrUpdate; + this._get = _get; + this._update = _update; + this._deleteMethod = _deleteMethod; + this._listByAccountNext = _listByAccountNext; + } + + /** + * Lists the Data Lake Store firewall rules within the specified Data Lake + * Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @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. + */ + listByAccountWithHttpOperationResponse(resourceGroupName, accountName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByAccount(resourceGroupName, accountName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists the Data Lake Store firewall rules within the specified Data Lake + * Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @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 {FirewallRuleListResult} - 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 FirewallRuleListResult} 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. + */ + listByAccount(resourceGroupName, accountName, 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._listByAccount(resourceGroupName, accountName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByAccount(resourceGroupName, accountName, options, optionalCallback); + } + } + + /** + * Creates or updates the specified firewall rule. During update, the firewall + * rule with the specified name will be replaced with this new firewall rule. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} firewallRuleName The name of the firewall rule to create or + * update. + * + * @param {object} parameters Parameters supplied to create or update the + * firewall rule. + * + * @param {string} parameters.startIpAddress The start IP address for the + * firewall rule. This can be either ipv4 or ipv6. Start and End should be in + * the same protocol. + * + * @param {string} parameters.endIpAddress The end IP address for the firewall + * rule. This can be either ipv4 or ipv6. Start and End should be in the same + * protocol. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, accountName, firewallRuleName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, accountName, firewallRuleName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates the specified firewall rule. During update, the firewall + * rule with the specified name will be replaced with this new firewall rule. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} firewallRuleName The name of the firewall rule to create or + * update. + * + * @param {object} parameters Parameters supplied to create or update the + * firewall rule. + * + * @param {string} parameters.startIpAddress The start IP address for the + * firewall rule. This can be either ipv4 or ipv6. Start and End should be in + * the same protocol. + * + * @param {string} parameters.endIpAddress The end IP address for the firewall + * rule. This can be either ipv4 or ipv6. Start and End should be in the same + * protocol. + * + * @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 {FirewallRule} - 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 FirewallRule} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, accountName, firewallRuleName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, accountName, firewallRuleName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, accountName, firewallRuleName, parameters, options, optionalCallback); + } + } + + /** + * Gets the specified Data Lake Store firewall rule. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} firewallRuleName The name of the firewall rule to retrieve. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, accountName, firewallRuleName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, accountName, firewallRuleName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the specified Data Lake Store firewall rule. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} firewallRuleName The name of the firewall rule to retrieve. + * + * @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 {FirewallRule} - 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 FirewallRule} 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, accountName, firewallRuleName, 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, accountName, firewallRuleName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, accountName, firewallRuleName, options, optionalCallback); + } + } + + /** + * Updates the specified firewall rule. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} firewallRuleName The name of the firewall rule to update. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.parameters] Parameters supplied to update the + * firewall rule. + * + * @param {string} [options.parameters.startIpAddress] The start IP address for + * the firewall rule. This can be either ipv4 or ipv6. Start and End should be + * in the same protocol. + * + * @param {string} [options.parameters.endIpAddress] The end IP address for the + * firewall rule. This can be either ipv4 or ipv6. Start and End should be in + * the same protocol. + * + * @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, accountName, firewallRuleName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, accountName, firewallRuleName, 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 specified firewall rule. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} firewallRuleName The name of the firewall rule to update. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.parameters] Parameters supplied to update the + * firewall rule. + * + * @param {string} [options.parameters.startIpAddress] The start IP address for + * the firewall rule. This can be either ipv4 or ipv6. Start and End should be + * in the same protocol. + * + * @param {string} [options.parameters.endIpAddress] The end IP address for the + * firewall rule. This can be either ipv4 or ipv6. Start and End should be in + * the same protocol. + * + * @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 {FirewallRule} - 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 FirewallRule} 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, accountName, firewallRuleName, 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, accountName, firewallRuleName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, accountName, firewallRuleName, options, optionalCallback); + } + } + + /** + * Deletes the specified firewall rule from the specified Data Lake Store + * account. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} firewallRuleName The name of the firewall rule to delete. + * + * @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, accountName, firewallRuleName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, accountName, firewallRuleName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified firewall rule from the specified Data Lake Store + * account. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} firewallRuleName The name of the firewall rule to delete. + * + * @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, accountName, firewallRuleName, 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, accountName, firewallRuleName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, accountName, firewallRuleName, options, optionalCallback); + } + } + + /** + * Lists the Data Lake Store firewall rules within the specified Data Lake + * Store account. + * + * @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. + */ + listByAccountNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByAccountNext(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 the Data Lake Store firewall rules within the specified Data Lake + * Store account. + * + * @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 {FirewallRuleListResult} - 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 FirewallRuleListResult} 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. + */ + listByAccountNext(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._listByAccountNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByAccountNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = FirewallRules; diff --git a/lib/services/datalake.Store/lib/account/operations/index.d.ts b/lib/services/datalake.Store/lib/account/operations/index.d.ts new file mode 100644 index 0000000000..57b4ebb2e8 --- /dev/null +++ b/lib/services/datalake.Store/lib/account/operations/index.d.ts @@ -0,0 +1,2733 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * 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 + * Accounts + * __NOTE__: An instance of this class is automatically created for an + * instance of the DataLakeStoreAccountManagementClient. + */ +export interface Accounts { + + + /** + * Lists the Data Lake Store accounts within the subscription. The response + * includes a link to the next page of results, if any. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] OData filter. Optional. + * + * @param {number} [options.top] The number of items to return. Optional. + * + * @param {number} [options.skip] The number of items to skip over before + * returning elements. Optional. + * + * @param {string} [options.select] OData Select statement. Limits the + * properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. + * + * @param {string} [options.orderby] OrderBy clause. One or more + * comma-separated expressions with an optional "asc" (the default) or "desc" + * depending on the order you'd like the values sorted, e.g. + * Categories?$orderby=CategoryName desc. Optional. + * + * @param {boolean} [options.count] The Boolean value of true or false to + * request a count of the matching resources included with the resources in the + * response, e.g. Categories?$count=true. Optional. + * + * @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?: { filter? : string, top? : number, skip? : number, select? : string, orderby? : string, count? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists the Data Lake Store accounts within the subscription. The response + * includes a link to the next page of results, if any. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] OData filter. Optional. + * + * @param {number} [options.top] The number of items to return. Optional. + * + * @param {number} [options.skip] The number of items to skip over before + * returning elements. Optional. + * + * @param {string} [options.select] OData Select statement. Limits the + * properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. + * + * @param {string} [options.orderby] OrderBy clause. One or more + * comma-separated expressions with an optional "asc" (the default) or "desc" + * depending on the order you'd like the values sorted, e.g. + * Categories?$orderby=CategoryName desc. Optional. + * + * @param {boolean} [options.count] The Boolean value of true or false to + * request a count of the matching resources included with the resources in the + * response, e.g. Categories?$count=true. Optional. + * + * @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 {DataLakeStoreAccountListResult} - 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. + * + * {DataLakeStoreAccountListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DataLakeStoreAccountListResult} 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?: { filter? : string, top? : number, skip? : number, select? : string, orderby? : string, count? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { filter? : string, top? : number, skip? : number, select? : string, orderby? : string, count? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists the Data Lake Store accounts within a specific resource group. The + * response includes a link to the next page of results, if any. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] OData filter. Optional. + * + * @param {number} [options.top] The number of items to return. Optional. + * + * @param {number} [options.skip] The number of items to skip over before + * returning elements. Optional. + * + * @param {string} [options.select] OData Select statement. Limits the + * properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. + * + * @param {string} [options.orderby] OrderBy clause. One or more + * comma-separated expressions with an optional "asc" (the default) or "desc" + * depending on the order you'd like the values sorted, e.g. + * Categories?$orderby=CategoryName desc. Optional. + * + * @param {boolean} [options.count] A Boolean value of true or false to request + * a count of the matching resources included with the resources in the + * response, e.g. Categories?$count=true. Optional. + * + * @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?: { filter? : string, top? : number, skip? : number, select? : string, orderby? : string, count? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists the Data Lake Store accounts within a specific resource group. The + * response includes a link to the next page of results, if any. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] OData filter. Optional. + * + * @param {number} [options.top] The number of items to return. Optional. + * + * @param {number} [options.skip] The number of items to skip over before + * returning elements. Optional. + * + * @param {string} [options.select] OData Select statement. Limits the + * properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. + * + * @param {string} [options.orderby] OrderBy clause. One or more + * comma-separated expressions with an optional "asc" (the default) or "desc" + * depending on the order you'd like the values sorted, e.g. + * Categories?$orderby=CategoryName desc. Optional. + * + * @param {boolean} [options.count] A Boolean value of true or false to request + * a count of the matching resources included with the resources in the + * response, e.g. Categories?$count=true. Optional. + * + * @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 {DataLakeStoreAccountListResult} - 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. + * + * {DataLakeStoreAccountListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DataLakeStoreAccountListResult} 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?: { filter? : string, top? : number, skip? : number, select? : string, orderby? : string, count? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options: { filter? : string, top? : number, skip? : number, select? : string, orderby? : string, count? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates the specified Data Lake Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {object} parameters Parameters supplied to create the Data Lake Store + * account. + * + * @param {string} parameters.location The resource location. + * + * @param {object} [parameters.tags] The resource tags. + * + * @param {object} [parameters.identity] The Key Vault encryption identity, if + * any. + * + * @param {string} [parameters.defaultGroup] The default owner group for all + * new folders and files created in the Data Lake Store account. + * + * @param {object} [parameters.encryptionConfig] The Key Vault encryption + * configuration. + * + * @param {string} parameters.encryptionConfig.type The type of encryption + * configuration being used. Currently the only supported types are + * 'UserManaged' and 'ServiceManaged'. Possible values include: 'UserManaged', + * 'ServiceManaged' + * + * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The Key Vault + * information for connecting to user managed encryption keys. + * + * @param {string} + * parameters.encryptionConfig.keyVaultMetaInfo.keyVaultResourceId The resource + * identifier for the user managed Key Vault being used to encrypt. + * + * @param {string} + * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyName The name of + * the user managed encryption key. + * + * @param {string} + * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion The + * version of the user managed encryption key. + * + * @param {string} [parameters.encryptionState] The current state of encryption + * for this Data Lake Store account. Possible values include: 'Enabled', + * 'Disabled' + * + * @param {array} [parameters.firewallRules] The list of firewall rules + * associated with this Data Lake Store account. + * + * @param {array} [parameters.virtualNetworkRules] The list of virtual network + * rules associated with this Data Lake Store account. + * + * @param {string} [parameters.firewallState] The current state of the IP + * address firewall for this Data Lake Store account. Possible values include: + * 'Enabled', 'Disabled' + * + * @param {string} [parameters.firewallAllowAzureIps] The current state of + * allowing or disallowing IPs originating within Azure through the firewall. + * If the firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * + * @param {array} [parameters.trustedIdProviders] The list of trusted identity + * providers associated with this Data Lake Store account. + * + * @param {string} [parameters.trustedIdProviderState] The current state of the + * trusted identity provider feature for this Data Lake Store account. Possible + * values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.newTier] The commitment tier to use for next + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' + * + * @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, accountName: string, parameters: models.CreateDataLakeStoreAccountParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates the specified Data Lake Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {object} parameters Parameters supplied to create the Data Lake Store + * account. + * + * @param {string} parameters.location The resource location. + * + * @param {object} [parameters.tags] The resource tags. + * + * @param {object} [parameters.identity] The Key Vault encryption identity, if + * any. + * + * @param {string} [parameters.defaultGroup] The default owner group for all + * new folders and files created in the Data Lake Store account. + * + * @param {object} [parameters.encryptionConfig] The Key Vault encryption + * configuration. + * + * @param {string} parameters.encryptionConfig.type The type of encryption + * configuration being used. Currently the only supported types are + * 'UserManaged' and 'ServiceManaged'. Possible values include: 'UserManaged', + * 'ServiceManaged' + * + * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The Key Vault + * information for connecting to user managed encryption keys. + * + * @param {string} + * parameters.encryptionConfig.keyVaultMetaInfo.keyVaultResourceId The resource + * identifier for the user managed Key Vault being used to encrypt. + * + * @param {string} + * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyName The name of + * the user managed encryption key. + * + * @param {string} + * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion The + * version of the user managed encryption key. + * + * @param {string} [parameters.encryptionState] The current state of encryption + * for this Data Lake Store account. Possible values include: 'Enabled', + * 'Disabled' + * + * @param {array} [parameters.firewallRules] The list of firewall rules + * associated with this Data Lake Store account. + * + * @param {array} [parameters.virtualNetworkRules] The list of virtual network + * rules associated with this Data Lake Store account. + * + * @param {string} [parameters.firewallState] The current state of the IP + * address firewall for this Data Lake Store account. Possible values include: + * 'Enabled', 'Disabled' + * + * @param {string} [parameters.firewallAllowAzureIps] The current state of + * allowing or disallowing IPs originating within Azure through the firewall. + * If the firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * + * @param {array} [parameters.trustedIdProviders] The list of trusted identity + * providers associated with this Data Lake Store account. + * + * @param {string} [parameters.trustedIdProviderState] The current state of the + * trusted identity provider feature for this Data Lake Store account. Possible + * values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.newTier] The commitment tier to use for next + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' + * + * @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 {DataLakeStoreAccount} - 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. + * + * {DataLakeStoreAccount} [result] - The deserialized result object if an error did not occur. + * See {@link DataLakeStoreAccount} 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, accountName: string, parameters: models.CreateDataLakeStoreAccountParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + create(resourceGroupName: string, accountName: string, parameters: models.CreateDataLakeStoreAccountParameters, callback: ServiceCallback): void; + create(resourceGroupName: string, accountName: string, parameters: models.CreateDataLakeStoreAccountParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the specified Data Lake Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the specified Data Lake Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @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 {DataLakeStoreAccount} - 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. + * + * {DataLakeStoreAccount} [result] - The deserialized result object if an error did not occur. + * See {@link DataLakeStoreAccount} 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, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, accountName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, accountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates the specified Data Lake Store account information. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {object} parameters Parameters supplied to update the Data Lake Store + * account. + * + * @param {object} [parameters.tags] Resource tags + * + * @param {string} [parameters.defaultGroup] The default owner group for all + * new folders and files created in the Data Lake Store account. + * + * @param {object} [parameters.encryptionConfig] Used for rotation of user + * managed Key Vault keys. Can only be used to rotate a user managed encryption + * Key Vault key. + * + * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The updated + * Key Vault key to use in user managed key rotation. + * + * @param {string} + * [parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] The + * version of the user managed encryption key to update through a key rotation. + * + * @param {array} [parameters.firewallRules] The list of firewall rules + * associated with this Data Lake Store account. + * + * @param {array} [parameters.virtualNetworkRules] The list of virtual network + * rules associated with this Data Lake Store account. + * + * @param {string} [parameters.firewallState] The current state of the IP + * address firewall for this Data Lake Store account. Disabling the firewall + * does not remove existing rules, they will just be ignored until the firewall + * is re-enabled. Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.firewallAllowAzureIps] The current state of + * allowing or disallowing IPs originating within Azure through the firewall. + * If the firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * + * @param {array} [parameters.trustedIdProviders] The list of trusted identity + * providers associated with this Data Lake Store account. + * + * @param {string} [parameters.trustedIdProviderState] The current state of the + * trusted identity provider feature for this Data Lake Store account. + * Disabling trusted identity provider functionality does not remove the + * providers, they will just be ignored until this feature is re-enabled. + * Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.newTier] The commitment tier to use for next + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName: string, accountName: string, parameters: models.UpdateDataLakeStoreAccountParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates the specified Data Lake Store account information. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {object} parameters Parameters supplied to update the Data Lake Store + * account. + * + * @param {object} [parameters.tags] Resource tags + * + * @param {string} [parameters.defaultGroup] The default owner group for all + * new folders and files created in the Data Lake Store account. + * + * @param {object} [parameters.encryptionConfig] Used for rotation of user + * managed Key Vault keys. Can only be used to rotate a user managed encryption + * Key Vault key. + * + * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The updated + * Key Vault key to use in user managed key rotation. + * + * @param {string} + * [parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] The + * version of the user managed encryption key to update through a key rotation. + * + * @param {array} [parameters.firewallRules] The list of firewall rules + * associated with this Data Lake Store account. + * + * @param {array} [parameters.virtualNetworkRules] The list of virtual network + * rules associated with this Data Lake Store account. + * + * @param {string} [parameters.firewallState] The current state of the IP + * address firewall for this Data Lake Store account. Disabling the firewall + * does not remove existing rules, they will just be ignored until the firewall + * is re-enabled. Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.firewallAllowAzureIps] The current state of + * allowing or disallowing IPs originating within Azure through the firewall. + * If the firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * + * @param {array} [parameters.trustedIdProviders] The list of trusted identity + * providers associated with this Data Lake Store account. + * + * @param {string} [parameters.trustedIdProviderState] The current state of the + * trusted identity provider feature for this Data Lake Store account. + * Disabling trusted identity provider functionality does not remove the + * providers, they will just be ignored until this feature is re-enabled. + * Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.newTier] The commitment tier to use for next + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' + * + * @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 {DataLakeStoreAccount} - 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. + * + * {DataLakeStoreAccount} [result] - The deserialized result object if an error did not occur. + * See {@link DataLakeStoreAccount} 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, accountName: string, parameters: models.UpdateDataLakeStoreAccountParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, accountName: string, parameters: models.UpdateDataLakeStoreAccountParameters, callback: ServiceCallback): void; + update(resourceGroupName: string, accountName: string, parameters: models.UpdateDataLakeStoreAccountParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified Data Lake Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @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, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified Data Lake Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @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, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, accountName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, accountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Attempts to enable a user managed Key Vault for encryption of the specified + * Data Lake Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @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. + */ + enableKeyVaultWithHttpOperationResponse(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Attempts to enable a user managed Key Vault for encryption of the specified + * Data Lake Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @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. + */ + enableKeyVault(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + enableKeyVault(resourceGroupName: string, accountName: string, callback: ServiceCallback): void; + enableKeyVault(resourceGroupName: string, accountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Checks whether the specified account name is available or taken. + * + * @param {string} location The resource location without whitespace. + * + * @param {object} parameters Parameters supplied to check the Data Lake Store + * account name availability. + * + * @param {string} parameters.name The Data Lake Store name to check + * availability for. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + checkNameAvailabilityWithHttpOperationResponse(location: string, parameters: models.CheckNameAvailabilityParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Checks whether the specified account name is available or taken. + * + * @param {string} location The resource location without whitespace. + * + * @param {object} parameters Parameters supplied to check the Data Lake Store + * account name availability. + * + * @param {string} parameters.name The Data Lake Store name to check + * availability for. + * + * @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 {NameAvailabilityInformation} - 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. + * + * {NameAvailabilityInformation} [result] - The deserialized result object if an error did not occur. + * See {@link NameAvailabilityInformation} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + checkNameAvailability(location: string, parameters: models.CheckNameAvailabilityParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + checkNameAvailability(location: string, parameters: models.CheckNameAvailabilityParameters, callback: ServiceCallback): void; + checkNameAvailability(location: string, parameters: models.CheckNameAvailabilityParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates the specified Data Lake Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {object} parameters Parameters supplied to create the Data Lake Store + * account. + * + * @param {string} parameters.location The resource location. + * + * @param {object} [parameters.tags] The resource tags. + * + * @param {object} [parameters.identity] The Key Vault encryption identity, if + * any. + * + * @param {string} [parameters.defaultGroup] The default owner group for all + * new folders and files created in the Data Lake Store account. + * + * @param {object} [parameters.encryptionConfig] The Key Vault encryption + * configuration. + * + * @param {string} parameters.encryptionConfig.type The type of encryption + * configuration being used. Currently the only supported types are + * 'UserManaged' and 'ServiceManaged'. Possible values include: 'UserManaged', + * 'ServiceManaged' + * + * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The Key Vault + * information for connecting to user managed encryption keys. + * + * @param {string} + * parameters.encryptionConfig.keyVaultMetaInfo.keyVaultResourceId The resource + * identifier for the user managed Key Vault being used to encrypt. + * + * @param {string} + * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyName The name of + * the user managed encryption key. + * + * @param {string} + * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion The + * version of the user managed encryption key. + * + * @param {string} [parameters.encryptionState] The current state of encryption + * for this Data Lake Store account. Possible values include: 'Enabled', + * 'Disabled' + * + * @param {array} [parameters.firewallRules] The list of firewall rules + * associated with this Data Lake Store account. + * + * @param {array} [parameters.virtualNetworkRules] The list of virtual network + * rules associated with this Data Lake Store account. + * + * @param {string} [parameters.firewallState] The current state of the IP + * address firewall for this Data Lake Store account. Possible values include: + * 'Enabled', 'Disabled' + * + * @param {string} [parameters.firewallAllowAzureIps] The current state of + * allowing or disallowing IPs originating within Azure through the firewall. + * If the firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * + * @param {array} [parameters.trustedIdProviders] The list of trusted identity + * providers associated with this Data Lake Store account. + * + * @param {string} [parameters.trustedIdProviderState] The current state of the + * trusted identity provider feature for this Data Lake Store account. Possible + * values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.newTier] The commitment tier to use for next + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' + * + * @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, accountName: string, parameters: models.CreateDataLakeStoreAccountParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates the specified Data Lake Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {object} parameters Parameters supplied to create the Data Lake Store + * account. + * + * @param {string} parameters.location The resource location. + * + * @param {object} [parameters.tags] The resource tags. + * + * @param {object} [parameters.identity] The Key Vault encryption identity, if + * any. + * + * @param {string} [parameters.defaultGroup] The default owner group for all + * new folders and files created in the Data Lake Store account. + * + * @param {object} [parameters.encryptionConfig] The Key Vault encryption + * configuration. + * + * @param {string} parameters.encryptionConfig.type The type of encryption + * configuration being used. Currently the only supported types are + * 'UserManaged' and 'ServiceManaged'. Possible values include: 'UserManaged', + * 'ServiceManaged' + * + * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The Key Vault + * information for connecting to user managed encryption keys. + * + * @param {string} + * parameters.encryptionConfig.keyVaultMetaInfo.keyVaultResourceId The resource + * identifier for the user managed Key Vault being used to encrypt. + * + * @param {string} + * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyName The name of + * the user managed encryption key. + * + * @param {string} + * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion The + * version of the user managed encryption key. + * + * @param {string} [parameters.encryptionState] The current state of encryption + * for this Data Lake Store account. Possible values include: 'Enabled', + * 'Disabled' + * + * @param {array} [parameters.firewallRules] The list of firewall rules + * associated with this Data Lake Store account. + * + * @param {array} [parameters.virtualNetworkRules] The list of virtual network + * rules associated with this Data Lake Store account. + * + * @param {string} [parameters.firewallState] The current state of the IP + * address firewall for this Data Lake Store account. Possible values include: + * 'Enabled', 'Disabled' + * + * @param {string} [parameters.firewallAllowAzureIps] The current state of + * allowing or disallowing IPs originating within Azure through the firewall. + * If the firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * + * @param {array} [parameters.trustedIdProviders] The list of trusted identity + * providers associated with this Data Lake Store account. + * + * @param {string} [parameters.trustedIdProviderState] The current state of the + * trusted identity provider feature for this Data Lake Store account. Possible + * values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.newTier] The commitment tier to use for next + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' + * + * @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 {DataLakeStoreAccount} - 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. + * + * {DataLakeStoreAccount} [result] - The deserialized result object if an error did not occur. + * See {@link DataLakeStoreAccount} 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, accountName: string, parameters: models.CreateDataLakeStoreAccountParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreate(resourceGroupName: string, accountName: string, parameters: models.CreateDataLakeStoreAccountParameters, callback: ServiceCallback): void; + beginCreate(resourceGroupName: string, accountName: string, parameters: models.CreateDataLakeStoreAccountParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates the specified Data Lake Store account information. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {object} parameters Parameters supplied to update the Data Lake Store + * account. + * + * @param {object} [parameters.tags] Resource tags + * + * @param {string} [parameters.defaultGroup] The default owner group for all + * new folders and files created in the Data Lake Store account. + * + * @param {object} [parameters.encryptionConfig] Used for rotation of user + * managed Key Vault keys. Can only be used to rotate a user managed encryption + * Key Vault key. + * + * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The updated + * Key Vault key to use in user managed key rotation. + * + * @param {string} + * [parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] The + * version of the user managed encryption key to update through a key rotation. + * + * @param {array} [parameters.firewallRules] The list of firewall rules + * associated with this Data Lake Store account. + * + * @param {array} [parameters.virtualNetworkRules] The list of virtual network + * rules associated with this Data Lake Store account. + * + * @param {string} [parameters.firewallState] The current state of the IP + * address firewall for this Data Lake Store account. Disabling the firewall + * does not remove existing rules, they will just be ignored until the firewall + * is re-enabled. Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.firewallAllowAzureIps] The current state of + * allowing or disallowing IPs originating within Azure through the firewall. + * If the firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * + * @param {array} [parameters.trustedIdProviders] The list of trusted identity + * providers associated with this Data Lake Store account. + * + * @param {string} [parameters.trustedIdProviderState] The current state of the + * trusted identity provider feature for this Data Lake Store account. + * Disabling trusted identity provider functionality does not remove the + * providers, they will just be ignored until this feature is re-enabled. + * Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.newTier] The commitment tier to use for next + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginUpdateWithHttpOperationResponse(resourceGroupName: string, accountName: string, parameters: models.UpdateDataLakeStoreAccountParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates the specified Data Lake Store account information. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {object} parameters Parameters supplied to update the Data Lake Store + * account. + * + * @param {object} [parameters.tags] Resource tags + * + * @param {string} [parameters.defaultGroup] The default owner group for all + * new folders and files created in the Data Lake Store account. + * + * @param {object} [parameters.encryptionConfig] Used for rotation of user + * managed Key Vault keys. Can only be used to rotate a user managed encryption + * Key Vault key. + * + * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The updated + * Key Vault key to use in user managed key rotation. + * + * @param {string} + * [parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] The + * version of the user managed encryption key to update through a key rotation. + * + * @param {array} [parameters.firewallRules] The list of firewall rules + * associated with this Data Lake Store account. + * + * @param {array} [parameters.virtualNetworkRules] The list of virtual network + * rules associated with this Data Lake Store account. + * + * @param {string} [parameters.firewallState] The current state of the IP + * address firewall for this Data Lake Store account. Disabling the firewall + * does not remove existing rules, they will just be ignored until the firewall + * is re-enabled. Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.firewallAllowAzureIps] The current state of + * allowing or disallowing IPs originating within Azure through the firewall. + * If the firewall is disabled, this is not enforced. Possible values include: + * 'Enabled', 'Disabled' + * + * @param {array} [parameters.trustedIdProviders] The list of trusted identity + * providers associated with this Data Lake Store account. + * + * @param {string} [parameters.trustedIdProviderState] The current state of the + * trusted identity provider feature for this Data Lake Store account. + * Disabling trusted identity provider functionality does not remove the + * providers, they will just be ignored until this feature is re-enabled. + * Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.newTier] The commitment tier to use for next + * month. Possible values include: 'Consumption', 'Commitment_1TB', + * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', + * 'Commitment_5PB' + * + * @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 {DataLakeStoreAccount} - 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. + * + * {DataLakeStoreAccount} [result] - The deserialized result object if an error did not occur. + * See {@link DataLakeStoreAccount} 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, accountName: string, parameters: models.UpdateDataLakeStoreAccountParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, accountName: string, parameters: models.UpdateDataLakeStoreAccountParameters, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, accountName: string, parameters: models.UpdateDataLakeStoreAccountParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified Data Lake Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified Data Lake Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @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. + */ + beginDeleteMethod(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, accountName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, accountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists the Data Lake Store accounts within the subscription. The response + * includes a link to the next page of results, if any. + * + * @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 the Data Lake Store accounts within the subscription. The response + * includes a link to the next page of results, if any. + * + * @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 {DataLakeStoreAccountListResult} - 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. + * + * {DataLakeStoreAccountListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DataLakeStoreAccountListResult} 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 the Data Lake Store accounts within a specific resource group. The + * response includes a link to the next page of results, if any. + * + * @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 the Data Lake Store accounts within a specific resource group. The + * response includes a link to the next page of results, if any. + * + * @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 {DataLakeStoreAccountListResult} - 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. + * + * {DataLakeStoreAccountListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DataLakeStoreAccountListResult} 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 + * FirewallRules + * __NOTE__: An instance of this class is automatically created for an + * instance of the DataLakeStoreAccountManagementClient. + */ +export interface FirewallRules { + + + /** + * Lists the Data Lake Store firewall rules within the specified Data Lake + * Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @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. + */ + listByAccountWithHttpOperationResponse(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists the Data Lake Store firewall rules within the specified Data Lake + * Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @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 {FirewallRuleListResult} - 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. + * + * {FirewallRuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link FirewallRuleListResult} 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. + */ + listByAccount(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByAccount(resourceGroupName: string, accountName: string, callback: ServiceCallback): void; + listByAccount(resourceGroupName: string, accountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates the specified firewall rule. During update, the firewall + * rule with the specified name will be replaced with this new firewall rule. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} firewallRuleName The name of the firewall rule to create or + * update. + * + * @param {object} parameters Parameters supplied to create or update the + * firewall rule. + * + * @param {string} parameters.startIpAddress The start IP address for the + * firewall rule. This can be either ipv4 or ipv6. Start and End should be in + * the same protocol. + * + * @param {string} parameters.endIpAddress The end IP address for the firewall + * rule. This can be either ipv4 or ipv6. Start and End should be in the same + * protocol. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, accountName: string, firewallRuleName: string, parameters: models.CreateOrUpdateFirewallRuleParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates the specified firewall rule. During update, the firewall + * rule with the specified name will be replaced with this new firewall rule. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} firewallRuleName The name of the firewall rule to create or + * update. + * + * @param {object} parameters Parameters supplied to create or update the + * firewall rule. + * + * @param {string} parameters.startIpAddress The start IP address for the + * firewall rule. This can be either ipv4 or ipv6. Start and End should be in + * the same protocol. + * + * @param {string} parameters.endIpAddress The end IP address for the firewall + * rule. This can be either ipv4 or ipv6. Start and End should be in the same + * protocol. + * + * @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 {FirewallRule} - 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. + * + * {FirewallRule} [result] - The deserialized result object if an error did not occur. + * See {@link FirewallRule} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, accountName: string, firewallRuleName: string, parameters: models.CreateOrUpdateFirewallRuleParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, accountName: string, firewallRuleName: string, parameters: models.CreateOrUpdateFirewallRuleParameters, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, accountName: string, firewallRuleName: string, parameters: models.CreateOrUpdateFirewallRuleParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the specified Data Lake Store firewall rule. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} firewallRuleName The name of the firewall rule to retrieve. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, accountName: string, firewallRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the specified Data Lake Store firewall rule. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} firewallRuleName The name of the firewall rule to retrieve. + * + * @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 {FirewallRule} - 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. + * + * {FirewallRule} [result] - The deserialized result object if an error did not occur. + * See {@link FirewallRule} 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, accountName: string, firewallRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, accountName: string, firewallRuleName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, accountName: string, firewallRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates the specified firewall rule. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} firewallRuleName The name of the firewall rule to update. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.parameters] Parameters supplied to update the + * firewall rule. + * + * @param {string} [options.parameters.startIpAddress] The start IP address for + * the firewall rule. This can be either ipv4 or ipv6. Start and End should be + * in the same protocol. + * + * @param {string} [options.parameters.endIpAddress] The end IP address for the + * firewall rule. This can be either ipv4 or ipv6. Start and End should be in + * the same protocol. + * + * @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, accountName: string, firewallRuleName: string, options?: { parameters? : models.UpdateFirewallRuleParameters, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates the specified firewall rule. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} firewallRuleName The name of the firewall rule to update. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.parameters] Parameters supplied to update the + * firewall rule. + * + * @param {string} [options.parameters.startIpAddress] The start IP address for + * the firewall rule. This can be either ipv4 or ipv6. Start and End should be + * in the same protocol. + * + * @param {string} [options.parameters.endIpAddress] The end IP address for the + * firewall rule. This can be either ipv4 or ipv6. Start and End should be in + * the same protocol. + * + * @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 {FirewallRule} - 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. + * + * {FirewallRule} [result] - The deserialized result object if an error did not occur. + * See {@link FirewallRule} 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, accountName: string, firewallRuleName: string, options?: { parameters? : models.UpdateFirewallRuleParameters, customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, accountName: string, firewallRuleName: string, callback: ServiceCallback): void; + update(resourceGroupName: string, accountName: string, firewallRuleName: string, options: { parameters? : models.UpdateFirewallRuleParameters, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified firewall rule from the specified Data Lake Store + * account. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} firewallRuleName The name of the firewall rule to delete. + * + * @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, accountName: string, firewallRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified firewall rule from the specified Data Lake Store + * account. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} firewallRuleName The name of the firewall rule to delete. + * + * @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, accountName: string, firewallRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, accountName: string, firewallRuleName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, accountName: string, firewallRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists the Data Lake Store firewall rules within the specified Data Lake + * Store account. + * + * @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. + */ + listByAccountNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists the Data Lake Store firewall rules within the specified Data Lake + * Store account. + * + * @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 {FirewallRuleListResult} - 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. + * + * {FirewallRuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link FirewallRuleListResult} 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. + */ + listByAccountNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByAccountNext(nextPageLink: string, callback: ServiceCallback): void; + listByAccountNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * VirtualNetworkRules + * __NOTE__: An instance of this class is automatically created for an + * instance of the DataLakeStoreAccountManagementClient. + */ +export interface VirtualNetworkRules { + + + /** + * Lists the Data Lake Store virtual network rules within the specified Data + * Lake Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @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. + */ + listByAccountWithHttpOperationResponse(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists the Data Lake Store virtual network rules within the specified Data + * Lake Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @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 {VirtualNetworkRuleListResult} - 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. + * + * {VirtualNetworkRuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkRuleListResult} 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. + */ + listByAccount(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByAccount(resourceGroupName: string, accountName: string, callback: ServiceCallback): void; + listByAccount(resourceGroupName: string, accountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates the specified virtual network rule. During update, the + * virtual network rule with the specified name will be replaced with this new + * virtual network rule. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} virtualNetworkRuleName The name of the virtual network rule + * to create or update. + * + * @param {object} parameters Parameters supplied to create or update the + * virtual network rule. + * + * @param {string} parameters.subnetId The resource identifier for the subnet. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, accountName: string, virtualNetworkRuleName: string, parameters: models.CreateOrUpdateVirtualNetworkRuleParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates the specified virtual network rule. During update, the + * virtual network rule with the specified name will be replaced with this new + * virtual network rule. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} virtualNetworkRuleName The name of the virtual network rule + * to create or update. + * + * @param {object} parameters Parameters supplied to create or update the + * virtual network rule. + * + * @param {string} parameters.subnetId The resource identifier for the subnet. + * + * @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 {VirtualNetworkRule} - 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. + * + * {VirtualNetworkRule} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkRule} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, accountName: string, virtualNetworkRuleName: string, parameters: models.CreateOrUpdateVirtualNetworkRuleParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, accountName: string, virtualNetworkRuleName: string, parameters: models.CreateOrUpdateVirtualNetworkRuleParameters, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, accountName: string, virtualNetworkRuleName: string, parameters: models.CreateOrUpdateVirtualNetworkRuleParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the specified Data Lake Store virtual network rule. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} virtualNetworkRuleName The name of the virtual network rule + * to retrieve. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, accountName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the specified Data Lake Store virtual network rule. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} virtualNetworkRuleName The name of the virtual network rule + * to retrieve. + * + * @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 {VirtualNetworkRule} - 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. + * + * {VirtualNetworkRule} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkRule} 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, accountName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, accountName: string, virtualNetworkRuleName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, accountName: string, virtualNetworkRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates the specified virtual network rule. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} virtualNetworkRuleName The name of the virtual network rule + * to update. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.parameters] Parameters supplied to update the + * virtual network rule. + * + * @param {string} [options.parameters.subnetId] The resource identifier for + * the subnet. + * + * @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, accountName: string, virtualNetworkRuleName: string, options?: { parameters? : models.UpdateVirtualNetworkRuleParameters, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates the specified virtual network rule. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} virtualNetworkRuleName The name of the virtual network rule + * to update. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.parameters] Parameters supplied to update the + * virtual network rule. + * + * @param {string} [options.parameters.subnetId] The resource identifier for + * the subnet. + * + * @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 {VirtualNetworkRule} - 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. + * + * {VirtualNetworkRule} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkRule} 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, accountName: string, virtualNetworkRuleName: string, options?: { parameters? : models.UpdateVirtualNetworkRuleParameters, customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, accountName: string, virtualNetworkRuleName: string, callback: ServiceCallback): void; + update(resourceGroupName: string, accountName: string, virtualNetworkRuleName: string, options: { parameters? : models.UpdateVirtualNetworkRuleParameters, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified virtual network rule from the specified Data Lake + * Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} virtualNetworkRuleName The name of the virtual network rule + * to delete. + * + * @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, accountName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified virtual network rule from the specified Data Lake + * Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} virtualNetworkRuleName The name of the virtual network rule + * to delete. + * + * @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, accountName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, accountName: string, virtualNetworkRuleName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, accountName: string, virtualNetworkRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists the Data Lake Store virtual network rules within the specified Data + * Lake Store account. + * + * @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. + */ + listByAccountNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists the Data Lake Store virtual network rules within the specified Data + * Lake Store account. + * + * @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 {VirtualNetworkRuleListResult} - 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. + * + * {VirtualNetworkRuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkRuleListResult} 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. + */ + listByAccountNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByAccountNext(nextPageLink: string, callback: ServiceCallback): void; + listByAccountNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * TrustedIdProviders + * __NOTE__: An instance of this class is automatically created for an + * instance of the DataLakeStoreAccountManagementClient. + */ +export interface TrustedIdProviders { + + + /** + * Lists the Data Lake Store trusted identity providers within the specified + * Data Lake Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @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. + */ + listByAccountWithHttpOperationResponse(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists the Data Lake Store trusted identity providers within the specified + * Data Lake Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @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 {TrustedIdProviderListResult} - 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. + * + * {TrustedIdProviderListResult} [result] - The deserialized result object if an error did not occur. + * See {@link TrustedIdProviderListResult} 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. + */ + listByAccount(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByAccount(resourceGroupName: string, accountName: string, callback: ServiceCallback): void; + listByAccount(resourceGroupName: string, accountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates the specified trusted identity provider. During update, + * the trusted identity provider with the specified name will be replaced with + * this new provider + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} trustedIdProviderName The name of the trusted identity + * provider. This is used for differentiation of providers in the account. + * + * @param {object} parameters Parameters supplied to create or replace the + * trusted identity provider. + * + * @param {string} parameters.idProvider The URL of this trusted identity + * provider. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, accountName: string, trustedIdProviderName: string, parameters: models.CreateOrUpdateTrustedIdProviderParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates the specified trusted identity provider. During update, + * the trusted identity provider with the specified name will be replaced with + * this new provider + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} trustedIdProviderName The name of the trusted identity + * provider. This is used for differentiation of providers in the account. + * + * @param {object} parameters Parameters supplied to create or replace the + * trusted identity provider. + * + * @param {string} parameters.idProvider The URL of this trusted identity + * provider. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {TrustedIdProvider} - 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. + * + * {TrustedIdProvider} [result] - The deserialized result object if an error did not occur. + * See {@link TrustedIdProvider} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, accountName: string, trustedIdProviderName: string, parameters: models.CreateOrUpdateTrustedIdProviderParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, accountName: string, trustedIdProviderName: string, parameters: models.CreateOrUpdateTrustedIdProviderParameters, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, accountName: string, trustedIdProviderName: string, parameters: models.CreateOrUpdateTrustedIdProviderParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the specified Data Lake Store trusted identity provider. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} trustedIdProviderName The name of the trusted identity + * provider to retrieve. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, accountName: string, trustedIdProviderName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the specified Data Lake Store trusted identity provider. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} trustedIdProviderName The name of the trusted identity + * provider to retrieve. + * + * @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 {TrustedIdProvider} - 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. + * + * {TrustedIdProvider} [result] - The deserialized result object if an error did not occur. + * See {@link TrustedIdProvider} 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, accountName: string, trustedIdProviderName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, accountName: string, trustedIdProviderName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, accountName: string, trustedIdProviderName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates the specified trusted identity provider. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} trustedIdProviderName The name of the trusted identity + * provider. This is used for differentiation of providers in the account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.parameters] Parameters supplied to update the + * trusted identity provider. + * + * @param {string} [options.parameters.idProvider] The URL of this trusted + * identity provider. + * + * @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, accountName: string, trustedIdProviderName: string, options?: { parameters? : models.UpdateTrustedIdProviderParameters, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates the specified trusted identity provider. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} trustedIdProviderName The name of the trusted identity + * provider. This is used for differentiation of providers in the account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.parameters] Parameters supplied to update the + * trusted identity provider. + * + * @param {string} [options.parameters.idProvider] The URL of this trusted + * identity provider. + * + * @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 {TrustedIdProvider} - 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. + * + * {TrustedIdProvider} [result] - The deserialized result object if an error did not occur. + * See {@link TrustedIdProvider} 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, accountName: string, trustedIdProviderName: string, options?: { parameters? : models.UpdateTrustedIdProviderParameters, customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, accountName: string, trustedIdProviderName: string, callback: ServiceCallback): void; + update(resourceGroupName: string, accountName: string, trustedIdProviderName: string, options: { parameters? : models.UpdateTrustedIdProviderParameters, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the specified trusted identity provider from the specified Data Lake + * Store account + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} trustedIdProviderName The name of the trusted identity + * provider to delete. + * + * @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, accountName: string, trustedIdProviderName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the specified trusted identity provider from the specified Data Lake + * Store account + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} trustedIdProviderName The name of the trusted identity + * provider to delete. + * + * @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, accountName: string, trustedIdProviderName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, accountName: string, trustedIdProviderName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, accountName: string, trustedIdProviderName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists the Data Lake Store trusted identity providers within the specified + * Data Lake Store account. + * + * @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. + */ + listByAccountNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists the Data Lake Store trusted identity providers within the specified + * Data Lake Store account. + * + * @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 {TrustedIdProviderListResult} - 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. + * + * {TrustedIdProviderListResult} [result] - The deserialized result object if an error did not occur. + * See {@link TrustedIdProviderListResult} 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. + */ + listByAccountNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByAccountNext(nextPageLink: string, callback: ServiceCallback): void; + listByAccountNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Operations + * __NOTE__: An instance of this class is automatically created for an + * instance of the DataLakeStoreAccountManagementClient. + */ +export interface Operations { + + + /** + * Lists all of the available Data Lake Store REST API 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>; + + /** + * Lists all of the available Data Lake Store REST API 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 {OperationListResult} - 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. + * + * {OperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} 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; +} + +/** + * @class + * Locations + * __NOTE__: An instance of this class is automatically created for an + * instance of the DataLakeStoreAccountManagementClient. + */ +export interface Locations { + + + /** + * Gets subscription-level properties and limits for Data Lake Store specified + * by resource location. + * + * @param {string} location The resource location without whitespace. + * + * @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. + */ + getCapabilityWithHttpOperationResponse(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets subscription-level properties and limits for Data Lake Store specified + * by resource location. + * + * @param {string} location The resource location without whitespace. + * + * @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 {CapabilityInformation} - 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. + * + * {CapabilityInformation} [result] - The deserialized result object if an error did not occur. + * See {@link CapabilityInformation} 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. + */ + getCapability(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getCapability(location: string, callback: ServiceCallback): void; + getCapability(location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} diff --git a/lib/services/dataLake.Store/lib/filesystem/operations/index.js b/lib/services/datalake.Store/lib/account/operations/index.js similarity index 57% rename from lib/services/dataLake.Store/lib/filesystem/operations/index.js rename to lib/services/datalake.Store/lib/account/operations/index.js index bfe29f562c..e537016285 100644 --- a/lib/services/dataLake.Store/lib/filesystem/operations/index.js +++ b/lib/services/datalake.Store/lib/account/operations/index.js @@ -14,4 +14,9 @@ 'use strict'; -exports.FileSystem = require('./fileSystem'); +exports.Accounts = require('./accounts'); +exports.FirewallRules = require('./firewallRules'); +exports.VirtualNetworkRules = require('./virtualNetworkRules'); +exports.TrustedIdProviders = require('./trustedIdProviders'); +exports.Operations = require('./operations'); +exports.Locations = require('./locations'); diff --git a/lib/services/datalake.Store/lib/account/operations/locations.js b/lib/services/datalake.Store/lib/account/operations/locations.js new file mode 100644 index 0000000000..1a332d914a --- /dev/null +++ b/lib/services/datalake.Store/lib/account/operations/locations.js @@ -0,0 +1,254 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Gets subscription-level properties and limits for Data Lake Store specified + * by resource location. + * + * @param {string} location The resource location without whitespace. + * + * @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 CapabilityInformation} 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 _getCapability(location, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // 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 (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.DataLakeStore/locations/{location}/capability'; + 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 = '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 && statusCode !== 404) { + 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['CapabilityInformation']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a Locations. */ +class Locations { + /** + * Create a Locations. + * @param {DataLakeStoreAccountManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._getCapability = _getCapability; + } + + /** + * Gets subscription-level properties and limits for Data Lake Store specified + * by resource location. + * + * @param {string} location The resource location without whitespace. + * + * @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. + */ + getCapabilityWithHttpOperationResponse(location, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getCapability(location, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets subscription-level properties and limits for Data Lake Store specified + * by resource location. + * + * @param {string} location The resource location without whitespace. + * + * @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 {CapabilityInformation} - 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 CapabilityInformation} 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. + */ + getCapability(location, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getCapability(location, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getCapability(location, options, optionalCallback); + } + } + +} + +module.exports = Locations; diff --git a/lib/services/datalake.Store/lib/account/operations/operations.js b/lib/services/datalake.Store/lib/account/operations/operations.js new file mode 100644 index 0000000000..08191bdc48 --- /dev/null +++ b/lib/services/datalake.Store/lib/account/operations/operations.js @@ -0,0 +1,237 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 of the available Data Lake Store REST API 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 OperationListResult} 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.DataLakeStore/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['OperationListResult']().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 {DataLakeStoreAccountManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + } + + /** + * Lists all of the available Data Lake Store REST API 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; + }); + }); + } + + /** + * Lists all of the available Data Lake Store REST API 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 {OperationListResult} - 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 OperationListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(options, optionalCallback); + } + } + +} + +module.exports = Operations; diff --git a/lib/services/datalake.Store/lib/account/operations/trustedIdProviders.js b/lib/services/datalake.Store/lib/account/operations/trustedIdProviders.js new file mode 100644 index 0000000000..36d1d4b9b6 --- /dev/null +++ b/lib/services/datalake.Store/lib/account/operations/trustedIdProviders.js @@ -0,0 +1,1521 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 the Data Lake Store trusted identity providers within the specified + * Data Lake Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @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 TrustedIdProviderListResult} 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 _listByAccount(resourceGroupName, accountName, 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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName 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 (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.DataLakeStore/accounts/{accountName}/trustedIdProviders'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); + 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['TrustedIdProviderListResult']().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 or updates the specified trusted identity provider. During update, + * the trusted identity provider with the specified name will be replaced with + * this new provider + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} trustedIdProviderName The name of the trusted identity + * provider. This is used for differentiation of providers in the account. + * + * @param {object} parameters Parameters supplied to create or replace the + * trusted identity provider. + * + * @param {string} parameters.idProvider The URL of this trusted identity + * provider. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link TrustedIdProvider} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, accountName, trustedIdProviderName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // 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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (trustedIdProviderName === null || trustedIdProviderName === undefined || typeof trustedIdProviderName.valueOf() !== 'string') { + throw new Error('trustedIdProviderName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.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.DataLakeStore/accounts/{accountName}/trustedIdProviders/{trustedIdProviderName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); + requestUrl = requestUrl.replace('{trustedIdProviderName}', encodeURIComponent(trustedIdProviderName)); + 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 (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['CreateOrUpdateTrustedIdProviderParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + 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['TrustedIdProvider']().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 the specified Data Lake Store trusted identity provider. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} trustedIdProviderName The name of the trusted identity + * provider to retrieve. + * + * @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 TrustedIdProvider} 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, accountName, trustedIdProviderName, 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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (trustedIdProviderName === null || trustedIdProviderName === undefined || typeof trustedIdProviderName.valueOf() !== 'string') { + throw new Error('trustedIdProviderName 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 (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.DataLakeStore/accounts/{accountName}/trustedIdProviders/{trustedIdProviderName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); + requestUrl = requestUrl.replace('{trustedIdProviderName}', encodeURIComponent(trustedIdProviderName)); + 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['TrustedIdProvider']().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 specified trusted identity provider. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} trustedIdProviderName The name of the trusted identity + * provider. This is used for differentiation of providers in the account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.parameters] Parameters supplied to update the + * trusted identity provider. + * + * @param {string} [options.parameters.idProvider] The URL of this trusted + * identity provider. + * + * @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 TrustedIdProvider} 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, accountName, trustedIdProviderName, 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 parameters = (options && options.parameters !== undefined) ? options.parameters : 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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (trustedIdProviderName === null || trustedIdProviderName === undefined || typeof trustedIdProviderName.valueOf() !== 'string') { + throw new Error('trustedIdProviderName 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 (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.DataLakeStore/accounts/{accountName}/trustedIdProviders/{trustedIdProviderName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); + requestUrl = requestUrl.replace('{trustedIdProviderName}', encodeURIComponent(trustedIdProviderName)); + 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 (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['UpdateTrustedIdProviderParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + 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['TrustedIdProvider']().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 the specified trusted identity provider from the specified Data Lake + * Store account + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} trustedIdProviderName The name of the trusted identity + * provider to delete. + * + * @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, accountName, trustedIdProviderName, 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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (trustedIdProviderName === null || trustedIdProviderName === undefined || typeof trustedIdProviderName.valueOf() !== 'string') { + throw new Error('trustedIdProviderName 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 (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.DataLakeStore/accounts/{accountName}/trustedIdProviders/{trustedIdProviderName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); + requestUrl = requestUrl.replace('{trustedIdProviderName}', encodeURIComponent(trustedIdProviderName)); + 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 !== 200 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + 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); + }); +} + +/** + * Lists the Data Lake Store trusted identity providers within the specified + * Data Lake Store account. + * + * @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 TrustedIdProviderListResult} 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 _listByAccountNext(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['TrustedIdProviderListResult']().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 TrustedIdProviders. */ +class TrustedIdProviders { + /** + * Create a TrustedIdProviders. + * @param {DataLakeStoreAccountManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._listByAccount = _listByAccount; + this._createOrUpdate = _createOrUpdate; + this._get = _get; + this._update = _update; + this._deleteMethod = _deleteMethod; + this._listByAccountNext = _listByAccountNext; + } + + /** + * Lists the Data Lake Store trusted identity providers within the specified + * Data Lake Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @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. + */ + listByAccountWithHttpOperationResponse(resourceGroupName, accountName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByAccount(resourceGroupName, accountName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists the Data Lake Store trusted identity providers within the specified + * Data Lake Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @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 {TrustedIdProviderListResult} - 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 TrustedIdProviderListResult} 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. + */ + listByAccount(resourceGroupName, accountName, 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._listByAccount(resourceGroupName, accountName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByAccount(resourceGroupName, accountName, options, optionalCallback); + } + } + + /** + * Creates or updates the specified trusted identity provider. During update, + * the trusted identity provider with the specified name will be replaced with + * this new provider + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} trustedIdProviderName The name of the trusted identity + * provider. This is used for differentiation of providers in the account. + * + * @param {object} parameters Parameters supplied to create or replace the + * trusted identity provider. + * + * @param {string} parameters.idProvider The URL of this trusted identity + * provider. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, accountName, trustedIdProviderName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, accountName, trustedIdProviderName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates the specified trusted identity provider. During update, + * the trusted identity provider with the specified name will be replaced with + * this new provider + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} trustedIdProviderName The name of the trusted identity + * provider. This is used for differentiation of providers in the account. + * + * @param {object} parameters Parameters supplied to create or replace the + * trusted identity provider. + * + * @param {string} parameters.idProvider The URL of this trusted identity + * provider. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {TrustedIdProvider} - 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 TrustedIdProvider} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, accountName, trustedIdProviderName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, accountName, trustedIdProviderName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, accountName, trustedIdProviderName, parameters, options, optionalCallback); + } + } + + /** + * Gets the specified Data Lake Store trusted identity provider. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} trustedIdProviderName The name of the trusted identity + * provider to retrieve. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, accountName, trustedIdProviderName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, accountName, trustedIdProviderName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the specified Data Lake Store trusted identity provider. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} trustedIdProviderName The name of the trusted identity + * provider to retrieve. + * + * @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 {TrustedIdProvider} - 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 TrustedIdProvider} 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, accountName, trustedIdProviderName, 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, accountName, trustedIdProviderName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, accountName, trustedIdProviderName, options, optionalCallback); + } + } + + /** + * Updates the specified trusted identity provider. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} trustedIdProviderName The name of the trusted identity + * provider. This is used for differentiation of providers in the account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.parameters] Parameters supplied to update the + * trusted identity provider. + * + * @param {string} [options.parameters.idProvider] The URL of this trusted + * identity provider. + * + * @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, accountName, trustedIdProviderName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, accountName, trustedIdProviderName, 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 specified trusted identity provider. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} trustedIdProviderName The name of the trusted identity + * provider. This is used for differentiation of providers in the account. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.parameters] Parameters supplied to update the + * trusted identity provider. + * + * @param {string} [options.parameters.idProvider] The URL of this trusted + * identity provider. + * + * @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 {TrustedIdProvider} - 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 TrustedIdProvider} 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, accountName, trustedIdProviderName, 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, accountName, trustedIdProviderName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, accountName, trustedIdProviderName, options, optionalCallback); + } + } + + /** + * Deletes the specified trusted identity provider from the specified Data Lake + * Store account + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} trustedIdProviderName The name of the trusted identity + * provider to delete. + * + * @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, accountName, trustedIdProviderName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, accountName, trustedIdProviderName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified trusted identity provider from the specified Data Lake + * Store account + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} trustedIdProviderName The name of the trusted identity + * provider to delete. + * + * @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, accountName, trustedIdProviderName, 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, accountName, trustedIdProviderName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, accountName, trustedIdProviderName, options, optionalCallback); + } + } + + /** + * Lists the Data Lake Store trusted identity providers within the specified + * Data Lake Store account. + * + * @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. + */ + listByAccountNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByAccountNext(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 the Data Lake Store trusted identity providers within the specified + * Data Lake Store account. + * + * @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 {TrustedIdProviderListResult} - 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 TrustedIdProviderListResult} 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. + */ + listByAccountNext(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._listByAccountNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByAccountNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = TrustedIdProviders; diff --git a/lib/services/datalake.Store/lib/account/operations/virtualNetworkRules.js b/lib/services/datalake.Store/lib/account/operations/virtualNetworkRules.js new file mode 100644 index 0000000000..d893fcd9e1 --- /dev/null +++ b/lib/services/datalake.Store/lib/account/operations/virtualNetworkRules.js @@ -0,0 +1,1518 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 the Data Lake Store virtual network rules within the specified Data + * Lake Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @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 VirtualNetworkRuleListResult} 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 _listByAccount(resourceGroupName, accountName, 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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName 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 (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.DataLakeStore/accounts/{accountName}/virtualNetworkRules'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); + 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['VirtualNetworkRuleListResult']().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 or updates the specified virtual network rule. During update, the + * virtual network rule with the specified name will be replaced with this new + * virtual network rule. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} virtualNetworkRuleName The name of the virtual network rule + * to create or update. + * + * @param {object} parameters Parameters supplied to create or update the + * virtual network rule. + * + * @param {string} parameters.subnetId The resource identifier for the subnet. + * + * @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 VirtualNetworkRule} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, accountName, virtualNetworkRuleName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // 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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (virtualNetworkRuleName === null || virtualNetworkRuleName === undefined || typeof virtualNetworkRuleName.valueOf() !== 'string') { + throw new Error('virtualNetworkRuleName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.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.DataLakeStore/accounts/{accountName}/virtualNetworkRules/{virtualNetworkRuleName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); + requestUrl = requestUrl.replace('{virtualNetworkRuleName}', encodeURIComponent(virtualNetworkRuleName)); + 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 (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['CreateOrUpdateVirtualNetworkRuleParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + 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['VirtualNetworkRule']().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 the specified Data Lake Store virtual network rule. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} virtualNetworkRuleName The name of the virtual network rule + * to retrieve. + * + * @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 VirtualNetworkRule} 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, accountName, virtualNetworkRuleName, 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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (virtualNetworkRuleName === null || virtualNetworkRuleName === undefined || typeof virtualNetworkRuleName.valueOf() !== 'string') { + throw new Error('virtualNetworkRuleName 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 (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.DataLakeStore/accounts/{accountName}/virtualNetworkRules/{virtualNetworkRuleName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); + requestUrl = requestUrl.replace('{virtualNetworkRuleName}', encodeURIComponent(virtualNetworkRuleName)); + 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['VirtualNetworkRule']().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 specified virtual network rule. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} virtualNetworkRuleName The name of the virtual network rule + * to update. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.parameters] Parameters supplied to update the + * virtual network rule. + * + * @param {string} [options.parameters.subnetId] The resource identifier for + * the subnet. + * + * @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 VirtualNetworkRule} 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, accountName, virtualNetworkRuleName, 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 parameters = (options && options.parameters !== undefined) ? options.parameters : 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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (virtualNetworkRuleName === null || virtualNetworkRuleName === undefined || typeof virtualNetworkRuleName.valueOf() !== 'string') { + throw new Error('virtualNetworkRuleName 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 (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.DataLakeStore/accounts/{accountName}/virtualNetworkRules/{virtualNetworkRuleName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); + requestUrl = requestUrl.replace('{virtualNetworkRuleName}', encodeURIComponent(virtualNetworkRuleName)); + 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 (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['UpdateVirtualNetworkRuleParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + 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['VirtualNetworkRule']().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 the specified virtual network rule from the specified Data Lake + * Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} virtualNetworkRuleName The name of the virtual network rule + * to delete. + * + * @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, accountName, virtualNetworkRuleName, 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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { + throw new Error('accountName cannot be null or undefined and it must be of type string.'); + } + if (virtualNetworkRuleName === null || virtualNetworkRuleName === undefined || typeof virtualNetworkRuleName.valueOf() !== 'string') { + throw new Error('virtualNetworkRuleName 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 (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.DataLakeStore/accounts/{accountName}/virtualNetworkRules/{virtualNetworkRuleName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); + requestUrl = requestUrl.replace('{virtualNetworkRuleName}', encodeURIComponent(virtualNetworkRuleName)); + 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 !== 200 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + 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); + }); +} + +/** + * Lists the Data Lake Store virtual network rules within the specified Data + * Lake Store account. + * + * @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 VirtualNetworkRuleListResult} 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 _listByAccountNext(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['VirtualNetworkRuleListResult']().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 VirtualNetworkRules. */ +class VirtualNetworkRules { + /** + * Create a VirtualNetworkRules. + * @param {DataLakeStoreAccountManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._listByAccount = _listByAccount; + this._createOrUpdate = _createOrUpdate; + this._get = _get; + this._update = _update; + this._deleteMethod = _deleteMethod; + this._listByAccountNext = _listByAccountNext; + } + + /** + * Lists the Data Lake Store virtual network rules within the specified Data + * Lake Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @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. + */ + listByAccountWithHttpOperationResponse(resourceGroupName, accountName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByAccount(resourceGroupName, accountName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists the Data Lake Store virtual network rules within the specified Data + * Lake Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @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 {VirtualNetworkRuleListResult} - 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 VirtualNetworkRuleListResult} 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. + */ + listByAccount(resourceGroupName, accountName, 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._listByAccount(resourceGroupName, accountName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByAccount(resourceGroupName, accountName, options, optionalCallback); + } + } + + /** + * Creates or updates the specified virtual network rule. During update, the + * virtual network rule with the specified name will be replaced with this new + * virtual network rule. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} virtualNetworkRuleName The name of the virtual network rule + * to create or update. + * + * @param {object} parameters Parameters supplied to create or update the + * virtual network rule. + * + * @param {string} parameters.subnetId The resource identifier for the subnet. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, accountName, virtualNetworkRuleName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, accountName, virtualNetworkRuleName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates the specified virtual network rule. During update, the + * virtual network rule with the specified name will be replaced with this new + * virtual network rule. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} virtualNetworkRuleName The name of the virtual network rule + * to create or update. + * + * @param {object} parameters Parameters supplied to create or update the + * virtual network rule. + * + * @param {string} parameters.subnetId The resource identifier for the subnet. + * + * @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 {VirtualNetworkRule} - 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 VirtualNetworkRule} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, accountName, virtualNetworkRuleName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, accountName, virtualNetworkRuleName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, accountName, virtualNetworkRuleName, parameters, options, optionalCallback); + } + } + + /** + * Gets the specified Data Lake Store virtual network rule. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} virtualNetworkRuleName The name of the virtual network rule + * to retrieve. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, accountName, virtualNetworkRuleName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, accountName, virtualNetworkRuleName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the specified Data Lake Store virtual network rule. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} virtualNetworkRuleName The name of the virtual network rule + * to retrieve. + * + * @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 {VirtualNetworkRule} - 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 VirtualNetworkRule} 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, accountName, virtualNetworkRuleName, 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, accountName, virtualNetworkRuleName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, accountName, virtualNetworkRuleName, options, optionalCallback); + } + } + + /** + * Updates the specified virtual network rule. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} virtualNetworkRuleName The name of the virtual network rule + * to update. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.parameters] Parameters supplied to update the + * virtual network rule. + * + * @param {string} [options.parameters.subnetId] The resource identifier for + * the subnet. + * + * @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, accountName, virtualNetworkRuleName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, accountName, virtualNetworkRuleName, 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 specified virtual network rule. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} virtualNetworkRuleName The name of the virtual network rule + * to update. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.parameters] Parameters supplied to update the + * virtual network rule. + * + * @param {string} [options.parameters.subnetId] The resource identifier for + * the subnet. + * + * @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 {VirtualNetworkRule} - 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 VirtualNetworkRule} 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, accountName, virtualNetworkRuleName, 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, accountName, virtualNetworkRuleName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, accountName, virtualNetworkRuleName, options, optionalCallback); + } + } + + /** + * Deletes the specified virtual network rule from the specified Data Lake + * Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} virtualNetworkRuleName The name of the virtual network rule + * to delete. + * + * @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, accountName, virtualNetworkRuleName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, accountName, virtualNetworkRuleName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified virtual network rule from the specified Data Lake + * Store account. + * + * @param {string} resourceGroupName The name of the Azure resource group. + * + * @param {string} accountName The name of the Data Lake Store account. + * + * @param {string} virtualNetworkRuleName The name of the virtual network rule + * to delete. + * + * @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, accountName, virtualNetworkRuleName, 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, accountName, virtualNetworkRuleName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, accountName, virtualNetworkRuleName, options, optionalCallback); + } + } + + /** + * Lists the Data Lake Store virtual network rules within the specified Data + * Lake Store account. + * + * @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. + */ + listByAccountNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByAccountNext(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 the Data Lake Store virtual network rules within the specified Data + * Lake Store account. + * + * @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 {VirtualNetworkRuleListResult} - 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 VirtualNetworkRuleListResult} 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. + */ + listByAccountNext(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._listByAccountNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByAccountNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = VirtualNetworkRules; diff --git a/lib/services/datalake.Store/lib/dataLakeStore.js b/lib/services/datalake.Store/lib/dataLakeStore.js deleted file mode 100644 index dd17d35e84..0000000000 --- a/lib/services/datalake.Store/lib/dataLakeStore.js +++ /dev/null @@ -1,20 +0,0 @@ -// -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -'use strict'; - -exports.DataLakeStoreAccountClient = require('./account/dataLakeStoreAccountManagementClient'); -exports.DataLakeStoreFileSystemClient = require('./filesystem/dataLakeStoreFileSystemManagementClient'); -exports = module.exports; \ No newline at end of file diff --git a/lib/services/datalake.Store/lib/datalakeStore.d.ts b/lib/services/datalake.Store/lib/datalakeStore.d.ts deleted file mode 100644 index 71bd5cf725..0000000000 --- a/lib/services/datalake.Store/lib/datalakeStore.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - */ - -import DataLakeStoreAccountClient = require('./account/dataLakeStoreAccountManagementClient'); -import * as StoreAccountModels from './account/models'; - -import DataLakeStoreFileSystemClient = require('./filesystem/dataLakeStoreFileSystemManagementClient'); -import * as FileSystemModels from './filesystem/models'; - - -export { DataLakeStoreAccountClient, StoreAccountModels, DataLakeStoreFileSystemClient, FileSystemModels }; \ No newline at end of file From cb2b8ac9103905c4e14674a0345fd64aa0c0db3f Mon Sep 17 00:00:00 2001 From: Dan Schulte Date: Thu, 15 Nov 2018 14:27:39 -0800 Subject: [PATCH 6/8] Add back LICENSE, README, and package.json --- lib/services/datalake.Store/LICENSE.txt | 21 +++++ lib/services/datalake.Store/README.md | 115 +++++++++++++++++++++++ lib/services/datalake.Store/package.json | 35 +++++++ 3 files changed, 171 insertions(+) create mode 100644 lib/services/datalake.Store/LICENSE.txt create mode 100644 lib/services/datalake.Store/README.md create mode 100644 lib/services/datalake.Store/package.json diff --git a/lib/services/datalake.Store/LICENSE.txt b/lib/services/datalake.Store/LICENSE.txt new file mode 100644 index 0000000000..0313a903d7 --- /dev/null +++ b/lib/services/datalake.Store/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2017 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/lib/services/datalake.Store/README.md b/lib/services/datalake.Store/README.md new file mode 100644 index 0000000000..c176700aa6 --- /dev/null +++ b/lib/services/datalake.Store/README.md @@ -0,0 +1,115 @@ +# Microsoft Azure SDK for Node.js - Data Lake Store + +This project provides a Node.js package that makes it easy to manage Azure Data Lake Store accounts. + +Right now it supports: + + * **Node.js version: 6.x.x or higher** + +## Features + +- Account management: create, get, list, update, and delete. +- File system management: create, get, upload, append, download, read, delete, list. + +## How to Install + +```bash +npm install azure-arm-datalake-store +``` + +## How to Use + +### Authentication, account and filesystem client creation and listing file status as an example + + ```javascript + var msRestAzure = require('ms-rest-azure'); + var adlsManagement = require("azure-arm-datalake-store"); + + // Interactive Login + // It provides a url and code that needs to be copied and pasted in a browser and authenticated over there. If successful, + // the user will get a DeviceTokenCredentials object. + msRestAzure.interactiveLogin(function(err, credentials) { + var accountName = 'testadlsacct'; + var pathToEnumerate = '/myfolder'; + var acccountClient = new adlsManagement.DataLakeStoreAccountClient(credentials, 'your-subscription-id'); + var filesystemClient = new adlsManagement.DataLakeStoreFileSystemClient(credentials, 'azuredatalakestore.net'); + filesystemClient.fileSystem.listFileStatus(accountName, pathToEnumerate, function(err, result, request, response) { + if (err) console.log(err); + console.log(result); + }); + }); + ``` + +### Create a Data Lake Store Account +```javascript +var util = require('util'); +var resourceGroupName = 'testrg'; +var accountName = 'testadlsacct'; +var location = 'eastus2'; + +// account object to create +var accountToCreate = { + tags: { + testtag1: 'testvalue1', + testtag2: 'testvalue2' + }, + location: location +}; + +client.account.create(resourceGroupName, accountName, accountToCreate, function (err, result, request, response) { + if (err) { + console.log(err); + /*err has reference to the actual request and response, so you can see what was sent and received on the wire. + The structure of err looks like this: + err: { + code: 'Error Code', + message: 'Error Message', + body: 'The response body if any', + request: reference to a stripped version of http request + response: reference to a stripped version of the response + } + */ + } else { + console.log('result is: ' + util.inspect(result, {depth: null})); + } +}); +``` + +### Create a file with content +```javascript +var util = require('util'); +var accountName = 'testadlsacct'; +var fileToCreate = '/myfolder/myfile.txt'; +var options = { + streamContents: new Buffer('some string content') +} + +filesystemClient.fileSystem.listFileStatus(accountName, fileToCreate, options, function (err, result, request, response) { + if (err) { + console.log(err); + } else { + // no result is returned, only a 201 response for success. + console.log('response is: ' + util.inspect(response, {depth: null})); + } +}); +``` + +### Get a list of files and folders + +```javascript +var util = require('util'); +var accountName = 'testadlsacct'; +var pathToEnumerate = '/myfolder'; +filesystemClient.fileSystem.listFileStatus(accountName, pathToEnumerate, function (err, result, request, response) { + if (err) { + console.log(err); + } else { + console.log('result is: ' + util.inspect(result, {depth: null})); + } +}); +``` + +## Related projects + +- [Microsoft Azure SDK for Node.js](https://github.com/azure/azure-sdk-for-node) +- [Microsoft Azure SDK for Node.js - Data Lake Analytics Management](https://github.com/Azure/azure-sdk-for-node/tree/autorest/lib/services/dataLake.Store) diff --git a/lib/services/datalake.Store/package.json b/lib/services/datalake.Store/package.json new file mode 100644 index 0000000000..00c01dcc5e --- /dev/null +++ b/lib/services/datalake.Store/package.json @@ -0,0 +1,35 @@ +{ + "name": "azure-arm-datalake-store", + "author": "Microsoft Corporation", + "contributors": [ + "Goldsmith, Benjamin " + ], + "version": "3.1.0-preview", + "description": "Microsoft Azure Data Lake Store Management Client Library for node", + "tags": [ + "azure", + "sdk" + ], + "keywords": [ + "node", + "azure" + ], + "main": "./lib/dataLakeStore.js", + "types": "./lib/dataLakeStore.d.ts", + "license": "MIT", + "dependencies": { + "ms-rest": "^2.2.2", + "ms-rest-azure": "^2.3.3" + }, + "homepage": "http://github.com/Azure/azure-sdk-for-node", + "repository": { + "type": "git", + "url": "git@github.com:Azure/azure-sdk-for-node.git" + }, + "bugs": { + "url": "http://github.com/Azure/azure-sdk-for-node/issues" + }, + "scripts": { + "test": "npm -s run-script jshint" + } +} \ No newline at end of file From 2fc4629be0c2620fc4c82cf38bcd0ead0a2e6f52 Mon Sep 17 00:00:00 2001 From: Dan Schulte Date: Thu, 15 Nov 2018 14:51:19 -0800 Subject: [PATCH 7/8] Rename dataLake.Store to datalake.Store --- lib/services/dataLake.Store/LICENSE.txt | 21 - lib/services/dataLake.Store/README.md | 115 - .../dataLakeStoreAccountManagementClient.d.ts | 67 - .../dataLakeStoreAccountManagementClient.js | 90 - .../account/models/dataLakeStoreAccount.js | 346 - .../models/dataLakeStoreAccountBasic.js | 156 - .../models/dataLakeStoreAccountListResult.js | 69 - .../lib/account/models/encryptionConfig.js | 71 - .../lib/account/models/encryptionIdentity.js | 73 - .../lib/account/models/firewallRule.js | 94 - .../lib/account/models/index.d.ts | 730 -- .../lib/account/models/index.js | 56 - .../lib/account/models/keyVaultMetaInfo.js | 71 - .../lib/account/models/resource.js | 100 - .../lib/account/models/subResource.js | 75 - .../lib/account/models/trustedIdProvider.js | 81 - .../account/models/updateEncryptionConfig.js | 56 - .../models/updateFirewallRuleParameters.js | 64 - .../account/models/updateKeyVaultMetaInfo.js | 53 - .../updateTrustedIdProviderParameters.js | 52 - .../lib/account/operations/firewallRules.js | 1539 ----- .../lib/account/operations/index.d.ts | 2733 -------- .../lib/account/operations/index.js | 22 - .../account/operations/trustedIdProviders.js | 1521 ----- ...taLakeStoreFileSystemManagementClient.d.ts | 82 - ...dataLakeStoreFileSystemManagementClient.js | 81 - .../lib/filesystem/models/aclStatus.js | 95 - .../lib/filesystem/models/aclStatusResult.js | 62 - .../models/adlsAccessControlException.js | 79 - .../models/adlsBadOffsetException.js | 79 - .../lib/filesystem/models/adlsError.js | 67 - .../models/adlsFileAlreadyExistsException.js | 78 - .../models/adlsFileNotFoundException.js | 78 - .../lib/filesystem/models/adlsIOException.js | 78 - .../models/adlsIllegalArgumentException.js | 78 - .../filesystem/models/adlsRemoteException.js | 80 - .../filesystem/models/adlsRuntimeException.js | 79 - .../models/adlsSecurityException.js | 78 - .../models/adlsThrottledException.js | 79 - .../adlsUnsupportedOperationException.js | 78 - .../lib/filesystem/models/contentSummary.js | 80 - .../filesystem/models/contentSummaryResult.js | 62 - .../filesystem/models/fileOperationResult.js | 54 - .../filesystem/models/fileStatusProperties.js | 149 - .../lib/filesystem/models/fileStatusResult.js | 73 - .../lib/filesystem/models/fileStatuses.js | 62 - .../filesystem/models/fileStatusesResult.js | 57 - .../lib/filesystem/models/index.d.ts | 276 - .../lib/filesystem/models/index.js | 54 - .../lib/filesystem/operations/fileSystem.js | 5855 ----------------- .../lib/filesystem/operations/index.d.ts | 1758 ----- .../lib/filesystem/operations/index.js | 17 - lib/services/dataLake.Store/package.json | 35 - 53 files changed, 18038 deletions(-) delete mode 100644 lib/services/dataLake.Store/LICENSE.txt delete mode 100644 lib/services/dataLake.Store/README.md delete mode 100644 lib/services/dataLake.Store/lib/account/dataLakeStoreAccountManagementClient.d.ts delete mode 100644 lib/services/dataLake.Store/lib/account/dataLakeStoreAccountManagementClient.js delete mode 100644 lib/services/dataLake.Store/lib/account/models/dataLakeStoreAccount.js delete mode 100644 lib/services/dataLake.Store/lib/account/models/dataLakeStoreAccountBasic.js delete mode 100644 lib/services/dataLake.Store/lib/account/models/dataLakeStoreAccountListResult.js delete mode 100644 lib/services/dataLake.Store/lib/account/models/encryptionConfig.js delete mode 100644 lib/services/dataLake.Store/lib/account/models/encryptionIdentity.js delete mode 100644 lib/services/dataLake.Store/lib/account/models/firewallRule.js delete mode 100644 lib/services/dataLake.Store/lib/account/models/index.d.ts delete mode 100644 lib/services/dataLake.Store/lib/account/models/index.js delete mode 100644 lib/services/dataLake.Store/lib/account/models/keyVaultMetaInfo.js delete mode 100644 lib/services/dataLake.Store/lib/account/models/resource.js delete mode 100644 lib/services/dataLake.Store/lib/account/models/subResource.js delete mode 100644 lib/services/dataLake.Store/lib/account/models/trustedIdProvider.js delete mode 100644 lib/services/dataLake.Store/lib/account/models/updateEncryptionConfig.js delete mode 100644 lib/services/dataLake.Store/lib/account/models/updateFirewallRuleParameters.js delete mode 100644 lib/services/dataLake.Store/lib/account/models/updateKeyVaultMetaInfo.js delete mode 100644 lib/services/dataLake.Store/lib/account/models/updateTrustedIdProviderParameters.js delete mode 100644 lib/services/dataLake.Store/lib/account/operations/firewallRules.js delete mode 100644 lib/services/dataLake.Store/lib/account/operations/index.d.ts delete mode 100644 lib/services/dataLake.Store/lib/account/operations/index.js delete mode 100644 lib/services/dataLake.Store/lib/account/operations/trustedIdProviders.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/dataLakeStoreFileSystemManagementClient.d.ts delete mode 100644 lib/services/dataLake.Store/lib/filesystem/dataLakeStoreFileSystemManagementClient.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/aclStatus.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/aclStatusResult.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/adlsAccessControlException.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/adlsBadOffsetException.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/adlsError.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/adlsFileAlreadyExistsException.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/adlsFileNotFoundException.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/adlsIOException.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/adlsIllegalArgumentException.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/adlsRemoteException.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/adlsRuntimeException.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/adlsSecurityException.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/adlsThrottledException.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/adlsUnsupportedOperationException.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/contentSummary.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/contentSummaryResult.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/fileOperationResult.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/fileStatusProperties.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/fileStatusResult.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/fileStatuses.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/fileStatusesResult.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/index.d.ts delete mode 100644 lib/services/dataLake.Store/lib/filesystem/models/index.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/operations/fileSystem.js delete mode 100644 lib/services/dataLake.Store/lib/filesystem/operations/index.d.ts delete mode 100644 lib/services/dataLake.Store/lib/filesystem/operations/index.js delete mode 100644 lib/services/dataLake.Store/package.json diff --git a/lib/services/dataLake.Store/LICENSE.txt b/lib/services/dataLake.Store/LICENSE.txt deleted file mode 100644 index 0313a903d7..0000000000 --- a/lib/services/dataLake.Store/LICENSE.txt +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2017 Microsoft - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/lib/services/dataLake.Store/README.md b/lib/services/dataLake.Store/README.md deleted file mode 100644 index c176700aa6..0000000000 --- a/lib/services/dataLake.Store/README.md +++ /dev/null @@ -1,115 +0,0 @@ -# Microsoft Azure SDK for Node.js - Data Lake Store - -This project provides a Node.js package that makes it easy to manage Azure Data Lake Store accounts. - -Right now it supports: - - * **Node.js version: 6.x.x or higher** - -## Features - -- Account management: create, get, list, update, and delete. -- File system management: create, get, upload, append, download, read, delete, list. - -## How to Install - -```bash -npm install azure-arm-datalake-store -``` - -## How to Use - -### Authentication, account and filesystem client creation and listing file status as an example - - ```javascript - var msRestAzure = require('ms-rest-azure'); - var adlsManagement = require("azure-arm-datalake-store"); - - // Interactive Login - // It provides a url and code that needs to be copied and pasted in a browser and authenticated over there. If successful, - // the user will get a DeviceTokenCredentials object. - msRestAzure.interactiveLogin(function(err, credentials) { - var accountName = 'testadlsacct'; - var pathToEnumerate = '/myfolder'; - var acccountClient = new adlsManagement.DataLakeStoreAccountClient(credentials, 'your-subscription-id'); - var filesystemClient = new adlsManagement.DataLakeStoreFileSystemClient(credentials, 'azuredatalakestore.net'); - filesystemClient.fileSystem.listFileStatus(accountName, pathToEnumerate, function(err, result, request, response) { - if (err) console.log(err); - console.log(result); - }); - }); - ``` - -### Create a Data Lake Store Account -```javascript -var util = require('util'); -var resourceGroupName = 'testrg'; -var accountName = 'testadlsacct'; -var location = 'eastus2'; - -// account object to create -var accountToCreate = { - tags: { - testtag1: 'testvalue1', - testtag2: 'testvalue2' - }, - location: location -}; - -client.account.create(resourceGroupName, accountName, accountToCreate, function (err, result, request, response) { - if (err) { - console.log(err); - /*err has reference to the actual request and response, so you can see what was sent and received on the wire. - The structure of err looks like this: - err: { - code: 'Error Code', - message: 'Error Message', - body: 'The response body if any', - request: reference to a stripped version of http request - response: reference to a stripped version of the response - } - */ - } else { - console.log('result is: ' + util.inspect(result, {depth: null})); - } -}); -``` - -### Create a file with content -```javascript -var util = require('util'); -var accountName = 'testadlsacct'; -var fileToCreate = '/myfolder/myfile.txt'; -var options = { - streamContents: new Buffer('some string content') -} - -filesystemClient.fileSystem.listFileStatus(accountName, fileToCreate, options, function (err, result, request, response) { - if (err) { - console.log(err); - } else { - // no result is returned, only a 201 response for success. - console.log('response is: ' + util.inspect(response, {depth: null})); - } -}); -``` - -### Get a list of files and folders - -```javascript -var util = require('util'); -var accountName = 'testadlsacct'; -var pathToEnumerate = '/myfolder'; -filesystemClient.fileSystem.listFileStatus(accountName, pathToEnumerate, function (err, result, request, response) { - if (err) { - console.log(err); - } else { - console.log('result is: ' + util.inspect(result, {depth: null})); - } -}); -``` - -## Related projects - -- [Microsoft Azure SDK for Node.js](https://github.com/azure/azure-sdk-for-node) -- [Microsoft Azure SDK for Node.js - Data Lake Analytics Management](https://github.com/Azure/azure-sdk-for-node/tree/autorest/lib/services/dataLake.Store) diff --git a/lib/services/dataLake.Store/lib/account/dataLakeStoreAccountManagementClient.d.ts b/lib/services/dataLake.Store/lib/account/dataLakeStoreAccountManagementClient.d.ts deleted file mode 100644 index 511c8934ee..0000000000 --- a/lib/services/dataLake.Store/lib/account/dataLakeStoreAccountManagementClient.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * 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 DataLakeStoreAccountManagementClient extends AzureServiceClient { - /** - * Initializes a new instance of the DataLakeStoreAccountManagementClient class. - * @constructor - * - * @class - * @param {credentials} credentials - Credentials needed for the client to connect to Azure. - * - * @param {string} subscriptionId - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - * - * @param {string} [baseUri] - The base URI of the service. - * - * @param {object} [options] - The parameter options - * - * @param {Array} [options.filters] - Filters to be added to the request pipeline - * - * @param {object} [options.requestOptions] - Options for the underlying request object - * {@link https://github.com/request/request#requestoptions-callback Options doc} - * - * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy - * - * @param {string} [options.acceptLanguage] - The preferred language for the response. - * - * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. - * - * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. - * - */ - constructor(credentials: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions); - - credentials: ServiceClientCredentials; - - subscriptionId: string; - - apiVersion: string; - - acceptLanguage: string; - - longRunningOperationRetryTimeout: number; - - generateClientRequestId: boolean; - - // Operation groups - accounts: operations.Accounts; - firewallRules: operations.FirewallRules; - virtualNetworkRules: operations.VirtualNetworkRules; - trustedIdProviders: operations.TrustedIdProviders; - operations: operations.Operations; - locations: operations.Locations; -} - -export { DataLakeStoreAccountManagementClient, models as DataLakeStoreAccountManagementModels }; diff --git a/lib/services/dataLake.Store/lib/account/dataLakeStoreAccountManagementClient.js b/lib/services/dataLake.Store/lib/account/dataLakeStoreAccountManagementClient.js deleted file mode 100644 index 9ccf8f3e43..0000000000 --- a/lib/services/dataLake.Store/lib/account/dataLakeStoreAccountManagementClient.js +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * 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 DataLakeStoreAccountManagementClient. */ -class DataLakeStoreAccountManagementClient extends ServiceClient { - /** - * Create a DataLakeStoreAccountManagementClient. - * @param {credentials} credentials - Credentials needed for the client to connect to Azure. - * @param {string} subscriptionId - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - * @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 = '2016-11-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.accounts = new operations.Accounts(this); - this.firewallRules = new operations.FirewallRules(this); - this.virtualNetworkRules = new operations.VirtualNetworkRules(this); - this.trustedIdProviders = new operations.TrustedIdProviders(this); - this.operations = new operations.Operations(this); - this.locations = new operations.Locations(this); - this.models = models; - msRest.addSerializationMixin(this); - } - -} - -module.exports = DataLakeStoreAccountManagementClient; -module.exports['default'] = DataLakeStoreAccountManagementClient; -module.exports.DataLakeStoreAccountManagementClient = DataLakeStoreAccountManagementClient; -module.exports.DataLakeStoreAccountManagementModels = models; diff --git a/lib/services/dataLake.Store/lib/account/models/dataLakeStoreAccount.js b/lib/services/dataLake.Store/lib/account/models/dataLakeStoreAccount.js deleted file mode 100644 index cac3fd0983..0000000000 --- a/lib/services/dataLake.Store/lib/account/models/dataLakeStoreAccount.js +++ /dev/null @@ -1,346 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * 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'); - -/** - * Data Lake Store account information. - * - * @extends models['Resource'] - */ -class DataLakeStoreAccount extends models['Resource'] { - /** - * Create a DataLakeStoreAccount. - * @property {object} [identity] The Key Vault encryption identity, if any. - * @property {uuid} [identity.principalId] The principal identifier - * associated with the encryption. - * @property {uuid} [identity.tenantId] The tenant identifier associated with - * the encryption. - * @property {uuid} [accountId] The unique identifier associated with this - * Data Lake Store account. - * @property {string} [provisioningState] The provisioning status of the Data - * Lake Store account. Possible values include: 'Failed', 'Creating', - * 'Running', 'Succeeded', 'Patching', 'Suspending', 'Resuming', 'Deleting', - * 'Deleted', 'Undeleting', 'Canceled' - * @property {string} [state] The state of the Data Lake Store account. - * Possible values include: 'Active', 'Suspended' - * @property {date} [creationTime] The account creation time. - * @property {date} [lastModifiedTime] The account last modified time. - * @property {string} [endpoint] The full CName endpoint for this account. - * @property {string} [defaultGroup] The default owner group for all new - * folders and files created in the Data Lake Store account. - * @property {object} [encryptionConfig] The Key Vault encryption - * configuration. - * @property {string} [encryptionConfig.type] The type of encryption - * configuration being used. Currently the only supported types are - * 'UserManaged' and 'ServiceManaged'. Possible values include: - * 'UserManaged', 'ServiceManaged' - * @property {object} [encryptionConfig.keyVaultMetaInfo] The Key Vault - * information for connecting to user managed encryption keys. - * @property {string} [encryptionConfig.keyVaultMetaInfo.keyVaultResourceId] - * The resource identifier for the user managed Key Vault being used to - * encrypt. - * @property {string} [encryptionConfig.keyVaultMetaInfo.encryptionKeyName] - * The name of the user managed encryption key. - * @property {string} - * [encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] The version of - * the user managed encryption key. - * @property {string} [encryptionState] The current state of encryption for - * this Data Lake Store account. Possible values include: 'Enabled', - * 'Disabled' - * @property {string} [encryptionProvisioningState] The current state of - * encryption provisioning for this Data Lake Store account. Possible values - * include: 'Creating', 'Succeeded' - * @property {array} [firewallRules] The list of firewall rules associated - * with this Data Lake Store account. - * @property {array} [virtualNetworkRules] The list of virtual network rules - * associated with this Data Lake Store account. - * @property {string} [firewallState] The current state of the IP address - * firewall for this Data Lake Store account. Possible values include: - * 'Enabled', 'Disabled' - * @property {string} [firewallAllowAzureIps] The current state of allowing - * or disallowing IPs originating within Azure through the firewall. If the - * firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' - * @property {array} [trustedIdProviders] The list of trusted identity - * providers associated with this Data Lake Store account. - * @property {string} [trustedIdProviderState] The current state of the - * trusted identity provider feature for this Data Lake Store account. - * Possible values include: 'Enabled', 'Disabled' - * @property {string} [newTier] The commitment tier to use for next month. - * Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', - * 'Commitment_1PB', 'Commitment_5PB' - * @property {string} [currentTier] The commitment tier in use for the - * current month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', - * 'Commitment_1PB', 'Commitment_5PB' - */ - constructor() { - super(); - } - - /** - * Defines the metadata of DataLakeStoreAccount - * - * @returns {object} metadata of DataLakeStoreAccount - * - */ - mapper() { - return { - required: false, - serializedName: 'DataLakeStoreAccount', - type: { - name: 'Composite', - className: 'DataLakeStoreAccount', - modelProperties: { - id: { - required: false, - readOnly: true, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - readOnly: true, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - readOnly: true, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - identity: { - required: false, - readOnly: true, - serializedName: 'identity', - type: { - name: 'Composite', - className: 'EncryptionIdentity' - } - }, - accountId: { - required: false, - readOnly: true, - serializedName: 'properties.accountId', - type: { - name: 'String' - } - }, - provisioningState: { - required: false, - readOnly: true, - serializedName: 'properties.provisioningState', - type: { - name: 'Enum', - allowedValues: [ 'Failed', 'Creating', 'Running', 'Succeeded', 'Patching', 'Suspending', 'Resuming', 'Deleting', 'Deleted', 'Undeleting', 'Canceled' ] - } - }, - state: { - required: false, - readOnly: true, - serializedName: 'properties.state', - type: { - name: 'Enum', - allowedValues: [ 'Active', 'Suspended' ] - } - }, - creationTime: { - required: false, - readOnly: true, - serializedName: 'properties.creationTime', - type: { - name: 'DateTime' - } - }, - lastModifiedTime: { - required: false, - readOnly: true, - serializedName: 'properties.lastModifiedTime', - type: { - name: 'DateTime' - } - }, - endpoint: { - required: false, - readOnly: true, - serializedName: 'properties.endpoint', - type: { - name: 'String' - } - }, - defaultGroup: { - required: false, - readOnly: true, - serializedName: 'properties.defaultGroup', - type: { - name: 'String' - } - }, - encryptionConfig: { - required: false, - readOnly: true, - serializedName: 'properties.encryptionConfig', - type: { - name: 'Composite', - className: 'EncryptionConfig' - } - }, - encryptionState: { - required: false, - readOnly: true, - serializedName: 'properties.encryptionState', - type: { - name: 'Enum', - allowedValues: [ 'Enabled', 'Disabled' ] - } - }, - encryptionProvisioningState: { - required: false, - readOnly: true, - serializedName: 'properties.encryptionProvisioningState', - type: { - name: 'Enum', - allowedValues: [ 'Creating', 'Succeeded' ] - } - }, - firewallRules: { - required: false, - readOnly: true, - serializedName: 'properties.firewallRules', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'FirewallRuleElementType', - type: { - name: 'Composite', - className: 'FirewallRule' - } - } - } - }, - virtualNetworkRules: { - required: false, - readOnly: true, - serializedName: 'properties.virtualNetworkRules', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'VirtualNetworkRuleElementType', - type: { - name: 'Composite', - className: 'VirtualNetworkRule' - } - } - } - }, - firewallState: { - required: false, - readOnly: true, - serializedName: 'properties.firewallState', - type: { - name: 'Enum', - allowedValues: [ 'Enabled', 'Disabled' ] - } - }, - firewallAllowAzureIps: { - required: false, - readOnly: true, - serializedName: 'properties.firewallAllowAzureIps', - type: { - name: 'Enum', - allowedValues: [ 'Enabled', 'Disabled' ] - } - }, - trustedIdProviders: { - required: false, - readOnly: true, - serializedName: 'properties.trustedIdProviders', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'TrustedIdProviderElementType', - type: { - name: 'Composite', - className: 'TrustedIdProvider' - } - } - } - }, - trustedIdProviderState: { - required: false, - readOnly: true, - serializedName: 'properties.trustedIdProviderState', - type: { - name: 'Enum', - allowedValues: [ 'Enabled', 'Disabled' ] - } - }, - newTier: { - required: false, - readOnly: true, - serializedName: 'properties.newTier', - type: { - name: 'Enum', - allowedValues: [ 'Consumption', 'Commitment_1TB', 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', 'Commitment_5PB' ] - } - }, - currentTier: { - required: false, - readOnly: true, - serializedName: 'properties.currentTier', - type: { - name: 'Enum', - allowedValues: [ 'Consumption', 'Commitment_1TB', 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', 'Commitment_5PB' ] - } - } - } - } - }; - } -} - -module.exports = DataLakeStoreAccount; diff --git a/lib/services/dataLake.Store/lib/account/models/dataLakeStoreAccountBasic.js b/lib/services/dataLake.Store/lib/account/models/dataLakeStoreAccountBasic.js deleted file mode 100644 index e829771eeb..0000000000 --- a/lib/services/dataLake.Store/lib/account/models/dataLakeStoreAccountBasic.js +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * 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'); - -/** - * Basic Data Lake Store account information, returned on list calls. - * - * @extends models['Resource'] - */ -class DataLakeStoreAccountBasic extends models['Resource'] { - /** - * Create a DataLakeStoreAccountBasic. - * @property {uuid} [accountId] The unique identifier associated with this - * Data Lake Store account. - * @property {string} [provisioningState] The provisioning status of the Data - * Lake Store account. Possible values include: 'Failed', 'Creating', - * 'Running', 'Succeeded', 'Patching', 'Suspending', 'Resuming', 'Deleting', - * 'Deleted', 'Undeleting', 'Canceled' - * @property {string} [state] The state of the Data Lake Store account. - * Possible values include: 'Active', 'Suspended' - * @property {date} [creationTime] The account creation time. - * @property {date} [lastModifiedTime] The account last modified time. - * @property {string} [endpoint] The full CName endpoint for this account. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of DataLakeStoreAccountBasic - * - * @returns {object} metadata of DataLakeStoreAccountBasic - * - */ - mapper() { - return { - required: false, - serializedName: 'DataLakeStoreAccountBasic', - type: { - name: 'Composite', - className: 'DataLakeStoreAccountBasic', - modelProperties: { - id: { - required: false, - readOnly: true, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - readOnly: true, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - readOnly: true, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - accountId: { - required: false, - readOnly: true, - serializedName: 'properties.accountId', - type: { - name: 'String' - } - }, - provisioningState: { - required: false, - readOnly: true, - serializedName: 'properties.provisioningState', - type: { - name: 'Enum', - allowedValues: [ 'Failed', 'Creating', 'Running', 'Succeeded', 'Patching', 'Suspending', 'Resuming', 'Deleting', 'Deleted', 'Undeleting', 'Canceled' ] - } - }, - state: { - required: false, - readOnly: true, - serializedName: 'properties.state', - type: { - name: 'Enum', - allowedValues: [ 'Active', 'Suspended' ] - } - }, - creationTime: { - required: false, - readOnly: true, - serializedName: 'properties.creationTime', - type: { - name: 'DateTime' - } - }, - lastModifiedTime: { - required: false, - readOnly: true, - serializedName: 'properties.lastModifiedTime', - type: { - name: 'DateTime' - } - }, - endpoint: { - required: false, - readOnly: true, - serializedName: 'properties.endpoint', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = DataLakeStoreAccountBasic; diff --git a/lib/services/dataLake.Store/lib/account/models/dataLakeStoreAccountListResult.js b/lib/services/dataLake.Store/lib/account/models/dataLakeStoreAccountListResult.js deleted file mode 100644 index 7b0f0f80a0..0000000000 --- a/lib/services/dataLake.Store/lib/account/models/dataLakeStoreAccountListResult.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Data Lake Store account list information response. - */ -class DataLakeStoreAccountListResult extends Array { - /** - * Create a DataLakeStoreAccountListResult. - * @property {string} [nextLink] The link (url) to the next page of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of DataLakeStoreAccountListResult - * - * @returns {object} metadata of DataLakeStoreAccountListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'DataLakeStoreAccountListResult', - type: { - name: 'Composite', - className: 'DataLakeStoreAccountListResult', - modelProperties: { - value: { - required: false, - readOnly: true, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'DataLakeStoreAccountBasicElementType', - type: { - name: 'Composite', - className: 'DataLakeStoreAccountBasic' - } - } - } - }, - nextLink: { - required: false, - readOnly: true, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = DataLakeStoreAccountListResult; diff --git a/lib/services/dataLake.Store/lib/account/models/encryptionConfig.js b/lib/services/dataLake.Store/lib/account/models/encryptionConfig.js deleted file mode 100644 index 5c853d8d45..0000000000 --- a/lib/services/dataLake.Store/lib/account/models/encryptionConfig.js +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * 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 encryption configuration for the account. - * - */ -class EncryptionConfig { - /** - * Create a EncryptionConfig. - * @property {string} type The type of encryption configuration being used. - * Currently the only supported types are 'UserManaged' and 'ServiceManaged'. - * Possible values include: 'UserManaged', 'ServiceManaged' - * @property {object} [keyVaultMetaInfo] The Key Vault information for - * connecting to user managed encryption keys. - * @property {string} [keyVaultMetaInfo.keyVaultResourceId] The resource - * identifier for the user managed Key Vault being used to encrypt. - * @property {string} [keyVaultMetaInfo.encryptionKeyName] The name of the - * user managed encryption key. - * @property {string} [keyVaultMetaInfo.encryptionKeyVersion] The version of - * the user managed encryption key. - */ - constructor() { - } - - /** - * Defines the metadata of EncryptionConfig - * - * @returns {object} metadata of EncryptionConfig - * - */ - mapper() { - return { - required: false, - serializedName: 'EncryptionConfig', - type: { - name: 'Composite', - className: 'EncryptionConfig', - modelProperties: { - type: { - required: true, - serializedName: 'type', - type: { - name: 'Enum', - allowedValues: [ 'UserManaged', 'ServiceManaged' ] - } - }, - keyVaultMetaInfo: { - required: false, - serializedName: 'keyVaultMetaInfo', - type: { - name: 'Composite', - className: 'KeyVaultMetaInfo' - } - } - } - } - }; - } -} - -module.exports = EncryptionConfig; diff --git a/lib/services/dataLake.Store/lib/account/models/encryptionIdentity.js b/lib/services/dataLake.Store/lib/account/models/encryptionIdentity.js deleted file mode 100644 index 319cac9cc2..0000000000 --- a/lib/services/dataLake.Store/lib/account/models/encryptionIdentity.js +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * 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 encryption identity properties. - * - */ -class EncryptionIdentity { - /** - * Create a EncryptionIdentity. - * @property {uuid} [principalId] The principal identifier associated with - * the encryption. - * @property {uuid} [tenantId] The tenant identifier associated with the - * encryption. - */ - constructor() { - } - - /** - * Defines the metadata of EncryptionIdentity - * - * @returns {object} metadata of EncryptionIdentity - * - */ - mapper() { - return { - required: false, - serializedName: 'EncryptionIdentity', - type: { - name: 'Composite', - className: 'EncryptionIdentity', - modelProperties: { - type: { - required: true, - isConstant: true, - serializedName: 'type', - defaultValue: 'SystemAssigned', - type: { - name: 'String' - } - }, - principalId: { - required: false, - readOnly: true, - serializedName: 'principalId', - type: { - name: 'String' - } - }, - tenantId: { - required: false, - readOnly: true, - serializedName: 'tenantId', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = EncryptionIdentity; diff --git a/lib/services/dataLake.Store/lib/account/models/firewallRule.js b/lib/services/dataLake.Store/lib/account/models/firewallRule.js deleted file mode 100644 index 7d0ef1165a..0000000000 --- a/lib/services/dataLake.Store/lib/account/models/firewallRule.js +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * 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'); - -/** - * Data Lake Store firewall rule information. - * - * @extends models['SubResource'] - */ -class FirewallRule extends models['SubResource'] { - /** - * Create a FirewallRule. - * @property {string} [startIpAddress] The start IP address for the firewall - * rule. This can be either ipv4 or ipv6. Start and End should be in the same - * protocol. - * @property {string} [endIpAddress] The end IP address for the firewall - * rule. This can be either ipv4 or ipv6. Start and End should be in the same - * protocol. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of FirewallRule - * - * @returns {object} metadata of FirewallRule - * - */ - mapper() { - return { - required: false, - serializedName: 'FirewallRule', - type: { - name: 'Composite', - className: 'FirewallRule', - modelProperties: { - id: { - required: false, - readOnly: true, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - startIpAddress: { - required: false, - readOnly: true, - serializedName: 'properties.startIpAddress', - type: { - name: 'String' - } - }, - endIpAddress: { - required: false, - readOnly: true, - serializedName: 'properties.endIpAddress', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = FirewallRule; diff --git a/lib/services/dataLake.Store/lib/account/models/index.d.ts b/lib/services/dataLake.Store/lib/account/models/index.d.ts deleted file mode 100644 index b843bfd5b5..0000000000 --- a/lib/services/dataLake.Store/lib/account/models/index.d.ts +++ /dev/null @@ -1,730 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for 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, CloudError } from "ms-rest-azure"; -import * as moment from "moment"; - -export { - - BaseResource, - CloudError -}; - -/** - * The resource model definition. - */ -export interface Resource extends BaseResource { - /** - * The resource identifier. - */ - readonly id?: string; - /** - * The resource name. - */ - readonly name?: string; - /** - * The resource type. - */ - readonly type?: string; - /** - * The resource location. - */ - readonly location?: string; - /** - * The resource tags. - */ - readonly tags?: { [propertyName: string]: string }; -} - -/** - * The resource model definition for a nested resource. - */ -export interface SubResource extends BaseResource { - /** - * The resource identifier. - */ - readonly id?: string; - /** - * The resource name. - */ - readonly name?: string; - /** - * The resource type. - */ - readonly type?: string; -} - -/** - * The encryption identity properties. - */ -export interface EncryptionIdentity { - /** - * The principal identifier associated with the encryption. - */ - readonly principalId?: string; - /** - * The tenant identifier associated with the encryption. - */ - readonly tenantId?: string; -} - -/** - * Metadata information used by account encryption. - */ -export interface KeyVaultMetaInfo { - /** - * The resource identifier for the user managed Key Vault being used to encrypt. - */ - keyVaultResourceId: string; - /** - * The name of the user managed encryption key. - */ - encryptionKeyName: string; - /** - * The version of the user managed encryption key. - */ - encryptionKeyVersion: string; -} - -/** - * The encryption configuration for the account. - */ -export interface EncryptionConfig { - /** - * The type of encryption configuration being used. Currently the only supported types are - * 'UserManaged' and 'ServiceManaged'. Possible values include: 'UserManaged', 'ServiceManaged' - */ - type: string; - /** - * The Key Vault information for connecting to user managed encryption keys. - */ - keyVaultMetaInfo?: KeyVaultMetaInfo; -} - -/** - * Data Lake Store firewall rule information. - */ -export interface FirewallRule extends SubResource { - /** - * The start IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End - * should be in the same protocol. - */ - readonly startIpAddress?: string; - /** - * The end IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End - * should be in the same protocol. - */ - readonly endIpAddress?: string; -} - -/** - * Data Lake Store virtual network rule information. - */ -export interface VirtualNetworkRule extends SubResource { - /** - * The resource identifier for the subnet. - */ - readonly subnetId?: string; -} - -/** - * Data Lake Store trusted identity provider information. - */ -export interface TrustedIdProvider extends SubResource { - /** - * The URL of this trusted identity provider. - */ - readonly idProvider?: string; -} - -/** - * Data Lake Store account information. - */ -export interface DataLakeStoreAccount extends Resource { - /** - * The Key Vault encryption identity, if any. - */ - readonly identity?: EncryptionIdentity; - /** - * The unique identifier associated with this Data Lake Store account. - */ - readonly accountId?: string; - /** - * The provisioning status of the Data Lake Store account. Possible values include: 'Failed', - * 'Creating', 'Running', 'Succeeded', 'Patching', 'Suspending', 'Resuming', 'Deleting', - * 'Deleted', 'Undeleting', 'Canceled' - */ - readonly provisioningState?: string; - /** - * The state of the Data Lake Store account. Possible values include: 'Active', 'Suspended' - */ - readonly state?: string; - /** - * The account creation time. - */ - readonly creationTime?: Date; - /** - * The account last modified time. - */ - readonly lastModifiedTime?: Date; - /** - * The full CName endpoint for this account. - */ - readonly endpoint?: string; - /** - * The default owner group for all new folders and files created in the Data Lake Store account. - */ - readonly defaultGroup?: string; - /** - * The Key Vault encryption configuration. - */ - readonly encryptionConfig?: EncryptionConfig; - /** - * The current state of encryption for this Data Lake Store account. Possible values include: - * 'Enabled', 'Disabled' - */ - readonly encryptionState?: string; - /** - * The current state of encryption provisioning for this Data Lake Store account. Possible values - * include: 'Creating', 'Succeeded' - */ - readonly encryptionProvisioningState?: string; - /** - * The list of firewall rules associated with this Data Lake Store account. - */ - readonly firewallRules?: FirewallRule[]; - /** - * The list of virtual network rules associated with this Data Lake Store account. - */ - readonly virtualNetworkRules?: VirtualNetworkRule[]; - /** - * The current state of the IP address firewall for this Data Lake Store account. Possible values - * include: 'Enabled', 'Disabled' - */ - readonly firewallState?: string; - /** - * The current state of allowing or disallowing IPs originating within Azure through the - * firewall. If the firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' - */ - readonly firewallAllowAzureIps?: string; - /** - * The list of trusted identity providers associated with this Data Lake Store account. - */ - readonly trustedIdProviders?: TrustedIdProvider[]; - /** - * The current state of the trusted identity provider feature for this Data Lake Store account. - * Possible values include: 'Enabled', 'Disabled' - */ - readonly trustedIdProviderState?: string; - /** - * The commitment tier to use for next month. Possible values include: 'Consumption', - * 'Commitment_1TB', 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' - */ - readonly newTier?: string; - /** - * The commitment tier in use for the current month. Possible values include: 'Consumption', - * 'Commitment_1TB', 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' - */ - readonly currentTier?: string; -} - -/** - * Basic Data Lake Store account information, returned on list calls. - */ -export interface DataLakeStoreAccountBasic extends Resource { - /** - * The unique identifier associated with this Data Lake Store account. - */ - readonly accountId?: string; - /** - * The provisioning status of the Data Lake Store account. Possible values include: 'Failed', - * 'Creating', 'Running', 'Succeeded', 'Patching', 'Suspending', 'Resuming', 'Deleting', - * 'Deleted', 'Undeleting', 'Canceled' - */ - readonly provisioningState?: string; - /** - * The state of the Data Lake Store account. Possible values include: 'Active', 'Suspended' - */ - readonly state?: string; - /** - * The account creation time. - */ - readonly creationTime?: Date; - /** - * The account last modified time. - */ - readonly lastModifiedTime?: Date; - /** - * The full CName endpoint for this account. - */ - readonly endpoint?: string; -} - -/** - * The display information for a particular operation. - */ -export interface OperationDisplay { - /** - * The resource provider of the operation. - */ - readonly provider?: string; - /** - * The resource type of the operation. - */ - readonly resource?: string; - /** - * A friendly name of the operation. - */ - readonly operation?: string; - /** - * A friendly description of the operation. - */ - readonly description?: string; -} - -/** - * An available operation for Data Lake Store. - */ -export interface Operation { - /** - * The name of the operation. - */ - readonly name?: string; - /** - * The display information for the operation. - */ - display?: OperationDisplay; - /** - * The intended executor of the operation. Possible values include: 'user', 'system', - * 'user,system' - */ - readonly origin?: string; -} - -/** - * The list of available operations for Data Lake Store. - */ -export interface OperationListResult { - /** - * The results of the list operation. - */ - readonly value?: Operation[]; - /** - * The link (url) to the next page of results. - */ - readonly nextLink?: string; -} - -/** - * Subscription-level properties and limits for Data Lake Store. - */ -export interface CapabilityInformation { - /** - * The subscription credentials that uniquely identifies the subscription. - */ - readonly subscriptionId?: string; - /** - * The subscription state. Possible values include: 'Registered', 'Suspended', 'Deleted', - * 'Unregistered', 'Warned' - */ - readonly state?: string; - /** - * The maximum supported number of accounts under this subscription. - */ - readonly maxAccountCount?: number; - /** - * The current number of accounts under this subscription. - */ - readonly accountCount?: number; - /** - * The Boolean value of true or false to indicate the maintenance state. - */ - readonly migrationState?: boolean; -} - -/** - * Data Lake Store account name availability result information. - */ -export interface NameAvailabilityInformation { - /** - * The Boolean value of true or false to indicate whether the Data Lake Store account name is - * available or not. - */ - readonly nameAvailable?: boolean; - /** - * The reason why the Data Lake Store account name is not available, if nameAvailable is false. - */ - readonly reason?: string; - /** - * The message describing why the Data Lake Store account name is not available, if nameAvailable - * is false. - */ - readonly message?: string; -} - -/** - * The parameters used to create a new firewall rule while creating a new Data Lake Store account. - */ -export interface CreateFirewallRuleWithAccountParameters { - /** - * The unique name of the firewall rule to create. - */ - name: string; - /** - * The start IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End - * should be in the same protocol. - */ - startIpAddress: string; - /** - * The end IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End - * should be in the same protocol. - */ - endIpAddress: string; -} - -/** - * The parameters used to create a new virtual network rule while creating a new Data Lake Store - * account. - */ -export interface CreateVirtualNetworkRuleWithAccountParameters { - /** - * The unique name of the virtual network rule to create. - */ - name: string; - /** - * The resource identifier for the subnet. - */ - subnetId: string; -} - -/** - * The parameters used to create a new trusted identity provider while creating a new Data Lake - * Store account. - */ -export interface CreateTrustedIdProviderWithAccountParameters { - /** - * The unique name of the trusted identity provider to create. - */ - name: string; - /** - * The URL of this trusted identity provider. - */ - idProvider: string; -} - -export interface CreateDataLakeStoreAccountParameters { - /** - * The resource location. - */ - location: string; - /** - * The resource tags. - */ - tags?: { [propertyName: string]: string }; - /** - * The Key Vault encryption identity, if any. - */ - identity?: EncryptionIdentity; - /** - * The default owner group for all new folders and files created in the Data Lake Store account. - */ - defaultGroup?: string; - /** - * The Key Vault encryption configuration. - */ - encryptionConfig?: EncryptionConfig; - /** - * The current state of encryption for this Data Lake Store account. Possible values include: - * 'Enabled', 'Disabled' - */ - encryptionState?: string; - /** - * The list of firewall rules associated with this Data Lake Store account. - */ - firewallRules?: CreateFirewallRuleWithAccountParameters[]; - /** - * The list of virtual network rules associated with this Data Lake Store account. - */ - virtualNetworkRules?: CreateVirtualNetworkRuleWithAccountParameters[]; - /** - * The current state of the IP address firewall for this Data Lake Store account. Possible values - * include: 'Enabled', 'Disabled' - */ - firewallState?: string; - /** - * The current state of allowing or disallowing IPs originating within Azure through the - * firewall. If the firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' - */ - firewallAllowAzureIps?: string; - /** - * The list of trusted identity providers associated with this Data Lake Store account. - */ - trustedIdProviders?: CreateTrustedIdProviderWithAccountParameters[]; - /** - * The current state of the trusted identity provider feature for this Data Lake Store account. - * Possible values include: 'Enabled', 'Disabled' - */ - trustedIdProviderState?: string; - /** - * The commitment tier to use for next month. Possible values include: 'Consumption', - * 'Commitment_1TB', 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' - */ - newTier?: string; -} - -/** - * The Key Vault update information used for user managed key rotation. -*/ -export interface UpdateKeyVaultMetaInfo { - /** - * The version of the user managed encryption key to update through a key rotation. - */ - encryptionKeyVersion?: string; -} - -/** - * The encryption configuration used to update a user managed Key Vault key. -*/ -export interface UpdateEncryptionConfig { - /** - * The updated Key Vault key to use in user managed key rotation. - */ - keyVaultMetaInfo?: UpdateKeyVaultMetaInfo; -} - -/** - * The parameters used to update a firewall rule while updating a Data Lake Store account. -*/ -export interface UpdateFirewallRuleWithAccountParameters { - /** - * The unique name of the firewall rule to update. - */ - name: string; - /** - * The start IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End - * should be in the same protocol. - */ - startIpAddress?: string; - /** - * The end IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End - * should be in the same protocol. - */ - endIpAddress?: string; -} - -/** - * The parameters used to update a virtual network rule while updating a Data Lake Store account. -*/ -export interface UpdateVirtualNetworkRuleWithAccountParameters { - /** - * The unique name of the virtual network rule to update. - */ - name: string; - /** - * The resource identifier for the subnet. - */ - subnetId?: string; -} - -/** - * The parameters used to update a trusted identity provider while updating a Data Lake Store - * account. -*/ -export interface UpdateTrustedIdProviderWithAccountParameters { - /** - * The unique name of the trusted identity provider to update. - */ - name: string; - /** - * The URL of this trusted identity provider. - */ - idProvider?: string; -} - -/** - * Data Lake Store account information to update. -*/ -export interface UpdateDataLakeStoreAccountParameters { - /** - * Resource tags - */ - tags?: { [propertyName: string]: string }; - /** - * The default owner group for all new folders and files created in the Data Lake Store account. - */ - defaultGroup?: string; - /** - * Used for rotation of user managed Key Vault keys. Can only be used to rotate a user managed - * encryption Key Vault key. - */ - encryptionConfig?: UpdateEncryptionConfig; - /** - * The list of firewall rules associated with this Data Lake Store account. - */ - firewallRules?: UpdateFirewallRuleWithAccountParameters[]; - /** - * The list of virtual network rules associated with this Data Lake Store account. - */ - virtualNetworkRules?: UpdateVirtualNetworkRuleWithAccountParameters[]; - /** - * The current state of the IP address firewall for this Data Lake Store account. Disabling the - * firewall does not remove existing rules, they will just be ignored until the firewall is - * re-enabled. Possible values include: 'Enabled', 'Disabled' - */ - firewallState?: string; - /** - * The current state of allowing or disallowing IPs originating within Azure through the - * firewall. If the firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' - */ - firewallAllowAzureIps?: string; - /** - * The list of trusted identity providers associated with this Data Lake Store account. - */ - trustedIdProviders?: UpdateTrustedIdProviderWithAccountParameters[]; - /** - * The current state of the trusted identity provider feature for this Data Lake Store account. - * Disabling trusted identity provider functionality does not remove the providers, they will - * just be ignored until this feature is re-enabled. Possible values include: 'Enabled', - * 'Disabled' - */ - trustedIdProviderState?: string; - /** - * The commitment tier to use for next month. Possible values include: 'Consumption', - * 'Commitment_1TB', 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' - */ - newTier?: string; -} - -/** - * The parameters used to create a new firewall rule. -*/ -export interface CreateOrUpdateFirewallRuleParameters { - /** - * The start IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End - * should be in the same protocol. - */ - startIpAddress: string; - /** - * The end IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End - * should be in the same protocol. - */ - endIpAddress: string; -} - -/** - * The parameters used to update a firewall rule. -*/ -export interface UpdateFirewallRuleParameters { - /** - * The start IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End - * should be in the same protocol. - */ - startIpAddress?: string; - /** - * The end IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End - * should be in the same protocol. - */ - endIpAddress?: string; -} - -/** - * The parameters used to create a new virtual network rule. -*/ -export interface CreateOrUpdateVirtualNetworkRuleParameters { - /** - * The resource identifier for the subnet. - */ - subnetId: string; -} - -/** - * The parameters used to update a virtual network rule. -*/ -export interface UpdateVirtualNetworkRuleParameters { - /** - * The resource identifier for the subnet. - */ - subnetId?: string; -} - -/** - * The parameters used to create a new trusted identity provider. -*/ -export interface CreateOrUpdateTrustedIdProviderParameters { - /** - * The URL of this trusted identity provider. - */ - idProvider: string; -} - -/** - * The parameters used to update a trusted identity provider. -*/ -export interface UpdateTrustedIdProviderParameters { - /** - * The URL of this trusted identity provider. - */ - idProvider?: string; -} - -/** - * Data Lake Store account name availability check parameters. -*/ -export interface CheckNameAvailabilityParameters { - /** - * The Data Lake Store name to check availability for. - */ - name: string; -} - -/** - * Data Lake Store account list information response. -*/ -export interface DataLakeStoreAccountListResult extends Array { - /** - * The link (url) to the next page of results. - */ - readonly nextLink?: string; -} - -/** - * Data Lake Store firewall rule list information. -*/ -export interface FirewallRuleListResult extends Array { - /** - * The link (url) to the next page of results. - */ - readonly nextLink?: string; -} - -/** - * Data Lake Store virtual network rule list information. -*/ -export interface VirtualNetworkRuleListResult extends Array { - /** - * The link (url) to the next page of results. - */ - readonly nextLink?: string; -} - -/** - * Data Lake Store trusted identity provider list information. -*/ -export interface TrustedIdProviderListResult extends Array { - /** - * The link (url) to the next page of results. - */ - readonly nextLink?: string; -} diff --git a/lib/services/dataLake.Store/lib/account/models/index.js b/lib/services/dataLake.Store/lib/account/models/index.js deleted file mode 100644 index 41fe88ad1d..0000000000 --- a/lib/services/dataLake.Store/lib/account/models/index.js +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -/* jshint latedef:false */ -/* jshint forin:false */ -/* jshint noempty:false */ - -'use strict'; - -var msRestAzure = require('ms-rest-azure'); - -exports.BaseResource = msRestAzure.BaseResource; -exports.CloudError = msRestAzure.CloudError; -exports.Resource = require('./resource'); -exports.SubResource = require('./subResource'); -exports.EncryptionIdentity = require('./encryptionIdentity'); -exports.KeyVaultMetaInfo = require('./keyVaultMetaInfo'); -exports.EncryptionConfig = require('./encryptionConfig'); -exports.FirewallRule = require('./firewallRule'); -exports.VirtualNetworkRule = require('./virtualNetworkRule'); -exports.TrustedIdProvider = require('./trustedIdProvider'); -exports.DataLakeStoreAccount = require('./dataLakeStoreAccount'); -exports.DataLakeStoreAccountBasic = require('./dataLakeStoreAccountBasic'); -exports.OperationDisplay = require('./operationDisplay'); -exports.Operation = require('./operation'); -exports.OperationListResult = require('./operationListResult'); -exports.CapabilityInformation = require('./capabilityInformation'); -exports.NameAvailabilityInformation = require('./nameAvailabilityInformation'); -exports.CreateFirewallRuleWithAccountParameters = require('./createFirewallRuleWithAccountParameters'); -exports.CreateVirtualNetworkRuleWithAccountParameters = require('./createVirtualNetworkRuleWithAccountParameters'); -exports.CreateTrustedIdProviderWithAccountParameters = require('./createTrustedIdProviderWithAccountParameters'); -exports.CreateDataLakeStoreAccountParameters = require('./createDataLakeStoreAccountParameters'); -exports.UpdateKeyVaultMetaInfo = require('./updateKeyVaultMetaInfo'); -exports.UpdateEncryptionConfig = require('./updateEncryptionConfig'); -exports.UpdateFirewallRuleWithAccountParameters = require('./updateFirewallRuleWithAccountParameters'); -exports.UpdateVirtualNetworkRuleWithAccountParameters = require('./updateVirtualNetworkRuleWithAccountParameters'); -exports.UpdateTrustedIdProviderWithAccountParameters = require('./updateTrustedIdProviderWithAccountParameters'); -exports.UpdateDataLakeStoreAccountParameters = require('./updateDataLakeStoreAccountParameters'); -exports.CreateOrUpdateFirewallRuleParameters = require('./createOrUpdateFirewallRuleParameters'); -exports.UpdateFirewallRuleParameters = require('./updateFirewallRuleParameters'); -exports.CreateOrUpdateVirtualNetworkRuleParameters = require('./createOrUpdateVirtualNetworkRuleParameters'); -exports.UpdateVirtualNetworkRuleParameters = require('./updateVirtualNetworkRuleParameters'); -exports.CreateOrUpdateTrustedIdProviderParameters = require('./createOrUpdateTrustedIdProviderParameters'); -exports.UpdateTrustedIdProviderParameters = require('./updateTrustedIdProviderParameters'); -exports.CheckNameAvailabilityParameters = require('./checkNameAvailabilityParameters'); -exports.DataLakeStoreAccountListResult = require('./dataLakeStoreAccountListResult'); -exports.FirewallRuleListResult = require('./firewallRuleListResult'); -exports.VirtualNetworkRuleListResult = require('./virtualNetworkRuleListResult'); -exports.TrustedIdProviderListResult = require('./trustedIdProviderListResult'); diff --git a/lib/services/dataLake.Store/lib/account/models/keyVaultMetaInfo.js b/lib/services/dataLake.Store/lib/account/models/keyVaultMetaInfo.js deleted file mode 100644 index b7ef991b1b..0000000000 --- a/lib/services/dataLake.Store/lib/account/models/keyVaultMetaInfo.js +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Metadata information used by account encryption. - * - */ -class KeyVaultMetaInfo { - /** - * Create a KeyVaultMetaInfo. - * @property {string} keyVaultResourceId The resource identifier for the user - * managed Key Vault being used to encrypt. - * @property {string} encryptionKeyName The name of the user managed - * encryption key. - * @property {string} encryptionKeyVersion The version of the user managed - * encryption key. - */ - constructor() { - } - - /** - * Defines the metadata of KeyVaultMetaInfo - * - * @returns {object} metadata of KeyVaultMetaInfo - * - */ - mapper() { - return { - required: false, - serializedName: 'KeyVaultMetaInfo', - type: { - name: 'Composite', - className: 'KeyVaultMetaInfo', - modelProperties: { - keyVaultResourceId: { - required: true, - serializedName: 'keyVaultResourceId', - type: { - name: 'String' - } - }, - encryptionKeyName: { - required: true, - serializedName: 'encryptionKeyName', - type: { - name: 'String' - } - }, - encryptionKeyVersion: { - required: true, - serializedName: 'encryptionKeyVersion', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = KeyVaultMetaInfo; diff --git a/lib/services/dataLake.Store/lib/account/models/resource.js b/lib/services/dataLake.Store/lib/account/models/resource.js deleted file mode 100644 index 7cd91c5c05..0000000000 --- a/lib/services/dataLake.Store/lib/account/models/resource.js +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * 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 resource model definition. - * - * @extends models['BaseResource'] - */ -class Resource extends models['BaseResource'] { - /** - * Create a Resource. - * @property {string} [id] The resource identifier. - * @property {string} [name] The resource name. - * @property {string} [type] The resource type. - * @property {string} [location] The resource location. - * @property {object} [tags] The resource tags. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of Resource - * - * @returns {object} metadata of Resource - * - */ - mapper() { - return { - required: false, - serializedName: 'Resource', - type: { - name: 'Composite', - className: 'Resource', - modelProperties: { - id: { - required: false, - readOnly: true, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - readOnly: true, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - readOnly: true, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - } - } - } - }; - } -} - -module.exports = Resource; diff --git a/lib/services/dataLake.Store/lib/account/models/subResource.js b/lib/services/dataLake.Store/lib/account/models/subResource.js deleted file mode 100644 index 5684e40ed8..0000000000 --- a/lib/services/dataLake.Store/lib/account/models/subResource.js +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * 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 resource model definition for a nested resource. - * - * @extends models['BaseResource'] - */ -class SubResource extends models['BaseResource'] { - /** - * Create a SubResource. - * @property {string} [id] The resource identifier. - * @property {string} [name] The resource name. - * @property {string} [type] The resource type. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of SubResource - * - * @returns {object} metadata of SubResource - * - */ - mapper() { - return { - required: false, - serializedName: 'SubResource', - type: { - name: 'Composite', - className: 'SubResource', - modelProperties: { - id: { - required: false, - readOnly: true, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = SubResource; diff --git a/lib/services/dataLake.Store/lib/account/models/trustedIdProvider.js b/lib/services/dataLake.Store/lib/account/models/trustedIdProvider.js deleted file mode 100644 index 0060534f65..0000000000 --- a/lib/services/dataLake.Store/lib/account/models/trustedIdProvider.js +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * 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'); - -/** - * Data Lake Store trusted identity provider information. - * - * @extends models['SubResource'] - */ -class TrustedIdProvider extends models['SubResource'] { - /** - * Create a TrustedIdProvider. - * @property {string} [idProvider] The URL of this trusted identity provider. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of TrustedIdProvider - * - * @returns {object} metadata of TrustedIdProvider - * - */ - mapper() { - return { - required: false, - serializedName: 'TrustedIdProvider', - type: { - name: 'Composite', - className: 'TrustedIdProvider', - modelProperties: { - id: { - required: false, - readOnly: true, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - idProvider: { - required: false, - readOnly: true, - serializedName: 'properties.idProvider', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = TrustedIdProvider; diff --git a/lib/services/dataLake.Store/lib/account/models/updateEncryptionConfig.js b/lib/services/dataLake.Store/lib/account/models/updateEncryptionConfig.js deleted file mode 100644 index 2611688583..0000000000 --- a/lib/services/dataLake.Store/lib/account/models/updateEncryptionConfig.js +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * 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 encryption configuration used to update a user managed Key Vault key. - * - */ -class UpdateEncryptionConfig { - /** - * Create a UpdateEncryptionConfig. - * @property {object} [keyVaultMetaInfo] The updated Key Vault key to use in - * user managed key rotation. - * @property {string} [keyVaultMetaInfo.encryptionKeyVersion] The version of - * the user managed encryption key to update through a key rotation. - */ - constructor() { - } - - /** - * Defines the metadata of UpdateEncryptionConfig - * - * @returns {object} metadata of UpdateEncryptionConfig - * - */ - mapper() { - return { - required: false, - serializedName: 'UpdateEncryptionConfig', - type: { - name: 'Composite', - className: 'UpdateEncryptionConfig', - modelProperties: { - keyVaultMetaInfo: { - required: false, - serializedName: 'keyVaultMetaInfo', - type: { - name: 'Composite', - className: 'UpdateKeyVaultMetaInfo' - } - } - } - } - }; - } -} - -module.exports = UpdateEncryptionConfig; diff --git a/lib/services/dataLake.Store/lib/account/models/updateFirewallRuleParameters.js b/lib/services/dataLake.Store/lib/account/models/updateFirewallRuleParameters.js deleted file mode 100644 index 343233da2e..0000000000 --- a/lib/services/dataLake.Store/lib/account/models/updateFirewallRuleParameters.js +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * 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 parameters used to update a firewall rule. - * - */ -class UpdateFirewallRuleParameters { - /** - * Create a UpdateFirewallRuleParameters. - * @property {string} [startIpAddress] The start IP address for the firewall - * rule. This can be either ipv4 or ipv6. Start and End should be in the same - * protocol. - * @property {string} [endIpAddress] The end IP address for the firewall - * rule. This can be either ipv4 or ipv6. Start and End should be in the same - * protocol. - */ - constructor() { - } - - /** - * Defines the metadata of UpdateFirewallRuleParameters - * - * @returns {object} metadata of UpdateFirewallRuleParameters - * - */ - mapper() { - return { - required: false, - serializedName: 'UpdateFirewallRuleParameters', - type: { - name: 'Composite', - className: 'UpdateFirewallRuleParameters', - modelProperties: { - startIpAddress: { - required: false, - serializedName: 'properties.startIpAddress', - type: { - name: 'String' - } - }, - endIpAddress: { - required: false, - serializedName: 'properties.endIpAddress', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = UpdateFirewallRuleParameters; diff --git a/lib/services/dataLake.Store/lib/account/models/updateKeyVaultMetaInfo.js b/lib/services/dataLake.Store/lib/account/models/updateKeyVaultMetaInfo.js deleted file mode 100644 index 812de14bd1..0000000000 --- a/lib/services/dataLake.Store/lib/account/models/updateKeyVaultMetaInfo.js +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * 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 Key Vault update information used for user managed key rotation. - * - */ -class UpdateKeyVaultMetaInfo { - /** - * Create a UpdateKeyVaultMetaInfo. - * @property {string} [encryptionKeyVersion] The version of the user managed - * encryption key to update through a key rotation. - */ - constructor() { - } - - /** - * Defines the metadata of UpdateKeyVaultMetaInfo - * - * @returns {object} metadata of UpdateKeyVaultMetaInfo - * - */ - mapper() { - return { - required: false, - serializedName: 'UpdateKeyVaultMetaInfo', - type: { - name: 'Composite', - className: 'UpdateKeyVaultMetaInfo', - modelProperties: { - encryptionKeyVersion: { - required: false, - serializedName: 'encryptionKeyVersion', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = UpdateKeyVaultMetaInfo; diff --git a/lib/services/dataLake.Store/lib/account/models/updateTrustedIdProviderParameters.js b/lib/services/dataLake.Store/lib/account/models/updateTrustedIdProviderParameters.js deleted file mode 100644 index 03247b4ba6..0000000000 --- a/lib/services/dataLake.Store/lib/account/models/updateTrustedIdProviderParameters.js +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * 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 parameters used to update a trusted identity provider. - * - */ -class UpdateTrustedIdProviderParameters { - /** - * Create a UpdateTrustedIdProviderParameters. - * @property {string} [idProvider] The URL of this trusted identity provider. - */ - constructor() { - } - - /** - * Defines the metadata of UpdateTrustedIdProviderParameters - * - * @returns {object} metadata of UpdateTrustedIdProviderParameters - * - */ - mapper() { - return { - required: false, - serializedName: 'UpdateTrustedIdProviderParameters', - type: { - name: 'Composite', - className: 'UpdateTrustedIdProviderParameters', - modelProperties: { - idProvider: { - required: false, - serializedName: 'properties.idProvider', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = UpdateTrustedIdProviderParameters; diff --git a/lib/services/dataLake.Store/lib/account/operations/firewallRules.js b/lib/services/dataLake.Store/lib/account/operations/firewallRules.js deleted file mode 100644 index 77a5d3988b..0000000000 --- a/lib/services/dataLake.Store/lib/account/operations/firewallRules.js +++ /dev/null @@ -1,1539 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * 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 the Data Lake Store firewall rules within the specified Data Lake - * Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @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 FirewallRuleListResult} 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 _listByAccount(resourceGroupName, accountName, 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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName 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 (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.DataLakeStore/accounts/{accountName}/firewallRules'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); - 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['FirewallRuleListResult']().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 or updates the specified firewall rule. During update, the firewall - * rule with the specified name will be replaced with this new firewall rule. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} firewallRuleName The name of the firewall rule to create or - * update. - * - * @param {object} parameters Parameters supplied to create or update the - * firewall rule. - * - * @param {string} parameters.startIpAddress The start IP address for the - * firewall rule. This can be either ipv4 or ipv6. Start and End should be in - * the same protocol. - * - * @param {string} parameters.endIpAddress The end IP address for the firewall - * rule. This can be either ipv4 or ipv6. Start and End should be in the same - * protocol. - * - * @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 FirewallRule} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _createOrUpdate(resourceGroupName, accountName, firewallRuleName, parameters, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - // 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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (firewallRuleName === null || firewallRuleName === undefined || typeof firewallRuleName.valueOf() !== 'string') { - throw new Error('firewallRuleName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - if (this.client.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.DataLakeStore/accounts/{accountName}/firewallRules/{firewallRuleName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); - requestUrl = requestUrl.replace('{firewallRuleName}', encodeURIComponent(firewallRuleName)); - 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 (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['CreateOrUpdateFirewallRuleParameters']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - 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['FirewallRule']().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 the specified Data Lake Store firewall rule. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} firewallRuleName The name of the firewall rule to retrieve. - * - * @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 FirewallRule} 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, accountName, firewallRuleName, 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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (firewallRuleName === null || firewallRuleName === undefined || typeof firewallRuleName.valueOf() !== 'string') { - throw new Error('firewallRuleName 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 (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.DataLakeStore/accounts/{accountName}/firewallRules/{firewallRuleName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); - requestUrl = requestUrl.replace('{firewallRuleName}', encodeURIComponent(firewallRuleName)); - 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['FirewallRule']().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 specified firewall rule. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} firewallRuleName The name of the firewall rule to update. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.parameters] Parameters supplied to update the - * firewall rule. - * - * @param {string} [options.parameters.startIpAddress] The start IP address for - * the firewall rule. This can be either ipv4 or ipv6. Start and End should be - * in the same protocol. - * - * @param {string} [options.parameters.endIpAddress] The end IP address for the - * firewall rule. This can be either ipv4 or ipv6. Start and End should be in - * the same protocol. - * - * @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 FirewallRule} 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, accountName, firewallRuleName, 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 parameters = (options && options.parameters !== undefined) ? options.parameters : 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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (firewallRuleName === null || firewallRuleName === undefined || typeof firewallRuleName.valueOf() !== 'string') { - throw new Error('firewallRuleName 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 (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.DataLakeStore/accounts/{accountName}/firewallRules/{firewallRuleName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); - requestUrl = requestUrl.replace('{firewallRuleName}', encodeURIComponent(firewallRuleName)); - 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 (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['UpdateFirewallRuleParameters']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - 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['FirewallRule']().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 the specified firewall rule from the specified Data Lake Store - * account. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} firewallRuleName The name of the firewall rule to delete. - * - * @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, accountName, firewallRuleName, 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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (firewallRuleName === null || firewallRuleName === undefined || typeof firewallRuleName.valueOf() !== 'string') { - throw new Error('firewallRuleName 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 (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.DataLakeStore/accounts/{accountName}/firewallRules/{firewallRuleName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); - requestUrl = requestUrl.replace('{firewallRuleName}', encodeURIComponent(firewallRuleName)); - 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 !== 200 && statusCode !== 204) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - 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); - }); -} - -/** - * Lists the Data Lake Store firewall rules within the specified Data Lake - * Store account. - * - * @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 FirewallRuleListResult} 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 _listByAccountNext(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['FirewallRuleListResult']().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 FirewallRules. */ -class FirewallRules { - /** - * Create a FirewallRules. - * @param {DataLakeStoreAccountManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._listByAccount = _listByAccount; - this._createOrUpdate = _createOrUpdate; - this._get = _get; - this._update = _update; - this._deleteMethod = _deleteMethod; - this._listByAccountNext = _listByAccountNext; - } - - /** - * Lists the Data Lake Store firewall rules within the specified Data Lake - * Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @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. - */ - listByAccountWithHttpOperationResponse(resourceGroupName, accountName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByAccount(resourceGroupName, accountName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists the Data Lake Store firewall rules within the specified Data Lake - * Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @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 {FirewallRuleListResult} - 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 FirewallRuleListResult} 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. - */ - listByAccount(resourceGroupName, accountName, 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._listByAccount(resourceGroupName, accountName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByAccount(resourceGroupName, accountName, options, optionalCallback); - } - } - - /** - * Creates or updates the specified firewall rule. During update, the firewall - * rule with the specified name will be replaced with this new firewall rule. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} firewallRuleName The name of the firewall rule to create or - * update. - * - * @param {object} parameters Parameters supplied to create or update the - * firewall rule. - * - * @param {string} parameters.startIpAddress The start IP address for the - * firewall rule. This can be either ipv4 or ipv6. Start and End should be in - * the same protocol. - * - * @param {string} parameters.endIpAddress The end IP address for the firewall - * rule. This can be either ipv4 or ipv6. Start and End should be in the same - * protocol. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, accountName, firewallRuleName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, accountName, firewallRuleName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates the specified firewall rule. During update, the firewall - * rule with the specified name will be replaced with this new firewall rule. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} firewallRuleName The name of the firewall rule to create or - * update. - * - * @param {object} parameters Parameters supplied to create or update the - * firewall rule. - * - * @param {string} parameters.startIpAddress The start IP address for the - * firewall rule. This can be either ipv4 or ipv6. Start and End should be in - * the same protocol. - * - * @param {string} parameters.endIpAddress The end IP address for the firewall - * rule. This can be either ipv4 or ipv6. Start and End should be in the same - * protocol. - * - * @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 {FirewallRule} - 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 FirewallRule} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - createOrUpdate(resourceGroupName, accountName, firewallRuleName, parameters, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, accountName, firewallRuleName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, accountName, firewallRuleName, parameters, options, optionalCallback); - } - } - - /** - * Gets the specified Data Lake Store firewall rule. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} firewallRuleName The name of the firewall rule to retrieve. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - getWithHttpOperationResponse(resourceGroupName, accountName, firewallRuleName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, accountName, firewallRuleName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Gets the specified Data Lake Store firewall rule. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} firewallRuleName The name of the firewall rule to retrieve. - * - * @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 {FirewallRule} - 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 FirewallRule} 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, accountName, firewallRuleName, 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, accountName, firewallRuleName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, accountName, firewallRuleName, options, optionalCallback); - } - } - - /** - * Updates the specified firewall rule. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} firewallRuleName The name of the firewall rule to update. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.parameters] Parameters supplied to update the - * firewall rule. - * - * @param {string} [options.parameters.startIpAddress] The start IP address for - * the firewall rule. This can be either ipv4 or ipv6. Start and End should be - * in the same protocol. - * - * @param {string} [options.parameters.endIpAddress] The end IP address for the - * firewall rule. This can be either ipv4 or ipv6. Start and End should be in - * the same protocol. - * - * @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, accountName, firewallRuleName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._update(resourceGroupName, accountName, firewallRuleName, 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 specified firewall rule. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} firewallRuleName The name of the firewall rule to update. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.parameters] Parameters supplied to update the - * firewall rule. - * - * @param {string} [options.parameters.startIpAddress] The start IP address for - * the firewall rule. This can be either ipv4 or ipv6. Start and End should be - * in the same protocol. - * - * @param {string} [options.parameters.endIpAddress] The end IP address for the - * firewall rule. This can be either ipv4 or ipv6. Start and End should be in - * the same protocol. - * - * @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 {FirewallRule} - 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 FirewallRule} 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, accountName, firewallRuleName, 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, accountName, firewallRuleName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._update(resourceGroupName, accountName, firewallRuleName, options, optionalCallback); - } - } - - /** - * Deletes the specified firewall rule from the specified Data Lake Store - * account. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} firewallRuleName The name of the firewall rule to delete. - * - * @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, accountName, firewallRuleName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, accountName, firewallRuleName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified firewall rule from the specified Data Lake Store - * account. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} firewallRuleName The name of the firewall rule to delete. - * - * @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, accountName, firewallRuleName, 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, accountName, firewallRuleName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, accountName, firewallRuleName, options, optionalCallback); - } - } - - /** - * Lists the Data Lake Store firewall rules within the specified Data Lake - * Store account. - * - * @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. - */ - listByAccountNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByAccountNext(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 the Data Lake Store firewall rules within the specified Data Lake - * Store account. - * - * @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 {FirewallRuleListResult} - 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 FirewallRuleListResult} 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. - */ - listByAccountNext(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._listByAccountNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByAccountNext(nextPageLink, options, optionalCallback); - } - } - -} - -module.exports = FirewallRules; diff --git a/lib/services/dataLake.Store/lib/account/operations/index.d.ts b/lib/services/dataLake.Store/lib/account/operations/index.d.ts deleted file mode 100644 index 57b4ebb2e8..0000000000 --- a/lib/services/dataLake.Store/lib/account/operations/index.d.ts +++ /dev/null @@ -1,2733 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * 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 - * Accounts - * __NOTE__: An instance of this class is automatically created for an - * instance of the DataLakeStoreAccountManagementClient. - */ -export interface Accounts { - - - /** - * Lists the Data Lake Store accounts within the subscription. The response - * includes a link to the next page of results, if any. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData filter. Optional. - * - * @param {number} [options.top] The number of items to return. Optional. - * - * @param {number} [options.skip] The number of items to skip over before - * returning elements. Optional. - * - * @param {string} [options.select] OData Select statement. Limits the - * properties on each entry to just those requested, e.g. - * Categories?$select=CategoryName,Description. Optional. - * - * @param {string} [options.orderby] OrderBy clause. One or more - * comma-separated expressions with an optional "asc" (the default) or "desc" - * depending on the order you'd like the values sorted, e.g. - * Categories?$orderby=CategoryName desc. Optional. - * - * @param {boolean} [options.count] The Boolean value of true or false to - * request a count of the matching resources included with the resources in the - * response, e.g. Categories?$count=true. Optional. - * - * @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?: { filter? : string, top? : number, skip? : number, select? : string, orderby? : string, count? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the Data Lake Store accounts within the subscription. The response - * includes a link to the next page of results, if any. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData filter. Optional. - * - * @param {number} [options.top] The number of items to return. Optional. - * - * @param {number} [options.skip] The number of items to skip over before - * returning elements. Optional. - * - * @param {string} [options.select] OData Select statement. Limits the - * properties on each entry to just those requested, e.g. - * Categories?$select=CategoryName,Description. Optional. - * - * @param {string} [options.orderby] OrderBy clause. One or more - * comma-separated expressions with an optional "asc" (the default) or "desc" - * depending on the order you'd like the values sorted, e.g. - * Categories?$orderby=CategoryName desc. Optional. - * - * @param {boolean} [options.count] The Boolean value of true or false to - * request a count of the matching resources included with the resources in the - * response, e.g. Categories?$count=true. Optional. - * - * @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 {DataLakeStoreAccountListResult} - 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. - * - * {DataLakeStoreAccountListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DataLakeStoreAccountListResult} 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?: { filter? : string, top? : number, skip? : number, select? : string, orderby? : string, count? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { filter? : string, top? : number, skip? : number, select? : string, orderby? : string, count? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the Data Lake Store accounts within a specific resource group. The - * response includes a link to the next page of results, if any. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData filter. Optional. - * - * @param {number} [options.top] The number of items to return. Optional. - * - * @param {number} [options.skip] The number of items to skip over before - * returning elements. Optional. - * - * @param {string} [options.select] OData Select statement. Limits the - * properties on each entry to just those requested, e.g. - * Categories?$select=CategoryName,Description. Optional. - * - * @param {string} [options.orderby] OrderBy clause. One or more - * comma-separated expressions with an optional "asc" (the default) or "desc" - * depending on the order you'd like the values sorted, e.g. - * Categories?$orderby=CategoryName desc. Optional. - * - * @param {boolean} [options.count] A Boolean value of true or false to request - * a count of the matching resources included with the resources in the - * response, e.g. Categories?$count=true. Optional. - * - * @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?: { filter? : string, top? : number, skip? : number, select? : string, orderby? : string, count? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the Data Lake Store accounts within a specific resource group. The - * response includes a link to the next page of results, if any. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData filter. Optional. - * - * @param {number} [options.top] The number of items to return. Optional. - * - * @param {number} [options.skip] The number of items to skip over before - * returning elements. Optional. - * - * @param {string} [options.select] OData Select statement. Limits the - * properties on each entry to just those requested, e.g. - * Categories?$select=CategoryName,Description. Optional. - * - * @param {string} [options.orderby] OrderBy clause. One or more - * comma-separated expressions with an optional "asc" (the default) or "desc" - * depending on the order you'd like the values sorted, e.g. - * Categories?$orderby=CategoryName desc. Optional. - * - * @param {boolean} [options.count] A Boolean value of true or false to request - * a count of the matching resources included with the resources in the - * response, e.g. Categories?$count=true. Optional. - * - * @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 {DataLakeStoreAccountListResult} - 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. - * - * {DataLakeStoreAccountListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DataLakeStoreAccountListResult} 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?: { filter? : string, top? : number, skip? : number, select? : string, orderby? : string, count? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options: { filter? : string, top? : number, skip? : number, select? : string, orderby? : string, count? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates the specified Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {object} parameters Parameters supplied to create the Data Lake Store - * account. - * - * @param {string} parameters.location The resource location. - * - * @param {object} [parameters.tags] The resource tags. - * - * @param {object} [parameters.identity] The Key Vault encryption identity, if - * any. - * - * @param {string} [parameters.defaultGroup] The default owner group for all - * new folders and files created in the Data Lake Store account. - * - * @param {object} [parameters.encryptionConfig] The Key Vault encryption - * configuration. - * - * @param {string} parameters.encryptionConfig.type The type of encryption - * configuration being used. Currently the only supported types are - * 'UserManaged' and 'ServiceManaged'. Possible values include: 'UserManaged', - * 'ServiceManaged' - * - * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The Key Vault - * information for connecting to user managed encryption keys. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.keyVaultResourceId The resource - * identifier for the user managed Key Vault being used to encrypt. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyName The name of - * the user managed encryption key. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion The - * version of the user managed encryption key. - * - * @param {string} [parameters.encryptionState] The current state of encryption - * for this Data Lake Store account. Possible values include: 'Enabled', - * 'Disabled' - * - * @param {array} [parameters.firewallRules] The list of firewall rules - * associated with this Data Lake Store account. - * - * @param {array} [parameters.virtualNetworkRules] The list of virtual network - * rules associated with this Data Lake Store account. - * - * @param {string} [parameters.firewallState] The current state of the IP - * address firewall for this Data Lake Store account. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {string} [parameters.firewallAllowAzureIps] The current state of - * allowing or disallowing IPs originating within Azure through the firewall. - * If the firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {array} [parameters.trustedIdProviders] The list of trusted identity - * providers associated with this Data Lake Store account. - * - * @param {string} [parameters.trustedIdProviderState] The current state of the - * trusted identity provider feature for this Data Lake Store account. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.newTier] The commitment tier to use for next - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' - * - * @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, accountName: string, parameters: models.CreateDataLakeStoreAccountParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates the specified Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {object} parameters Parameters supplied to create the Data Lake Store - * account. - * - * @param {string} parameters.location The resource location. - * - * @param {object} [parameters.tags] The resource tags. - * - * @param {object} [parameters.identity] The Key Vault encryption identity, if - * any. - * - * @param {string} [parameters.defaultGroup] The default owner group for all - * new folders and files created in the Data Lake Store account. - * - * @param {object} [parameters.encryptionConfig] The Key Vault encryption - * configuration. - * - * @param {string} parameters.encryptionConfig.type The type of encryption - * configuration being used. Currently the only supported types are - * 'UserManaged' and 'ServiceManaged'. Possible values include: 'UserManaged', - * 'ServiceManaged' - * - * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The Key Vault - * information for connecting to user managed encryption keys. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.keyVaultResourceId The resource - * identifier for the user managed Key Vault being used to encrypt. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyName The name of - * the user managed encryption key. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion The - * version of the user managed encryption key. - * - * @param {string} [parameters.encryptionState] The current state of encryption - * for this Data Lake Store account. Possible values include: 'Enabled', - * 'Disabled' - * - * @param {array} [parameters.firewallRules] The list of firewall rules - * associated with this Data Lake Store account. - * - * @param {array} [parameters.virtualNetworkRules] The list of virtual network - * rules associated with this Data Lake Store account. - * - * @param {string} [parameters.firewallState] The current state of the IP - * address firewall for this Data Lake Store account. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {string} [parameters.firewallAllowAzureIps] The current state of - * allowing or disallowing IPs originating within Azure through the firewall. - * If the firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {array} [parameters.trustedIdProviders] The list of trusted identity - * providers associated with this Data Lake Store account. - * - * @param {string} [parameters.trustedIdProviderState] The current state of the - * trusted identity provider feature for this Data Lake Store account. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.newTier] The commitment tier to use for next - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' - * - * @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 {DataLakeStoreAccount} - 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. - * - * {DataLakeStoreAccount} [result] - The deserialized result object if an error did not occur. - * See {@link DataLakeStoreAccount} 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, accountName: string, parameters: models.CreateDataLakeStoreAccountParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - create(resourceGroupName: string, accountName: string, parameters: models.CreateDataLakeStoreAccountParameters, callback: ServiceCallback): void; - create(resourceGroupName: string, accountName: string, parameters: models.CreateDataLakeStoreAccountParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the specified Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getWithHttpOperationResponse(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the specified Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @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 {DataLakeStoreAccount} - 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. - * - * {DataLakeStoreAccount} [result] - The deserialized result object if an error did not occur. - * See {@link DataLakeStoreAccount} 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, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, accountName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, accountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates the specified Data Lake Store account information. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {object} parameters Parameters supplied to update the Data Lake Store - * account. - * - * @param {object} [parameters.tags] Resource tags - * - * @param {string} [parameters.defaultGroup] The default owner group for all - * new folders and files created in the Data Lake Store account. - * - * @param {object} [parameters.encryptionConfig] Used for rotation of user - * managed Key Vault keys. Can only be used to rotate a user managed encryption - * Key Vault key. - * - * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The updated - * Key Vault key to use in user managed key rotation. - * - * @param {string} - * [parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] The - * version of the user managed encryption key to update through a key rotation. - * - * @param {array} [parameters.firewallRules] The list of firewall rules - * associated with this Data Lake Store account. - * - * @param {array} [parameters.virtualNetworkRules] The list of virtual network - * rules associated with this Data Lake Store account. - * - * @param {string} [parameters.firewallState] The current state of the IP - * address firewall for this Data Lake Store account. Disabling the firewall - * does not remove existing rules, they will just be ignored until the firewall - * is re-enabled. Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.firewallAllowAzureIps] The current state of - * allowing or disallowing IPs originating within Azure through the firewall. - * If the firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {array} [parameters.trustedIdProviders] The list of trusted identity - * providers associated with this Data Lake Store account. - * - * @param {string} [parameters.trustedIdProviderState] The current state of the - * trusted identity provider feature for this Data Lake Store account. - * Disabling trusted identity provider functionality does not remove the - * providers, they will just be ignored until this feature is re-enabled. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.newTier] The commitment tier to use for next - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - updateWithHttpOperationResponse(resourceGroupName: string, accountName: string, parameters: models.UpdateDataLakeStoreAccountParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates the specified Data Lake Store account information. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {object} parameters Parameters supplied to update the Data Lake Store - * account. - * - * @param {object} [parameters.tags] Resource tags - * - * @param {string} [parameters.defaultGroup] The default owner group for all - * new folders and files created in the Data Lake Store account. - * - * @param {object} [parameters.encryptionConfig] Used for rotation of user - * managed Key Vault keys. Can only be used to rotate a user managed encryption - * Key Vault key. - * - * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The updated - * Key Vault key to use in user managed key rotation. - * - * @param {string} - * [parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] The - * version of the user managed encryption key to update through a key rotation. - * - * @param {array} [parameters.firewallRules] The list of firewall rules - * associated with this Data Lake Store account. - * - * @param {array} [parameters.virtualNetworkRules] The list of virtual network - * rules associated with this Data Lake Store account. - * - * @param {string} [parameters.firewallState] The current state of the IP - * address firewall for this Data Lake Store account. Disabling the firewall - * does not remove existing rules, they will just be ignored until the firewall - * is re-enabled. Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.firewallAllowAzureIps] The current state of - * allowing or disallowing IPs originating within Azure through the firewall. - * If the firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {array} [parameters.trustedIdProviders] The list of trusted identity - * providers associated with this Data Lake Store account. - * - * @param {string} [parameters.trustedIdProviderState] The current state of the - * trusted identity provider feature for this Data Lake Store account. - * Disabling trusted identity provider functionality does not remove the - * providers, they will just be ignored until this feature is re-enabled. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.newTier] The commitment tier to use for next - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' - * - * @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 {DataLakeStoreAccount} - 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. - * - * {DataLakeStoreAccount} [result] - The deserialized result object if an error did not occur. - * See {@link DataLakeStoreAccount} 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, accountName: string, parameters: models.UpdateDataLakeStoreAccountParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, accountName: string, parameters: models.UpdateDataLakeStoreAccountParameters, callback: ServiceCallback): void; - update(resourceGroupName: string, accountName: string, parameters: models.UpdateDataLakeStoreAccountParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @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, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @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, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, accountName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, accountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Attempts to enable a user managed Key Vault for encryption of the specified - * Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @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. - */ - enableKeyVaultWithHttpOperationResponse(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Attempts to enable a user managed Key Vault for encryption of the specified - * Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @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. - */ - enableKeyVault(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - enableKeyVault(resourceGroupName: string, accountName: string, callback: ServiceCallback): void; - enableKeyVault(resourceGroupName: string, accountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Checks whether the specified account name is available or taken. - * - * @param {string} location The resource location without whitespace. - * - * @param {object} parameters Parameters supplied to check the Data Lake Store - * account name availability. - * - * @param {string} parameters.name The Data Lake Store name to check - * availability for. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - checkNameAvailabilityWithHttpOperationResponse(location: string, parameters: models.CheckNameAvailabilityParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Checks whether the specified account name is available or taken. - * - * @param {string} location The resource location without whitespace. - * - * @param {object} parameters Parameters supplied to check the Data Lake Store - * account name availability. - * - * @param {string} parameters.name The Data Lake Store name to check - * availability for. - * - * @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 {NameAvailabilityInformation} - 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. - * - * {NameAvailabilityInformation} [result] - The deserialized result object if an error did not occur. - * See {@link NameAvailabilityInformation} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - checkNameAvailability(location: string, parameters: models.CheckNameAvailabilityParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - checkNameAvailability(location: string, parameters: models.CheckNameAvailabilityParameters, callback: ServiceCallback): void; - checkNameAvailability(location: string, parameters: models.CheckNameAvailabilityParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates the specified Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {object} parameters Parameters supplied to create the Data Lake Store - * account. - * - * @param {string} parameters.location The resource location. - * - * @param {object} [parameters.tags] The resource tags. - * - * @param {object} [parameters.identity] The Key Vault encryption identity, if - * any. - * - * @param {string} [parameters.defaultGroup] The default owner group for all - * new folders and files created in the Data Lake Store account. - * - * @param {object} [parameters.encryptionConfig] The Key Vault encryption - * configuration. - * - * @param {string} parameters.encryptionConfig.type The type of encryption - * configuration being used. Currently the only supported types are - * 'UserManaged' and 'ServiceManaged'. Possible values include: 'UserManaged', - * 'ServiceManaged' - * - * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The Key Vault - * information for connecting to user managed encryption keys. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.keyVaultResourceId The resource - * identifier for the user managed Key Vault being used to encrypt. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyName The name of - * the user managed encryption key. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion The - * version of the user managed encryption key. - * - * @param {string} [parameters.encryptionState] The current state of encryption - * for this Data Lake Store account. Possible values include: 'Enabled', - * 'Disabled' - * - * @param {array} [parameters.firewallRules] The list of firewall rules - * associated with this Data Lake Store account. - * - * @param {array} [parameters.virtualNetworkRules] The list of virtual network - * rules associated with this Data Lake Store account. - * - * @param {string} [parameters.firewallState] The current state of the IP - * address firewall for this Data Lake Store account. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {string} [parameters.firewallAllowAzureIps] The current state of - * allowing or disallowing IPs originating within Azure through the firewall. - * If the firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {array} [parameters.trustedIdProviders] The list of trusted identity - * providers associated with this Data Lake Store account. - * - * @param {string} [parameters.trustedIdProviderState] The current state of the - * trusted identity provider feature for this Data Lake Store account. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.newTier] The commitment tier to use for next - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' - * - * @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, accountName: string, parameters: models.CreateDataLakeStoreAccountParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates the specified Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {object} parameters Parameters supplied to create the Data Lake Store - * account. - * - * @param {string} parameters.location The resource location. - * - * @param {object} [parameters.tags] The resource tags. - * - * @param {object} [parameters.identity] The Key Vault encryption identity, if - * any. - * - * @param {string} [parameters.defaultGroup] The default owner group for all - * new folders and files created in the Data Lake Store account. - * - * @param {object} [parameters.encryptionConfig] The Key Vault encryption - * configuration. - * - * @param {string} parameters.encryptionConfig.type The type of encryption - * configuration being used. Currently the only supported types are - * 'UserManaged' and 'ServiceManaged'. Possible values include: 'UserManaged', - * 'ServiceManaged' - * - * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The Key Vault - * information for connecting to user managed encryption keys. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.keyVaultResourceId The resource - * identifier for the user managed Key Vault being used to encrypt. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyName The name of - * the user managed encryption key. - * - * @param {string} - * parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion The - * version of the user managed encryption key. - * - * @param {string} [parameters.encryptionState] The current state of encryption - * for this Data Lake Store account. Possible values include: 'Enabled', - * 'Disabled' - * - * @param {array} [parameters.firewallRules] The list of firewall rules - * associated with this Data Lake Store account. - * - * @param {array} [parameters.virtualNetworkRules] The list of virtual network - * rules associated with this Data Lake Store account. - * - * @param {string} [parameters.firewallState] The current state of the IP - * address firewall for this Data Lake Store account. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {string} [parameters.firewallAllowAzureIps] The current state of - * allowing or disallowing IPs originating within Azure through the firewall. - * If the firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {array} [parameters.trustedIdProviders] The list of trusted identity - * providers associated with this Data Lake Store account. - * - * @param {string} [parameters.trustedIdProviderState] The current state of the - * trusted identity provider feature for this Data Lake Store account. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.newTier] The commitment tier to use for next - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' - * - * @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 {DataLakeStoreAccount} - 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. - * - * {DataLakeStoreAccount} [result] - The deserialized result object if an error did not occur. - * See {@link DataLakeStoreAccount} 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, accountName: string, parameters: models.CreateDataLakeStoreAccountParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreate(resourceGroupName: string, accountName: string, parameters: models.CreateDataLakeStoreAccountParameters, callback: ServiceCallback): void; - beginCreate(resourceGroupName: string, accountName: string, parameters: models.CreateDataLakeStoreAccountParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates the specified Data Lake Store account information. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {object} parameters Parameters supplied to update the Data Lake Store - * account. - * - * @param {object} [parameters.tags] Resource tags - * - * @param {string} [parameters.defaultGroup] The default owner group for all - * new folders and files created in the Data Lake Store account. - * - * @param {object} [parameters.encryptionConfig] Used for rotation of user - * managed Key Vault keys. Can only be used to rotate a user managed encryption - * Key Vault key. - * - * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The updated - * Key Vault key to use in user managed key rotation. - * - * @param {string} - * [parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] The - * version of the user managed encryption key to update through a key rotation. - * - * @param {array} [parameters.firewallRules] The list of firewall rules - * associated with this Data Lake Store account. - * - * @param {array} [parameters.virtualNetworkRules] The list of virtual network - * rules associated with this Data Lake Store account. - * - * @param {string} [parameters.firewallState] The current state of the IP - * address firewall for this Data Lake Store account. Disabling the firewall - * does not remove existing rules, they will just be ignored until the firewall - * is re-enabled. Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.firewallAllowAzureIps] The current state of - * allowing or disallowing IPs originating within Azure through the firewall. - * If the firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {array} [parameters.trustedIdProviders] The list of trusted identity - * providers associated with this Data Lake Store account. - * - * @param {string} [parameters.trustedIdProviderState] The current state of the - * trusted identity provider feature for this Data Lake Store account. - * Disabling trusted identity provider functionality does not remove the - * providers, they will just be ignored until this feature is re-enabled. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.newTier] The commitment tier to use for next - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, accountName: string, parameters: models.UpdateDataLakeStoreAccountParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates the specified Data Lake Store account information. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {object} parameters Parameters supplied to update the Data Lake Store - * account. - * - * @param {object} [parameters.tags] Resource tags - * - * @param {string} [parameters.defaultGroup] The default owner group for all - * new folders and files created in the Data Lake Store account. - * - * @param {object} [parameters.encryptionConfig] Used for rotation of user - * managed Key Vault keys. Can only be used to rotate a user managed encryption - * Key Vault key. - * - * @param {object} [parameters.encryptionConfig.keyVaultMetaInfo] The updated - * Key Vault key to use in user managed key rotation. - * - * @param {string} - * [parameters.encryptionConfig.keyVaultMetaInfo.encryptionKeyVersion] The - * version of the user managed encryption key to update through a key rotation. - * - * @param {array} [parameters.firewallRules] The list of firewall rules - * associated with this Data Lake Store account. - * - * @param {array} [parameters.virtualNetworkRules] The list of virtual network - * rules associated with this Data Lake Store account. - * - * @param {string} [parameters.firewallState] The current state of the IP - * address firewall for this Data Lake Store account. Disabling the firewall - * does not remove existing rules, they will just be ignored until the firewall - * is re-enabled. Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.firewallAllowAzureIps] The current state of - * allowing or disallowing IPs originating within Azure through the firewall. - * If the firewall is disabled, this is not enforced. Possible values include: - * 'Enabled', 'Disabled' - * - * @param {array} [parameters.trustedIdProviders] The list of trusted identity - * providers associated with this Data Lake Store account. - * - * @param {string} [parameters.trustedIdProviderState] The current state of the - * trusted identity provider feature for this Data Lake Store account. - * Disabling trusted identity provider functionality does not remove the - * providers, they will just be ignored until this feature is re-enabled. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.newTier] The commitment tier to use for next - * month. Possible values include: 'Consumption', 'Commitment_1TB', - * 'Commitment_10TB', 'Commitment_100TB', 'Commitment_500TB', 'Commitment_1PB', - * 'Commitment_5PB' - * - * @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 {DataLakeStoreAccount} - 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. - * - * {DataLakeStoreAccount} [result] - The deserialized result object if an error did not occur. - * See {@link DataLakeStoreAccount} 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, accountName: string, parameters: models.UpdateDataLakeStoreAccountParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdate(resourceGroupName: string, accountName: string, parameters: models.UpdateDataLakeStoreAccountParameters, callback: ServiceCallback): void; - beginUpdate(resourceGroupName: string, accountName: string, parameters: models.UpdateDataLakeStoreAccountParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @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. - */ - beginDeleteMethod(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, accountName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, accountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the Data Lake Store accounts within the subscription. The response - * includes a link to the next page of results, if any. - * - * @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 the Data Lake Store accounts within the subscription. The response - * includes a link to the next page of results, if any. - * - * @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 {DataLakeStoreAccountListResult} - 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. - * - * {DataLakeStoreAccountListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DataLakeStoreAccountListResult} 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 the Data Lake Store accounts within a specific resource group. The - * response includes a link to the next page of results, if any. - * - * @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 the Data Lake Store accounts within a specific resource group. The - * response includes a link to the next page of results, if any. - * - * @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 {DataLakeStoreAccountListResult} - 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. - * - * {DataLakeStoreAccountListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DataLakeStoreAccountListResult} 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 - * FirewallRules - * __NOTE__: An instance of this class is automatically created for an - * instance of the DataLakeStoreAccountManagementClient. - */ -export interface FirewallRules { - - - /** - * Lists the Data Lake Store firewall rules within the specified Data Lake - * Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @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. - */ - listByAccountWithHttpOperationResponse(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the Data Lake Store firewall rules within the specified Data Lake - * Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @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 {FirewallRuleListResult} - 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. - * - * {FirewallRuleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link FirewallRuleListResult} 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. - */ - listByAccount(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByAccount(resourceGroupName: string, accountName: string, callback: ServiceCallback): void; - listByAccount(resourceGroupName: string, accountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates the specified firewall rule. During update, the firewall - * rule with the specified name will be replaced with this new firewall rule. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} firewallRuleName The name of the firewall rule to create or - * update. - * - * @param {object} parameters Parameters supplied to create or update the - * firewall rule. - * - * @param {string} parameters.startIpAddress The start IP address for the - * firewall rule. This can be either ipv4 or ipv6. Start and End should be in - * the same protocol. - * - * @param {string} parameters.endIpAddress The end IP address for the firewall - * rule. This can be either ipv4 or ipv6. Start and End should be in the same - * protocol. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, accountName: string, firewallRuleName: string, parameters: models.CreateOrUpdateFirewallRuleParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates the specified firewall rule. During update, the firewall - * rule with the specified name will be replaced with this new firewall rule. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} firewallRuleName The name of the firewall rule to create or - * update. - * - * @param {object} parameters Parameters supplied to create or update the - * firewall rule. - * - * @param {string} parameters.startIpAddress The start IP address for the - * firewall rule. This can be either ipv4 or ipv6. Start and End should be in - * the same protocol. - * - * @param {string} parameters.endIpAddress The end IP address for the firewall - * rule. This can be either ipv4 or ipv6. Start and End should be in the same - * protocol. - * - * @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 {FirewallRule} - 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. - * - * {FirewallRule} [result] - The deserialized result object if an error did not occur. - * See {@link FirewallRule} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - createOrUpdate(resourceGroupName: string, accountName: string, firewallRuleName: string, parameters: models.CreateOrUpdateFirewallRuleParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, accountName: string, firewallRuleName: string, parameters: models.CreateOrUpdateFirewallRuleParameters, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, accountName: string, firewallRuleName: string, parameters: models.CreateOrUpdateFirewallRuleParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the specified Data Lake Store firewall rule. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} firewallRuleName The name of the firewall rule to retrieve. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getWithHttpOperationResponse(resourceGroupName: string, accountName: string, firewallRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the specified Data Lake Store firewall rule. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} firewallRuleName The name of the firewall rule to retrieve. - * - * @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 {FirewallRule} - 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. - * - * {FirewallRule} [result] - The deserialized result object if an error did not occur. - * See {@link FirewallRule} 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, accountName: string, firewallRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, accountName: string, firewallRuleName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, accountName: string, firewallRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates the specified firewall rule. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} firewallRuleName The name of the firewall rule to update. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.parameters] Parameters supplied to update the - * firewall rule. - * - * @param {string} [options.parameters.startIpAddress] The start IP address for - * the firewall rule. This can be either ipv4 or ipv6. Start and End should be - * in the same protocol. - * - * @param {string} [options.parameters.endIpAddress] The end IP address for the - * firewall rule. This can be either ipv4 or ipv6. Start and End should be in - * the same protocol. - * - * @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, accountName: string, firewallRuleName: string, options?: { parameters? : models.UpdateFirewallRuleParameters, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates the specified firewall rule. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} firewallRuleName The name of the firewall rule to update. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.parameters] Parameters supplied to update the - * firewall rule. - * - * @param {string} [options.parameters.startIpAddress] The start IP address for - * the firewall rule. This can be either ipv4 or ipv6. Start and End should be - * in the same protocol. - * - * @param {string} [options.parameters.endIpAddress] The end IP address for the - * firewall rule. This can be either ipv4 or ipv6. Start and End should be in - * the same protocol. - * - * @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 {FirewallRule} - 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. - * - * {FirewallRule} [result] - The deserialized result object if an error did not occur. - * See {@link FirewallRule} 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, accountName: string, firewallRuleName: string, options?: { parameters? : models.UpdateFirewallRuleParameters, customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, accountName: string, firewallRuleName: string, callback: ServiceCallback): void; - update(resourceGroupName: string, accountName: string, firewallRuleName: string, options: { parameters? : models.UpdateFirewallRuleParameters, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified firewall rule from the specified Data Lake Store - * account. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} firewallRuleName The name of the firewall rule to delete. - * - * @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, accountName: string, firewallRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified firewall rule from the specified Data Lake Store - * account. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} firewallRuleName The name of the firewall rule to delete. - * - * @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, accountName: string, firewallRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, accountName: string, firewallRuleName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, accountName: string, firewallRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the Data Lake Store firewall rules within the specified Data Lake - * Store account. - * - * @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. - */ - listByAccountNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the Data Lake Store firewall rules within the specified Data Lake - * Store account. - * - * @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 {FirewallRuleListResult} - 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. - * - * {FirewallRuleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link FirewallRuleListResult} 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. - */ - listByAccountNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByAccountNext(nextPageLink: string, callback: ServiceCallback): void; - listByAccountNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * VirtualNetworkRules - * __NOTE__: An instance of this class is automatically created for an - * instance of the DataLakeStoreAccountManagementClient. - */ -export interface VirtualNetworkRules { - - - /** - * Lists the Data Lake Store virtual network rules within the specified Data - * Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @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. - */ - listByAccountWithHttpOperationResponse(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the Data Lake Store virtual network rules within the specified Data - * Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @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 {VirtualNetworkRuleListResult} - 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. - * - * {VirtualNetworkRuleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkRuleListResult} 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. - */ - listByAccount(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByAccount(resourceGroupName: string, accountName: string, callback: ServiceCallback): void; - listByAccount(resourceGroupName: string, accountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates the specified virtual network rule. During update, the - * virtual network rule with the specified name will be replaced with this new - * virtual network rule. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} virtualNetworkRuleName The name of the virtual network rule - * to create or update. - * - * @param {object} parameters Parameters supplied to create or update the - * virtual network rule. - * - * @param {string} parameters.subnetId The resource identifier for the subnet. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, accountName: string, virtualNetworkRuleName: string, parameters: models.CreateOrUpdateVirtualNetworkRuleParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates the specified virtual network rule. During update, the - * virtual network rule with the specified name will be replaced with this new - * virtual network rule. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} virtualNetworkRuleName The name of the virtual network rule - * to create or update. - * - * @param {object} parameters Parameters supplied to create or update the - * virtual network rule. - * - * @param {string} parameters.subnetId The resource identifier for the subnet. - * - * @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 {VirtualNetworkRule} - 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. - * - * {VirtualNetworkRule} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkRule} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - createOrUpdate(resourceGroupName: string, accountName: string, virtualNetworkRuleName: string, parameters: models.CreateOrUpdateVirtualNetworkRuleParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, accountName: string, virtualNetworkRuleName: string, parameters: models.CreateOrUpdateVirtualNetworkRuleParameters, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, accountName: string, virtualNetworkRuleName: string, parameters: models.CreateOrUpdateVirtualNetworkRuleParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the specified Data Lake Store virtual network rule. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} virtualNetworkRuleName The name of the virtual network rule - * to retrieve. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getWithHttpOperationResponse(resourceGroupName: string, accountName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the specified Data Lake Store virtual network rule. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} virtualNetworkRuleName The name of the virtual network rule - * to retrieve. - * - * @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 {VirtualNetworkRule} - 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. - * - * {VirtualNetworkRule} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkRule} 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, accountName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, accountName: string, virtualNetworkRuleName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, accountName: string, virtualNetworkRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates the specified virtual network rule. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} virtualNetworkRuleName The name of the virtual network rule - * to update. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.parameters] Parameters supplied to update the - * virtual network rule. - * - * @param {string} [options.parameters.subnetId] The resource identifier for - * the subnet. - * - * @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, accountName: string, virtualNetworkRuleName: string, options?: { parameters? : models.UpdateVirtualNetworkRuleParameters, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates the specified virtual network rule. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} virtualNetworkRuleName The name of the virtual network rule - * to update. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.parameters] Parameters supplied to update the - * virtual network rule. - * - * @param {string} [options.parameters.subnetId] The resource identifier for - * the subnet. - * - * @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 {VirtualNetworkRule} - 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. - * - * {VirtualNetworkRule} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkRule} 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, accountName: string, virtualNetworkRuleName: string, options?: { parameters? : models.UpdateVirtualNetworkRuleParameters, customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, accountName: string, virtualNetworkRuleName: string, callback: ServiceCallback): void; - update(resourceGroupName: string, accountName: string, virtualNetworkRuleName: string, options: { parameters? : models.UpdateVirtualNetworkRuleParameters, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified virtual network rule from the specified Data Lake - * Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} virtualNetworkRuleName The name of the virtual network rule - * to delete. - * - * @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, accountName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified virtual network rule from the specified Data Lake - * Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} virtualNetworkRuleName The name of the virtual network rule - * to delete. - * - * @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, accountName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, accountName: string, virtualNetworkRuleName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, accountName: string, virtualNetworkRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the Data Lake Store virtual network rules within the specified Data - * Lake Store account. - * - * @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. - */ - listByAccountNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the Data Lake Store virtual network rules within the specified Data - * Lake Store account. - * - * @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 {VirtualNetworkRuleListResult} - 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. - * - * {VirtualNetworkRuleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkRuleListResult} 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. - */ - listByAccountNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByAccountNext(nextPageLink: string, callback: ServiceCallback): void; - listByAccountNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * TrustedIdProviders - * __NOTE__: An instance of this class is automatically created for an - * instance of the DataLakeStoreAccountManagementClient. - */ -export interface TrustedIdProviders { - - - /** - * Lists the Data Lake Store trusted identity providers within the specified - * Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @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. - */ - listByAccountWithHttpOperationResponse(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the Data Lake Store trusted identity providers within the specified - * Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @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 {TrustedIdProviderListResult} - 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. - * - * {TrustedIdProviderListResult} [result] - The deserialized result object if an error did not occur. - * See {@link TrustedIdProviderListResult} 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. - */ - listByAccount(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByAccount(resourceGroupName: string, accountName: string, callback: ServiceCallback): void; - listByAccount(resourceGroupName: string, accountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates the specified trusted identity provider. During update, - * the trusted identity provider with the specified name will be replaced with - * this new provider - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} trustedIdProviderName The name of the trusted identity - * provider. This is used for differentiation of providers in the account. - * - * @param {object} parameters Parameters supplied to create or replace the - * trusted identity provider. - * - * @param {string} parameters.idProvider The URL of this trusted identity - * provider. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, accountName: string, trustedIdProviderName: string, parameters: models.CreateOrUpdateTrustedIdProviderParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates the specified trusted identity provider. During update, - * the trusted identity provider with the specified name will be replaced with - * this new provider - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} trustedIdProviderName The name of the trusted identity - * provider. This is used for differentiation of providers in the account. - * - * @param {object} parameters Parameters supplied to create or replace the - * trusted identity provider. - * - * @param {string} parameters.idProvider The URL of this trusted identity - * provider. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {TrustedIdProvider} - 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. - * - * {TrustedIdProvider} [result] - The deserialized result object if an error did not occur. - * See {@link TrustedIdProvider} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - createOrUpdate(resourceGroupName: string, accountName: string, trustedIdProviderName: string, parameters: models.CreateOrUpdateTrustedIdProviderParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, accountName: string, trustedIdProviderName: string, parameters: models.CreateOrUpdateTrustedIdProviderParameters, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, accountName: string, trustedIdProviderName: string, parameters: models.CreateOrUpdateTrustedIdProviderParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the specified Data Lake Store trusted identity provider. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} trustedIdProviderName The name of the trusted identity - * provider to retrieve. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getWithHttpOperationResponse(resourceGroupName: string, accountName: string, trustedIdProviderName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the specified Data Lake Store trusted identity provider. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} trustedIdProviderName The name of the trusted identity - * provider to retrieve. - * - * @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 {TrustedIdProvider} - 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. - * - * {TrustedIdProvider} [result] - The deserialized result object if an error did not occur. - * See {@link TrustedIdProvider} 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, accountName: string, trustedIdProviderName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, accountName: string, trustedIdProviderName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, accountName: string, trustedIdProviderName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates the specified trusted identity provider. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} trustedIdProviderName The name of the trusted identity - * provider. This is used for differentiation of providers in the account. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.parameters] Parameters supplied to update the - * trusted identity provider. - * - * @param {string} [options.parameters.idProvider] The URL of this trusted - * identity provider. - * - * @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, accountName: string, trustedIdProviderName: string, options?: { parameters? : models.UpdateTrustedIdProviderParameters, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates the specified trusted identity provider. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} trustedIdProviderName The name of the trusted identity - * provider. This is used for differentiation of providers in the account. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.parameters] Parameters supplied to update the - * trusted identity provider. - * - * @param {string} [options.parameters.idProvider] The URL of this trusted - * identity provider. - * - * @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 {TrustedIdProvider} - 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. - * - * {TrustedIdProvider} [result] - The deserialized result object if an error did not occur. - * See {@link TrustedIdProvider} 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, accountName: string, trustedIdProviderName: string, options?: { parameters? : models.UpdateTrustedIdProviderParameters, customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, accountName: string, trustedIdProviderName: string, callback: ServiceCallback): void; - update(resourceGroupName: string, accountName: string, trustedIdProviderName: string, options: { parameters? : models.UpdateTrustedIdProviderParameters, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified trusted identity provider from the specified Data Lake - * Store account - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} trustedIdProviderName The name of the trusted identity - * provider to delete. - * - * @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, accountName: string, trustedIdProviderName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified trusted identity provider from the specified Data Lake - * Store account - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} trustedIdProviderName The name of the trusted identity - * provider to delete. - * - * @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, accountName: string, trustedIdProviderName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, accountName: string, trustedIdProviderName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, accountName: string, trustedIdProviderName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the Data Lake Store trusted identity providers within the specified - * Data Lake Store account. - * - * @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. - */ - listByAccountNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists the Data Lake Store trusted identity providers within the specified - * Data Lake Store account. - * - * @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 {TrustedIdProviderListResult} - 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. - * - * {TrustedIdProviderListResult} [result] - The deserialized result object if an error did not occur. - * See {@link TrustedIdProviderListResult} 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. - */ - listByAccountNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByAccountNext(nextPageLink: string, callback: ServiceCallback): void; - listByAccountNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * Operations - * __NOTE__: An instance of this class is automatically created for an - * instance of the DataLakeStoreAccountManagementClient. - */ -export interface Operations { - - - /** - * Lists all of the available Data Lake Store REST API 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>; - - /** - * Lists all of the available Data Lake Store REST API 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 {OperationListResult} - 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. - * - * {OperationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link OperationListResult} 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; -} - -/** - * @class - * Locations - * __NOTE__: An instance of this class is automatically created for an - * instance of the DataLakeStoreAccountManagementClient. - */ -export interface Locations { - - - /** - * Gets subscription-level properties and limits for Data Lake Store specified - * by resource location. - * - * @param {string} location The resource location without whitespace. - * - * @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. - */ - getCapabilityWithHttpOperationResponse(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets subscription-level properties and limits for Data Lake Store specified - * by resource location. - * - * @param {string} location The resource location without whitespace. - * - * @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 {CapabilityInformation} - 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. - * - * {CapabilityInformation} [result] - The deserialized result object if an error did not occur. - * See {@link CapabilityInformation} 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. - */ - getCapability(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getCapability(location: string, callback: ServiceCallback): void; - getCapability(location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} diff --git a/lib/services/dataLake.Store/lib/account/operations/index.js b/lib/services/dataLake.Store/lib/account/operations/index.js deleted file mode 100644 index e537016285..0000000000 --- a/lib/services/dataLake.Store/lib/account/operations/index.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * 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.Accounts = require('./accounts'); -exports.FirewallRules = require('./firewallRules'); -exports.VirtualNetworkRules = require('./virtualNetworkRules'); -exports.TrustedIdProviders = require('./trustedIdProviders'); -exports.Operations = require('./operations'); -exports.Locations = require('./locations'); diff --git a/lib/services/dataLake.Store/lib/account/operations/trustedIdProviders.js b/lib/services/dataLake.Store/lib/account/operations/trustedIdProviders.js deleted file mode 100644 index 36d1d4b9b6..0000000000 --- a/lib/services/dataLake.Store/lib/account/operations/trustedIdProviders.js +++ /dev/null @@ -1,1521 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * 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 the Data Lake Store trusted identity providers within the specified - * Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @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 TrustedIdProviderListResult} 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 _listByAccount(resourceGroupName, accountName, 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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName 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 (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.DataLakeStore/accounts/{accountName}/trustedIdProviders'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); - 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['TrustedIdProviderListResult']().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 or updates the specified trusted identity provider. During update, - * the trusted identity provider with the specified name will be replaced with - * this new provider - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} trustedIdProviderName The name of the trusted identity - * provider. This is used for differentiation of providers in the account. - * - * @param {object} parameters Parameters supplied to create or replace the - * trusted identity provider. - * - * @param {string} parameters.idProvider The URL of this trusted identity - * provider. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link TrustedIdProvider} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _createOrUpdate(resourceGroupName, accountName, trustedIdProviderName, parameters, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - // 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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (trustedIdProviderName === null || trustedIdProviderName === undefined || typeof trustedIdProviderName.valueOf() !== 'string') { - throw new Error('trustedIdProviderName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - if (this.client.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.DataLakeStore/accounts/{accountName}/trustedIdProviders/{trustedIdProviderName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); - requestUrl = requestUrl.replace('{trustedIdProviderName}', encodeURIComponent(trustedIdProviderName)); - 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 (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['CreateOrUpdateTrustedIdProviderParameters']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - 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['TrustedIdProvider']().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 the specified Data Lake Store trusted identity provider. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} trustedIdProviderName The name of the trusted identity - * provider to retrieve. - * - * @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 TrustedIdProvider} 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, accountName, trustedIdProviderName, 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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (trustedIdProviderName === null || trustedIdProviderName === undefined || typeof trustedIdProviderName.valueOf() !== 'string') { - throw new Error('trustedIdProviderName 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 (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.DataLakeStore/accounts/{accountName}/trustedIdProviders/{trustedIdProviderName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); - requestUrl = requestUrl.replace('{trustedIdProviderName}', encodeURIComponent(trustedIdProviderName)); - 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['TrustedIdProvider']().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 specified trusted identity provider. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} trustedIdProviderName The name of the trusted identity - * provider. This is used for differentiation of providers in the account. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.parameters] Parameters supplied to update the - * trusted identity provider. - * - * @param {string} [options.parameters.idProvider] The URL of this trusted - * identity provider. - * - * @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 TrustedIdProvider} 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, accountName, trustedIdProviderName, 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 parameters = (options && options.parameters !== undefined) ? options.parameters : 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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (trustedIdProviderName === null || trustedIdProviderName === undefined || typeof trustedIdProviderName.valueOf() !== 'string') { - throw new Error('trustedIdProviderName 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 (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.DataLakeStore/accounts/{accountName}/trustedIdProviders/{trustedIdProviderName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); - requestUrl = requestUrl.replace('{trustedIdProviderName}', encodeURIComponent(trustedIdProviderName)); - 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 (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['UpdateTrustedIdProviderParameters']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - 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['TrustedIdProvider']().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 the specified trusted identity provider from the specified Data Lake - * Store account - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} trustedIdProviderName The name of the trusted identity - * provider to delete. - * - * @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, accountName, trustedIdProviderName, 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 (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (trustedIdProviderName === null || trustedIdProviderName === undefined || typeof trustedIdProviderName.valueOf() !== 'string') { - throw new Error('trustedIdProviderName 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 (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.DataLakeStore/accounts/{accountName}/trustedIdProviders/{trustedIdProviderName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName)); - requestUrl = requestUrl.replace('{trustedIdProviderName}', encodeURIComponent(trustedIdProviderName)); - 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 !== 200 && statusCode !== 204) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - 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); - }); -} - -/** - * Lists the Data Lake Store trusted identity providers within the specified - * Data Lake Store account. - * - * @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 TrustedIdProviderListResult} 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 _listByAccountNext(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['TrustedIdProviderListResult']().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 TrustedIdProviders. */ -class TrustedIdProviders { - /** - * Create a TrustedIdProviders. - * @param {DataLakeStoreAccountManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._listByAccount = _listByAccount; - this._createOrUpdate = _createOrUpdate; - this._get = _get; - this._update = _update; - this._deleteMethod = _deleteMethod; - this._listByAccountNext = _listByAccountNext; - } - - /** - * Lists the Data Lake Store trusted identity providers within the specified - * Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @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. - */ - listByAccountWithHttpOperationResponse(resourceGroupName, accountName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByAccount(resourceGroupName, accountName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists the Data Lake Store trusted identity providers within the specified - * Data Lake Store account. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @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 {TrustedIdProviderListResult} - 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 TrustedIdProviderListResult} 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. - */ - listByAccount(resourceGroupName, accountName, 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._listByAccount(resourceGroupName, accountName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByAccount(resourceGroupName, accountName, options, optionalCallback); - } - } - - /** - * Creates or updates the specified trusted identity provider. During update, - * the trusted identity provider with the specified name will be replaced with - * this new provider - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} trustedIdProviderName The name of the trusted identity - * provider. This is used for differentiation of providers in the account. - * - * @param {object} parameters Parameters supplied to create or replace the - * trusted identity provider. - * - * @param {string} parameters.idProvider The URL of this trusted identity - * provider. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, accountName, trustedIdProviderName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, accountName, trustedIdProviderName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates the specified trusted identity provider. During update, - * the trusted identity provider with the specified name will be replaced with - * this new provider - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} trustedIdProviderName The name of the trusted identity - * provider. This is used for differentiation of providers in the account. - * - * @param {object} parameters Parameters supplied to create or replace the - * trusted identity provider. - * - * @param {string} parameters.idProvider The URL of this trusted identity - * provider. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {TrustedIdProvider} - 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 TrustedIdProvider} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - createOrUpdate(resourceGroupName, accountName, trustedIdProviderName, parameters, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, accountName, trustedIdProviderName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, accountName, trustedIdProviderName, parameters, options, optionalCallback); - } - } - - /** - * Gets the specified Data Lake Store trusted identity provider. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} trustedIdProviderName The name of the trusted identity - * provider to retrieve. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - getWithHttpOperationResponse(resourceGroupName, accountName, trustedIdProviderName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, accountName, trustedIdProviderName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Gets the specified Data Lake Store trusted identity provider. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} trustedIdProviderName The name of the trusted identity - * provider to retrieve. - * - * @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 {TrustedIdProvider} - 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 TrustedIdProvider} 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, accountName, trustedIdProviderName, 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, accountName, trustedIdProviderName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, accountName, trustedIdProviderName, options, optionalCallback); - } - } - - /** - * Updates the specified trusted identity provider. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} trustedIdProviderName The name of the trusted identity - * provider. This is used for differentiation of providers in the account. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.parameters] Parameters supplied to update the - * trusted identity provider. - * - * @param {string} [options.parameters.idProvider] The URL of this trusted - * identity provider. - * - * @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, accountName, trustedIdProviderName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._update(resourceGroupName, accountName, trustedIdProviderName, 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 specified trusted identity provider. - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} trustedIdProviderName The name of the trusted identity - * provider. This is used for differentiation of providers in the account. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.parameters] Parameters supplied to update the - * trusted identity provider. - * - * @param {string} [options.parameters.idProvider] The URL of this trusted - * identity provider. - * - * @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 {TrustedIdProvider} - 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 TrustedIdProvider} 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, accountName, trustedIdProviderName, 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, accountName, trustedIdProviderName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._update(resourceGroupName, accountName, trustedIdProviderName, options, optionalCallback); - } - } - - /** - * Deletes the specified trusted identity provider from the specified Data Lake - * Store account - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} trustedIdProviderName The name of the trusted identity - * provider to delete. - * - * @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, accountName, trustedIdProviderName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, accountName, trustedIdProviderName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified trusted identity provider from the specified Data Lake - * Store account - * - * @param {string} resourceGroupName The name of the Azure resource group. - * - * @param {string} accountName The name of the Data Lake Store account. - * - * @param {string} trustedIdProviderName The name of the trusted identity - * provider to delete. - * - * @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, accountName, trustedIdProviderName, 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, accountName, trustedIdProviderName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, accountName, trustedIdProviderName, options, optionalCallback); - } - } - - /** - * Lists the Data Lake Store trusted identity providers within the specified - * Data Lake Store account. - * - * @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. - */ - listByAccountNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByAccountNext(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 the Data Lake Store trusted identity providers within the specified - * Data Lake Store account. - * - * @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 {TrustedIdProviderListResult} - 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 TrustedIdProviderListResult} 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. - */ - listByAccountNext(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._listByAccountNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByAccountNext(nextPageLink, options, optionalCallback); - } - } - -} - -module.exports = TrustedIdProviders; diff --git a/lib/services/dataLake.Store/lib/filesystem/dataLakeStoreFileSystemManagementClient.d.ts b/lib/services/dataLake.Store/lib/filesystem/dataLakeStoreFileSystemManagementClient.d.ts deleted file mode 100644 index 6096d849da..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/dataLakeStoreFileSystemManagementClient.d.ts +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * 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"; - -/** - * DataLakeStoreFileSystemManagementClientOptions for DataLakeStoreFileSystemManagementClient. - */ -declare interface DataLakeStoreFileSystemManagementClientOptions extends AzureServiceClientOptions { - /** - * @property {string} [adlsFileSystemDnsSuffix] - Gets the URI used as the base for all cloud service requests. - */ - adlsFileSystemDnsSuffix?: string; - /** - * @property {string} [acceptLanguage] - The preferred language for the response. - */ - acceptLanguage?: string; - /** - * @property {number} [longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. - */ - longRunningOperationRetryTimeout?: number; - /** - * @property {boolean} [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. - */ - generateClientRequestId?: boolean; -} - -export default class DataLakeStoreFileSystemManagementClient extends AzureServiceClient { - /** - * Initializes a new instance of the DataLakeStoreFileSystemManagementClient class. - * @constructor - * - * @class - * @param {credentials} credentials - Credentials needed for the client to connect to Azure. - * - * @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.adlsFileSystemDnsSuffix] - Gets the URI used as the base for all cloud service requests. - * - * @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, options?: DataLakeStoreFileSystemManagementClientOptions); - - credentials: ServiceClientCredentials; - - apiVersion: string; - - adlsFileSystemDnsSuffix: string; - - acceptLanguage: string; - - longRunningOperationRetryTimeout: number; - - generateClientRequestId: boolean; - - // Operation groups - fileSystem: operations.FileSystem; -} - -export { DataLakeStoreFileSystemManagementClient, models as DataLakeStoreFileSystemManagementModels }; diff --git a/lib/services/dataLake.Store/lib/filesystem/dataLakeStoreFileSystemManagementClient.js b/lib/services/dataLake.Store/lib/filesystem/dataLakeStoreFileSystemManagementClient.js deleted file mode 100644 index f1518f7367..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/dataLakeStoreFileSystemManagementClient.js +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * 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 DataLakeStoreFileSystemManagementClient. */ -class DataLakeStoreFileSystemManagementClient extends ServiceClient { - /** - * Create a DataLakeStoreFileSystemManagementClient. - * @param {credentials} credentials - Credentials needed for the client to connect to Azure. - * @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.adlsFileSystemDnsSuffix] - Gets the URI used as the base for all cloud service requests. - * @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, options) { - if (credentials === null || credentials === undefined) { - throw new Error('\'credentials\' cannot be null.'); - } - - if (!options) options = {}; - - super(credentials, options); - - this.apiVersion = '2016-11-01'; - this.adlsFileSystemDnsSuffix = 'azuredatalakestore.net'; - this.acceptLanguage = 'en-US'; - this.longRunningOperationRetryTimeout = 30; - this.generateClientRequestId = true; - this.baseUri = 'https://{accountName}.{adlsFileSystemDnsSuffix}'; - this.credentials = credentials; - - let packageInfo = this.getPackageJsonInfo(__dirname); - this.addUserAgentInfo(`${packageInfo.name}/${packageInfo.version}`); - if(options.adlsFileSystemDnsSuffix !== null && options.adlsFileSystemDnsSuffix !== undefined) { - this.adlsFileSystemDnsSuffix = options.adlsFileSystemDnsSuffix; - } - 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.fileSystem = new operations.FileSystem(this); - this.models = models; - msRest.addSerializationMixin(this); - } - -} - -module.exports = DataLakeStoreFileSystemManagementClient; -module.exports['default'] = DataLakeStoreFileSystemManagementClient; -module.exports.DataLakeStoreFileSystemManagementClient = DataLakeStoreFileSystemManagementClient; -module.exports.DataLakeStoreFileSystemManagementModels = models; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/aclStatus.js b/lib/services/dataLake.Store/lib/filesystem/models/aclStatus.js deleted file mode 100644 index 5c33de6971..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/aclStatus.js +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Data Lake Store file or directory Access Control List information. - * - */ -class AclStatus { - /** - * Create a AclStatus. - * @property {array} [entries] the list of ACLSpec entries on a file or - * directory. - * @property {string} [group] the group owner, an AAD Object ID. - * @property {string} [owner] the user owner, an AAD Object ID. - * @property {string} [permission] The octal representation of the unnamed - * user, mask and other permissions. - * @property {boolean} [stickyBit] the indicator of whether the sticky bit is - * on or off. - */ - constructor() { - } - - /** - * Defines the metadata of AclStatus - * - * @returns {object} metadata of AclStatus - * - */ - mapper() { - return { - required: false, - serializedName: 'AclStatus', - type: { - name: 'Composite', - className: 'AclStatus', - modelProperties: { - entries: { - required: false, - serializedName: 'entries', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - group: { - required: false, - serializedName: 'group', - type: { - name: 'String' - } - }, - owner: { - required: false, - serializedName: 'owner', - type: { - name: 'String' - } - }, - permission: { - required: false, - serializedName: 'permission', - type: { - name: 'String' - } - }, - stickyBit: { - required: false, - readOnly: true, - serializedName: 'stickyBit', - type: { - name: 'Boolean' - } - } - } - } - }; - } -} - -module.exports = AclStatus; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/aclStatusResult.js b/lib/services/dataLake.Store/lib/filesystem/models/aclStatusResult.js deleted file mode 100644 index 45076aa4ab..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/aclStatusResult.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Data Lake Store file or directory Access Control List information. - * - */ -class AclStatusResult { - /** - * Create a AclStatusResult. - * @property {object} [aclStatus] the AclStatus object for a given file or - * directory. - * @property {array} [aclStatus.entries] the list of ACLSpec entries on a - * file or directory. - * @property {string} [aclStatus.group] the group owner, an AAD Object ID. - * @property {string} [aclStatus.owner] the user owner, an AAD Object ID. - * @property {string} [aclStatus.permission] The octal representation of the - * unnamed user, mask and other permissions. - * @property {boolean} [aclStatus.stickyBit] the indicator of whether the - * sticky bit is on or off. - */ - constructor() { - } - - /** - * Defines the metadata of AclStatusResult - * - * @returns {object} metadata of AclStatusResult - * - */ - mapper() { - return { - required: false, - serializedName: 'AclStatusResult', - type: { - name: 'Composite', - className: 'AclStatusResult', - modelProperties: { - aclStatus: { - required: false, - serializedName: 'aclStatus', - type: { - name: 'Composite', - className: 'AclStatus' - } - } - } - } - }; - } -} - -module.exports = AclStatusResult; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/adlsAccessControlException.js b/lib/services/dataLake.Store/lib/filesystem/models/adlsAccessControlException.js deleted file mode 100644 index bd8dfb50b9..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/adlsAccessControlException.js +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * A WebHDFS exception thrown indicating that access is denied due to - * insufficient permissions. Thrown when a 403 error response code is returned - * (forbidden). - * - * @extends models['AdlsRemoteException'] - */ -class AdlsAccessControlException extends models['AdlsRemoteException'] { - /** - * Create a AdlsAccessControlException. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of AdlsAccessControlException - * - * @returns {object} metadata of AdlsAccessControlException - * - */ - mapper() { - return { - required: false, - serializedName: 'AccessControlException', - type: { - name: 'Composite', - polymorphicDiscriminator: { - serializedName: 'exception', - clientName: 'exception' - }, - uberParent: 'AdlsRemoteException', - className: 'AdlsAccessControlException', - modelProperties: { - javaClassName: { - required: false, - readOnly: true, - serializedName: 'javaClassName', - type: { - name: 'String' - } - }, - message: { - required: false, - readOnly: true, - serializedName: 'message', - type: { - name: 'String' - } - }, - exception: { - required: true, - serializedName: 'exception', - isPolymorphicDiscriminator: true, - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = AdlsAccessControlException; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/adlsBadOffsetException.js b/lib/services/dataLake.Store/lib/filesystem/models/adlsBadOffsetException.js deleted file mode 100644 index b37a11a3bb..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/adlsBadOffsetException.js +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * A WebHDFS exception thrown indicating the append or read is from a bad - * offset. Thrown when a 400 error response code is returned for append and - * open operations (Bad request). - * - * @extends models['AdlsRemoteException'] - */ -class AdlsBadOffsetException extends models['AdlsRemoteException'] { - /** - * Create a AdlsBadOffsetException. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of AdlsBadOffsetException - * - * @returns {object} metadata of AdlsBadOffsetException - * - */ - mapper() { - return { - required: false, - serializedName: 'BadOffsetException', - type: { - name: 'Composite', - polymorphicDiscriminator: { - serializedName: 'exception', - clientName: 'exception' - }, - uberParent: 'AdlsRemoteException', - className: 'AdlsBadOffsetException', - modelProperties: { - javaClassName: { - required: false, - readOnly: true, - serializedName: 'javaClassName', - type: { - name: 'String' - } - }, - message: { - required: false, - readOnly: true, - serializedName: 'message', - type: { - name: 'String' - } - }, - exception: { - required: true, - serializedName: 'exception', - isPolymorphicDiscriminator: true, - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = AdlsBadOffsetException; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/adlsError.js b/lib/services/dataLake.Store/lib/filesystem/models/adlsError.js deleted file mode 100644 index afee6cdaca..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/adlsError.js +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Data Lake Store filesystem error containing a specific WebHDFS exception. - * - */ -class AdlsError { - /** - * Create a AdlsError. - * @property {object} [remoteException] the object representing the actual - * WebHDFS exception being returned. - * @property {string} [remoteException.javaClassName] the full class package - * name for the exception thrown, such as - * 'java.lang.IllegalArgumentException'. - * @property {string} [remoteException.message] the message associated with - * the exception that was thrown, such as 'Invalid value for webhdfs - * parameter "permission":...'. - * @property {string} [remoteException.exception] Polymorphic Discriminator - */ - constructor() { - } - - /** - * Defines the metadata of AdlsError - * - * @returns {object} metadata of AdlsError - * - */ - mapper() { - return { - required: false, - serializedName: 'AdlsError', - type: { - name: 'Composite', - className: 'AdlsError', - modelProperties: { - remoteException: { - required: false, - readOnly: true, - serializedName: 'remoteException', - type: { - name: 'Composite', - polymorphicDiscriminator: { - serializedName: 'exception', - clientName: 'exception' - }, - uberParent: 'AdlsRemoteException', - className: 'AdlsRemoteException' - } - } - } - } - }; - } -} - -module.exports = AdlsError; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/adlsFileAlreadyExistsException.js b/lib/services/dataLake.Store/lib/filesystem/models/adlsFileAlreadyExistsException.js deleted file mode 100644 index 322a120690..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/adlsFileAlreadyExistsException.js +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * A WebHDFS exception thrown indicating the file or folder already exists. - * Thrown when a 403 error response code is returned (forbidden). - * - * @extends models['AdlsRemoteException'] - */ -class AdlsFileAlreadyExistsException extends models['AdlsRemoteException'] { - /** - * Create a AdlsFileAlreadyExistsException. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of AdlsFileAlreadyExistsException - * - * @returns {object} metadata of AdlsFileAlreadyExistsException - * - */ - mapper() { - return { - required: false, - serializedName: 'FileAlreadyExistsException', - type: { - name: 'Composite', - polymorphicDiscriminator: { - serializedName: 'exception', - clientName: 'exception' - }, - uberParent: 'AdlsRemoteException', - className: 'AdlsFileAlreadyExistsException', - modelProperties: { - javaClassName: { - required: false, - readOnly: true, - serializedName: 'javaClassName', - type: { - name: 'String' - } - }, - message: { - required: false, - readOnly: true, - serializedName: 'message', - type: { - name: 'String' - } - }, - exception: { - required: true, - serializedName: 'exception', - isPolymorphicDiscriminator: true, - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = AdlsFileAlreadyExistsException; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/adlsFileNotFoundException.js b/lib/services/dataLake.Store/lib/filesystem/models/adlsFileNotFoundException.js deleted file mode 100644 index fc7dedb0b7..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/adlsFileNotFoundException.js +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * A WebHDFS exception thrown indicating the file or folder could not be found. - * Thrown when a 404 error response code is returned (not found). - * - * @extends models['AdlsRemoteException'] - */ -class AdlsFileNotFoundException extends models['AdlsRemoteException'] { - /** - * Create a AdlsFileNotFoundException. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of AdlsFileNotFoundException - * - * @returns {object} metadata of AdlsFileNotFoundException - * - */ - mapper() { - return { - required: false, - serializedName: 'FileNotFoundException', - type: { - name: 'Composite', - polymorphicDiscriminator: { - serializedName: 'exception', - clientName: 'exception' - }, - uberParent: 'AdlsRemoteException', - className: 'AdlsFileNotFoundException', - modelProperties: { - javaClassName: { - required: false, - readOnly: true, - serializedName: 'javaClassName', - type: { - name: 'String' - } - }, - message: { - required: false, - readOnly: true, - serializedName: 'message', - type: { - name: 'String' - } - }, - exception: { - required: true, - serializedName: 'exception', - isPolymorphicDiscriminator: true, - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = AdlsFileNotFoundException; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/adlsIOException.js b/lib/services/dataLake.Store/lib/filesystem/models/adlsIOException.js deleted file mode 100644 index 144d991c95..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/adlsIOException.js +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * A WebHDFS exception thrown indicating there was an IO (read or write) error. - * Thrown when a 403 error response code is returned (forbidden). - * - * @extends models['AdlsRemoteException'] - */ -class AdlsIOException extends models['AdlsRemoteException'] { - /** - * Create a AdlsIOException. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of AdlsIOException - * - * @returns {object} metadata of AdlsIOException - * - */ - mapper() { - return { - required: false, - serializedName: 'IOException', - type: { - name: 'Composite', - polymorphicDiscriminator: { - serializedName: 'exception', - clientName: 'exception' - }, - uberParent: 'AdlsRemoteException', - className: 'AdlsIOException', - modelProperties: { - javaClassName: { - required: false, - readOnly: true, - serializedName: 'javaClassName', - type: { - name: 'String' - } - }, - message: { - required: false, - readOnly: true, - serializedName: 'message', - type: { - name: 'String' - } - }, - exception: { - required: true, - serializedName: 'exception', - isPolymorphicDiscriminator: true, - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = AdlsIOException; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/adlsIllegalArgumentException.js b/lib/services/dataLake.Store/lib/filesystem/models/adlsIllegalArgumentException.js deleted file mode 100644 index 3487ead2f7..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/adlsIllegalArgumentException.js +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * A WebHDFS exception thrown indicating that one more arguments is incorrect. - * Thrown when a 400 error response code is returned (bad request). - * - * @extends models['AdlsRemoteException'] - */ -class AdlsIllegalArgumentException extends models['AdlsRemoteException'] { - /** - * Create a AdlsIllegalArgumentException. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of AdlsIllegalArgumentException - * - * @returns {object} metadata of AdlsIllegalArgumentException - * - */ - mapper() { - return { - required: false, - serializedName: 'IllegalArgumentException', - type: { - name: 'Composite', - polymorphicDiscriminator: { - serializedName: 'exception', - clientName: 'exception' - }, - uberParent: 'AdlsRemoteException', - className: 'AdlsIllegalArgumentException', - modelProperties: { - javaClassName: { - required: false, - readOnly: true, - serializedName: 'javaClassName', - type: { - name: 'String' - } - }, - message: { - required: false, - readOnly: true, - serializedName: 'message', - type: { - name: 'String' - } - }, - exception: { - required: true, - serializedName: 'exception', - isPolymorphicDiscriminator: true, - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = AdlsIllegalArgumentException; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/adlsRemoteException.js b/lib/services/dataLake.Store/lib/filesystem/models/adlsRemoteException.js deleted file mode 100644 index 63bc60d088..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/adlsRemoteException.js +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Data Lake Store filesystem exception based on the WebHDFS definition for - * RemoteExceptions. This is a WebHDFS 'catch all' exception - * - */ -class AdlsRemoteException { - /** - * Create a AdlsRemoteException. - * @property {string} [javaClassName] the full class package name for the - * exception thrown, such as 'java.lang.IllegalArgumentException'. - * @property {string} [message] the message associated with the exception - * that was thrown, such as 'Invalid value for webhdfs parameter - * "permission":...'. - * @property {string} exception Polymorphic Discriminator - */ - constructor() { - } - - /** - * Defines the metadata of AdlsRemoteException - * - * @returns {object} metadata of AdlsRemoteException - * - */ - mapper() { - return { - required: false, - serializedName: 'AdlsRemoteException', - type: { - name: 'Composite', - polymorphicDiscriminator: { - serializedName: 'exception', - clientName: 'exception' - }, - uberParent: 'AdlsRemoteException', - className: 'AdlsRemoteException', - modelProperties: { - javaClassName: { - required: false, - readOnly: true, - serializedName: 'javaClassName', - type: { - name: 'String' - } - }, - message: { - required: false, - readOnly: true, - serializedName: 'message', - type: { - name: 'String' - } - }, - exception: { - required: true, - serializedName: 'exception', - isPolymorphicDiscriminator: true, - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = AdlsRemoteException; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/adlsRuntimeException.js b/lib/services/dataLake.Store/lib/filesystem/models/adlsRuntimeException.js deleted file mode 100644 index fa925f17ec..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/adlsRuntimeException.js +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * A WebHDFS exception thrown when an unexpected error occurs during an - * operation. Thrown when a 500 error response code is returned (Internal - * server error). - * - * @extends models['AdlsRemoteException'] - */ -class AdlsRuntimeException extends models['AdlsRemoteException'] { - /** - * Create a AdlsRuntimeException. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of AdlsRuntimeException - * - * @returns {object} metadata of AdlsRuntimeException - * - */ - mapper() { - return { - required: false, - serializedName: 'RuntimeException', - type: { - name: 'Composite', - polymorphicDiscriminator: { - serializedName: 'exception', - clientName: 'exception' - }, - uberParent: 'AdlsRemoteException', - className: 'AdlsRuntimeException', - modelProperties: { - javaClassName: { - required: false, - readOnly: true, - serializedName: 'javaClassName', - type: { - name: 'String' - } - }, - message: { - required: false, - readOnly: true, - serializedName: 'message', - type: { - name: 'String' - } - }, - exception: { - required: true, - serializedName: 'exception', - isPolymorphicDiscriminator: true, - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = AdlsRuntimeException; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/adlsSecurityException.js b/lib/services/dataLake.Store/lib/filesystem/models/adlsSecurityException.js deleted file mode 100644 index 7bef0f8275..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/adlsSecurityException.js +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * A WebHDFS exception thrown indicating that access is denied. Thrown when a - * 401 error response code is returned (Unauthorized). - * - * @extends models['AdlsRemoteException'] - */ -class AdlsSecurityException extends models['AdlsRemoteException'] { - /** - * Create a AdlsSecurityException. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of AdlsSecurityException - * - * @returns {object} metadata of AdlsSecurityException - * - */ - mapper() { - return { - required: false, - serializedName: 'SecurityException', - type: { - name: 'Composite', - polymorphicDiscriminator: { - serializedName: 'exception', - clientName: 'exception' - }, - uberParent: 'AdlsRemoteException', - className: 'AdlsSecurityException', - modelProperties: { - javaClassName: { - required: false, - readOnly: true, - serializedName: 'javaClassName', - type: { - name: 'String' - } - }, - message: { - required: false, - readOnly: true, - serializedName: 'message', - type: { - name: 'String' - } - }, - exception: { - required: true, - serializedName: 'exception', - isPolymorphicDiscriminator: true, - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = AdlsSecurityException; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/adlsThrottledException.js b/lib/services/dataLake.Store/lib/filesystem/models/adlsThrottledException.js deleted file mode 100644 index f06eca6765..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/adlsThrottledException.js +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * A WebHDFS exception thrown indicating that the request is being throttled. - * Reducing the number of requests or request size helps to mitigate this - * error. - * - * @extends models['AdlsRemoteException'] - */ -class AdlsThrottledException extends models['AdlsRemoteException'] { - /** - * Create a AdlsThrottledException. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of AdlsThrottledException - * - * @returns {object} metadata of AdlsThrottledException - * - */ - mapper() { - return { - required: false, - serializedName: 'ThrottledException', - type: { - name: 'Composite', - polymorphicDiscriminator: { - serializedName: 'exception', - clientName: 'exception' - }, - uberParent: 'AdlsRemoteException', - className: 'AdlsThrottledException', - modelProperties: { - javaClassName: { - required: false, - readOnly: true, - serializedName: 'javaClassName', - type: { - name: 'String' - } - }, - message: { - required: false, - readOnly: true, - serializedName: 'message', - type: { - name: 'String' - } - }, - exception: { - required: true, - serializedName: 'exception', - isPolymorphicDiscriminator: true, - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = AdlsThrottledException; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/adlsUnsupportedOperationException.js b/lib/services/dataLake.Store/lib/filesystem/models/adlsUnsupportedOperationException.js deleted file mode 100644 index 9bedfacb32..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/adlsUnsupportedOperationException.js +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * A WebHDFS exception thrown indicating that the requested operation is not - * supported. Thrown when a 400 error response code is returned (bad request). - * - * @extends models['AdlsRemoteException'] - */ -class AdlsUnsupportedOperationException extends models['AdlsRemoteException'] { - /** - * Create a AdlsUnsupportedOperationException. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of AdlsUnsupportedOperationException - * - * @returns {object} metadata of AdlsUnsupportedOperationException - * - */ - mapper() { - return { - required: false, - serializedName: 'UnsupportedOperationException', - type: { - name: 'Composite', - polymorphicDiscriminator: { - serializedName: 'exception', - clientName: 'exception' - }, - uberParent: 'AdlsRemoteException', - className: 'AdlsUnsupportedOperationException', - modelProperties: { - javaClassName: { - required: false, - readOnly: true, - serializedName: 'javaClassName', - type: { - name: 'String' - } - }, - message: { - required: false, - readOnly: true, - serializedName: 'message', - type: { - name: 'String' - } - }, - exception: { - required: true, - serializedName: 'exception', - isPolymorphicDiscriminator: true, - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = AdlsUnsupportedOperationException; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/contentSummary.js b/lib/services/dataLake.Store/lib/filesystem/models/contentSummary.js deleted file mode 100644 index 0a28148049..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/contentSummary.js +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Data Lake Store content summary information - * - */ -class ContentSummary { - /** - * Create a ContentSummary. - * @property {number} [directoryCount] the number of directories. - * @property {number} [fileCount] the number of files. - * @property {number} [length] the number of bytes used by the content. - * @property {number} [spaceConsumed] the disk space consumed by the content. - */ - constructor() { - } - - /** - * Defines the metadata of ContentSummary - * - * @returns {object} metadata of ContentSummary - * - */ - mapper() { - return { - required: false, - serializedName: 'ContentSummary', - type: { - name: 'Composite', - className: 'ContentSummary', - modelProperties: { - directoryCount: { - required: false, - readOnly: true, - serializedName: 'directoryCount', - type: { - name: 'Number' - } - }, - fileCount: { - required: false, - readOnly: true, - serializedName: 'fileCount', - type: { - name: 'Number' - } - }, - length: { - required: false, - readOnly: true, - serializedName: 'length', - type: { - name: 'Number' - } - }, - spaceConsumed: { - required: false, - readOnly: true, - serializedName: 'spaceConsumed', - type: { - name: 'Number' - } - } - } - } - }; - } -} - -module.exports = ContentSummary; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/contentSummaryResult.js b/lib/services/dataLake.Store/lib/filesystem/models/contentSummaryResult.js deleted file mode 100644 index 33569c05d6..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/contentSummaryResult.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Data Lake Store filesystem content summary information response. - * - */ -class ContentSummaryResult { - /** - * Create a ContentSummaryResult. - * @property {object} [contentSummary] the content summary for the specified - * path - * @property {number} [contentSummary.directoryCount] the number of - * directories. - * @property {number} [contentSummary.fileCount] the number of files. - * @property {number} [contentSummary.length] the number of bytes used by the - * content. - * @property {number} [contentSummary.spaceConsumed] the disk space consumed - * by the content. - */ - constructor() { - } - - /** - * Defines the metadata of ContentSummaryResult - * - * @returns {object} metadata of ContentSummaryResult - * - */ - mapper() { - return { - required: false, - serializedName: 'ContentSummaryResult', - type: { - name: 'Composite', - className: 'ContentSummaryResult', - modelProperties: { - contentSummary: { - required: false, - readOnly: true, - serializedName: 'contentSummary', - type: { - name: 'Composite', - className: 'ContentSummary' - } - } - } - } - }; - } -} - -module.exports = ContentSummaryResult; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/fileOperationResult.js b/lib/services/dataLake.Store/lib/filesystem/models/fileOperationResult.js deleted file mode 100644 index adab3af571..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/fileOperationResult.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * 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 result of the request or operation. - * - */ -class FileOperationResult { - /** - * Create a FileOperationResult. - * @property {boolean} [operationResult] the result of the operation or - * request. - */ - constructor() { - } - - /** - * Defines the metadata of FileOperationResult - * - * @returns {object} metadata of FileOperationResult - * - */ - mapper() { - return { - required: false, - serializedName: 'FileOperationResult', - type: { - name: 'Composite', - className: 'FileOperationResult', - modelProperties: { - operationResult: { - required: false, - readOnly: true, - serializedName: 'boolean', - type: { - name: 'Boolean' - } - } - } - } - }; - } -} - -module.exports = FileOperationResult; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/fileStatusProperties.js b/lib/services/dataLake.Store/lib/filesystem/models/fileStatusProperties.js deleted file mode 100644 index 73fed29d22..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/fileStatusProperties.js +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Data Lake Store file or directory information. - * - */ -class FileStatusProperties { - /** - * Create a FileStatusProperties. - * @property {number} [accessTime] the last access time as ticks since the - * epoch. - * @property {number} [blockSize] the block size for the file. - * @property {number} [expirationTime] Gets the expiration time, if any, as - * ticks since the epoch. If the value is 0 or DateTime.MaxValue there is no - * expiration. - * @property {string} [group] the group owner. - * @property {number} [length] the number of bytes in a file. - * @property {number} [modificationTime] the modification time as ticks since - * the epoch. - * @property {string} [owner] the user who is the owner. - * @property {string} [pathSuffix] the path suffix. - * @property {string} [permission] the permission represented as an string. - * @property {string} [type] the type of the path object. Possible values - * include: 'FILE', 'DIRECTORY' - * @property {boolean} [aclBit] flag to indicate if extended acls are enabled - */ - constructor() { - } - - /** - * Defines the metadata of FileStatusProperties - * - * @returns {object} metadata of FileStatusProperties - * - */ - mapper() { - return { - required: false, - serializedName: 'FileStatusProperties', - type: { - name: 'Composite', - className: 'FileStatusProperties', - modelProperties: { - accessTime: { - required: false, - readOnly: true, - serializedName: 'accessTime', - type: { - name: 'Number' - } - }, - blockSize: { - required: false, - readOnly: true, - serializedName: 'blockSize', - type: { - name: 'Number' - } - }, - expirationTime: { - required: false, - readOnly: true, - serializedName: 'msExpirationTime', - type: { - name: 'Number' - } - }, - group: { - required: false, - readOnly: true, - serializedName: 'group', - type: { - name: 'String' - } - }, - length: { - required: false, - readOnly: true, - serializedName: 'length', - type: { - name: 'Number' - } - }, - modificationTime: { - required: false, - readOnly: true, - serializedName: 'modificationTime', - type: { - name: 'Number' - } - }, - owner: { - required: false, - readOnly: true, - serializedName: 'owner', - type: { - name: 'String' - } - }, - pathSuffix: { - required: false, - readOnly: true, - serializedName: 'pathSuffix', - type: { - name: 'String' - } - }, - permission: { - required: false, - readOnly: true, - serializedName: 'permission', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'Enum', - allowedValues: [ 'FILE', 'DIRECTORY' ] - } - }, - aclBit: { - required: false, - readOnly: true, - serializedName: 'aclBit', - type: { - name: 'Boolean' - } - } - } - } - }; - } -} - -module.exports = FileStatusProperties; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/fileStatusResult.js b/lib/services/dataLake.Store/lib/filesystem/models/fileStatusResult.js deleted file mode 100644 index 5940e4c7a8..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/fileStatusResult.js +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Data Lake Store filesystem file status information response. - * - */ -class FileStatusResult { - /** - * Create a FileStatusResult. - * @property {object} [fileStatus] the file status object associated with the - * specified path. - * @property {number} [fileStatus.accessTime] the last access time as ticks - * since the epoch. - * @property {number} [fileStatus.blockSize] the block size for the file. - * @property {number} [fileStatus.expirationTime] Gets the expiration time, - * if any, as ticks since the epoch. If the value is 0 or DateTime.MaxValue - * there is no expiration. - * @property {string} [fileStatus.group] the group owner. - * @property {number} [fileStatus.length] the number of bytes in a file. - * @property {number} [fileStatus.modificationTime] the modification time as - * ticks since the epoch. - * @property {string} [fileStatus.owner] the user who is the owner. - * @property {string} [fileStatus.pathSuffix] the path suffix. - * @property {string} [fileStatus.permission] the permission represented as - * an string. - * @property {string} [fileStatus.type] the type of the path object. Possible - * values include: 'FILE', 'DIRECTORY' - * @property {boolean} [fileStatus.aclBit] flag to indicate if extended acls - * are enabled - */ - constructor() { - } - - /** - * Defines the metadata of FileStatusResult - * - * @returns {object} metadata of FileStatusResult - * - */ - mapper() { - return { - required: false, - serializedName: 'FileStatusResult', - type: { - name: 'Composite', - className: 'FileStatusResult', - modelProperties: { - fileStatus: { - required: false, - readOnly: true, - serializedName: 'fileStatus', - type: { - name: 'Composite', - className: 'FileStatusProperties' - } - } - } - } - }; - } -} - -module.exports = FileStatusResult; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/fileStatuses.js b/lib/services/dataLake.Store/lib/filesystem/models/fileStatuses.js deleted file mode 100644 index c73fa30d0b..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/fileStatuses.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Data Lake Store file status list information. - * - */ -class FileStatuses { - /** - * Create a FileStatuses. - * @property {array} [fileStatus] the object containing the list of - * properties of the files. - */ - constructor() { - } - - /** - * Defines the metadata of FileStatuses - * - * @returns {object} metadata of FileStatuses - * - */ - mapper() { - return { - required: false, - serializedName: 'FileStatuses', - type: { - name: 'Composite', - className: 'FileStatuses', - modelProperties: { - fileStatus: { - required: false, - readOnly: true, - serializedName: 'fileStatus', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'FileStatusPropertiesElementType', - type: { - name: 'Composite', - className: 'FileStatusProperties' - } - } - } - } - } - } - }; - } -} - -module.exports = FileStatuses; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/fileStatusesResult.js b/lib/services/dataLake.Store/lib/filesystem/models/fileStatusesResult.js deleted file mode 100644 index bff868c5f7..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/fileStatusesResult.js +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Data Lake Store filesystem file status list information response. - * - */ -class FileStatusesResult { - /** - * Create a FileStatusesResult. - * @property {object} [fileStatuses] the object representing the list of file - * statuses. - * @property {array} [fileStatuses.fileStatus] the object containing the list - * of properties of the files. - */ - constructor() { - } - - /** - * Defines the metadata of FileStatusesResult - * - * @returns {object} metadata of FileStatusesResult - * - */ - mapper() { - return { - required: false, - serializedName: 'FileStatusesResult', - type: { - name: 'Composite', - className: 'FileStatusesResult', - modelProperties: { - fileStatuses: { - required: false, - readOnly: true, - serializedName: 'fileStatuses', - type: { - name: 'Composite', - className: 'FileStatuses' - } - } - } - } - }; - } -} - -module.exports = FileStatusesResult; diff --git a/lib/services/dataLake.Store/lib/filesystem/models/index.d.ts b/lib/services/dataLake.Store/lib/filesystem/models/index.d.ts deleted file mode 100644 index 2055076f20..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/index.d.ts +++ /dev/null @@ -1,276 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for 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, CloudError } from "ms-rest-azure"; -import * as moment from "moment"; - -export { - - BaseResource, - CloudError -}; - -/** - * The result of the request or operation. - */ -export interface FileOperationResult { - /** - * the result of the operation or request. - */ - readonly operationResult?: boolean; -} - -/** - * Data Lake Store file or directory Access Control List information. - */ -export interface AclStatus { - /** - * the list of ACLSpec entries on a file or directory. - */ - entries?: string[]; - /** - * the group owner, an AAD Object ID. - */ - group?: string; - /** - * the user owner, an AAD Object ID. - */ - owner?: string; - /** - * The octal representation of the unnamed user, mask and other permissions. - */ - permission?: string; - /** - * the indicator of whether the sticky bit is on or off. - */ - readonly stickyBit?: boolean; -} - -/** - * Data Lake Store file or directory Access Control List information. - */ -export interface AclStatusResult { - /** - * the AclStatus object for a given file or directory. - */ - aclStatus?: AclStatus; -} - -/** - * Data Lake Store content summary information - */ -export interface ContentSummary { - /** - * the number of directories. - */ - readonly directoryCount?: number; - /** - * the number of files. - */ - readonly fileCount?: number; - /** - * the number of bytes used by the content. - */ - readonly length?: number; - /** - * the disk space consumed by the content. - */ - readonly spaceConsumed?: number; -} - -/** - * Data Lake Store filesystem content summary information response. - */ -export interface ContentSummaryResult { - /** - * the content summary for the specified path - */ - readonly contentSummary?: ContentSummary; -} - -/** - * Data Lake Store file or directory information. - */ -export interface FileStatusProperties { - /** - * the last access time as ticks since the epoch. - */ - readonly accessTime?: number; - /** - * the block size for the file. - */ - readonly blockSize?: number; - /** - * Gets the expiration time, if any, as ticks since the epoch. If the value is 0 or - * DateTime.MaxValue there is no expiration. - */ - readonly expirationTime?: number; - /** - * the group owner. - */ - readonly group?: string; - /** - * the number of bytes in a file. - */ - readonly length?: number; - /** - * the modification time as ticks since the epoch. - */ - readonly modificationTime?: number; - /** - * the user who is the owner. - */ - readonly owner?: string; - /** - * the path suffix. - */ - readonly pathSuffix?: string; - /** - * the permission represented as an string. - */ - readonly permission?: string; - /** - * the type of the path object. Possible values include: 'FILE', 'DIRECTORY' - */ - readonly type?: string; - /** - * flag to indicate if extended acls are enabled - */ - readonly aclBit?: boolean; -} - -/** - * Data Lake Store file status list information. - */ -export interface FileStatuses { - /** - * the object containing the list of properties of the files. - */ - readonly fileStatus?: FileStatusProperties[]; -} - -/** - * Data Lake Store filesystem file status list information response. - */ -export interface FileStatusesResult { - /** - * the object representing the list of file statuses. - */ - readonly fileStatuses?: FileStatuses; -} - -/** - * Data Lake Store filesystem file status information response. - */ -export interface FileStatusResult { - /** - * the file status object associated with the specified path. - */ - readonly fileStatus?: FileStatusProperties; -} - -/** - * Data Lake Store filesystem exception based on the WebHDFS definition for RemoteExceptions. This - * is a WebHDFS 'catch all' exception - */ -export interface AdlsRemoteException { - /** - * the full class package name for the exception thrown, such as - * 'java.lang.IllegalArgumentException'. - */ - readonly javaClassName?: string; - /** - * the message associated with the exception that was thrown, such as 'Invalid value for webhdfs - * parameter "permission":...'. - */ - readonly message?: string; - /** - * Polymorphic Discriminator - */ - exception: string; -} - -/** - * A WebHDFS exception thrown indicating that one more arguments is incorrect. Thrown when a 400 - * error response code is returned (bad request). - */ -export interface AdlsIllegalArgumentException extends AdlsRemoteException { -} - -/** - * A WebHDFS exception thrown indicating that the requested operation is not supported. Thrown when - * a 400 error response code is returned (bad request). - */ -export interface AdlsUnsupportedOperationException extends AdlsRemoteException { -} - -/** - * A WebHDFS exception thrown indicating that access is denied. Thrown when a 401 error response - * code is returned (Unauthorized). - */ -export interface AdlsSecurityException extends AdlsRemoteException { -} - -/** - * A WebHDFS exception thrown indicating there was an IO (read or write) error. Thrown when a 403 - * error response code is returned (forbidden). - */ -export interface AdlsIOException extends AdlsRemoteException { -} - -/** - * A WebHDFS exception thrown indicating the file or folder could not be found. Thrown when a 404 - * error response code is returned (not found). - */ -export interface AdlsFileNotFoundException extends AdlsRemoteException { -} - -/** - * A WebHDFS exception thrown indicating the file or folder already exists. Thrown when a 403 error - * response code is returned (forbidden). - */ -export interface AdlsFileAlreadyExistsException extends AdlsRemoteException { -} - -/** - * A WebHDFS exception thrown indicating the append or read is from a bad offset. Thrown when a 400 - * error response code is returned for append and open operations (Bad request). - */ -export interface AdlsBadOffsetException extends AdlsRemoteException { -} - -/** - * A WebHDFS exception thrown when an unexpected error occurs during an operation. Thrown when a - * 500 error response code is returned (Internal server error). - */ -export interface AdlsRuntimeException extends AdlsRemoteException { -} - -/** - * A WebHDFS exception thrown indicating that access is denied due to insufficient permissions. - * Thrown when a 403 error response code is returned (forbidden). - */ -export interface AdlsAccessControlException extends AdlsRemoteException { -} - -/** - * A WebHDFS exception thrown indicating that the request is being throttled. Reducing the number - * of requests or request size helps to mitigate this error. - */ -export interface AdlsThrottledException extends AdlsRemoteException { -} - -/** - * Data Lake Store filesystem error containing a specific WebHDFS exception. - */ -export interface AdlsError { - /** - * the object representing the actual WebHDFS exception being returned. - */ - readonly remoteException?: AdlsRemoteException; -} diff --git a/lib/services/dataLake.Store/lib/filesystem/models/index.js b/lib/services/dataLake.Store/lib/filesystem/models/index.js deleted file mode 100644 index 010fcdf236..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/models/index.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * 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.FileOperationResult = require('./fileOperationResult'); -exports.AclStatus = require('./aclStatus'); -exports.AclStatusResult = require('./aclStatusResult'); -exports.ContentSummary = require('./contentSummary'); -exports.ContentSummaryResult = require('./contentSummaryResult'); -exports.FileStatusProperties = require('./fileStatusProperties'); -exports.FileStatuses = require('./fileStatuses'); -exports.FileStatusesResult = require('./fileStatusesResult'); -exports.FileStatusResult = require('./fileStatusResult'); -exports.AdlsRemoteException = require('./adlsRemoteException'); -exports.AdlsIllegalArgumentException = require('./adlsIllegalArgumentException'); -exports.AdlsUnsupportedOperationException = require('./adlsUnsupportedOperationException'); -exports.AdlsSecurityException = require('./adlsSecurityException'); -exports.AdlsIOException = require('./adlsIOException'); -exports.AdlsFileNotFoundException = require('./adlsFileNotFoundException'); -exports.AdlsFileAlreadyExistsException = require('./adlsFileAlreadyExistsException'); -exports.AdlsBadOffsetException = require('./adlsBadOffsetException'); -exports.AdlsRuntimeException = require('./adlsRuntimeException'); -exports.AdlsAccessControlException = require('./adlsAccessControlException'); -exports.AdlsThrottledException = require('./adlsThrottledException'); -exports.AdlsError = require('./adlsError'); -exports.discriminators = { - 'AdlsRemoteException.IllegalArgumentException' : exports.AdlsIllegalArgumentException, - 'AdlsRemoteException.UnsupportedOperationException' : exports.AdlsUnsupportedOperationException, - 'AdlsRemoteException.SecurityException' : exports.AdlsSecurityException, - 'AdlsRemoteException.IOException' : exports.AdlsIOException, - 'AdlsRemoteException.FileNotFoundException' : exports.AdlsFileNotFoundException, - 'AdlsRemoteException.FileAlreadyExistsException' : exports.AdlsFileAlreadyExistsException, - 'AdlsRemoteException.BadOffsetException' : exports.AdlsBadOffsetException, - 'AdlsRemoteException.RuntimeException' : exports.AdlsRuntimeException, - 'AdlsRemoteException.AccessControlException' : exports.AdlsAccessControlException, - 'AdlsRemoteException.ThrottledException' : exports.AdlsThrottledException, - 'AdlsRemoteException' : exports.AdlsRemoteException -}; diff --git a/lib/services/dataLake.Store/lib/filesystem/operations/fileSystem.js b/lib/services/dataLake.Store/lib/filesystem/operations/fileSystem.js deleted file mode 100644 index 2d288d3dc7..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/operations/fileSystem.js +++ /dev/null @@ -1,5855 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * 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; - -/** - * Sets or removes the expiration time on the specified file. This operation - * can only be executed against files. Folders are not supported. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file on which to set or remove the expiration time. - * - * @param {string} expiryOption Indicates the type of expiration to use for the - * file: 1. NeverExpire: ExpireTime is ignored. 2. RelativeToNow: ExpireTime is - * an integer in milliseconds representing the expiration date relative to when - * file expiration is updated. 3. RelativeToCreationDate: ExpireTime is an - * integer in milliseconds representing the expiration date relative to file - * creation. 4. Absolute: ExpireTime is an integer in milliseconds, as a Unix - * timestamp relative to 1/1/1970 00:00:00. Possible values include: - * 'NeverExpire', 'RelativeToNow', 'RelativeToCreationDate', 'Absolute' - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.expireTime] The time that the file will expire, - * corresponding to the ExpiryOption that was set. - * - * @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 _setFileExpiry(accountName, path, expiryOption, 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 expireTime = (options && options.expireTime !== undefined) ? options.expireTime : undefined; - let op = 'SETEXPIRY'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path cannot be null or undefined and it must be of type string.'); - } - if (expiryOption) { - let allowedValues = [ 'NeverExpire', 'RelativeToNow', 'RelativeToCreationDate', 'Absolute' ]; - if (!allowedValues.some( function(item) { return item === expiryOption; })) { - throw new Error(expiryOption + ' is not a valid value. The valid values are: ' + allowedValues); - } - } else { - throw new Error('expiryOption cannot be null or undefined.'); - } - if (expireTime !== null && expireTime !== undefined && typeof expireTime !== 'number') { - throw new Error('expireTime must be of type number.'); - } - 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('/') ? '' : '/') + 'WebHdfsExt/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - queryParameters.push('expiryOption=' + encodeURIComponent(expiryOption)); - if (expireTime !== null && expireTime !== undefined) { - queryParameters.push('expireTime=' + encodeURIComponent(expireTime.toString())); - } - queryParameters.push('op=' + encodeURIComponent(op)); - 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]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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); - }); -} - -/** - * Appends to the specified file, optionally first creating the file if it does - * not yet exist. This method supports multiple concurrent appends to the file. - * NOTE: The target must not contain data added by Create or normal (serial) - * Append. ConcurrentAppend and Append cannot be used interchangeably; once a - * target file has been modified using either of these append options, the - * other append option cannot be used on the target file. ConcurrentAppend does - * not guarantee order and can result in duplicated data landing in the target - * file. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file to which to append using concurrent append. - * - * @param {object} streamContents The file contents to include when appending - * to the file. The maximum content size is 4MB. For content larger than 4MB - * you must append the content in 4MB chunks. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.appendMode] Indicates the concurrent append call - * should create the file if it doesn't exist or just open the existing file - * for append. Possible values include: 'autocreate' - * - * @param {string} [options.syncFlag] Optionally indicates what to do after - * completion of the concurrent append. DATA indicates that more data will be - * sent immediately by the client, the file handle should remain open/locked, - * and file metadata (including file length, last modified time) should NOT get - * updated. METADATA indicates that more data will be sent immediately by the - * client, the file handle should remain open/locked, and file metadata should - * get updated. CLOSE indicates that the client is done sending data, the file - * handle should be closed/unlocked, and file metadata should get updated. - * Possible values include: 'DATA', 'METADATA', 'CLOSE' - * - * @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 _concurrentAppend(accountName, path, streamContents, 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 appendMode = (options && options.appendMode !== undefined) ? options.appendMode : undefined; - let syncFlag = (options && options.syncFlag !== undefined) ? options.syncFlag : 'DATA'; - let op = 'CONCURRENTAPPEND'; - let transferEncoding = 'chunked'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path cannot be null or undefined and it must be of type string.'); - } - if (streamContents === null || streamContents === undefined) { - throw new Error('streamContents cannot be null or undefined and it must be of type object.'); - } - if (appendMode) { - let allowedValues = [ 'autocreate' ]; - if (!allowedValues.some( function(item) { return item === appendMode; })) { - throw new Error(appendMode + ' is not a valid value. The valid values are: ' + allowedValues); - } - } - if (syncFlag) { - let allowedValues1 = [ 'DATA', 'METADATA', 'CLOSE' ]; - if (!allowedValues1.some( function(item) { return item === syncFlag; })) { - throw new Error(syncFlag + ' is not a valid value. The valid values are: ' + allowedValues1); - } - } - 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('/') ? '' : '/') + 'WebHdfsExt/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - if (appendMode !== null && appendMode !== undefined) { - queryParameters.push('appendMode=' + encodeURIComponent(appendMode)); - } - queryParameters.push('op=' + encodeURIComponent(op)); - if (syncFlag !== null && syncFlag !== undefined) { - queryParameters.push('syncFlag=' + encodeURIComponent(syncFlag)); - } - 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/octet-stream'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (transferEncoding !== undefined && transferEncoding !== null) { - httpRequest.headers['Transfer-Encoding'] = transferEncoding; - } - 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 = streamContents; - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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); - }); -} - -/** - * Checks if the specified access is available at the given path. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to check access. - * - * @param {string} fsaction File system operation read/write/execute in string - * form, matching regex pattern '[rwx-]{3}' - * - * @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 _checkAccess(accountName, path, fsaction, 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 op = 'CHECKACCESS'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path cannot be null or undefined and it must be of type string.'); - } - if (fsaction === null || fsaction === undefined || typeof fsaction.valueOf() !== 'string') { - throw new Error('fsaction 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 (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('/') ? '' : '/') + 'webhdfs/v1/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - queryParameters.push('fsaction=' + encodeURIComponent(fsaction)); - queryParameters.push('op=' + encodeURIComponent(op)); - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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 directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * directory to create. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.permission] Optional octal permission with which - * the directory should be created. - * - * @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 FileOperationResult} 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 _mkdirs(accountName, path, 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 permission = (options && options.permission !== undefined) ? options.permission : undefined; - let op = 'MKDIRS'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path cannot be null or undefined and it must be of type string.'); - } - if (permission !== null && permission !== undefined && typeof permission !== 'number') { - throw new Error('permission must be of type number.'); - } - 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('/') ? '' : '/') + 'webhdfs/v1/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - if (permission !== null && permission !== undefined) { - queryParameters.push('permission=' + encodeURIComponent(permission.toString())); - } - queryParameters.push('op=' + encodeURIComponent(op)); - 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]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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['FileOperationResult']().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); - }); -} - -/** - * Concatenates the list of source files into the destination file, removing - * all source files upon success. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * destination file resulting from the concatenation. - * - * @param {array} sources A list of comma separated Data Lake Store paths - * (starting with '/') of the files to concatenate, in the order in which they - * should be concatenated. - * - * @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 _concat(accountName, path, sources, 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 op = 'CONCAT'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path cannot be null or undefined and it must be of type string.'); - } - if (!Array.isArray(sources)) { - throw new Error('sources cannot be null or undefined and it must be of type array.'); - } - for (let i = 0; i < sources.length; i++) { - if (sources[i] !== null && sources[i] !== undefined && typeof sources[i].valueOf() !== 'string') { - throw new Error('sources[i] 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 (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('/') ? '' : '/') + 'webhdfs/v1/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - queryParameters.push('sources=' + encodeURIComponent(sources.join(','))); - queryParameters.push('op=' + encodeURIComponent(op)); - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'POST'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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); - }); -} - -/** - * Concatenates the list of source files into the destination file, deleting - * all source files upon success. This method accepts more source file paths - * than the Concat method. This method and the parameters it accepts are - * subject to change for usability in an upcoming version. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * destination file resulting from the concatenation. - * - * @param {object} streamContents A list of Data Lake Store paths (starting - * with '/') of the source files. Must be a comma-separated path list in the - * format: sources=/file/path/1.txt,/file/path/2.txt,/file/path/lastfile.csv - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.deleteSourceDirectory] Indicates that as an - * optimization instead of deleting each individual source stream, delete the - * source stream folder if all streams are in the same folder instead. This - * results in a substantial performance improvement when the only streams in - * the folder are part of the concatenation operation. WARNING: This includes - * the deletion of any other files that are not source files. Only set this to - * true when source files are the only files in the source directory. - * - * @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 _msConcat(accountName, path, streamContents, 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 deleteSourceDirectory = (options && options.deleteSourceDirectory !== undefined) ? options.deleteSourceDirectory : undefined; - let op = 'MSCONCAT'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path cannot be null or undefined and it must be of type string.'); - } - if (deleteSourceDirectory !== null && deleteSourceDirectory !== undefined && typeof deleteSourceDirectory !== 'boolean') { - throw new Error('deleteSourceDirectory must be of type boolean.'); - } - if (streamContents === null || streamContents === undefined) { - throw new Error('streamContents cannot be null or undefined and it must be of type object.'); - } - 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('/') ? '' : '/') + 'webhdfs/v1/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - if (deleteSourceDirectory !== null && deleteSourceDirectory !== undefined) { - queryParameters.push('deleteSourceDirectory=' + encodeURIComponent(deleteSourceDirectory.toString())); - } - queryParameters.push('op=' + encodeURIComponent(op)); - 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/octet-stream'; - 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 = streamContents; - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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); - }); -} - -/** - * Get the list of file status objects specified by the file path, with - * optional pagination parameters - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * directory to list. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.listSize] Gets or sets the number of items to - * return. Optional. - * - * @param {string} [options.listAfter] Gets or sets the item or lexographical - * index after which to begin returning results. For example, a file list of - * 'a','b','d' and listAfter='b' will return 'd', and a listAfter='c' will also - * return 'd'. Optional. - * - * @param {string} [options.listBefore] Gets or sets the item or lexographical - * index before which to begin returning results. For example, a file list of - * 'a','b','d' and listBefore='d' will return 'a','b', and a listBefore='c' - * will also return 'a','b'. Optional. - * - * @param {boolean} [options.tooId] An optional switch to return friendly names - * in place of owner and group. tooid=false returns friendly names instead of - * the AAD Object ID. Default value is true, returning AAD object IDs. - * - * @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 FileStatusesResult} 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 _listFileStatus(accountName, path, 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 listSize = (options && options.listSize !== undefined) ? options.listSize : undefined; - let listAfter = (options && options.listAfter !== undefined) ? options.listAfter : undefined; - let listBefore = (options && options.listBefore !== undefined) ? options.listBefore : undefined; - let tooId = (options && options.tooId !== undefined) ? options.tooId : undefined; - let op = 'LISTSTATUS'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path cannot be null or undefined and it must be of type string.'); - } - if (listSize !== null && listSize !== undefined && typeof listSize !== 'number') { - throw new Error('listSize must be of type number.'); - } - if (listAfter !== null && listAfter !== undefined && typeof listAfter.valueOf() !== 'string') { - throw new Error('listAfter must be of type string.'); - } - if (listBefore !== null && listBefore !== undefined && typeof listBefore.valueOf() !== 'string') { - throw new Error('listBefore must be of type string.'); - } - if (tooId !== null && tooId !== undefined && typeof tooId !== 'boolean') { - throw new Error('tooId must be of type boolean.'); - } - 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('/') ? '' : '/') + 'webhdfs/v1/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - if (listSize !== null && listSize !== undefined) { - queryParameters.push('listSize=' + encodeURIComponent(listSize.toString())); - } - if (listAfter !== null && listAfter !== undefined) { - queryParameters.push('listAfter=' + encodeURIComponent(listAfter)); - } - if (listBefore !== null && listBefore !== undefined) { - queryParameters.push('listBefore=' + encodeURIComponent(listBefore)); - } - if (tooId !== null && tooId !== undefined) { - queryParameters.push('tooId=' + encodeURIComponent(tooId.toString())); - } - queryParameters.push('op=' + encodeURIComponent(op)); - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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['FileStatusesResult']().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 the file content summary object specified by the file path. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file for which to retrieve the summary. - * - * @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 ContentSummaryResult} 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 _getContentSummary(accountName, path, 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 op = 'GETCONTENTSUMMARY'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path 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 (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('/') ? '' : '/') + 'webhdfs/v1/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - queryParameters.push('op=' + encodeURIComponent(op)); - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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['ContentSummaryResult']().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 the file status object specified by the file path. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to retrieve the status. - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.tooId] An optional switch to return friendly names - * in place of owner and group. tooid=false returns friendly names instead of - * the AAD Object ID. Default value is true, returning AAD object IDs. - * - * @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 FileStatusResult} 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 _getFileStatus(accountName, path, 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 tooId = (options && options.tooId !== undefined) ? options.tooId : undefined; - let op = 'GETFILESTATUS'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path cannot be null or undefined and it must be of type string.'); - } - if (tooId !== null && tooId !== undefined && typeof tooId !== 'boolean') { - throw new Error('tooId must be of type boolean.'); - } - 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('/') ? '' : '/') + 'webhdfs/v1/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - if (tooId !== null && tooId !== undefined) { - queryParameters.push('tooId=' + encodeURIComponent(tooId.toString())); - } - queryParameters.push('op=' + encodeURIComponent(op)); - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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['FileStatusResult']().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); - }); -} - -/** - * Opens and reads from the specified file. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file to open. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.length] The number of bytes that the server will - * attempt to retrieve. It will retrieve <= length bytes. - * - * @param {number} [options.offset] The byte offset to start reading data from. - * - * @param {uuid} [options.fileSessionId] Optional unique GUID per file - * indicating all the reads with the same fileSessionId are from the same - * client and same session. This will give a performance benefit. - * - * @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. - * - * {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 _open(accountName, path, 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 length = (options && options.length !== undefined) ? options.length : undefined; - let offset = (options && options.offset !== undefined) ? options.offset : undefined; - let fileSessionId = (options && options.fileSessionId !== undefined) ? options.fileSessionId : undefined; - let read = 'true'; - let op = 'OPEN'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path cannot be null or undefined and it must be of type string.'); - } - if (length !== null && length !== undefined && typeof length !== 'number') { - throw new Error('length must be of type number.'); - } - if (offset !== null && offset !== undefined && typeof offset !== 'number') { - throw new Error('offset must be of type number.'); - } - if (fileSessionId !== null && fileSessionId !== undefined && !(typeof fileSessionId.valueOf() === 'string' && msRest.isValidUuid(fileSessionId))) { - throw new Error('fileSessionId must be of type string and must be a valid uuid.'); - } - 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('/') ? '' : '/') + 'webhdfs/v1/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - if (length !== null && length !== undefined) { - queryParameters.push('length=' + encodeURIComponent(length.toString())); - } - if (offset !== null && offset !== undefined) { - queryParameters.push('offset=' + encodeURIComponent(offset.toString())); - } - if (fileSessionId !== null && fileSessionId !== undefined) { - queryParameters.push('fileSessionId=' + encodeURIComponent(fileSessionId.toString())); - } - queryParameters.push('read=' + encodeURIComponent(read)); - queryParameters.push('op=' + encodeURIComponent(op)); - 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 - httpRequest.streamedResponse = true; - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(`Unexpected status code: ${statusCode}`); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - if (responseBody !== undefined) 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 = response; - return callback(null, result, httpRequest, response); - }); -} - -/** - * Used for serial appends to the specified file. NOTE: The target must not - * contain data added by ConcurrentAppend. ConcurrentAppend and Append cannot - * be used interchangeably; once a target file has been modified using either - * of these append options, the other append option cannot be used on the - * target file. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file to which to append. - * - * @param {object} streamContents The file contents to include when appending - * to the file. The maximum content size is 4MB. For content larger than 4MB - * you must append the content in 4MB chunks. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.offset] The optional offset in the stream to begin - * the append operation. Default is to append at the end of the stream. - * - * @param {string} [options.syncFlag] Optionally indicates what to do after - * completion of the concurrent append. DATA indicates that more data will be - * sent immediately by the client, the file handle should remain open/locked, - * and file metadata (including file length, last modified time) should NOT get - * updated. METADATA indicates that more data will be sent immediately by the - * client, the file handle should remain open/locked, and file metadata should - * get updated. CLOSE indicates that the client is done sending data, the file - * handle should be closed/unlocked, and file metadata should get updated. - * Possible values include: 'DATA', 'METADATA', 'CLOSE' - * - * @param {uuid} [options.leaseId] Optional unique GUID per file to ensure - * single writer semantics, meaning that only clients that append to the file - * with the same leaseId will be allowed to do so. - * - * @param {uuid} [options.fileSessionId] Optional unique GUID per file - * indicating all the appends with the same fileSessionId are from the same - * client and same session. This will give a performance benefit when syncFlag - * is DATA or METADATA. - * - * @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 _append(accountName, path, streamContents, 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 offset = (options && options.offset !== undefined) ? options.offset : undefined; - let syncFlag = (options && options.syncFlag !== undefined) ? options.syncFlag : 'CLOSE'; - let leaseId = (options && options.leaseId !== undefined) ? options.leaseId : undefined; - let fileSessionId = (options && options.fileSessionId !== undefined) ? options.fileSessionId : undefined; - let appendParameter = 'true'; - let op = 'APPEND'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path cannot be null or undefined and it must be of type string.'); - } - if (streamContents === null || streamContents === undefined) { - throw new Error('streamContents cannot be null or undefined and it must be of type object.'); - } - if (offset !== null && offset !== undefined && typeof offset !== 'number') { - throw new Error('offset must be of type number.'); - } - if (syncFlag) { - let allowedValues = [ 'DATA', 'METADATA', 'CLOSE' ]; - if (!allowedValues.some( function(item) { return item === syncFlag; })) { - throw new Error(syncFlag + ' is not a valid value. The valid values are: ' + allowedValues); - } - } - if (leaseId !== null && leaseId !== undefined && !(typeof leaseId.valueOf() === 'string' && msRest.isValidUuid(leaseId))) { - throw new Error('leaseId must be of type string and must be a valid uuid.'); - } - if (fileSessionId !== null && fileSessionId !== undefined && !(typeof fileSessionId.valueOf() === 'string' && msRest.isValidUuid(fileSessionId))) { - throw new Error('fileSessionId must be of type string and must be a valid uuid.'); - } - 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('/') ? '' : '/') + 'webhdfs/v1/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - if (offset !== null && offset !== undefined) { - queryParameters.push('offset=' + encodeURIComponent(offset.toString())); - } - if (syncFlag !== null && syncFlag !== undefined) { - queryParameters.push('syncFlag=' + encodeURIComponent(syncFlag)); - } - if (leaseId !== null && leaseId !== undefined) { - queryParameters.push('leaseId=' + encodeURIComponent(leaseId.toString())); - } - if (fileSessionId !== null && fileSessionId !== undefined) { - queryParameters.push('fileSessionId=' + encodeURIComponent(fileSessionId.toString())); - } - queryParameters.push('append=' + encodeURIComponent(appendParameter)); - queryParameters.push('op=' + encodeURIComponent(op)); - 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/octet-stream'; - 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 = streamContents; - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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 file with optionally specified content. NOTE: If content is - * provided, the resulting file cannot be modified using ConcurrentAppend. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file to create. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.streamContents] The file contents to include when - * creating the file. This parameter is optional, resulting in an empty file if - * not specified. The maximum content size is 4MB. For content larger than - * 4MB you must append the content in 4MB chunks. - * - * @param {boolean} [options.overwrite] The indication of if the file should be - * overwritten. - * - * @param {string} [options.syncFlag] Optionally indicates what to do after - * completion of the create. DATA indicates that more data will be sent - * immediately by the client, the file handle should remain open/locked, and - * file metadata (including file length, last modified time) should NOT get - * updated. METADATA indicates that more data will be sent immediately by the - * client, the file handle should remain open/locked, and file metadata should - * get updated. CLOSE indicates that the client is done sending data, the file - * handle should be closed/unlocked, and file metadata should get updated. - * Possible values include: 'DATA', 'METADATA', 'CLOSE' - * - * @param {uuid} [options.leaseId] Optional unique GUID per file to ensure - * single writer semantics, meaning that only clients that append to the file - * with the same leaseId will be allowed to do so. - * - * @param {number} [options.permission] The octal representation of the unnamed - * user, mask and other permissions that should be set for the file when - * created. If not specified, it inherits these from the container. - * - * @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 _create(accountName, path, 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 streamContents = (options && options.streamContents !== undefined) ? options.streamContents : undefined; - let overwrite = (options && options.overwrite !== undefined) ? options.overwrite : undefined; - let syncFlag = (options && options.syncFlag !== undefined) ? options.syncFlag : 'CLOSE'; - let leaseId = (options && options.leaseId !== undefined) ? options.leaseId : undefined; - let permission = (options && options.permission !== undefined) ? options.permission : undefined; - let write = 'true'; - let op = 'CREATE'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path cannot be null or undefined and it must be of type string.'); - } - if (streamContents !== null && streamContents !== undefined && typeof streamContents.valueOf() !== 'object') { - throw new Error('streamContents must be of type object.'); - } - if (overwrite !== null && overwrite !== undefined && typeof overwrite !== 'boolean') { - throw new Error('overwrite must be of type boolean.'); - } - if (syncFlag) { - let allowedValues = [ 'DATA', 'METADATA', 'CLOSE' ]; - if (!allowedValues.some( function(item) { return item === syncFlag; })) { - throw new Error(syncFlag + ' is not a valid value. The valid values are: ' + allowedValues); - } - } - if (leaseId !== null && leaseId !== undefined && !(typeof leaseId.valueOf() === 'string' && msRest.isValidUuid(leaseId))) { - throw new Error('leaseId must be of type string and must be a valid uuid.'); - } - if (permission !== null && permission !== undefined && typeof permission !== 'number') { - throw new Error('permission must be of type number.'); - } - 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('/') ? '' : '/') + 'webhdfs/v1/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - if (overwrite !== null && overwrite !== undefined) { - queryParameters.push('overwrite=' + encodeURIComponent(overwrite.toString())); - } - if (syncFlag !== null && syncFlag !== undefined) { - queryParameters.push('syncFlag=' + encodeURIComponent(syncFlag)); - } - if (leaseId !== null && leaseId !== undefined) { - queryParameters.push('leaseId=' + encodeURIComponent(leaseId.toString())); - } - if (permission !== null && permission !== undefined) { - queryParameters.push('permission=' + encodeURIComponent(permission.toString())); - } - queryParameters.push('write=' + encodeURIComponent(write)); - queryParameters.push('op=' + encodeURIComponent(op)); - 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/octet-stream'; - 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 = streamContents; - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 201) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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); - }); -} - -/** - * Sets the Access Control List (ACL) for a file or folder. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory on which to set the ACL. - * - * @param {string} aclspec The ACL spec included in ACL creation operations in - * the format '[default:]user|group|other::r|-w|-x|-' - * - * @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 _setAcl(accountName, path, aclspec, 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 op = 'SETACL'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path cannot be null or undefined and it must be of type string.'); - } - if (aclspec === null || aclspec === undefined || typeof aclspec.valueOf() !== 'string') { - throw new Error('aclspec 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 (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('/') ? '' : '/') + 'webhdfs/v1/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - queryParameters.push('aclspec=' + encodeURIComponent(aclspec)); - queryParameters.push('op=' + encodeURIComponent(op)); - 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]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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); - }); -} - -/** - * Modifies existing Access Control List (ACL) entries on a file or folder. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory with the ACL being modified. - * - * @param {string} aclspec The ACL specification included in ACL modification - * operations in the format '[default:]user|group|other::r|-w|-x|-' - * - * @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 _modifyAclEntries(accountName, path, aclspec, 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 op = 'MODIFYACLENTRIES'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path cannot be null or undefined and it must be of type string.'); - } - if (aclspec === null || aclspec === undefined || typeof aclspec.valueOf() !== 'string') { - throw new Error('aclspec 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 (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('/') ? '' : '/') + 'webhdfs/v1/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - queryParameters.push('aclspec=' + encodeURIComponent(aclspec)); - queryParameters.push('op=' + encodeURIComponent(op)); - 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]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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); - }); -} - -/** - * Removes existing Access Control List (ACL) entries for a file or folder. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory with the ACL being removed. - * - * @param {string} aclspec The ACL spec included in ACL removal operations in - * the format '[default:]user|group|other' - * - * @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 _removeAclEntries(accountName, path, aclspec, 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 op = 'REMOVEACLENTRIES'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path cannot be null or undefined and it must be of type string.'); - } - if (aclspec === null || aclspec === undefined || typeof aclspec.valueOf() !== 'string') { - throw new Error('aclspec 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 (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('/') ? '' : '/') + 'webhdfs/v1/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - queryParameters.push('aclspec=' + encodeURIComponent(aclspec)); - queryParameters.push('op=' + encodeURIComponent(op)); - 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]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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); - }); -} - -/** - * Removes the existing Default Access Control List (ACL) of the specified - * directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * directory with the default ACL being removed. - * - * @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 _removeDefaultAcl(accountName, path, 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 op = 'REMOVEDEFAULTACL'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path 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 (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('/') ? '' : '/') + 'webhdfs/v1/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - queryParameters.push('op=' + encodeURIComponent(op)); - 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]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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); - }); -} - -/** - * Removes the existing Access Control List (ACL) of the specified file or - * directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory with the ACL being removed. - * - * @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 _removeAcl(accountName, path, 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 op = 'REMOVEACL'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path 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 (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('/') ? '' : '/') + 'webhdfs/v1/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - queryParameters.push('op=' + encodeURIComponent(op)); - 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]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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); - }); -} - -/** - * Gets Access Control List (ACL) entries for the specified file or directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to get the ACL. - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.tooId] An optional switch to return friendly names - * in place of object ID for ACL entries. tooid=false returns friendly names - * instead of the AAD Object ID. Default value is true, returning AAD object - * IDs. - * - * @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 AclStatusResult} 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 _getAclStatus(accountName, path, 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 tooId = (options && options.tooId !== undefined) ? options.tooId : undefined; - let op = 'GETACLSTATUS'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path cannot be null or undefined and it must be of type string.'); - } - if (tooId !== null && tooId !== undefined && typeof tooId !== 'boolean') { - throw new Error('tooId must be of type boolean.'); - } - 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('/') ? '' : '/') + 'webhdfs/v1/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - if (tooId !== null && tooId !== undefined) { - queryParameters.push('tooId=' + encodeURIComponent(tooId.toString())); - } - queryParameters.push('op=' + encodeURIComponent(op)); - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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['AclStatusResult']().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 the requested file or directory, optionally recursively. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory to delete. - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.recursive] The optional switch indicating if the - * delete should be recursive - * - * @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 FileOperationResult} 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 _deleteMethod(accountName, path, 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 recursive = (options && options.recursive !== undefined) ? options.recursive : undefined; - let op = 'DELETE'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path cannot be null or undefined and it must be of type string.'); - } - if (recursive !== null && recursive !== undefined && typeof recursive !== 'boolean') { - throw new Error('recursive must be of type boolean.'); - } - 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('/') ? '' : '/') + 'webhdfs/v1/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - if (recursive !== null && recursive !== undefined) { - queryParameters.push('recursive=' + encodeURIComponent(recursive.toString())); - } - queryParameters.push('op=' + encodeURIComponent(op)); - 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 !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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['FileOperationResult']().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); - }); -} - -/** - * Rename a file or directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory to move/rename. - * - * @param {string} destination The path to move/rename the file or folder to - * - * @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 FileOperationResult} 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 _rename(accountName, path, destination, 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 op = 'RENAME'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path cannot be null or undefined and it must be of type string.'); - } - if (destination === null || destination === undefined || typeof destination.valueOf() !== 'string') { - throw new Error('destination 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 (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('/') ? '' : '/') + 'webhdfs/v1/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - queryParameters.push('destination=' + encodeURIComponent(destination)); - queryParameters.push('op=' + encodeURIComponent(op)); - 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]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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['FileOperationResult']().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); - }); -} - -/** - * Sets the owner of a file or directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to set the owner. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.owner] The AAD Object ID of the user owner of the - * file or directory. If empty, the property will remain unchanged. - * - * @param {string} [options.group] The AAD Object ID of the group owner of the - * file or directory. If empty, the property will remain unchanged. - * - * @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 _setOwner(accountName, path, 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 owner = (options && options.owner !== undefined) ? options.owner : undefined; - let group = (options && options.group !== undefined) ? options.group : undefined; - let op = 'SETOWNER'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path cannot be null or undefined and it must be of type string.'); - } - if (owner !== null && owner !== undefined && typeof owner.valueOf() !== 'string') { - throw new Error('owner must be of type string.'); - } - if (group !== null && group !== undefined && typeof group.valueOf() !== 'string') { - throw new Error('group 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 (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('/') ? '' : '/') + 'webhdfs/v1/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - if (owner !== null && owner !== undefined) { - queryParameters.push('owner=' + encodeURIComponent(owner)); - } - if (group !== null && group !== undefined) { - queryParameters.push('group=' + encodeURIComponent(group)); - } - queryParameters.push('op=' + encodeURIComponent(op)); - 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]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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); - }); -} - -/** - * Sets the permission of the file or folder. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to set the permission. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.permission] A string representation of the - * permission (i.e 'rwx'). If empty, this property remains unchanged. - * - * @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 _setPermission(accountName, path, 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 permission = (options && options.permission !== undefined) ? options.permission : undefined; - let op = 'SETPERMISSION'; - // Validate - try { - if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') { - throw new Error('accountName cannot be null or undefined and it must be of type string.'); - } - if (this.client.adlsFileSystemDnsSuffix === null || this.client.adlsFileSystemDnsSuffix === undefined || typeof this.client.adlsFileSystemDnsSuffix.valueOf() !== 'string') { - throw new Error('this.client.adlsFileSystemDnsSuffix cannot be null or undefined and it must be of type string.'); - } - if (path === null || path === undefined || typeof path.valueOf() !== 'string') { - throw new Error('path cannot be null or undefined and it must be of type string.'); - } - if (permission !== null && permission !== undefined && typeof permission.valueOf() !== 'string') { - throw new Error('permission 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 (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('/') ? '' : '/') + 'webhdfs/v1/{path}'; - requestUrl = requestUrl.replace('{accountName}', accountName); - requestUrl = requestUrl.replace('{adlsFileSystemDnsSuffix}', this.client.adlsFileSystemDnsSuffix); - requestUrl = requestUrl.replace('{path}', encodeURIComponent(path)); - let queryParameters = []; - if (permission !== null && permission !== undefined) { - queryParameters.push('permission=' + encodeURIComponent(permission)); - } - queryParameters.push('op=' + encodeURIComponent(op)); - 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]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['AdlsError']().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); - }); -} - -/** Class representing a FileSystem. */ -class FileSystem { - /** - * Create a FileSystem. - * @param {DataLakeStoreFileSystemManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._setFileExpiry = _setFileExpiry; - this._concurrentAppend = _concurrentAppend; - this._checkAccess = _checkAccess; - this._mkdirs = _mkdirs; - this._concat = _concat; - this._msConcat = _msConcat; - this._listFileStatus = _listFileStatus; - this._getContentSummary = _getContentSummary; - this._getFileStatus = _getFileStatus; - this._open = _open; - this._append = _append; - this._create = _create; - this._setAcl = _setAcl; - this._modifyAclEntries = _modifyAclEntries; - this._removeAclEntries = _removeAclEntries; - this._removeDefaultAcl = _removeDefaultAcl; - this._removeAcl = _removeAcl; - this._getAclStatus = _getAclStatus; - this._deleteMethod = _deleteMethod; - this._rename = _rename; - this._setOwner = _setOwner; - this._setPermission = _setPermission; - } - - /** - * Sets or removes the expiration time on the specified file. This operation - * can only be executed against files. Folders are not supported. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file on which to set or remove the expiration time. - * - * @param {string} expiryOption Indicates the type of expiration to use for the - * file: 1. NeverExpire: ExpireTime is ignored. 2. RelativeToNow: ExpireTime is - * an integer in milliseconds representing the expiration date relative to when - * file expiration is updated. 3. RelativeToCreationDate: ExpireTime is an - * integer in milliseconds representing the expiration date relative to file - * creation. 4. Absolute: ExpireTime is an integer in milliseconds, as a Unix - * timestamp relative to 1/1/1970 00:00:00. Possible values include: - * 'NeverExpire', 'RelativeToNow', 'RelativeToCreationDate', 'Absolute' - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.expireTime] The time that the file will expire, - * corresponding to the ExpiryOption that was set. - * - * @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. - */ - setFileExpiryWithHttpOperationResponse(accountName, path, expiryOption, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._setFileExpiry(accountName, path, expiryOption, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Sets or removes the expiration time on the specified file. This operation - * can only be executed against files. Folders are not supported. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file on which to set or remove the expiration time. - * - * @param {string} expiryOption Indicates the type of expiration to use for the - * file: 1. NeverExpire: ExpireTime is ignored. 2. RelativeToNow: ExpireTime is - * an integer in milliseconds representing the expiration date relative to when - * file expiration is updated. 3. RelativeToCreationDate: ExpireTime is an - * integer in milliseconds representing the expiration date relative to file - * creation. 4. Absolute: ExpireTime is an integer in milliseconds, as a Unix - * timestamp relative to 1/1/1970 00:00:00. Possible values include: - * 'NeverExpire', 'RelativeToNow', 'RelativeToCreationDate', 'Absolute' - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.expireTime] The time that the file will expire, - * corresponding to the ExpiryOption that was set. - * - * @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. - */ - setFileExpiry(accountName, path, expiryOption, 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._setFileExpiry(accountName, path, expiryOption, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._setFileExpiry(accountName, path, expiryOption, options, optionalCallback); - } - } - - /** - * Appends to the specified file, optionally first creating the file if it does - * not yet exist. This method supports multiple concurrent appends to the file. - * NOTE: The target must not contain data added by Create or normal (serial) - * Append. ConcurrentAppend and Append cannot be used interchangeably; once a - * target file has been modified using either of these append options, the - * other append option cannot be used on the target file. ConcurrentAppend does - * not guarantee order and can result in duplicated data landing in the target - * file. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file to which to append using concurrent append. - * - * @param {object} streamContents The file contents to include when appending - * to the file. The maximum content size is 4MB. For content larger than 4MB - * you must append the content in 4MB chunks. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.appendMode] Indicates the concurrent append call - * should create the file if it doesn't exist or just open the existing file - * for append. Possible values include: 'autocreate' - * - * @param {string} [options.syncFlag] Optionally indicates what to do after - * completion of the concurrent append. DATA indicates that more data will be - * sent immediately by the client, the file handle should remain open/locked, - * and file metadata (including file length, last modified time) should NOT get - * updated. METADATA indicates that more data will be sent immediately by the - * client, the file handle should remain open/locked, and file metadata should - * get updated. CLOSE indicates that the client is done sending data, the file - * handle should be closed/unlocked, and file metadata should get updated. - * Possible values include: 'DATA', 'METADATA', 'CLOSE' - * - * @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. - */ - concurrentAppendWithHttpOperationResponse(accountName, path, streamContents, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._concurrentAppend(accountName, path, streamContents, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Appends to the specified file, optionally first creating the file if it does - * not yet exist. This method supports multiple concurrent appends to the file. - * NOTE: The target must not contain data added by Create or normal (serial) - * Append. ConcurrentAppend and Append cannot be used interchangeably; once a - * target file has been modified using either of these append options, the - * other append option cannot be used on the target file. ConcurrentAppend does - * not guarantee order and can result in duplicated data landing in the target - * file. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file to which to append using concurrent append. - * - * @param {object} streamContents The file contents to include when appending - * to the file. The maximum content size is 4MB. For content larger than 4MB - * you must append the content in 4MB chunks. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.appendMode] Indicates the concurrent append call - * should create the file if it doesn't exist or just open the existing file - * for append. Possible values include: 'autocreate' - * - * @param {string} [options.syncFlag] Optionally indicates what to do after - * completion of the concurrent append. DATA indicates that more data will be - * sent immediately by the client, the file handle should remain open/locked, - * and file metadata (including file length, last modified time) should NOT get - * updated. METADATA indicates that more data will be sent immediately by the - * client, the file handle should remain open/locked, and file metadata should - * get updated. CLOSE indicates that the client is done sending data, the file - * handle should be closed/unlocked, and file metadata should get updated. - * Possible values include: 'DATA', 'METADATA', 'CLOSE' - * - * @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. - */ - concurrentAppend(accountName, path, streamContents, 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._concurrentAppend(accountName, path, streamContents, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._concurrentAppend(accountName, path, streamContents, options, optionalCallback); - } - } - - /** - * Checks if the specified access is available at the given path. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to check access. - * - * @param {string} fsaction File system operation read/write/execute in string - * form, matching regex pattern '[rwx-]{3}' - * - * @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. - */ - checkAccessWithHttpOperationResponse(accountName, path, fsaction, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._checkAccess(accountName, path, fsaction, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Checks if the specified access is available at the given path. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to check access. - * - * @param {string} fsaction File system operation read/write/execute in string - * form, matching regex pattern '[rwx-]{3}' - * - * @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. - */ - checkAccess(accountName, path, fsaction, 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._checkAccess(accountName, path, fsaction, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._checkAccess(accountName, path, fsaction, options, optionalCallback); - } - } - - /** - * Creates a directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * directory to create. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.permission] Optional octal permission with which - * the directory should be created. - * - * @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. - */ - mkdirsWithHttpOperationResponse(accountName, path, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._mkdirs(accountName, path, 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 directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * directory to create. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.permission] Optional octal permission with which - * the directory should be created. - * - * @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 {FileOperationResult} - 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 FileOperationResult} 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. - */ - mkdirs(accountName, path, 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._mkdirs(accountName, path, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._mkdirs(accountName, path, options, optionalCallback); - } - } - - /** - * Concatenates the list of source files into the destination file, removing - * all source files upon success. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * destination file resulting from the concatenation. - * - * @param {array} sources A list of comma separated Data Lake Store paths - * (starting with '/') of the files to concatenate, in the order in which they - * should be concatenated. - * - * @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. - */ - concatWithHttpOperationResponse(accountName, path, sources, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._concat(accountName, path, sources, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Concatenates the list of source files into the destination file, removing - * all source files upon success. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * destination file resulting from the concatenation. - * - * @param {array} sources A list of comma separated Data Lake Store paths - * (starting with '/') of the files to concatenate, in the order in which they - * should be concatenated. - * - * @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. - */ - concat(accountName, path, sources, 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._concat(accountName, path, sources, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._concat(accountName, path, sources, options, optionalCallback); - } - } - - /** - * Concatenates the list of source files into the destination file, deleting - * all source files upon success. This method accepts more source file paths - * than the Concat method. This method and the parameters it accepts are - * subject to change for usability in an upcoming version. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * destination file resulting from the concatenation. - * - * @param {object} streamContents A list of Data Lake Store paths (starting - * with '/') of the source files. Must be a comma-separated path list in the - * format: sources=/file/path/1.txt,/file/path/2.txt,/file/path/lastfile.csv - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.deleteSourceDirectory] Indicates that as an - * optimization instead of deleting each individual source stream, delete the - * source stream folder if all streams are in the same folder instead. This - * results in a substantial performance improvement when the only streams in - * the folder are part of the concatenation operation. WARNING: This includes - * the deletion of any other files that are not source files. Only set this to - * true when source files are the only files in the source directory. - * - * @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. - */ - msConcatWithHttpOperationResponse(accountName, path, streamContents, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._msConcat(accountName, path, streamContents, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Concatenates the list of source files into the destination file, deleting - * all source files upon success. This method accepts more source file paths - * than the Concat method. This method and the parameters it accepts are - * subject to change for usability in an upcoming version. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * destination file resulting from the concatenation. - * - * @param {object} streamContents A list of Data Lake Store paths (starting - * with '/') of the source files. Must be a comma-separated path list in the - * format: sources=/file/path/1.txt,/file/path/2.txt,/file/path/lastfile.csv - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.deleteSourceDirectory] Indicates that as an - * optimization instead of deleting each individual source stream, delete the - * source stream folder if all streams are in the same folder instead. This - * results in a substantial performance improvement when the only streams in - * the folder are part of the concatenation operation. WARNING: This includes - * the deletion of any other files that are not source files. Only set this to - * true when source files are the only files in the source directory. - * - * @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. - */ - msConcat(accountName, path, streamContents, 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._msConcat(accountName, path, streamContents, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._msConcat(accountName, path, streamContents, options, optionalCallback); - } - } - - /** - * Get the list of file status objects specified by the file path, with - * optional pagination parameters - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * directory to list. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.listSize] Gets or sets the number of items to - * return. Optional. - * - * @param {string} [options.listAfter] Gets or sets the item or lexographical - * index after which to begin returning results. For example, a file list of - * 'a','b','d' and listAfter='b' will return 'd', and a listAfter='c' will also - * return 'd'. Optional. - * - * @param {string} [options.listBefore] Gets or sets the item or lexographical - * index before which to begin returning results. For example, a file list of - * 'a','b','d' and listBefore='d' will return 'a','b', and a listBefore='c' - * will also return 'a','b'. Optional. - * - * @param {boolean} [options.tooId] An optional switch to return friendly names - * in place of owner and group. tooid=false returns friendly names instead of - * the AAD Object ID. Default value is true, returning AAD object IDs. - * - * @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. - */ - listFileStatusWithHttpOperationResponse(accountName, path, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listFileStatus(accountName, path, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Get the list of file status objects specified by the file path, with - * optional pagination parameters - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * directory to list. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.listSize] Gets or sets the number of items to - * return. Optional. - * - * @param {string} [options.listAfter] Gets or sets the item or lexographical - * index after which to begin returning results. For example, a file list of - * 'a','b','d' and listAfter='b' will return 'd', and a listAfter='c' will also - * return 'd'. Optional. - * - * @param {string} [options.listBefore] Gets or sets the item or lexographical - * index before which to begin returning results. For example, a file list of - * 'a','b','d' and listBefore='d' will return 'a','b', and a listBefore='c' - * will also return 'a','b'. Optional. - * - * @param {boolean} [options.tooId] An optional switch to return friendly names - * in place of owner and group. tooid=false returns friendly names instead of - * the AAD Object ID. Default value is true, returning AAD object IDs. - * - * @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 {FileStatusesResult} - 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 FileStatusesResult} 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. - */ - listFileStatus(accountName, path, 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._listFileStatus(accountName, path, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listFileStatus(accountName, path, options, optionalCallback); - } - } - - /** - * Gets the file content summary object specified by the file path. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file for which to retrieve the summary. - * - * @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. - */ - getContentSummaryWithHttpOperationResponse(accountName, path, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getContentSummary(accountName, path, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Gets the file content summary object specified by the file path. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file for which to retrieve the summary. - * - * @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 {ContentSummaryResult} - 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 ContentSummaryResult} 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. - */ - getContentSummary(accountName, path, 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._getContentSummary(accountName, path, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getContentSummary(accountName, path, options, optionalCallback); - } - } - - /** - * Get the file status object specified by the file path. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to retrieve the status. - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.tooId] An optional switch to return friendly names - * in place of owner and group. tooid=false returns friendly names instead of - * the AAD Object ID. Default value is true, returning AAD object IDs. - * - * @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. - */ - getFileStatusWithHttpOperationResponse(accountName, path, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getFileStatus(accountName, path, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Get the file status object specified by the file path. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to retrieve the status. - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.tooId] An optional switch to return friendly names - * in place of owner and group. tooid=false returns friendly names instead of - * the AAD Object ID. Default value is true, returning AAD object IDs. - * - * @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 {FileStatusResult} - 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 FileStatusResult} 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. - */ - getFileStatus(accountName, path, 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._getFileStatus(accountName, path, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getFileStatus(accountName, path, options, optionalCallback); - } - } - - /** - * Opens and reads from the specified file. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file to open. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.length] The number of bytes that the server will - * attempt to retrieve. It will retrieve <= length bytes. - * - * @param {number} [options.offset] The byte offset to start reading data from. - * - * @param {uuid} [options.fileSessionId] Optional unique GUID per file - * indicating all the reads with the same fileSessionId are from the same - * client and same session. This will give a performance benefit. - * - * @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. - */ - openWithHttpOperationResponse(accountName, path, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._open(accountName, path, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Opens and reads from the specified file. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file to open. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.length] The number of bytes that the server will - * attempt to retrieve. It will retrieve <= length bytes. - * - * @param {number} [options.offset] The byte offset to start reading data from. - * - * @param {uuid} [options.fileSessionId] Optional unique GUID per file - * indicating all the reads with the same fileSessionId are from the same - * client and same session. This will give a performance benefit. - * - * @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 {Object} - 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. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - open(accountName, path, 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._open(accountName, path, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._open(accountName, path, options, optionalCallback); - } - } - - /** - * Used for serial appends to the specified file. NOTE: The target must not - * contain data added by ConcurrentAppend. ConcurrentAppend and Append cannot - * be used interchangeably; once a target file has been modified using either - * of these append options, the other append option cannot be used on the - * target file. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file to which to append. - * - * @param {object} streamContents The file contents to include when appending - * to the file. The maximum content size is 4MB. For content larger than 4MB - * you must append the content in 4MB chunks. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.offset] The optional offset in the stream to begin - * the append operation. Default is to append at the end of the stream. - * - * @param {string} [options.syncFlag] Optionally indicates what to do after - * completion of the concurrent append. DATA indicates that more data will be - * sent immediately by the client, the file handle should remain open/locked, - * and file metadata (including file length, last modified time) should NOT get - * updated. METADATA indicates that more data will be sent immediately by the - * client, the file handle should remain open/locked, and file metadata should - * get updated. CLOSE indicates that the client is done sending data, the file - * handle should be closed/unlocked, and file metadata should get updated. - * Possible values include: 'DATA', 'METADATA', 'CLOSE' - * - * @param {uuid} [options.leaseId] Optional unique GUID per file to ensure - * single writer semantics, meaning that only clients that append to the file - * with the same leaseId will be allowed to do so. - * - * @param {uuid} [options.fileSessionId] Optional unique GUID per file - * indicating all the appends with the same fileSessionId are from the same - * client and same session. This will give a performance benefit when syncFlag - * is DATA or METADATA. - * - * @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. - */ - appendWithHttpOperationResponse(accountName, path, streamContents, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._append(accountName, path, streamContents, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Used for serial appends to the specified file. NOTE: The target must not - * contain data added by ConcurrentAppend. ConcurrentAppend and Append cannot - * be used interchangeably; once a target file has been modified using either - * of these append options, the other append option cannot be used on the - * target file. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file to which to append. - * - * @param {object} streamContents The file contents to include when appending - * to the file. The maximum content size is 4MB. For content larger than 4MB - * you must append the content in 4MB chunks. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.offset] The optional offset in the stream to begin - * the append operation. Default is to append at the end of the stream. - * - * @param {string} [options.syncFlag] Optionally indicates what to do after - * completion of the concurrent append. DATA indicates that more data will be - * sent immediately by the client, the file handle should remain open/locked, - * and file metadata (including file length, last modified time) should NOT get - * updated. METADATA indicates that more data will be sent immediately by the - * client, the file handle should remain open/locked, and file metadata should - * get updated. CLOSE indicates that the client is done sending data, the file - * handle should be closed/unlocked, and file metadata should get updated. - * Possible values include: 'DATA', 'METADATA', 'CLOSE' - * - * @param {uuid} [options.leaseId] Optional unique GUID per file to ensure - * single writer semantics, meaning that only clients that append to the file - * with the same leaseId will be allowed to do so. - * - * @param {uuid} [options.fileSessionId] Optional unique GUID per file - * indicating all the appends with the same fileSessionId are from the same - * client and same session. This will give a performance benefit when syncFlag - * is DATA or METADATA. - * - * @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. - */ - append(accountName, path, streamContents, 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._append(accountName, path, streamContents, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._append(accountName, path, streamContents, options, optionalCallback); - } - } - - /** - * Creates a file with optionally specified content. NOTE: If content is - * provided, the resulting file cannot be modified using ConcurrentAppend. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file to create. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.streamContents] The file contents to include when - * creating the file. This parameter is optional, resulting in an empty file if - * not specified. The maximum content size is 4MB. For content larger than - * 4MB you must append the content in 4MB chunks. - * - * @param {boolean} [options.overwrite] The indication of if the file should be - * overwritten. - * - * @param {string} [options.syncFlag] Optionally indicates what to do after - * completion of the create. DATA indicates that more data will be sent - * immediately by the client, the file handle should remain open/locked, and - * file metadata (including file length, last modified time) should NOT get - * updated. METADATA indicates that more data will be sent immediately by the - * client, the file handle should remain open/locked, and file metadata should - * get updated. CLOSE indicates that the client is done sending data, the file - * handle should be closed/unlocked, and file metadata should get updated. - * Possible values include: 'DATA', 'METADATA', 'CLOSE' - * - * @param {uuid} [options.leaseId] Optional unique GUID per file to ensure - * single writer semantics, meaning that only clients that append to the file - * with the same leaseId will be allowed to do so. - * - * @param {number} [options.permission] The octal representation of the unnamed - * user, mask and other permissions that should be set for the file when - * created. If not specified, it inherits these from the container. - * - * @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(accountName, path, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._create(accountName, path, 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 file with optionally specified content. NOTE: If content is - * provided, the resulting file cannot be modified using ConcurrentAppend. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file to create. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.streamContents] The file contents to include when - * creating the file. This parameter is optional, resulting in an empty file if - * not specified. The maximum content size is 4MB. For content larger than - * 4MB you must append the content in 4MB chunks. - * - * @param {boolean} [options.overwrite] The indication of if the file should be - * overwritten. - * - * @param {string} [options.syncFlag] Optionally indicates what to do after - * completion of the create. DATA indicates that more data will be sent - * immediately by the client, the file handle should remain open/locked, and - * file metadata (including file length, last modified time) should NOT get - * updated. METADATA indicates that more data will be sent immediately by the - * client, the file handle should remain open/locked, and file metadata should - * get updated. CLOSE indicates that the client is done sending data, the file - * handle should be closed/unlocked, and file metadata should get updated. - * Possible values include: 'DATA', 'METADATA', 'CLOSE' - * - * @param {uuid} [options.leaseId] Optional unique GUID per file to ensure - * single writer semantics, meaning that only clients that append to the file - * with the same leaseId will be allowed to do so. - * - * @param {number} [options.permission] The octal representation of the unnamed - * user, mask and other permissions that should be set for the file when - * created. If not specified, it inherits these from the container. - * - * @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. - */ - create(accountName, path, 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(accountName, path, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._create(accountName, path, options, optionalCallback); - } - } - - /** - * Sets the Access Control List (ACL) for a file or folder. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory on which to set the ACL. - * - * @param {string} aclspec The ACL spec included in ACL creation operations in - * the format '[default:]user|group|other::r|-w|-x|-' - * - * @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. - */ - setAclWithHttpOperationResponse(accountName, path, aclspec, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._setAcl(accountName, path, aclspec, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Sets the Access Control List (ACL) for a file or folder. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory on which to set the ACL. - * - * @param {string} aclspec The ACL spec included in ACL creation operations in - * the format '[default:]user|group|other::r|-w|-x|-' - * - * @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. - */ - setAcl(accountName, path, aclspec, 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._setAcl(accountName, path, aclspec, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._setAcl(accountName, path, aclspec, options, optionalCallback); - } - } - - /** - * Modifies existing Access Control List (ACL) entries on a file or folder. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory with the ACL being modified. - * - * @param {string} aclspec The ACL specification included in ACL modification - * operations in the format '[default:]user|group|other::r|-w|-x|-' - * - * @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. - */ - modifyAclEntriesWithHttpOperationResponse(accountName, path, aclspec, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._modifyAclEntries(accountName, path, aclspec, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Modifies existing Access Control List (ACL) entries on a file or folder. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory with the ACL being modified. - * - * @param {string} aclspec The ACL specification included in ACL modification - * operations in the format '[default:]user|group|other::r|-w|-x|-' - * - * @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. - */ - modifyAclEntries(accountName, path, aclspec, 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._modifyAclEntries(accountName, path, aclspec, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._modifyAclEntries(accountName, path, aclspec, options, optionalCallback); - } - } - - /** - * Removes existing Access Control List (ACL) entries for a file or folder. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory with the ACL being removed. - * - * @param {string} aclspec The ACL spec included in ACL removal operations in - * the format '[default:]user|group|other' - * - * @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. - */ - removeAclEntriesWithHttpOperationResponse(accountName, path, aclspec, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._removeAclEntries(accountName, path, aclspec, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Removes existing Access Control List (ACL) entries for a file or folder. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory with the ACL being removed. - * - * @param {string} aclspec The ACL spec included in ACL removal operations in - * the format '[default:]user|group|other' - * - * @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. - */ - removeAclEntries(accountName, path, aclspec, 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._removeAclEntries(accountName, path, aclspec, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._removeAclEntries(accountName, path, aclspec, options, optionalCallback); - } - } - - /** - * Removes the existing Default Access Control List (ACL) of the specified - * directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * directory with the default ACL being removed. - * - * @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. - */ - removeDefaultAclWithHttpOperationResponse(accountName, path, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._removeDefaultAcl(accountName, path, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Removes the existing Default Access Control List (ACL) of the specified - * directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * directory with the default ACL being removed. - * - * @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. - */ - removeDefaultAcl(accountName, path, 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._removeDefaultAcl(accountName, path, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._removeDefaultAcl(accountName, path, options, optionalCallback); - } - } - - /** - * Removes the existing Access Control List (ACL) of the specified file or - * directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory with the ACL being removed. - * - * @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. - */ - removeAclWithHttpOperationResponse(accountName, path, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._removeAcl(accountName, path, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Removes the existing Access Control List (ACL) of the specified file or - * directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory with the ACL being removed. - * - * @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. - */ - removeAcl(accountName, path, 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._removeAcl(accountName, path, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._removeAcl(accountName, path, options, optionalCallback); - } - } - - /** - * Gets Access Control List (ACL) entries for the specified file or directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to get the ACL. - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.tooId] An optional switch to return friendly names - * in place of object ID for ACL entries. tooid=false returns friendly names - * instead of the AAD Object ID. Default value is true, returning AAD object - * IDs. - * - * @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. - */ - getAclStatusWithHttpOperationResponse(accountName, path, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getAclStatus(accountName, path, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Gets Access Control List (ACL) entries for the specified file or directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to get the ACL. - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.tooId] An optional switch to return friendly names - * in place of object ID for ACL entries. tooid=false returns friendly names - * instead of the AAD Object ID. Default value is true, returning AAD object - * IDs. - * - * @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 {AclStatusResult} - 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 AclStatusResult} 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. - */ - getAclStatus(accountName, path, 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._getAclStatus(accountName, path, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getAclStatus(accountName, path, options, optionalCallback); - } - } - - /** - * Deletes the requested file or directory, optionally recursively. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory to delete. - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.recursive] The optional switch indicating if the - * delete should be recursive - * - * @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(accountName, path, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(accountName, path, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the requested file or directory, optionally recursively. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory to delete. - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.recursive] The optional switch indicating if the - * delete should be recursive - * - * @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 {FileOperationResult} - 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 FileOperationResult} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(accountName, path, 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(accountName, path, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(accountName, path, options, optionalCallback); - } - } - - /** - * Rename a file or directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory to move/rename. - * - * @param {string} destination The path to move/rename the file or folder to - * - * @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. - */ - renameWithHttpOperationResponse(accountName, path, destination, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._rename(accountName, path, destination, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Rename a file or directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory to move/rename. - * - * @param {string} destination The path to move/rename the file or folder to - * - * @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 {FileOperationResult} - 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 FileOperationResult} 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. - */ - rename(accountName, path, destination, 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._rename(accountName, path, destination, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._rename(accountName, path, destination, options, optionalCallback); - } - } - - /** - * Sets the owner of a file or directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to set the owner. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.owner] The AAD Object ID of the user owner of the - * file or directory. If empty, the property will remain unchanged. - * - * @param {string} [options.group] The AAD Object ID of the group owner of the - * file or directory. If empty, the property will remain unchanged. - * - * @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. - */ - setOwnerWithHttpOperationResponse(accountName, path, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._setOwner(accountName, path, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Sets the owner of a file or directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to set the owner. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.owner] The AAD Object ID of the user owner of the - * file or directory. If empty, the property will remain unchanged. - * - * @param {string} [options.group] The AAD Object ID of the group owner of the - * file or directory. If empty, the property will remain unchanged. - * - * @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. - */ - setOwner(accountName, path, 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._setOwner(accountName, path, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._setOwner(accountName, path, options, optionalCallback); - } - } - - /** - * Sets the permission of the file or folder. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to set the permission. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.permission] A string representation of the - * permission (i.e 'rwx'). If empty, this property remains unchanged. - * - * @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. - */ - setPermissionWithHttpOperationResponse(accountName, path, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._setPermission(accountName, path, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Sets the permission of the file or folder. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to set the permission. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.permission] A string representation of the - * permission (i.e 'rwx'). If empty, this property remains unchanged. - * - * @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. - */ - setPermission(accountName, path, 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._setPermission(accountName, path, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._setPermission(accountName, path, options, optionalCallback); - } - } - -} - -module.exports = FileSystem; diff --git a/lib/services/dataLake.Store/lib/filesystem/operations/index.d.ts b/lib/services/dataLake.Store/lib/filesystem/operations/index.d.ts deleted file mode 100644 index cd17fe23fc..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/operations/index.d.ts +++ /dev/null @@ -1,1758 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * 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 stream from 'stream'; -import * as models from '../models'; - - -/** - * @class - * FileSystem - * __NOTE__: An instance of this class is automatically created for an - * instance of the DataLakeStoreFileSystemManagementClient. - */ -export interface FileSystem { - - - /** - * Sets or removes the expiration time on the specified file. This operation - * can only be executed against files. Folders are not supported. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file on which to set or remove the expiration time. - * - * @param {string} expiryOption Indicates the type of expiration to use for the - * file: 1. NeverExpire: ExpireTime is ignored. 2. RelativeToNow: ExpireTime is - * an integer in milliseconds representing the expiration date relative to when - * file expiration is updated. 3. RelativeToCreationDate: ExpireTime is an - * integer in milliseconds representing the expiration date relative to file - * creation. 4. Absolute: ExpireTime is an integer in milliseconds, as a Unix - * timestamp relative to 1/1/1970 00:00:00. Possible values include: - * 'NeverExpire', 'RelativeToNow', 'RelativeToCreationDate', 'Absolute' - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.expireTime] The time that the file will expire, - * corresponding to the ExpiryOption that was set. - * - * @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. - */ - setFileExpiryWithHttpOperationResponse(accountName: string, path: string, expiryOption: string, options?: { expireTime? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Sets or removes the expiration time on the specified file. This operation - * can only be executed against files. Folders are not supported. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file on which to set or remove the expiration time. - * - * @param {string} expiryOption Indicates the type of expiration to use for the - * file: 1. NeverExpire: ExpireTime is ignored. 2. RelativeToNow: ExpireTime is - * an integer in milliseconds representing the expiration date relative to when - * file expiration is updated. 3. RelativeToCreationDate: ExpireTime is an - * integer in milliseconds representing the expiration date relative to file - * creation. 4. Absolute: ExpireTime is an integer in milliseconds, as a Unix - * timestamp relative to 1/1/1970 00:00:00. Possible values include: - * 'NeverExpire', 'RelativeToNow', 'RelativeToCreationDate', 'Absolute' - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.expireTime] The time that the file will expire, - * corresponding to the ExpiryOption that was set. - * - * @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. - */ - setFileExpiry(accountName: string, path: string, expiryOption: string, options?: { expireTime? : number, customHeaders? : { [headerName: string]: string; } }): Promise; - setFileExpiry(accountName: string, path: string, expiryOption: string, callback: ServiceCallback): void; - setFileExpiry(accountName: string, path: string, expiryOption: string, options: { expireTime? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Appends to the specified file, optionally first creating the file if it does - * not yet exist. This method supports multiple concurrent appends to the file. - * NOTE: The target must not contain data added by Create or normal (serial) - * Append. ConcurrentAppend and Append cannot be used interchangeably; once a - * target file has been modified using either of these append options, the - * other append option cannot be used on the target file. ConcurrentAppend does - * not guarantee order and can result in duplicated data landing in the target - * file. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file to which to append using concurrent append. - * - * @param {object} streamContents The file contents to include when appending - * to the file. The maximum content size is 4MB. For content larger than 4MB - * you must append the content in 4MB chunks. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.appendMode] Indicates the concurrent append call - * should create the file if it doesn't exist or just open the existing file - * for append. Possible values include: 'autocreate' - * - * @param {string} [options.syncFlag] Optionally indicates what to do after - * completion of the concurrent append. DATA indicates that more data will be - * sent immediately by the client, the file handle should remain open/locked, - * and file metadata (including file length, last modified time) should NOT get - * updated. METADATA indicates that more data will be sent immediately by the - * client, the file handle should remain open/locked, and file metadata should - * get updated. CLOSE indicates that the client is done sending data, the file - * handle should be closed/unlocked, and file metadata should get updated. - * Possible values include: 'DATA', 'METADATA', 'CLOSE' - * - * @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. - */ - concurrentAppendWithHttpOperationResponse(accountName: string, path: string, streamContents: stream.Readable, options?: { appendMode? : string, syncFlag? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Appends to the specified file, optionally first creating the file if it does - * not yet exist. This method supports multiple concurrent appends to the file. - * NOTE: The target must not contain data added by Create or normal (serial) - * Append. ConcurrentAppend and Append cannot be used interchangeably; once a - * target file has been modified using either of these append options, the - * other append option cannot be used on the target file. ConcurrentAppend does - * not guarantee order and can result in duplicated data landing in the target - * file. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file to which to append using concurrent append. - * - * @param {object} streamContents The file contents to include when appending - * to the file. The maximum content size is 4MB. For content larger than 4MB - * you must append the content in 4MB chunks. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.appendMode] Indicates the concurrent append call - * should create the file if it doesn't exist or just open the existing file - * for append. Possible values include: 'autocreate' - * - * @param {string} [options.syncFlag] Optionally indicates what to do after - * completion of the concurrent append. DATA indicates that more data will be - * sent immediately by the client, the file handle should remain open/locked, - * and file metadata (including file length, last modified time) should NOT get - * updated. METADATA indicates that more data will be sent immediately by the - * client, the file handle should remain open/locked, and file metadata should - * get updated. CLOSE indicates that the client is done sending data, the file - * handle should be closed/unlocked, and file metadata should get updated. - * Possible values include: 'DATA', 'METADATA', 'CLOSE' - * - * @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. - */ - concurrentAppend(accountName: string, path: string, streamContents: stream.Readable, options?: { appendMode? : string, syncFlag? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - concurrentAppend(accountName: string, path: string, streamContents: stream.Readable, callback: ServiceCallback): void; - concurrentAppend(accountName: string, path: string, streamContents: stream.Readable, options: { appendMode? : string, syncFlag? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Checks if the specified access is available at the given path. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to check access. - * - * @param {string} fsaction File system operation read/write/execute in string - * form, matching regex pattern '[rwx-]{3}' - * - * @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. - */ - checkAccessWithHttpOperationResponse(accountName: string, path: string, fsaction: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Checks if the specified access is available at the given path. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to check access. - * - * @param {string} fsaction File system operation read/write/execute in string - * form, matching regex pattern '[rwx-]{3}' - * - * @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. - */ - checkAccess(accountName: string, path: string, fsaction: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - checkAccess(accountName: string, path: string, fsaction: string, callback: ServiceCallback): void; - checkAccess(accountName: string, path: string, fsaction: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates a directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * directory to create. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.permission] Optional octal permission with which - * the directory should be created. - * - * @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. - */ - mkdirsWithHttpOperationResponse(accountName: string, path: string, options?: { permission? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates a directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * directory to create. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.permission] Optional octal permission with which - * the directory should be created. - * - * @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 {FileOperationResult} - 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. - * - * {FileOperationResult} [result] - The deserialized result object if an error did not occur. - * See {@link FileOperationResult} 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. - */ - mkdirs(accountName: string, path: string, options?: { permission? : number, customHeaders? : { [headerName: string]: string; } }): Promise; - mkdirs(accountName: string, path: string, callback: ServiceCallback): void; - mkdirs(accountName: string, path: string, options: { permission? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Concatenates the list of source files into the destination file, removing - * all source files upon success. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * destination file resulting from the concatenation. - * - * @param {array} sources A list of comma separated Data Lake Store paths - * (starting with '/') of the files to concatenate, in the order in which they - * should be concatenated. - * - * @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. - */ - concatWithHttpOperationResponse(accountName: string, path: string, sources: string[], options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Concatenates the list of source files into the destination file, removing - * all source files upon success. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * destination file resulting from the concatenation. - * - * @param {array} sources A list of comma separated Data Lake Store paths - * (starting with '/') of the files to concatenate, in the order in which they - * should be concatenated. - * - * @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. - */ - concat(accountName: string, path: string, sources: string[], options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - concat(accountName: string, path: string, sources: string[], callback: ServiceCallback): void; - concat(accountName: string, path: string, sources: string[], options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Concatenates the list of source files into the destination file, deleting - * all source files upon success. This method accepts more source file paths - * than the Concat method. This method and the parameters it accepts are - * subject to change for usability in an upcoming version. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * destination file resulting from the concatenation. - * - * @param {object} streamContents A list of Data Lake Store paths (starting - * with '/') of the source files. Must be a comma-separated path list in the - * format: sources=/file/path/1.txt,/file/path/2.txt,/file/path/lastfile.csv - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.deleteSourceDirectory] Indicates that as an - * optimization instead of deleting each individual source stream, delete the - * source stream folder if all streams are in the same folder instead. This - * results in a substantial performance improvement when the only streams in - * the folder are part of the concatenation operation. WARNING: This includes - * the deletion of any other files that are not source files. Only set this to - * true when source files are the only files in the source directory. - * - * @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. - */ - msConcatWithHttpOperationResponse(accountName: string, path: string, streamContents: stream.Readable, options?: { deleteSourceDirectory? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Concatenates the list of source files into the destination file, deleting - * all source files upon success. This method accepts more source file paths - * than the Concat method. This method and the parameters it accepts are - * subject to change for usability in an upcoming version. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * destination file resulting from the concatenation. - * - * @param {object} streamContents A list of Data Lake Store paths (starting - * with '/') of the source files. Must be a comma-separated path list in the - * format: sources=/file/path/1.txt,/file/path/2.txt,/file/path/lastfile.csv - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.deleteSourceDirectory] Indicates that as an - * optimization instead of deleting each individual source stream, delete the - * source stream folder if all streams are in the same folder instead. This - * results in a substantial performance improvement when the only streams in - * the folder are part of the concatenation operation. WARNING: This includes - * the deletion of any other files that are not source files. Only set this to - * true when source files are the only files in the source directory. - * - * @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. - */ - msConcat(accountName: string, path: string, streamContents: stream.Readable, options?: { deleteSourceDirectory? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; - msConcat(accountName: string, path: string, streamContents: stream.Readable, callback: ServiceCallback): void; - msConcat(accountName: string, path: string, streamContents: stream.Readable, options: { deleteSourceDirectory? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Get the list of file status objects specified by the file path, with - * optional pagination parameters - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * directory to list. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.listSize] Gets or sets the number of items to - * return. Optional. - * - * @param {string} [options.listAfter] Gets or sets the item or lexographical - * index after which to begin returning results. For example, a file list of - * 'a','b','d' and listAfter='b' will return 'd', and a listAfter='c' will also - * return 'd'. Optional. - * - * @param {string} [options.listBefore] Gets or sets the item or lexographical - * index before which to begin returning results. For example, a file list of - * 'a','b','d' and listBefore='d' will return 'a','b', and a listBefore='c' - * will also return 'a','b'. Optional. - * - * @param {boolean} [options.tooId] An optional switch to return friendly names - * in place of owner and group. tooid=false returns friendly names instead of - * the AAD Object ID. Default value is true, returning AAD object IDs. - * - * @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. - */ - listFileStatusWithHttpOperationResponse(accountName: string, path: string, options?: { listSize? : number, listAfter? : string, listBefore? : string, tooId? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Get the list of file status objects specified by the file path, with - * optional pagination parameters - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * directory to list. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.listSize] Gets or sets the number of items to - * return. Optional. - * - * @param {string} [options.listAfter] Gets or sets the item or lexographical - * index after which to begin returning results. For example, a file list of - * 'a','b','d' and listAfter='b' will return 'd', and a listAfter='c' will also - * return 'd'. Optional. - * - * @param {string} [options.listBefore] Gets or sets the item or lexographical - * index before which to begin returning results. For example, a file list of - * 'a','b','d' and listBefore='d' will return 'a','b', and a listBefore='c' - * will also return 'a','b'. Optional. - * - * @param {boolean} [options.tooId] An optional switch to return friendly names - * in place of owner and group. tooid=false returns friendly names instead of - * the AAD Object ID. Default value is true, returning AAD object IDs. - * - * @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 {FileStatusesResult} - 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. - * - * {FileStatusesResult} [result] - The deserialized result object if an error did not occur. - * See {@link FileStatusesResult} 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. - */ - listFileStatus(accountName: string, path: string, options?: { listSize? : number, listAfter? : string, listBefore? : string, tooId? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; - listFileStatus(accountName: string, path: string, callback: ServiceCallback): void; - listFileStatus(accountName: string, path: string, options: { listSize? : number, listAfter? : string, listBefore? : string, tooId? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the file content summary object specified by the file path. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file for which to retrieve the summary. - * - * @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. - */ - getContentSummaryWithHttpOperationResponse(accountName: string, path: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the file content summary object specified by the file path. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file for which to retrieve the summary. - * - * @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 {ContentSummaryResult} - 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. - * - * {ContentSummaryResult} [result] - The deserialized result object if an error did not occur. - * See {@link ContentSummaryResult} 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. - */ - getContentSummary(accountName: string, path: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getContentSummary(accountName: string, path: string, callback: ServiceCallback): void; - getContentSummary(accountName: string, path: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Get the file status object specified by the file path. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to retrieve the status. - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.tooId] An optional switch to return friendly names - * in place of owner and group. tooid=false returns friendly names instead of - * the AAD Object ID. Default value is true, returning AAD object IDs. - * - * @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. - */ - getFileStatusWithHttpOperationResponse(accountName: string, path: string, options?: { tooId? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Get the file status object specified by the file path. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to retrieve the status. - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.tooId] An optional switch to return friendly names - * in place of owner and group. tooid=false returns friendly names instead of - * the AAD Object ID. Default value is true, returning AAD object IDs. - * - * @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 {FileStatusResult} - 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. - * - * {FileStatusResult} [result] - The deserialized result object if an error did not occur. - * See {@link FileStatusResult} 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. - */ - getFileStatus(accountName: string, path: string, options?: { tooId? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; - getFileStatus(accountName: string, path: string, callback: ServiceCallback): void; - getFileStatus(accountName: string, path: string, options: { tooId? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Opens and reads from the specified file. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file to open. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.length] The number of bytes that the server will - * attempt to retrieve. It will retrieve <= length bytes. - * - * @param {number} [options.offset] The byte offset to start reading data from. - * - * @param {uuid} [options.fileSessionId] Optional unique GUID per file - * indicating all the reads with the same fileSessionId are from the same - * client and same session. This will give a performance benefit. - * - * @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. - */ - openWithHttpOperationResponse(accountName: string, path: string, options?: { length? : number, offset? : number, fileSessionId? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Opens and reads from the specified file. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file to open. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.length] The number of bytes that the server will - * attempt to retrieve. It will retrieve <= length bytes. - * - * @param {number} [options.offset] The byte offset to start reading data from. - * - * @param {uuid} [options.fileSessionId] Optional unique GUID per file - * indicating all the reads with the same fileSessionId are from the same - * client and same session. This will give a performance benefit. - * - * @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 {Object} - 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. - * - * {Object} [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. - */ - open(accountName: string, path: string, options?: { length? : number, offset? : number, fileSessionId? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - open(accountName: string, path: string, callback: ServiceCallback): void; - open(accountName: string, path: string, options: { length? : number, offset? : number, fileSessionId? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Used for serial appends to the specified file. NOTE: The target must not - * contain data added by ConcurrentAppend. ConcurrentAppend and Append cannot - * be used interchangeably; once a target file has been modified using either - * of these append options, the other append option cannot be used on the - * target file. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file to which to append. - * - * @param {object} streamContents The file contents to include when appending - * to the file. The maximum content size is 4MB. For content larger than 4MB - * you must append the content in 4MB chunks. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.offset] The optional offset in the stream to begin - * the append operation. Default is to append at the end of the stream. - * - * @param {string} [options.syncFlag] Optionally indicates what to do after - * completion of the concurrent append. DATA indicates that more data will be - * sent immediately by the client, the file handle should remain open/locked, - * and file metadata (including file length, last modified time) should NOT get - * updated. METADATA indicates that more data will be sent immediately by the - * client, the file handle should remain open/locked, and file metadata should - * get updated. CLOSE indicates that the client is done sending data, the file - * handle should be closed/unlocked, and file metadata should get updated. - * Possible values include: 'DATA', 'METADATA', 'CLOSE' - * - * @param {uuid} [options.leaseId] Optional unique GUID per file to ensure - * single writer semantics, meaning that only clients that append to the file - * with the same leaseId will be allowed to do so. - * - * @param {uuid} [options.fileSessionId] Optional unique GUID per file - * indicating all the appends with the same fileSessionId are from the same - * client and same session. This will give a performance benefit when syncFlag - * is DATA or METADATA. - * - * @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. - */ - appendWithHttpOperationResponse(accountName: string, path: string, streamContents: stream.Readable, options?: { offset? : number, syncFlag? : string, leaseId? : string, fileSessionId? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Used for serial appends to the specified file. NOTE: The target must not - * contain data added by ConcurrentAppend. ConcurrentAppend and Append cannot - * be used interchangeably; once a target file has been modified using either - * of these append options, the other append option cannot be used on the - * target file. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file to which to append. - * - * @param {object} streamContents The file contents to include when appending - * to the file. The maximum content size is 4MB. For content larger than 4MB - * you must append the content in 4MB chunks. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.offset] The optional offset in the stream to begin - * the append operation. Default is to append at the end of the stream. - * - * @param {string} [options.syncFlag] Optionally indicates what to do after - * completion of the concurrent append. DATA indicates that more data will be - * sent immediately by the client, the file handle should remain open/locked, - * and file metadata (including file length, last modified time) should NOT get - * updated. METADATA indicates that more data will be sent immediately by the - * client, the file handle should remain open/locked, and file metadata should - * get updated. CLOSE indicates that the client is done sending data, the file - * handle should be closed/unlocked, and file metadata should get updated. - * Possible values include: 'DATA', 'METADATA', 'CLOSE' - * - * @param {uuid} [options.leaseId] Optional unique GUID per file to ensure - * single writer semantics, meaning that only clients that append to the file - * with the same leaseId will be allowed to do so. - * - * @param {uuid} [options.fileSessionId] Optional unique GUID per file - * indicating all the appends with the same fileSessionId are from the same - * client and same session. This will give a performance benefit when syncFlag - * is DATA or METADATA. - * - * @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. - */ - append(accountName: string, path: string, streamContents: stream.Readable, options?: { offset? : number, syncFlag? : string, leaseId? : string, fileSessionId? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - append(accountName: string, path: string, streamContents: stream.Readable, callback: ServiceCallback): void; - append(accountName: string, path: string, streamContents: stream.Readable, options: { offset? : number, syncFlag? : string, leaseId? : string, fileSessionId? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates a file with optionally specified content. NOTE: If content is - * provided, the resulting file cannot be modified using ConcurrentAppend. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file to create. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.streamContents] The file contents to include when - * creating the file. This parameter is optional, resulting in an empty file if - * not specified. The maximum content size is 4MB. For content larger than - * 4MB you must append the content in 4MB chunks. - * - * @param {boolean} [options.overwrite] The indication of if the file should be - * overwritten. - * - * @param {string} [options.syncFlag] Optionally indicates what to do after - * completion of the create. DATA indicates that more data will be sent - * immediately by the client, the file handle should remain open/locked, and - * file metadata (including file length, last modified time) should NOT get - * updated. METADATA indicates that more data will be sent immediately by the - * client, the file handle should remain open/locked, and file metadata should - * get updated. CLOSE indicates that the client is done sending data, the file - * handle should be closed/unlocked, and file metadata should get updated. - * Possible values include: 'DATA', 'METADATA', 'CLOSE' - * - * @param {uuid} [options.leaseId] Optional unique GUID per file to ensure - * single writer semantics, meaning that only clients that append to the file - * with the same leaseId will be allowed to do so. - * - * @param {number} [options.permission] The octal representation of the unnamed - * user, mask and other permissions that should be set for the file when - * created. If not specified, it inherits these from the container. - * - * @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(accountName: string, path: string, options?: { streamContents? : stream.Readable, overwrite? : boolean, syncFlag? : string, leaseId? : string, permission? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates a file with optionally specified content. NOTE: If content is - * provided, the resulting file cannot be modified using ConcurrentAppend. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file to create. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.streamContents] The file contents to include when - * creating the file. This parameter is optional, resulting in an empty file if - * not specified. The maximum content size is 4MB. For content larger than - * 4MB you must append the content in 4MB chunks. - * - * @param {boolean} [options.overwrite] The indication of if the file should be - * overwritten. - * - * @param {string} [options.syncFlag] Optionally indicates what to do after - * completion of the create. DATA indicates that more data will be sent - * immediately by the client, the file handle should remain open/locked, and - * file metadata (including file length, last modified time) should NOT get - * updated. METADATA indicates that more data will be sent immediately by the - * client, the file handle should remain open/locked, and file metadata should - * get updated. CLOSE indicates that the client is done sending data, the file - * handle should be closed/unlocked, and file metadata should get updated. - * Possible values include: 'DATA', 'METADATA', 'CLOSE' - * - * @param {uuid} [options.leaseId] Optional unique GUID per file to ensure - * single writer semantics, meaning that only clients that append to the file - * with the same leaseId will be allowed to do so. - * - * @param {number} [options.permission] The octal representation of the unnamed - * user, mask and other permissions that should be set for the file when - * created. If not specified, it inherits these from the container. - * - * @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. - */ - create(accountName: string, path: string, options?: { streamContents? : stream.Readable, overwrite? : boolean, syncFlag? : string, leaseId? : string, permission? : number, customHeaders? : { [headerName: string]: string; } }): Promise; - create(accountName: string, path: string, callback: ServiceCallback): void; - create(accountName: string, path: string, options: { streamContents? : stream.Readable, overwrite? : boolean, syncFlag? : string, leaseId? : string, permission? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Sets the Access Control List (ACL) for a file or folder. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory on which to set the ACL. - * - * @param {string} aclspec The ACL spec included in ACL creation operations in - * the format '[default:]user|group|other::r|-w|-x|-' - * - * @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. - */ - setAclWithHttpOperationResponse(accountName: string, path: string, aclspec: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Sets the Access Control List (ACL) for a file or folder. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory on which to set the ACL. - * - * @param {string} aclspec The ACL spec included in ACL creation operations in - * the format '[default:]user|group|other::r|-w|-x|-' - * - * @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. - */ - setAcl(accountName: string, path: string, aclspec: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - setAcl(accountName: string, path: string, aclspec: string, callback: ServiceCallback): void; - setAcl(accountName: string, path: string, aclspec: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Modifies existing Access Control List (ACL) entries on a file or folder. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory with the ACL being modified. - * - * @param {string} aclspec The ACL specification included in ACL modification - * operations in the format '[default:]user|group|other::r|-w|-x|-' - * - * @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. - */ - modifyAclEntriesWithHttpOperationResponse(accountName: string, path: string, aclspec: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Modifies existing Access Control List (ACL) entries on a file or folder. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory with the ACL being modified. - * - * @param {string} aclspec The ACL specification included in ACL modification - * operations in the format '[default:]user|group|other::r|-w|-x|-' - * - * @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. - */ - modifyAclEntries(accountName: string, path: string, aclspec: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - modifyAclEntries(accountName: string, path: string, aclspec: string, callback: ServiceCallback): void; - modifyAclEntries(accountName: string, path: string, aclspec: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Removes existing Access Control List (ACL) entries for a file or folder. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory with the ACL being removed. - * - * @param {string} aclspec The ACL spec included in ACL removal operations in - * the format '[default:]user|group|other' - * - * @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. - */ - removeAclEntriesWithHttpOperationResponse(accountName: string, path: string, aclspec: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Removes existing Access Control List (ACL) entries for a file or folder. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory with the ACL being removed. - * - * @param {string} aclspec The ACL spec included in ACL removal operations in - * the format '[default:]user|group|other' - * - * @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. - */ - removeAclEntries(accountName: string, path: string, aclspec: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - removeAclEntries(accountName: string, path: string, aclspec: string, callback: ServiceCallback): void; - removeAclEntries(accountName: string, path: string, aclspec: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Removes the existing Default Access Control List (ACL) of the specified - * directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * directory with the default ACL being removed. - * - * @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. - */ - removeDefaultAclWithHttpOperationResponse(accountName: string, path: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Removes the existing Default Access Control List (ACL) of the specified - * directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * directory with the default ACL being removed. - * - * @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. - */ - removeDefaultAcl(accountName: string, path: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - removeDefaultAcl(accountName: string, path: string, callback: ServiceCallback): void; - removeDefaultAcl(accountName: string, path: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Removes the existing Access Control List (ACL) of the specified file or - * directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory with the ACL being removed. - * - * @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. - */ - removeAclWithHttpOperationResponse(accountName: string, path: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Removes the existing Access Control List (ACL) of the specified file or - * directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory with the ACL being removed. - * - * @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. - */ - removeAcl(accountName: string, path: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - removeAcl(accountName: string, path: string, callback: ServiceCallback): void; - removeAcl(accountName: string, path: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets Access Control List (ACL) entries for the specified file or directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to get the ACL. - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.tooId] An optional switch to return friendly names - * in place of object ID for ACL entries. tooid=false returns friendly names - * instead of the AAD Object ID. Default value is true, returning AAD object - * IDs. - * - * @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. - */ - getAclStatusWithHttpOperationResponse(accountName: string, path: string, options?: { tooId? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets Access Control List (ACL) entries for the specified file or directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to get the ACL. - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.tooId] An optional switch to return friendly names - * in place of object ID for ACL entries. tooid=false returns friendly names - * instead of the AAD Object ID. Default value is true, returning AAD object - * IDs. - * - * @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 {AclStatusResult} - 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. - * - * {AclStatusResult} [result] - The deserialized result object if an error did not occur. - * See {@link AclStatusResult} 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. - */ - getAclStatus(accountName: string, path: string, options?: { tooId? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; - getAclStatus(accountName: string, path: string, callback: ServiceCallback): void; - getAclStatus(accountName: string, path: string, options: { tooId? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the requested file or directory, optionally recursively. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory to delete. - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.recursive] The optional switch indicating if the - * delete should be recursive - * - * @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(accountName: string, path: string, options?: { recursive? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the requested file or directory, optionally recursively. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory to delete. - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.recursive] The optional switch indicating if the - * delete should be recursive - * - * @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 {FileOperationResult} - 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. - * - * {FileOperationResult} [result] - The deserialized result object if an error did not occur. - * See {@link FileOperationResult} 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. - */ - deleteMethod(accountName: string, path: string, options?: { recursive? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(accountName: string, path: string, callback: ServiceCallback): void; - deleteMethod(accountName: string, path: string, options: { recursive? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Rename a file or directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory to move/rename. - * - * @param {string} destination The path to move/rename the file or folder to - * - * @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. - */ - renameWithHttpOperationResponse(accountName: string, path: string, destination: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Rename a file or directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory to move/rename. - * - * @param {string} destination The path to move/rename the file or folder to - * - * @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 {FileOperationResult} - 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. - * - * {FileOperationResult} [result] - The deserialized result object if an error did not occur. - * See {@link FileOperationResult} 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. - */ - rename(accountName: string, path: string, destination: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - rename(accountName: string, path: string, destination: string, callback: ServiceCallback): void; - rename(accountName: string, path: string, destination: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Sets the owner of a file or directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to set the owner. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.owner] The AAD Object ID of the user owner of the - * file or directory. If empty, the property will remain unchanged. - * - * @param {string} [options.group] The AAD Object ID of the group owner of the - * file or directory. If empty, the property will remain unchanged. - * - * @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. - */ - setOwnerWithHttpOperationResponse(accountName: string, path: string, options?: { owner? : string, group? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Sets the owner of a file or directory. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to set the owner. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.owner] The AAD Object ID of the user owner of the - * file or directory. If empty, the property will remain unchanged. - * - * @param {string} [options.group] The AAD Object ID of the group owner of the - * file or directory. If empty, the property will remain unchanged. - * - * @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. - */ - setOwner(accountName: string, path: string, options?: { owner? : string, group? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - setOwner(accountName: string, path: string, callback: ServiceCallback): void; - setOwner(accountName: string, path: string, options: { owner? : string, group? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Sets the permission of the file or folder. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to set the permission. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.permission] A string representation of the - * permission (i.e 'rwx'). If empty, this property remains unchanged. - * - * @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. - */ - setPermissionWithHttpOperationResponse(accountName: string, path: string, options?: { permission? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Sets the permission of the file or folder. - * - * @param {string} accountName The Azure Data Lake Store account to execute - * filesystem operations on. - * - * @param {string} path The Data Lake Store path (starting with '/') of the - * file or directory for which to set the permission. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.permission] A string representation of the - * permission (i.e 'rwx'). If empty, this property remains unchanged. - * - * @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. - */ - setPermission(accountName: string, path: string, options?: { permission? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - setPermission(accountName: string, path: string, callback: ServiceCallback): void; - setPermission(accountName: string, path: string, options: { permission? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} diff --git a/lib/services/dataLake.Store/lib/filesystem/operations/index.js b/lib/services/dataLake.Store/lib/filesystem/operations/index.js deleted file mode 100644 index bfe29f562c..0000000000 --- a/lib/services/dataLake.Store/lib/filesystem/operations/index.js +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * 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.FileSystem = require('./fileSystem'); diff --git a/lib/services/dataLake.Store/package.json b/lib/services/dataLake.Store/package.json deleted file mode 100644 index 00c01dcc5e..0000000000 --- a/lib/services/dataLake.Store/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "azure-arm-datalake-store", - "author": "Microsoft Corporation", - "contributors": [ - "Goldsmith, Benjamin " - ], - "version": "3.1.0-preview", - "description": "Microsoft Azure Data Lake Store Management Client Library for node", - "tags": [ - "azure", - "sdk" - ], - "keywords": [ - "node", - "azure" - ], - "main": "./lib/dataLakeStore.js", - "types": "./lib/dataLakeStore.d.ts", - "license": "MIT", - "dependencies": { - "ms-rest": "^2.2.2", - "ms-rest-azure": "^2.3.3" - }, - "homepage": "http://github.com/Azure/azure-sdk-for-node", - "repository": { - "type": "git", - "url": "git@github.com:Azure/azure-sdk-for-node.git" - }, - "bugs": { - "url": "http://github.com/Azure/azure-sdk-for-node/issues" - }, - "scripts": { - "test": "npm -s run-script jshint" - } -} \ No newline at end of file From 397e02e7aa59fcb090c2976af0aa0546fc37a1b8 Mon Sep 17 00:00:00 2001 From: Dan Schulte Date: Thu, 15 Nov 2018 15:05:16 -0800 Subject: [PATCH 8/8] Update test references --- test/runtimeTests/rpRegistrationFilterTest.js | 2 +- .../dataLakeAnalyticsManagementClient-tests.js | 2 +- .../dataLakeStoreManagementClient-tests.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/runtimeTests/rpRegistrationFilterTest.js b/test/runtimeTests/rpRegistrationFilterTest.js index fc82c53271..3d8eeb8cc0 100644 --- a/test/runtimeTests/rpRegistrationFilterTest.js +++ b/test/runtimeTests/rpRegistrationFilterTest.js @@ -33,7 +33,7 @@ var requiredEnvironment = [{ ]; // the necessary clients -var DataLakeStoreAccountManagementClient = require('../../lib/services/dataLake.Store/lib/account/dataLakeStoreAccountManagementClient'); +var DataLakeStoreAccountManagementClient = require('../../lib/services/datalake.Store/lib/account/dataLakeStoreAccountManagementClient'); var ResourceManagementClient = require('../../lib/services/resourceManagement/lib/resource/resourceManagementClient'); var adlsClient; var adlsFileSystemClient; diff --git a/test/services/dataLakeAnalyticsManagement/dataLakeAnalyticsManagementClient-tests.js b/test/services/dataLakeAnalyticsManagement/dataLakeAnalyticsManagementClient-tests.js index 35764f8769..f42db306c9 100644 --- a/test/services/dataLakeAnalyticsManagement/dataLakeAnalyticsManagementClient-tests.js +++ b/test/services/dataLakeAnalyticsManagement/dataLakeAnalyticsManagementClient-tests.js @@ -21,7 +21,7 @@ var SuiteBase = require('../../framework/suite-base'); var dump = util.inspect; var DataLakeAnalyticsAccountManagementClient = require('../../../lib/services/dataLake.Analytics/lib/account/dataLakeAnalyticsAccountManagementClient'); -var DataLakeStoreAccountManagementClient = require('../../../lib/services/dataLake.Store/lib/account/dataLakeStoreAccountManagementClient'); +var DataLakeStoreAccountManagementClient = require('../../../lib/services/datalake.Store/lib/account/dataLakeStoreAccountManagementClient'); var DataLakeAnalyticsJobManagementClient = require('../../../lib/services/dataLake.Analytics/lib/job/dataLakeAnalyticsJobManagementClient'); var DataLakeAnalyticsCatalogManagementClient = require('../../../lib/services/dataLake.Analytics/lib/catalog/dataLakeAnalyticsCatalogManagementClient'); var ResourceManagementClient = require('../../../lib/services/resourceManagement/lib/resource/resourceManagementClient'); diff --git a/test/services/dataLakeStoreManagement/dataLakeStoreManagementClient-tests.js b/test/services/dataLakeStoreManagement/dataLakeStoreManagementClient-tests.js index 837694c9ff..b237093968 100644 --- a/test/services/dataLakeStoreManagement/dataLakeStoreManagementClient-tests.js +++ b/test/services/dataLakeStoreManagement/dataLakeStoreManagementClient-tests.js @@ -34,8 +34,8 @@ var requiredEnvironment = [{ ]; // the necessary clients -var DataLakeStoreAccountManagementClient = require('../../../lib/services/dataLake.Store/lib/account/dataLakeStoreAccountManagementClient'); -var DataLakeStoreFileSystemManagementClient = require('../../../lib/services/dataLake.Store/lib/filesystem/dataLakeStoreFileSystemManagementClient'); +var DataLakeStoreAccountManagementClient = require('../../../lib/services/datalake.Store/lib/account/dataLakeStoreAccountManagementClient'); +var DataLakeStoreFileSystemManagementClient = require('../../../lib/services/datalake.Store/lib/filesystem/dataLakeStoreFileSystemManagementClient'); var ResourceManagementClient = require('../../../lib/services/resourceManagement/lib/resource/resourceManagementClient'); var adlsClient; var adlsFileSystemClient;