diff --git a/file/.npmignore b/file/.npmignore
new file mode 100644
index 0000000..d7bc9af
--- /dev/null
+++ b/file/.npmignore
@@ -0,0 +1,50 @@
+# browser #
+browser/azure-storage.file.js
+
+# dist-esm #
+!dist-esm/lib/**/*.js
+dist-esm/test
+dist-esm/samples
+
+# dist-test #
+dist-test/
+
+# Node #
+node_modules/
+
+# Samples #
+samples/
+
+# Swagger #
+swagger/
+
+# typings #
+!typings/lib/**/*.d.ts
+typings/test
+typings/samples
+
+# git #
+.git*
+
+# Test #
+test/
+
+# Others #
+.vscode/
+.idea/
+.travis.yml
+.gitignore
+gulpfile.js
+.git
+.DS_Store
+tsconfig.json
+tslint.json
+*.js.map
+*.zip
+package-lock.json
+karma.conf.js
+temp
+gulpfile.js
+rollup.config.js
+rollup.test.config.js
+*.html
\ No newline at end of file
diff --git a/file/BreakingChanges.md b/file/BreakingChanges.md
new file mode 100644
index 0000000..ca1e03e
--- /dev/null
+++ b/file/BreakingChanges.md
@@ -0,0 +1 @@
+# Breaking Changes
\ No newline at end of file
diff --git a/file/ChangeLog.md b/file/ChangeLog.md
new file mode 100644
index 0000000..c013d80
--- /dev/null
+++ b/file/ChangeLog.md
@@ -0,0 +1,5 @@
+# Changelog
+
+2018.11 Version 10.0.0-preview
+
+* Initial Release. API version 2018-03-28 supported. Please see the README for information on the new design.
diff --git a/file/LICENSE b/file/LICENSE
new file mode 100644
index 0000000..2107107
--- /dev/null
+++ b/file/LICENSE
@@ -0,0 +1,21 @@
+ MIT License
+
+ Copyright (c) Microsoft Corporation. All rights reserved.
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE
diff --git a/file/README.md b/file/README.md
new file mode 100644
index 0000000..c4b2642
--- /dev/null
+++ b/file/README.md
@@ -0,0 +1,148 @@
+# Azure Storage SDK V10 for JavaScript - File
+
+- [![npm version](https://badge.fury.io/js/%40azure%2Fstorage-file.svg)](https://badge.fury.io/js/%40azure%2Fstorage-file)
+- [API Reference documentation](https://docs.microsoft.com/en-us/javascript/api/%40azure/storage-file/index?view=azure-node-preview)
+
+## Introduction
+
+This project provides a SDK in JavaScript that makes it easy to consume Microsoft Azure Storage services.
+
+Please note that this version of the SDK is a compete overhaul of the current [Azure Storage SDK for Node.js and JavaScript in Browsers](https://github.com/azure/azure-storage-node), and is based on the new Storage SDK architecture.
+
+### Features
+
+- File Storage
+ - Get/Set File Service Properties
+ - Create/List/Delete File Shares
+ - Create/List/Delete File Directories
+ - Create/Read/List/Update/Delete Files
+- Features new
+ - Asynchronous I/O for all operations using the async methods
+ - HttpPipeline which enables a high degree of per-request configurability
+ - 1-to-1 correlation with the Storage REST API for clarity and simplicity
+
+### Compatibility
+
+This SDK is compatible with Node.js and browsers, and validated against LTS Node.js versions (>=6.5) and latest versions of Chrome, Firefox and Edge.
+
+#### Compatible with IE11
+
+You need polyfills to make this library work with IE11. The easiest way is to use [@babel/polyfill](https://babeljs.io/docs/en/babel-polyfill), or [polyfill service](https://polyfill.io/v2/docs/).
+Or you can load separate polyfills for missed ES feature(s).
+This library depends on following ES6 features which need external polyfills loaded.
+
+- `Promise`
+- `String.prototype.startsWith`
+- `String.prototype.endsWith`
+- `String.prototype.repeat`
+- `String.prototype.includes`
+
+#### Differences between Node.js and browsers
+
+There are differences between Node.js and browsers runtime. When getting start with this SDK, pay attention to APIs or classes marked with _"ONLY AVAILABLE IN NODE.JS RUNTIME"_ or _"ONLY AVAILABLE IN BROWSERS"_.
+
+##### Following features, interfaces, classes or functions are only available in Node.js
+
+- Shared Key Authorization based on account name and account key
+ - `SharedKeyCredential`
+- Shared Access Signature(SAS) generation
+ - `generateAccountSASQueryParameters()`
+ - `generateFileSASQueryParameters()`
+- Parallel uploading and downloading
+ - `uploadFileToBlockFile()`
+ - `uploadStreamToBlockFile()`
+ - `downloadFileToBuffer()`
+
+##### Following features, interfaces, classes or functions are only available in browsers
+
+- Parallel uploading and downloading
+ - `uploadBrowserDataToFile()`
+
+## Getting Started
+
+### NPM
+
+The preferred way to install the Azure Storage SDK for JavaScript is to use the npm package manager. Simply type the following into a terminal window:
+
+```bash
+npm install @azure/storage-file
+```
+
+In your TypeScript or JavaScript file, import via following:
+
+```JavaScript
+import * as Azure from "@azure/storage-file";
+```
+
+Or
+
+```JavaScript
+const Azure = require("@azure/storage-file");
+```
+
+### JavaScript Bundle
+
+To use the SDK with JS bundle in the browsers, simply add a script tag to your HTML pages pointing to the downloaded JS bundle file(s):
+
+```html
+
+```
+
+The JS bundled file is compatible with [UMD](https://github.com/umdjs/umd) standard, if no module system found, following global variable(s) will be exported:
+
+- `azfile`
+
+#### Download
+
+Download latest released JS bundles from links in the [GitHub release page](https://github.com/Azure/azure-storage-js/releases). Or from following links directly:
+
+- File [https://aka.ms/downloadazurestoragejsfile](https://aka.ms/downloadazurestoragejsfile)
+
+### CORS
+
+You need to set up [Cross-Origin Resource Sharing (CORS)](https://docs.microsoft.com/zh-cn/rest/api/storageservices/cross-origin-resource-sharing--cors--support-for-the-azure-storage-services) rules for your storage account if you need to develop for browsers. Go to Azure portal and Azure Storage Explorer, find your storage account, create new CORS rules for blob/queue/file/table service(s).
+
+For example, you can create following CORS settings for debugging. But please customize the settings carefully according to your requirements in production environment.
+
+- Allowed origins: \*
+- Allowed verbs: DELETE,GET,HEAD,MERGE,POST,OPTIONS,PUT
+- Allowed headers: \*
+- Exposed headers: \*
+- Maximum age (seconds): 86400
+
+## SDK Architecture
+
+The Azure Storage SDK for JavaScript provides low-level and high-level APIs.
+
+- ServiceURL, ShareURL, DirectoryURL and FileURL objects provide the low-level API functionality and map one-to-one to the [Azure Storage File REST APIs](https://docs.microsoft.com/en-us/rest/api/storageservices/file-service-rest-api).
+
+- The high-level APIs provide convenience abstractions such as uploading a large stream to a file (using multiple PutBlock requests).
+
+## Code Samples
+
+```javascript
+// TODO:
+```
+
+## More Code Samples
+
+- [File Storage Examples](https://github.com/azure/azure-storage-js/tree/master/file/samples)
+- [File Storage Examples - Test Cases](https://github.com/azure/azure-storage-js/tree/master/file/test/)
+
+## License
+
+This project is licensed under MIT.
+
+## Contributing
+
+This project welcomes contributions and suggestions. Most contributions require you to agree to a
+Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
+the rights to use your contribution. For details, visit
+
+When you submit a pull request, a CLA-bot will automatically determine whether you need to provide
+a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions
+provided by the bot. You will only need to do this once across all repos using our CLA.
+
+This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
+For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
+contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
diff --git a/file/gulpfile.js b/file/gulpfile.js
new file mode 100644
index 0000000..6f0f146
--- /dev/null
+++ b/file/gulpfile.js
@@ -0,0 +1,16 @@
+const gulp = require("gulp");
+const zip = require("gulp-zip");
+
+const version = require("./package.json").version;
+const zipFileName = `azurestoragejs.file-${version}.zip`;
+
+gulp.task("zip", () => {
+ return gulp
+ .src([
+ "browser/azure-storage.file.js",
+ "browser/azure-storage.file.min.js",
+ "browser/*.txt"
+ ])
+ .pipe(zip(zipFileName))
+ .pipe(gulp.dest("browser"));
+});
\ No newline at end of file
diff --git a/file/karma.conf.js b/file/karma.conf.js
new file mode 100644
index 0000000..ece2a53
--- /dev/null
+++ b/file/karma.conf.js
@@ -0,0 +1,82 @@
+module.exports = function(config) {
+ config.set({
+ // base path that will be used to resolve all patterns (eg. files, exclude)
+ basePath: "./",
+
+ // frameworks to use
+ // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
+ frameworks: ["mocha"],
+
+ plugins: [
+ "karma-mocha",
+ "karma-mocha-reporter",
+ "karma-chrome-launcher",
+ "karma-edge-launcher",
+ "karma-firefox-launcher",
+ "karma-ie-launcher",
+ "karma-env-preprocessor"
+ ],
+
+ // list of files / patterns to load in the browser
+ files: [
+ // polyfill service supporting IE11 missing features
+ "https://cdn.polyfill.io/v2/polyfill.min.js?features=Promise,String.prototype.startsWith,String.prototype.endsWith,String.prototype.repeat,String.prototype.includes",
+ "dist-test/index.browser.js"
+ ],
+
+ // list of files / patterns to exclude
+ exclude: [],
+
+ // preprocess matching files before serving them to the browser
+ // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
+ preprocessors: {
+ "**/*.js": ["env"]
+ },
+
+ // inject following environment values into browser testing with window.__env__
+ // environment values MUST be exported or set with same console running "karma start"
+ // https://www.npmjs.com/package/karma-env-preprocessor
+ envPreprocessor: ["ACCOUNT_NAME", "ACCOUNT_SAS"],
+
+ // test results reporter to use
+ // possible values: 'dots', 'progress'
+ // available reporters: https://npmjs.org/browse/keyword/karma-reporter
+ reporters: ["mocha"],
+
+ // web server port
+ port: 9876,
+
+ // enable / disable colors in the output (reporters and logs)
+ colors: true,
+
+ // level of logging
+ // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
+ logLevel: config.LOG_INFO,
+
+ // enable / disable watching file and executing tests whenever any file changes
+ autoWatch: false,
+
+ // start these browsers
+ // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
+ // 'Chrome', 'Firefox', 'Edge', 'IE'
+ browsers: ["Chrome"],
+
+ // Continuous Integration mode
+ // if true, Karma captures browsers, runs the tests and exits
+ singleRun: false,
+
+ // Concurrency level
+ // how many browser should be started simultaneous
+ concurrency: 1,
+
+ browserNoActivityTimeout: 600000,
+
+ client: {
+ mocha: {
+ // change Karma's debug.html to the mocha web reporter
+ reporter: "html",
+ timeout: "600000"
+ }
+ }
+ });
+};
diff --git a/file/lib/Aborter.ts b/file/lib/Aborter.ts
new file mode 100644
index 0000000..d6b1232
--- /dev/null
+++ b/file/lib/Aborter.ts
@@ -0,0 +1,290 @@
+import { AbortSignalLike, isNode } from "ms-rest-js";
+
+/**
+ * An aborter instance implements AbortSignal interface, can abort HTTP requests.
+ *
+ * - Call Aborter.none to create a new Aborter instance without timeout.
+ * - Call Aborter.timeout() to create a new Aborter instance with timeout.
+ *
+ * For an existing instance aborter:
+ * - Call aborter.withTimeout() to create and return a child Aborter instance with timeout.
+ * - Call aborter.withValue(key, value) to create and return a child Aborter instance with key/value pair.
+ * - Call aborter.abort() to abort current instance and all children instances.
+ * - Call aborter.getValue(key) to search and get value with corresponding key from current aborter to all parents.
+ *
+ * @example
+ * // Abort without timeout
+ * await blockBlobURL.upload(Aborter.none, buf, buf.length);
+ *
+ * @example
+ * // Abort container create in 1000ms
+ * await blockBlobURL.upload(Aborter.timeout(1000), buf, buf.length);
+ *
+ * @example
+ * // Share aborter cross multiple operations in 30s
+ * // Upload the same data to 2 different data centers at the same time, abort another when any of them is finished
+ * const aborter = Aborter.timeout(30 * 1000);
+ * blockBlobURL1.upload(aborter, buf, buf.length).then(aborter.abort);
+ * blockBlobURL2.upload(aborter, buf, buf.length).then(aborter.abort);
+ *
+ * @example
+ * // Cascaded aborting
+ * // All operations can't take more than 30 seconds
+ * const aborter = Aborter.timeout(30 * 1000);
+ *
+ * // Following 2 operations can't take more than 25 seconds
+ * await blockBlobURL.upload(aborter.withTimeout(25 * 1000), buf, buf.length);
+ * await blockBlobURL.upload(aborter.withTimeout(25 * 1000), buf, buf.length);
+ *
+ * @export
+ * @class Aborter
+ * @implements {AbortSignalLike}
+ */
+
+export class Aborter implements AbortSignalLike {
+ /**
+ * Status of whether aborted or not.
+ *
+ * @readonly
+ * @type {boolean}
+ * @memberof Aborter
+ */
+ public get aborted(): boolean {
+ return this._aborted;
+ }
+
+ /**
+ * Creates a new Aborter instance without timeout.
+ *
+ * @readonly
+ * @static
+ * @type {Aborter}
+ * @memberof Aborter
+ */
+ public static get none(): Aborter {
+ return new Aborter(undefined, 0);
+ }
+
+ /**
+ * Creates a new Aborter instance with timeout in million-seconds.
+ * Set parameter timeout to 0 will not create a timer.
+ *
+ * @static
+ * @param {number} {timeout} in million-seconds
+ * @returns {Aborter}
+ * @memberof Aborter
+ */
+ public static timeout(timeout: number): Aborter {
+ return new Aborter(undefined, timeout);
+ }
+
+ /**
+ * onabort event listener.
+ *
+ * @memberof Aborter
+ */
+ public onabort?: ((ev: Event) => any);
+
+ // tslint:disable-next-line:variable-name
+ private _aborted: boolean = false;
+ private timer?: any;
+ private readonly parent?: Aborter;
+ private readonly children: Aborter[] = []; // When child object calls dispose(), remove child from here
+ private readonly abortEventListeners: Array<
+ (this: AbortSignalLike, ev: any) => any
+ > = [];
+ // Pipeline proxies need to use "abortSignal as Aborter" in order to access non AbortSignalLike methods
+ // immutable primitive types
+ private readonly key?: string;
+ private readonly value?: string | number | boolean | null;
+ // private disposed: boolean = false;
+
+ /**
+ * Private constructor for internal usage, creates an instance of Aborter.
+ *
+ * @param {Aborter} [parent] Optional. Parent aborter.
+ * @param {number} [timeout=0] Optional. Timeout before abort in millisecond, 0 means no timeout.
+ * @param {string} [key] Optional. Immutable key in string.
+ * @param {(string | number | boolean | null)} [value] Optional. Immutable value.
+ * @memberof Aborter
+ */
+ private constructor(
+ parent?: Aborter,
+ timeout: number = 0,
+ key?: string,
+ value?: string | number | boolean | null
+ ) {
+ this.parent = parent;
+ this.key = key;
+ this.value = value;
+
+ if (timeout > 0) {
+ this.timer = setTimeout(() => {
+ this.abort.call(this);
+ }, timeout);
+
+ // When called, the active Timeout object will not require the Node.js event loop
+ // to remain active. If there is no other activity keeping the event loop running,
+ // the process may exit before the Timeout object's callback is invoked.
+ if (this.timer && isNode) {
+ this.timer!.unref();
+ }
+ }
+ }
+
+ /**
+ * Create and return a new Aborter instance, which will be appended as a child node of current Aborter.
+ * Current Aborter instance becomes father node of the new instance. When current or father Aborter node
+ * triggers timeout event, all children nodes abort event will be triggered too.
+ *
+ * When timeout parameter (in millisecond) is larger than 0, the abort event will be triggered when timeout.
+ * Otherwise, call abort() method to manually abort.
+ *
+ * @param {number} {timeout} Timeout in millisecond.
+ * @returns {Aborter} The new Aborter instance created.
+ * @memberof Aborter
+ */
+ public withTimeout(timeout: number): Aborter {
+ const childCancelContext = new Aborter(this, timeout);
+ this.children.push(childCancelContext);
+ return childCancelContext;
+ }
+
+ /**
+ * Create and return a new Aborter instance, which will be appended as a child node of current Aborter.
+ * Current Aborter instance becomes father node of the new instance. When current or father Aborter node
+ * triggers timeout event, all children nodes abort event will be triggered too.
+ *
+ * Immutable key value pair will be set into the new created Aborter instance.
+ * Call getValue() to find out latest value with corresponding key in the chain of
+ * [current node] -> [parent node] and [grand parent node]....
+ *
+ * @param {string} key
+ * @param {(string | number | boolean | null)} [value]
+ * @returns {Aborter}
+ * @memberof Aborter
+ */
+ public withValue(
+ key: string,
+ value?: string | number | boolean | null
+ ): Aborter {
+ const childCancelContext = new Aborter(this, 0, key, value);
+ this.children.push(childCancelContext);
+ return childCancelContext;
+ }
+
+ /**
+ * Find out latest value with corresponding key in the chain of
+ * [current node] -> [parent node] -> [grand parent node] -> ... -> [root node].
+ *
+ * If key is not found, undefined will be returned.
+ *
+ * @param {string} key
+ * @returns {(string | number | boolean | null | undefined)}
+ * @memberof Aborter
+ */
+ public getValue(key: string): string | number | boolean | null | undefined {
+ for (
+ let parent: Aborter | undefined = this;
+ parent;
+ parent = parent.parent
+ ) {
+ if (parent.key === key) {
+ return parent.value;
+ }
+ }
+ return undefined;
+ }
+
+ /**
+ * Trigger abort event immediately, the onabort and all abort event listeners will be triggered.
+ * Will try to trigger abort event for all children Aborter nodes.
+ *
+ * - If there is a timeout, the timer will be cancelled.
+ * - If aborted is true, nothing will happen.
+ *
+ * @returns
+ * @memberof Aborter
+ */
+ public abort() {
+ if (this.aborted) {
+ return;
+ }
+ this.cancelTimer();
+
+ if (this.onabort) {
+ this.onabort.call(this);
+ }
+
+ this.abortEventListeners.forEach(listener => {
+ listener.call(this);
+ });
+
+ this.children.forEach(child => child.cancelByParent());
+
+ this._aborted = true;
+ }
+
+ // public dispose() {
+ // if (this.disposed || this.aborted) {
+ // return;
+ // }
+
+ // this.cancelTimer();
+
+ // // (parent)A <- B <- C(child), if B disposes, when A abort, C will not abort
+ // if (this.parent) {
+ // const index = this.parent.children.indexOf(this);
+ // if (index > -1) {
+ // this.parent.children.splice(index, 1);
+ // }
+ // }
+
+ // this.disposed = true;
+ // }
+
+ /**
+ * Added new "abort" event listener, only support "abort" event.
+ *
+ * @param {"abort"} _type Only support "abort" event
+ * @param {(this: AbortSignalLike, ev: any) => any} listener
+ * @memberof Aborter
+ */
+ public addEventListener(
+ // tslint:disable-next-line:variable-name
+ _type: "abort",
+ listener: (this: AbortSignalLike, ev: any) => any
+ ): void {
+ this.abortEventListeners.push(listener);
+ }
+
+ /**
+ * Remove "abort" event listener, only support "abort" event.
+ *
+ * @param {"abort"} _type Only support "abort" event
+ * @param {(this: AbortSignalLike, ev: any) => any} listener
+ * @memberof Aborter
+ */
+ public removeEventListener(
+ // tslint:disable-next-line:variable-name
+ _type: "abort",
+ listener: (this: AbortSignalLike, ev: any) => any
+ ): void {
+ const index = this.abortEventListeners.indexOf(listener);
+ if (index > -1) {
+ this.abortEventListeners.splice(index, 1);
+ }
+ }
+
+ private cancelByParent() {
+ // if (!this.disposed) {
+ this.abort();
+ // }
+ }
+
+ private cancelTimer() {
+ if (this.timer) {
+ clearTimeout(this.timer);
+ }
+ }
+}
diff --git a/file/lib/AccountSASPermissions.ts b/file/lib/AccountSASPermissions.ts
new file mode 100644
index 0000000..8b8c18d
--- /dev/null
+++ b/file/lib/AccountSASPermissions.ts
@@ -0,0 +1,166 @@
+/**
+ * ONLY AVAILABLE IN NODE.JS RUNTIME.
+ *
+ * This is a helper class to construct a string representing the permissions granted by an AccountSAS. Setting a value
+ * to true means that any SAS which uses these permissions will grant permissions for that operation. Once all the
+ * values are set, this should be serialized with toString and set as the permissions field on an
+ * {@link AccountSASSignatureValues} object. It is possible to construct the permissions string without this class, but
+ * the order of the permissions is particular and this class guarantees correctness.
+ *
+ * @export
+ * @class AccountSASPermissions
+ */
+export class AccountSASPermissions {
+ /**
+ * Parse initializes the AccountSASPermissions fields from a string.
+ *
+ * @static
+ * @param {string} permissions
+ * @returns {AccountSASPermissions}
+ * @memberof AccountSASPermissions
+ */
+ public static parse(permissions: string): AccountSASPermissions {
+ const accountSASPermissions = new AccountSASPermissions();
+
+ for (const c of permissions) {
+ switch (c) {
+ case "r":
+ accountSASPermissions.read = true;
+ break;
+ case "w":
+ accountSASPermissions.write = true;
+ break;
+ case "d":
+ accountSASPermissions.delete = true;
+ break;
+ case "l":
+ accountSASPermissions.list = true;
+ break;
+ case "a":
+ accountSASPermissions.add = true;
+ break;
+ case "c":
+ accountSASPermissions.create = true;
+ break;
+ case "u":
+ accountSASPermissions.update = true;
+ break;
+ case "p":
+ accountSASPermissions.process = true;
+ break;
+ default:
+ throw new RangeError(`Invalid permission character: ${c}`);
+ }
+ }
+
+ return accountSASPermissions;
+ }
+
+ /**
+ * Permission to read resources and list queues and tables granted.
+ *
+ * @type {boolean}
+ * @memberof AccountSASPermissions
+ */
+ public read: boolean = false;
+
+ /**
+ * Permission to write resources granted.
+ *
+ * @type {boolean}
+ * @memberof AccountSASPermissions
+ */
+ public write: boolean = false;
+
+ /**
+ * Permission to create blobs and files granted.
+ *
+ * @type {boolean}
+ * @memberof AccountSASPermissions
+ */
+ public delete: boolean = false;
+
+ /**
+ * Permission to list blob containers, blobs, shares, directories, and files granted.
+ *
+ * @type {boolean}
+ * @memberof AccountSASPermissions
+ */
+ public list: boolean = false;
+
+ /**
+ * Permission to add messages, table entities, and append to blobs granted.
+ *
+ * @type {boolean}
+ * @memberof AccountSASPermissions
+ */
+ public add: boolean = false;
+
+ /**
+ * Permission to create blobs and files granted.
+ *
+ * @type {boolean}
+ * @memberof AccountSASPermissions
+ */
+ public create: boolean = false;
+
+ /**
+ * Permissions to update messages and table entities granted.
+ *
+ * @type {boolean}
+ * @memberof AccountSASPermissions
+ */
+ public update: boolean = false;
+
+ /**
+ * Permission to get and delete messages granted.
+ *
+ * @type {boolean}
+ * @memberof AccountSASPermissions
+ */
+ public process: boolean = false;
+
+ /**
+ * Produces the SAS permissions string for an Azure Storage account.
+ * Call this method to set AccountSASSignatureValues Permissions field.
+ *
+ * Using this method will guarantee the resource types are in
+ * an order accepted by the service.
+ *
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas
+ *
+ * @returns {string}
+ * @memberof AccountSASPermissions
+ */
+ public toString(): string {
+ // The order of the characters should be as specified here to ensure correctness:
+ // https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas
+ // Use a string array instead of string concatenating += operator for performance
+ const permissions: string[] = [];
+ if (this.read) {
+ permissions.push("r");
+ }
+ if (this.write) {
+ permissions.push("w");
+ }
+ if (this.delete) {
+ permissions.push("d");
+ }
+ if (this.list) {
+ permissions.push("l");
+ }
+ if (this.add) {
+ permissions.push("a");
+ }
+ if (this.create) {
+ permissions.push("c");
+ }
+ if (this.update) {
+ permissions.push("u");
+ }
+ if (this.process) {
+ permissions.push("p");
+ }
+ return permissions.join("");
+ }
+}
diff --git a/file/lib/AccountSASResourceTypes.ts b/file/lib/AccountSASResourceTypes.ts
new file mode 100644
index 0000000..55defd0
--- /dev/null
+++ b/file/lib/AccountSASResourceTypes.ts
@@ -0,0 +1,90 @@
+/**
+ * ONLY AVAILABLE IN NODE.JS RUNTIME.
+ *
+ * This is a helper class to construct a string representing the resources accessible by an AccountSAS. Setting a value
+ * to true means that any SAS which uses these permissions will grant access to that resource type. Once all the
+ * values are set, this should be serialized with toString and set as the resources field on an
+ * {@link AccountSASSignatureValues} object. It is possible to construct the resources string without this class, but
+ * the order of the resources is particular and this class guarantees correctness.
+ *
+ * @export
+ * @class AccountSASResourceTypes
+ */
+export class AccountSASResourceTypes {
+ /**
+ * Creates an {@link AccountSASResourceType} from the specified resource types string. This method will throw an
+ * Error if it encounters a character that does not correspond to a valid resource type.
+ *
+ * @static
+ * @param {string} resourceTypes
+ * @returns {AccountSASResourceTypes}
+ * @memberof AccountSASResourceTypes
+ */
+ public static parse(resourceTypes: string): AccountSASResourceTypes {
+ const accountSASResourceTypes = new AccountSASResourceTypes();
+
+ for (const c of resourceTypes) {
+ switch (c) {
+ case "s":
+ accountSASResourceTypes.service = true;
+ break;
+ case "c":
+ accountSASResourceTypes.container = true;
+ break;
+ case "o":
+ accountSASResourceTypes.object = true;
+ break;
+ default:
+ throw new RangeError(`Invalid resource type: ${c}`);
+ }
+ }
+
+ return accountSASResourceTypes;
+ }
+
+ /**
+ * Permission to access service level APIs granted.
+ *
+ * @type {boolean}
+ * @memberof AccountSASResourceTypes
+ */
+ public service: boolean = false;
+
+ /**
+ * Permission to access container level APIs (Blob Containers, Tables, Queues, File Shares) granted.
+ *
+ * @type {boolean}
+ * @memberof AccountSASResourceTypes
+ */
+ public container: boolean = false;
+
+ /**
+ * Permission to access object level APIs (Blobs, Table Entities, Queue Messages, Files) granted.
+ *
+ * @type {boolean}
+ * @memberof AccountSASResourceTypes
+ */
+ public object: boolean = false;
+
+ /**
+ * Converts the given resource types to a string.
+ *
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas
+ *
+ * @returns {string}
+ * @memberof AccountSASResourceTypes
+ */
+ public toString(): string {
+ const resourceTypes: string[] = [];
+ if (this.service) {
+ resourceTypes.push("s");
+ }
+ if (this.container) {
+ resourceTypes.push("c");
+ }
+ if (this.object) {
+ resourceTypes.push("o");
+ }
+ return resourceTypes.join("");
+ }
+}
diff --git a/file/lib/AccountSASServices.ts b/file/lib/AccountSASServices.ts
new file mode 100644
index 0000000..1dc9f5e
--- /dev/null
+++ b/file/lib/AccountSASServices.ts
@@ -0,0 +1,102 @@
+/**
+ * ONLY AVAILABLE IN NODE.JS RUNTIME.
+ *
+ * This is a helper class to construct a string representing the services accessible by an AccountSAS. Setting a value
+ * to true means that any SAS which uses these permissions will grant access to that service. Once all the
+ * values are set, this should be serialized with toString and set as the services field on an
+ * {@link AccountSASSignatureValues} object. It is possible to construct the services string without this class, but
+ * the order of the services is particular and this class guarantees correctness.
+ *
+ * @export
+ * @class AccountSASServices
+ */
+export class AccountSASServices {
+ /**
+ * Creates an {@link AccountSASServices} from the specified services string. This method will throw an
+ * Error if it encounters a character that does not correspond to a valid service.
+ *
+ * @static
+ * @param {string} services
+ * @returns {AccountSASServices}
+ * @memberof AccountSASServices
+ */
+ public static parse(services: string): AccountSASServices {
+ const accountSASServices = new AccountSASServices();
+
+ for (const c of services) {
+ switch (c) {
+ case "b":
+ accountSASServices.blob = true;
+ break;
+ case "f":
+ accountSASServices.file = true;
+ break;
+ case "q":
+ accountSASServices.queue = true;
+ break;
+ case "t":
+ accountSASServices.table = true;
+ break;
+ default:
+ throw new RangeError(`Invalid service character: ${c}`);
+ }
+ }
+
+ return accountSASServices;
+ }
+
+ /**
+ * Permission to access blob resources granted.
+ *
+ * @type {boolean}
+ * @memberof AccountSASServices
+ */
+ public blob: boolean = false;
+
+ /**
+ * Permission to access file resources granted.
+ *
+ * @type {boolean}
+ * @memberof AccountSASServices
+ */
+ public file: boolean = false;
+
+ /**
+ * Permission to access queue resources granted.
+ *
+ * @type {boolean}
+ * @memberof AccountSASServices
+ */
+ public queue: boolean = false;
+
+ /**
+ * Permission to access table resources granted.
+ *
+ * @type {boolean}
+ * @memberof AccountSASServices
+ */
+ public table: boolean = false;
+
+ /**
+ * Converts the given services to a string.
+ *
+ * @returns {string}
+ * @memberof AccountSASServices
+ */
+ public toString(): string {
+ const services: string[] = [];
+ if (this.blob) {
+ services.push("b");
+ }
+ if (this.table) {
+ services.push("t");
+ }
+ if (this.queue) {
+ services.push("q");
+ }
+ if (this.file) {
+ services.push("f");
+ }
+ return services.join("");
+ }
+}
diff --git a/file/lib/AppendBlobURL.ts b/file/lib/AppendBlobURL.ts
new file mode 100644
index 0000000..e3f1d4c
--- /dev/null
+++ b/file/lib/AppendBlobURL.ts
@@ -0,0 +1,179 @@
+import { HttpRequestBody, TransferProgressEvent } from "ms-rest-js";
+
+import * as Models from "../lib/generated/models";
+import { Aborter } from "./Aborter";
+import { BlobURL } from "./BlobURL";
+import { ContainerURL } from "./ContainerURL";
+import { AppendBlob } from "./generated/operations";
+import {
+ IAppendBlobAccessConditions,
+ IBlobAccessConditions,
+ IMetadata
+} from "./models";
+import { Pipeline } from "./Pipeline";
+import { URLConstants } from "./utils/constants";
+import { appendToURLPath, setURLParameter } from "./utils/utils.common";
+
+export interface IAppendBlobCreateOptions {
+ accessConditions?: IBlobAccessConditions;
+ blobHTTPHeaders?: Models.BlobHTTPHeaders;
+ metadata?: IMetadata;
+}
+
+export interface IAppendBlobAppendBlockOptions {
+ accessConditions?: IAppendBlobAccessConditions;
+ progress?: (progress: TransferProgressEvent) => void;
+ transactionalContentMD5?: Uint8Array;
+}
+
+/**
+ * AppendBlobURL defines a set of operations applicable to append blobs.
+ *
+ * @export
+ * @class AppendBlobURL
+ * @extends {StorageURL}
+ */
+export class AppendBlobURL extends BlobURL {
+ /**
+ * Creates a AppendBlobURL object from ContainerURL instance.
+ *
+ * @static
+ * @param {ContainerURL} containerURL
+ * @param {string} blobName
+ * @returns {AppendBlobURL}
+ * @memberof AppendBlobURL
+ */
+ public static fromContainerURL(
+ containerURL: ContainerURL,
+ blobName: string
+ ): AppendBlobURL {
+ return new AppendBlobURL(
+ appendToURLPath(containerURL.url, blobName),
+ containerURL.pipeline
+ );
+ }
+
+ /**
+ * Creates a AppendBlobURL object from BlobURL instance.
+ *
+ * @static
+ * @param {BlobURL} blobURL
+ * @returns {AppendBlobURL}
+ * @memberof AppendBlobURL
+ */
+ public static fromBlobURL(blobURL: BlobURL): AppendBlobURL {
+ return new AppendBlobURL(blobURL.url, blobURL.pipeline);
+ }
+
+ /**
+ * appendBlobsContext provided by protocol layer.
+ *
+ * @private
+ * @type {AppendBlobs}
+ * @memberof AppendBlobURL
+ */
+ private appendBlobContext: AppendBlob;
+
+ /**
+ * Creates an instance of AppendBlobURL.
+ * @param {string} url A URL string pointing to Azure Storage append blob, such as
+ * "https://myaccount.blob.core.windows.net/mycontainer/appendblob". You can
+ * append a SAS if using AnonymousCredential, such as
+ * "https://myaccount.blob.core.windows.net/mycontainer/appendblob?sasString".
+ * @param {Pipeline} pipeline Call StorageURL.newPipeline() to create a default
+ * pipeline, or provide a customized pipeline.
+ * @memberof AppendBlobURL
+ */
+ constructor(url: string, pipeline: Pipeline) {
+ super(url, pipeline);
+ this.appendBlobContext = new AppendBlob(this.storageClientContext);
+ }
+
+ /**
+ * Creates a new AppendBlobURL object identical to the source but with the
+ * specified request policy pipeline.
+ *
+ * @param {Pipeline} pipeline
+ * @returns {AppendBlobURL}
+ * @memberof AppendBlobURL
+ */
+ public withPipeline(pipeline: Pipeline): AppendBlobURL {
+ return new AppendBlobURL(this.url, pipeline);
+ }
+
+ /**
+ * Creates a new AppendBlobURL object identical to the source but with the
+ * specified snapshot timestamp.
+ * Provide "" will remove the snapshot and return a URL to the base blob.
+ *
+ * @param {string} snapshot
+ * @returns {AppendBlobURL}
+ * @memberof AppendBlobURL
+ */
+ public withSnapshot(snapshot: string): AppendBlobURL {
+ return new AppendBlobURL(
+ setURLParameter(
+ this.url,
+ URLConstants.Parameters.SNAPSHOT,
+ snapshot.length === 0 ? undefined : snapshot
+ ),
+ this.pipeline
+ );
+ }
+
+ /**
+ * Creates a 0-length append blob. Call AppendBlock to append data to an append blob.
+ * @see https://docs.microsoft.com/rest/api/storageservices/put-blob
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {IAppendBlobCreateOptions} [options]
+ * @returns {Promise}
+ * @memberof AppendBlobURL
+ */
+ public async create(
+ aborter: Aborter,
+ options: IAppendBlobCreateOptions = {}
+ ): Promise {
+ options.accessConditions = options.accessConditions || {};
+ return this.appendBlobContext.create(0, {
+ abortSignal: aborter,
+ blobHTTPHeaders: options.blobHTTPHeaders,
+ leaseAccessConditions: options.accessConditions.leaseAccessConditions,
+ metadata: options.metadata,
+ modifiedAccessConditions:
+ options.accessConditions.modifiedAccessConditions
+ });
+ }
+
+ /**
+ * Commits a new block of data to the end of the existing append blob.
+ * @see https://docs.microsoft.com/rest/api/storageservices/append-block
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {HttpRequestBody} body
+ * @param {number} contentLength
+ * @param {IAppendBlobAppendBlockOptions} [options]
+ * @returns {Promise}
+ * @memberof AppendBlobURL
+ */
+ public async appendBlock(
+ aborter: Aborter,
+ body: HttpRequestBody,
+ contentLength: number,
+ options: IAppendBlobAppendBlockOptions = {}
+ ): Promise {
+ options.accessConditions = options.accessConditions || {};
+ return this.appendBlobContext.appendBlock(body, contentLength, {
+ abortSignal: aborter,
+ appendPositionAccessConditions:
+ options.accessConditions.appendPositionAccessConditions,
+ leaseAccessConditions: options.accessConditions.leaseAccessConditions,
+ modifiedAccessConditions:
+ options.accessConditions.modifiedAccessConditions,
+ onUploadProgress: options.progress,
+ transactionalContentMD5: options.transactionalContentMD5
+ });
+ }
+}
diff --git a/file/lib/BlobSASPermissions.ts b/file/lib/BlobSASPermissions.ts
new file mode 100644
index 0000000..a7d8d15
--- /dev/null
+++ b/file/lib/BlobSASPermissions.ts
@@ -0,0 +1,117 @@
+/**
+ * ONLY AVAILABLE IN NODE.JS RUNTIME.
+ *
+ * This is a helper class to construct a string representing the permissions granted by a ServiceSAS to a blob. Setting
+ * a value to true means that any SAS which uses these permissions will grant permissions for that operation. Once all
+ * the values are set, this should be serialized with toString and set as the permissions field on a
+ * {@link ServiceSASSignatureValues} object. It is possible to construct the permissions string without this class, but
+ * the order of the permissions is particular and this class guarantees correctness.
+ *
+ * @export
+ * @class BlobSASPermissions
+ */
+export class BlobSASPermissions {
+ /**
+ * Creates a {@link BlobSASPermission} from the specified permissions string. This method will throw an
+ * Error if it encounters a character that does not correspond to a valid permission.
+ *
+ * @static
+ * @param {string} permissions
+ * @returns {BlobSASPermissions}
+ * @memberof BlobSASPermissions
+ */
+ public static parse(permissions: string): BlobSASPermissions {
+ const blobSASPermissions = new BlobSASPermissions();
+
+ for (const char of permissions) {
+ switch (char) {
+ case "r":
+ blobSASPermissions.read = true;
+ break;
+ case "a":
+ blobSASPermissions.add = true;
+ break;
+ case "c":
+ blobSASPermissions.create = true;
+ break;
+ case "w":
+ blobSASPermissions.write = true;
+ break;
+ case "d":
+ blobSASPermissions.delete = true;
+ break;
+ default:
+ throw new RangeError(`Invalid permission: ${char}`);
+ }
+ }
+
+ return blobSASPermissions;
+ }
+
+ /**
+ * Specifies Read access granted.
+ *
+ * @type {boolean}
+ * @memberof BlobSASPermissions
+ */
+ public read: boolean = false;
+
+ /**
+ * Specifies Add access granted.
+ *
+ * @type {boolean}
+ * @memberof BlobSASPermissions
+ */
+ public add: boolean = false;
+
+ /**
+ * Specifies Create access granted.
+ *
+ * @type {boolean}
+ * @memberof BlobSASPermissions
+ */
+ public create: boolean = false;
+
+ /**
+ * Specifies Write access granted.
+ *
+ * @type {boolean}
+ * @memberof BlobSASPermissions
+ */
+ public write: boolean = false;
+
+ /**
+ * Specifies Delete access granted.
+ *
+ * @type {boolean}
+ * @memberof BlobSASPermissions
+ */
+ public delete: boolean = false;
+
+ /**
+ * Converts the given permissions to a string. Using this method will guarantee the permissions are in an
+ * order accepted by the service.
+ *
+ * @returns {string} A string which represents the BlobSASPermissions
+ * @memberof BlobSASPermissions
+ */
+ public toString(): string {
+ const permissions: string[] = [];
+ if (this.read) {
+ permissions.push("r");
+ }
+ if (this.add) {
+ permissions.push("a");
+ }
+ if (this.create) {
+ permissions.push("c");
+ }
+ if (this.write) {
+ permissions.push("w");
+ }
+ if (this.delete) {
+ permissions.push("d");
+ }
+ return permissions.join("");
+ }
+}
diff --git a/file/lib/BlobURL.ts b/file/lib/BlobURL.ts
new file mode 100644
index 0000000..a4a1f7f
--- /dev/null
+++ b/file/lib/BlobURL.ts
@@ -0,0 +1,574 @@
+import { TransferProgressEvent } from "ms-rest-js";
+
+import * as Models from "../lib/generated/models";
+import { Aborter } from "./Aborter";
+import { ContainerURL } from "./ContainerURL";
+import { Blob } from "./generated/operations";
+import { rangeToString } from "./IRange";
+import { IBlobAccessConditions, IMetadata } from "./models";
+import { Pipeline } from "./Pipeline";
+import { StorageURL } from "./StorageURL";
+import { URLConstants } from "./utils/constants";
+import { appendToURLPath, setURLParameter } from "./utils/utils.common";
+
+export interface IBlobDownloadOptions {
+ snapshot?: string;
+ rangeGetContentMD5?: boolean;
+ blobAccessConditions?: IBlobAccessConditions;
+ progress?: (progress: TransferProgressEvent) => void;
+}
+
+export interface IBlobGetPropertiesOptions {
+ blobAccessConditions?: IBlobAccessConditions;
+}
+
+export interface IBlobDeleteOptions {
+ blobAccessConditions?: IBlobAccessConditions;
+ deleteSnapshots?: Models.DeleteSnapshotsOptionType;
+}
+
+export interface IBlobSetHTTPHeadersOptions {
+ blobAccessConditions?: IBlobAccessConditions;
+ blobHTTPHeaders?: Models.BlobHTTPHeaders;
+}
+
+export interface IBlobSetMetadataOptions {
+ metadata?: IMetadata;
+ blobAccessConditions?: IBlobAccessConditions;
+}
+
+export interface IBlobAcquireLeaseOptions {
+ modifiedAccessConditions?: Models.ModifiedAccessConditions;
+}
+
+export interface IBlobReleaseLeaseOptions {
+ modifiedAccessConditions?: Models.ModifiedAccessConditions;
+}
+
+export interface IBlobRenewLeaseOptions {
+ modifiedAccessConditions?: Models.ModifiedAccessConditions;
+}
+
+export interface IBlobChangeLeaseOptions {
+ modifiedAccessConditions?: Models.ModifiedAccessConditions;
+}
+
+export interface IBlobBreakLeaseOptions {
+ modifiedAccessConditions?: Models.ModifiedAccessConditions;
+}
+
+export interface IBlobCreateSnapshotOptions {
+ metadata?: IMetadata;
+ blobAccessConditions?: IBlobAccessConditions;
+}
+
+export interface IBlobStartCopyFromURLOptions {
+ metadata?: IMetadata;
+ blobAccessConditions?: IBlobAccessConditions;
+ sourceModifiedAccessConditions?: Models.ModifiedAccessConditions;
+}
+
+export interface IBlobAbortCopyFromURLOptions {
+ leaseAccessConditions?: Models.LeaseAccessConditions;
+}
+
+export interface IBlobSetTierOptions {
+ leaseAccessConditions?: Models.LeaseAccessConditions;
+}
+
+/**
+ * A BlobURL represents a URL to an Azure Storage blob; the blob may be a block blob,
+ * append blob, or page blob.
+ *
+ * @export
+ * @class BlobURL
+ * @extends {StorageURL}
+ */
+export class BlobURL extends StorageURL {
+ /**
+ * Creates a BlobURL object from an ContainerURL object.
+ *
+ * @static
+ * @param {ContainerURL} containerURL
+ * @param {string} blobName
+ * @returns
+ * @memberof BlobURL
+ */
+ public static fromContainerURL(containerURL: ContainerURL, blobName: string) {
+ return new BlobURL(
+ appendToURLPath(containerURL.url, blobName),
+ containerURL.pipeline
+ );
+ }
+
+ /**
+ * blobContext provided by protocol layer.
+ *
+ * @private
+ * @type {Blobs}
+ * @memberof BlobURL
+ */
+ private blobContext: Blob;
+
+ /**
+ * Creates an instance of BlobURL.
+ * @param {string} url A URL string pointing to Azure Storage blob, such as
+ * "https://myaccount.blob.core.windows.net/mycontainer/blob". You can
+ * append a SAS if using AnonymousCredential, such as
+ * "https://myaccount.blob.core.windows.net/mycontainer/blob?sasString".
+ * @param {Pipeline} pipeline Call StorageURL.newPipeline() to create a default
+ * pipeline, or provide a customized pipeline.
+ * @memberof BlobURL
+ */
+ constructor(url: string, pipeline: Pipeline) {
+ super(url, pipeline);
+ this.blobContext = new Blob(this.storageClientContext);
+ }
+
+ /**
+ * Creates a new BlobURL object identical to the source but with the
+ * specified request policy pipeline.
+ *
+ * @param {Pipeline} pipeline
+ * @returns {BlobURL}
+ * @memberof BlobURL
+ */
+ public withPipeline(pipeline: Pipeline): BlobURL {
+ return new BlobURL(this.url, pipeline);
+ }
+
+ /**
+ * Creates a new BlobURL object identical to the source but with the specified snapshot timestamp.
+ * Provide "" will remove the snapshot and return a URL to the base blob.
+ *
+ * @param {string} snapshot
+ * @returns {BlobURL} A new BlobURL object identical to the source but with the specified snapshot timestamp
+ * @memberof BlobURL
+ */
+ public withSnapshot(snapshot: string): BlobURL {
+ return new BlobURL(
+ setURLParameter(
+ this.url,
+ URLConstants.Parameters.SNAPSHOT,
+ snapshot.length === 0 ? undefined : snapshot
+ ),
+ this.pipeline
+ );
+ }
+
+ /**
+ * Reads or downloads a blob from the system, including its metadata and properties.
+ * You can also call Get Blob to read a snapshot.
+ *
+ * * In Node.js, data returns in a Readable stream readableStreamBody
+ * * In browsers, data returns in a promise blobBody
+ *
+ * WARNING: In Node.js, abort or network error during reading from response stream will NOT
+ * trigger any error, readable stream will end immediately. You need to check downloaded data
+ * length when stream ends.
+ *
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {number} offset From which position of the blob to download, >= 0
+ * @param {number} [count] How much data to be downloaded, > 0. Will download to the end when undefined
+ * @param {IBlobDownloadOptions} [options]
+ * @returns {Promise}
+ * @memberof BlobURL
+ */
+ public async download(
+ aborter: Aborter,
+ offset: number,
+ count?: number,
+ options: IBlobDownloadOptions = {}
+ ): Promise {
+ options.blobAccessConditions = options.blobAccessConditions || {};
+
+ const res = await this.blobContext.download({
+ abortSignal: aborter,
+ leaseAccessConditions: options.blobAccessConditions.leaseAccessConditions,
+ modifiedAccessConditions:
+ options.blobAccessConditions.modifiedAccessConditions,
+ onDownloadProgress: options.progress,
+ range:
+ offset === 0 && !count ? undefined : rangeToString({ offset, count }),
+ rangeGetContentMD5: options.rangeGetContentMD5,
+ snapshot: options.snapshot
+ });
+
+ // Default axios based HTTP client cannot abort download stream, manually pause/abort it
+ // Currently, no error will be triggered when network error or abort during reading from response stream
+ // TODO: Now need to manually validate the date length when stream ends, add download retry in the future
+ if (res.readableStreamBody) {
+ aborter.addEventListener("abort", () => {
+ if (res.readableStreamBody) {
+ res.readableStreamBody.pause();
+ }
+ });
+ }
+
+ return res;
+ }
+
+ /**
+ * Returns all user-defined metadata, standard HTTP properties, and system properties
+ * for the blob. It does not return the content of the blob.
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-properties
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {IBlobGetPropertiesOptions} [options]
+ * @returns {Promise}
+ * @memberof BlobURL
+ */
+ public async getProperties(
+ aborter: Aborter,
+ options: IBlobGetPropertiesOptions = {}
+ ): Promise {
+ options.blobAccessConditions = options.blobAccessConditions || {};
+ return this.blobContext.getProperties({
+ abortSignal: aborter,
+ leaseAccessConditions: options.blobAccessConditions.leaseAccessConditions,
+ modifiedAccessConditions:
+ options.blobAccessConditions.modifiedAccessConditions
+ });
+ }
+
+ /**
+ * Marks the specified blob or snapshot for deletion. The blob is later deleted
+ * during garbage collection. Note that in order to delete a blob, you must delete
+ * all of its snapshots. You can delete both at the same time with the Delete
+ * Blob operation.
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {IBlobDeleteOptions} [options]
+ * @returns {Promise}
+ * @memberof BlobURL
+ */
+ public async delete(
+ aborter: Aborter,
+ options: IBlobDeleteOptions = {}
+ ): Promise {
+ options.blobAccessConditions = options.blobAccessConditions || {};
+ return this.blobContext.deleteMethod({
+ abortSignal: aborter,
+ deleteSnapshots: options.deleteSnapshots,
+ leaseAccessConditions: options.blobAccessConditions.leaseAccessConditions,
+ modifiedAccessConditions:
+ options.blobAccessConditions.modifiedAccessConditions
+ });
+ }
+
+ /**
+ * Restores the contents and metadata of soft deleted blob and any associated
+ * soft deleted snapshots. Undelete Blob is supported only on version 2017-07-29
+ * or later.
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/undelete-blob
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @returns {Promise}
+ * @memberof BlobURL
+ */
+ public async undelete(
+ aborter: Aborter
+ ): Promise {
+ return this.blobContext.undelete({
+ abortSignal: aborter
+ });
+ }
+
+ /**
+ * Sets system properties on the blob.
+ *
+ * If no option provided, or no value provided for the blob HTTP headers in the options,
+ * these blob HTTP headers without a value will be cleared.
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {IBlobSetHTTPHeadersOptions} [options]
+ * @returns {Promise}
+ * @memberof BlobURL
+ */
+ public async setHTTPHeaders(
+ aborter: Aborter,
+ options: IBlobSetHTTPHeadersOptions = {}
+ ): Promise {
+ options.blobAccessConditions = options.blobAccessConditions || {};
+ return this.blobContext.setHTTPHeaders({
+ abortSignal: aborter,
+ blobHTTPHeaders: options.blobHTTPHeaders,
+ leaseAccessConditions: options.blobAccessConditions.leaseAccessConditions,
+ modifiedAccessConditions:
+ options.blobAccessConditions.modifiedAccessConditions
+ });
+ }
+
+ /**
+ * Sets user-defined metadata for the specified blob as one or more name-value pairs.
+ *
+ * If no option provided, or no metadata defined in the option parameter, the blob
+ * metadata will be removed.
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-metadata
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {IBlobSetMetadataOptions} [options]
+ * @returns {Promise}
+ * @memberof BlobURL
+ */
+ public async setMetadata(
+ aborter: Aborter,
+ options: IBlobSetMetadataOptions = {}
+ ): Promise {
+ options.blobAccessConditions = options.blobAccessConditions || {};
+ return this.blobContext.setMetadata({
+ abortSignal: aborter,
+ leaseAccessConditions: options.blobAccessConditions.leaseAccessConditions,
+ metadata: options.metadata,
+ modifiedAccessConditions:
+ options.blobAccessConditions.modifiedAccessConditions
+ });
+ }
+
+ /**
+ * Establishes and manages a lock on a blob for write and delete operations.
+ * The lock duration can be 15 to 60 seconds, or can be infinite.
+ * In versions prior to 2012-02-12, the lock duration is 60 seconds.
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {string} proposedLeaseId Can be specified in any valid GUID string format
+ * @param {number} duration The lock duration can be 15 to 60 seconds, or can be infinite
+ * @param {IBlobAcquireLeaseOptions} [options]
+ * @returns {Promise}
+ * @memberof BlobURL
+ */
+ public async acquireLease(
+ aborter: Aborter,
+ proposedLeaseId: string,
+ duration: number,
+ options: IBlobAcquireLeaseOptions = {}
+ ): Promise {
+ return this.blobContext.acquireLease({
+ abortSignal: aborter,
+ duration,
+ modifiedAccessConditions: options.modifiedAccessConditions,
+ proposedLeaseId
+ });
+ }
+
+ /**
+ * To free the lease if it is no longer needed so that another client may immediately
+ * acquire a lease against the blob.
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {string} leaseId
+ * @param {IBlobReleaseLeaseOptions} [options]
+ * @returns {Promise}
+ * @memberof BlobURL
+ */
+ public async releaseLease(
+ aborter: Aborter,
+ leaseId: string,
+ options: IBlobReleaseLeaseOptions = {}
+ ): Promise {
+ return this.blobContext.releaseLease(leaseId, {
+ abortSignal: aborter,
+ modifiedAccessConditions: options.modifiedAccessConditions
+ });
+ }
+
+ /**
+ * To renew an existing lease.
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {string} leaseId
+ * @param {IBlobRenewLeaseOptions} [options]
+ * @returns {Promise}
+ * @memberof BlobURL
+ */
+ public async renewLease(
+ aborter: Aborter,
+ leaseId: string,
+ options: IBlobRenewLeaseOptions = {}
+ ): Promise {
+ return this.blobContext.renewLease(leaseId, {
+ abortSignal: aborter,
+ modifiedAccessConditions: options.modifiedAccessConditions
+ });
+ }
+
+ /**
+ * To change the ID of an existing lease.
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {string} leaseId
+ * @param {string} proposedLeaseId
+ * @param {IBlobChangeLeaseOptions} [options]
+ * @returns {Promise}
+ * @memberof BlobURL
+ */
+ public async changeLease(
+ aborter: Aborter,
+ leaseId: string,
+ proposedLeaseId: string,
+ options: IBlobChangeLeaseOptions = {}
+ ): Promise {
+ return this.blobContext.changeLease(leaseId, proposedLeaseId, {
+ abortSignal: aborter,
+ modifiedAccessConditions: options.modifiedAccessConditions
+ });
+ }
+
+ /**
+ * To end the lease but ensure that another client cannot acquire a new lease
+ * until the current lease period has expired.
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {number} [breakPeriod]
+ * @param {IBlobBreakLeaseOptions} [options]
+ * @returns {Promise}
+ * @memberof BlobURL
+ */
+ public async breakLease(
+ aborter: Aborter,
+ breakPeriod?: number,
+ options: IBlobBreakLeaseOptions = {}
+ ): Promise {
+ return this.blobContext.breakLease({
+ abortSignal: aborter,
+ breakPeriod,
+ modifiedAccessConditions: options.modifiedAccessConditions
+ });
+ }
+
+ /**
+ * Creates a read-only snapshot of a blob.
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/snapshot-blob
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {IBlobCreateSnapshotOptions} [options]
+ * @returns {Promise}
+ * @memberof BlobURL
+ */
+ public async createSnapshot(
+ aborter: Aborter,
+ options: IBlobCreateSnapshotOptions = {}
+ ): Promise {
+ options.blobAccessConditions = options.blobAccessConditions || {};
+ return this.blobContext.createSnapshot({
+ abortSignal: aborter,
+ leaseAccessConditions: options.blobAccessConditions.leaseAccessConditions,
+ metadata: options.metadata,
+ modifiedAccessConditions:
+ options.blobAccessConditions.modifiedAccessConditions
+ });
+ }
+
+ /**
+ * Copies a blob to a destination within the storage account.
+ * In version 2012-02-12 and later, the source for a Copy Blob operation can be
+ * a committed blob in any Azure storage account.
+ * Beginning with version 2015-02-21, the source for a Copy Blob operation can be
+ * an Azure file in any Azure storage account.
+ * Only storage accounts created on or after June 7th, 2012 allow the Copy Blob
+ * operation to copy from another storage account.
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {string} copySource
+ * @param {IBlobStartCopyFromURLOptions} [options]
+ * @returns {Promise}
+ * @memberof BlobURL
+ */
+ public async startCopyFromURL(
+ aborter: Aborter,
+ copySource: string,
+ options: IBlobStartCopyFromURLOptions = {}
+ ): Promise {
+ options.blobAccessConditions = options.blobAccessConditions || {};
+ options.sourceModifiedAccessConditions =
+ options.sourceModifiedAccessConditions || {};
+
+ return this.blobContext.startCopyFromURL(copySource, {
+ abortSignal: aborter,
+ leaseAccessConditions: options.blobAccessConditions.leaseAccessConditions,
+ metadata: options.metadata,
+ modifiedAccessConditions:
+ options.blobAccessConditions.modifiedAccessConditions,
+ sourceModifiedAccessConditions: {
+ sourceIfMatch: options.sourceModifiedAccessConditions.ifMatch,
+ sourceIfModifiedSince:
+ options.sourceModifiedAccessConditions.ifModifiedSince,
+ sourceIfNoneMatch: options.sourceModifiedAccessConditions.ifNoneMatch,
+ sourceIfUnmodifiedSince:
+ options.sourceModifiedAccessConditions.ifUnmodifiedSince
+ }
+ });
+ }
+
+ /**
+ * Aborts a pending Copy Blob operation, and leaves a destination blob with zero
+ * length and full metadata. Version 2012-02-12 and newer.
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/abort-copy-blob
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {string} copyId
+ * @param {IBlobAbortCopyFromURLOptions} [options]
+ * @returns {Promise}
+ * @memberof BlobURL
+ */
+ public async abortCopyFromURL(
+ aborter: Aborter,
+ copyId: string,
+ options: IBlobAbortCopyFromURLOptions = {}
+ ): Promise {
+ return this.blobContext.abortCopyFromURL(copyId, {
+ abortSignal: aborter,
+ leaseAccessConditions: options.leaseAccessConditions
+ });
+ }
+
+ /**
+ * Sets the tier on a blob. The operation is allowed on a page blob in a premium
+ * storage account and on a block blob in a blob storage account (locally redundant
+ * storage only). A premium page blob's tier determines the allowed size, IOPS,
+ * and bandwidth of the blob. A block blob's tier determines Hot/Cool/Archive
+ * storage type. This operation does not update the blob's ETag.
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-tier
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {Models.AccessTier} tier
+ * @param {IBlobSetTierOptions} [options]
+ * @returns {Promise}
+ * @memberof BlobURL
+ */
+ public async setTier(
+ aborter: Aborter,
+ tier: Models.AccessTier,
+ options: IBlobSetTierOptions = {}
+ ): Promise {
+ return await this.blobContext.setTier(tier, {
+ abortSignal: aborter,
+ leaseAccessConditions: options.leaseAccessConditions
+ });
+ }
+}
diff --git a/file/lib/BlockBlobURL.ts b/file/lib/BlockBlobURL.ts
new file mode 100644
index 0000000..75921aa
--- /dev/null
+++ b/file/lib/BlockBlobURL.ts
@@ -0,0 +1,313 @@
+import { HttpRequestBody, TransferProgressEvent } from "ms-rest-js";
+
+import * as Models from "../lib/generated/models";
+import { Aborter } from "./Aborter";
+import { BlobURL } from "./BlobURL";
+import { ContainerURL } from "./ContainerURL";
+import { BlockBlob } from "./generated/operations";
+import { IRange, rangeToString } from "./IRange";
+import { IBlobAccessConditions, IMetadata } from "./models";
+import { Pipeline } from "./Pipeline";
+import { URLConstants } from "./utils/constants";
+import { appendToURLPath, setURLParameter } from "./utils/utils.common";
+
+export interface IBlockBlobUploadOptions {
+ accessConditions?: IBlobAccessConditions;
+ blobHTTPHeaders?: Models.BlobHTTPHeaders;
+ metadata?: IMetadata;
+ progress?: (progress: TransferProgressEvent) => void;
+}
+
+export interface IBlockBlobStageBlockOptions {
+ leaseAccessConditions?: Models.LeaseAccessConditions;
+ progress?: (progress: TransferProgressEvent) => void;
+ transactionalContentMD5?: Uint8Array;
+}
+
+export interface IBlockBlobStageBlockFromURLOptions {
+ range?: IRange;
+ leaseAccessConditions?: Models.LeaseAccessConditions;
+ sourceContentMD5?: Uint8Array;
+}
+
+export interface IBlockBlobCommitBlockListOptions {
+ accessConditions?: IBlobAccessConditions;
+ blobHTTPHeaders?: Models.BlobHTTPHeaders;
+ metadata?: IMetadata;
+}
+
+export interface IBlockBlobGetBlockListOptions {
+ leaseAccessConditions?: Models.LeaseAccessConditions;
+}
+
+/**
+ * BlockBlobURL defines a set of operations applicable to block blobs.
+ *
+ * @export
+ * @class BlockBlobURL
+ * @extends {StorageURL}
+ */
+export class BlockBlobURL extends BlobURL {
+ /**
+ * Creates a BlockBlobURL object from ContainerURL instance.
+ *
+ * @static
+ * @param {ContainerURL} containerURL
+ * @param {string} blobName
+ * @returns {BlockBlobURL}
+ * @memberof BlockBlobURL
+ */
+ public static fromContainerURL(
+ containerURL: ContainerURL,
+ blobName: string
+ ): BlockBlobURL {
+ return new BlockBlobURL(
+ appendToURLPath(containerURL.url, blobName),
+ containerURL.pipeline
+ );
+ }
+
+ /**
+ * Creates a BlockBlobURL object from BlobURL instance.
+ *
+ * @static
+ * @param {BlobURL} blobURL
+ * @returns {BlockBlobURL}
+ * @memberof BlockBlobURL
+ */
+ public static fromBlobURL(blobURL: BlobURL): BlockBlobURL {
+ return new BlockBlobURL(blobURL.url, blobURL.pipeline);
+ }
+
+ /**
+ * blockBlobContext provided by protocol layer.
+ *
+ * @private
+ * @type {BlockBlobs}
+ * @memberof BlockBlobURL
+ */
+ private blockBlobContext: BlockBlob;
+
+ /**
+ * Creates an instance of BlockBlobURL.
+ * @param {string} url A URL string pointing to Azure Storage block blob, such as
+ * "https://myaccount.blob.core.windows.net/mycontainer/blockblob". You can
+ * append a SAS if using AnonymousCredential, such as
+ * "https://myaccount.blob.core.windows.net/mycontainer/blockblob?sasString".
+ * @param {Pipeline} pipeline Call StorageURL.newPipeline() to create a default
+ * pipeline, or provide a customized pipeline.
+ * @memberof BlockBlobURL
+ */
+ constructor(url: string, pipeline: Pipeline) {
+ super(url, pipeline);
+ this.blockBlobContext = new BlockBlob(this.storageClientContext);
+ }
+
+ /**
+ * Creates a new BlockBlobURL object identical to the source but with the
+ * specified request policy pipeline.
+ *
+ * @param {Pipeline} pipeline
+ * @returns {BlockBlobURL}
+ * @memberof BlockBlobURL
+ */
+ public withPipeline(pipeline: Pipeline): BlockBlobURL {
+ return new BlockBlobURL(this.url, pipeline);
+ }
+
+ /**
+ * Creates a new BlockBlobURL object identical to the source but with the
+ * specified snapshot timestamp.
+ * Provide "" will remove the snapshot and return a URL to the base blob.
+ *
+ * @param {string} snapshot
+ * @returns {BlockBlobURL}
+ * @memberof BlockBlobURL
+ */
+ public withSnapshot(snapshot: string): BlockBlobURL {
+ return new BlockBlobURL(
+ setURLParameter(
+ this.url,
+ URLConstants.Parameters.SNAPSHOT,
+ snapshot.length === 0 ? undefined : snapshot
+ ),
+ this.pipeline
+ );
+ }
+
+ /**
+ * Creates a new block blob, or updates the content of an existing block blob.
+ * Updating an existing block blob overwrites any existing metadata on the blob.
+ * Partial updates are not supported; the content of the existing blob is
+ * overwritten with the new content. To perform a partial update of a block blob's,
+ * use stageBlock and commitBlockList.
+ *
+ * This is a non-parallel uploading method, please use uploadFileToBlockBlob(),
+ * uploadStreamToBlockBlob() or uploadBrowserDataToBlockBlob() for better performance
+ * with concurrency uploading.
+ *
+ * @see https://docs.microsoft.com/rest/api/storageservices/put-blob
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {HttpRequestBody} body
+ * @param {number} contentLength
+ * @param {IBlockBlobUploadOptions} [options]
+ * @returns {Promise}
+ * @memberof BlockBlobURL
+ */
+ public async upload(
+ aborter: Aborter,
+ body: HttpRequestBody,
+ contentLength: number,
+ options: IBlockBlobUploadOptions = {}
+ ): Promise {
+ options.accessConditions = options.accessConditions || {};
+ return this.blockBlobContext.upload(body, contentLength, {
+ abortSignal: aborter,
+ blobHTTPHeaders: options.blobHTTPHeaders,
+ leaseAccessConditions: options.accessConditions.leaseAccessConditions,
+ metadata: options.metadata,
+ modifiedAccessConditions:
+ options.accessConditions.modifiedAccessConditions,
+ onUploadProgress: options.progress
+ });
+ }
+
+ /**
+ * Uploads the specified block to the block blob's "staging area" to be later
+ * committed by a call to commitBlockList.
+ * @see https://docs.microsoft.com/rest/api/storageservices/put-block
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {string} blockId A 64-byte value that is base64-encoded
+ * @param {HttpRequestBody} body
+ * @param {number} contentLength
+ * @param {IBlockBlobStageBlockOptions} [options]
+ * @returns {Promise}
+ * @memberof BlockBlobURL
+ */
+ public async stageBlock(
+ aborter: Aborter,
+ blockId: string,
+ body: HttpRequestBody,
+ contentLength: number,
+ options: IBlockBlobStageBlockOptions = {}
+ ): Promise {
+ return this.blockBlobContext.stageBlock(blockId, contentLength, body, {
+ abortSignal: aborter,
+ leaseAccessConditions: options.leaseAccessConditions,
+ onUploadProgress: options.progress,
+ transactionalContentMD5: options.transactionalContentMD5
+ });
+ }
+
+ /**
+ * The Stage Block From URL operation creates a new block to be committed as part
+ * of a blob where the contents are read from a URL.
+ * This API is available starting in version 2018-03-28.
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/put-block-from-url
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {string} blockId A 64-byte value that is base64-encoded
+ * @param {string} sourceURL Specifies the URL of the blob. The value
+ * may be a URL of up to 2 KB in length that specifies a blob.
+ * The value should be URL-encoded as it would appear
+ * in a request URI. The source blob must either be public
+ * or must be authenticated via a shared access signature.
+ * If the source blob is public, no authentication is required
+ * to perform the operation. Here are some examples of source object URLs:
+ * - https://myaccount.blob.core.windows.net/mycontainer/myblob
+ * - https://myaccount.blob.core.windows.net/mycontainer/myblob?snapshot=
+ * @param {number} offset From which position of the blob to download, >= 0
+ * @param {number} [count] How much data to be downloaded, > 0. Will download to the end when undefined
+ * @param {IBlockBlobStageBlockFromURLOptions} [options={}]
+ * @returns {Promise}
+ * @memberof BlockBlobURL
+ */
+ public async stageBlockFromURL(
+ aborter: Aborter,
+ blockId: string,
+ sourceURL: string,
+ offset: number,
+ count?: number,
+ options: IBlockBlobStageBlockFromURLOptions = {}
+ ): Promise {
+ return this.blockBlobContext.stageBlockFromURL(blockId, 0, sourceURL, {
+ abortSignal: aborter,
+ leaseAccessConditions: options.leaseAccessConditions,
+ sourceContentMD5: options.sourceContentMD5,
+ sourceRange:
+ offset === 0 && !count ? undefined : rangeToString({ offset, count })
+ });
+ }
+
+ /**
+ * Writes a blob by specifying the list of block IDs that make up the blob.
+ * In order to be written as part of a blob, a block must have been successfully written
+ * to the server in a prior stageBlock operation. You can call commitBlockList to update a blob
+ * by uploading only those blocks that have changed, then committing the new and existing
+ * blocks together. Any blocks not specified in the block list and permanently deleted.
+ * @see https://docs.microsoft.com/rest/api/storageservices/put-block-list
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {string[]} blocks Array of 64-byte value that is base64-encoded
+ * @param {IBlockBlobCommitBlockListOptions} [options]
+ * @returns {Promise}
+ * @memberof BlockBlobURL
+ */
+ public async commitBlockList(
+ aborter: Aborter,
+ blocks: string[],
+ options: IBlockBlobCommitBlockListOptions = {}
+ ): Promise {
+ options.accessConditions = options.accessConditions || {};
+ return this.blockBlobContext.commitBlockList(
+ { latest: blocks },
+ {
+ abortSignal: aborter,
+ blobHTTPHeaders: options.blobHTTPHeaders,
+ leaseAccessConditions: options.accessConditions.leaseAccessConditions,
+ metadata: options.metadata,
+ modifiedAccessConditions:
+ options.accessConditions.modifiedAccessConditions
+ }
+ );
+ }
+
+ /**
+ * Returns the list of blocks that have been uploaded as part of a block blob
+ * using the specified block list filter.
+ * @see https://docs.microsoft.com/rest/api/storageservices/get-block-list
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {Models.BlockListType} listType
+ * @param {IBlockBlobGetBlockListOptions} [options]
+ * @returns {Promise}
+ * @memberof BlockBlobURL
+ */
+ public async getBlockList(
+ aborter: Aborter,
+ listType: Models.BlockListType,
+ options: IBlockBlobGetBlockListOptions = {}
+ ): Promise {
+ const res = await this.blockBlobContext.getBlockList(listType, {
+ abortSignal: aborter,
+ leaseAccessConditions: options.leaseAccessConditions
+ });
+
+ if (!res.committedBlocks) {
+ res.committedBlocks = [];
+ }
+
+ if (!res.uncommittedBlocks) {
+ res.uncommittedBlocks = [];
+ }
+
+ return res;
+ }
+}
diff --git a/file/lib/BrowserPolicyFactory.ts b/file/lib/BrowserPolicyFactory.ts
new file mode 100644
index 0000000..db09627
--- /dev/null
+++ b/file/lib/BrowserPolicyFactory.ts
@@ -0,0 +1,23 @@
+import {
+ RequestPolicy,
+ RequestPolicyFactory,
+ RequestPolicyOptions
+} from "ms-rest-js";
+
+import { BrowserPolicy } from "./policies/BrowserPolicy";
+
+/**
+ * BrowserPolicyFactory is a factory class helping generating BrowserPolicy objects.
+ *
+ * @export
+ * @class BrowserPolicyFactory
+ * @implements {RequestPolicyFactory}
+ */
+export class BrowserPolicyFactory implements RequestPolicyFactory {
+ public create(
+ nextPolicy: RequestPolicy,
+ options: RequestPolicyOptions
+ ): BrowserPolicy {
+ return new BrowserPolicy(nextPolicy, options);
+ }
+}
diff --git a/file/lib/ContainerSASPermissions.ts b/file/lib/ContainerSASPermissions.ts
new file mode 100644
index 0000000..2f7c3ff
--- /dev/null
+++ b/file/lib/ContainerSASPermissions.ts
@@ -0,0 +1,132 @@
+/**
+ * This is a helper class to construct a string representing the permissions granted by a ServiceSAS to a container.
+ * Setting a value to true means that any SAS which uses these permissions will grant permissions for that operation.
+ * Once all the values are set, this should be serialized with toString and set as the permissions field on a
+ * {@link ServiceSASSignatureValues} object. It is possible to construct the permissions string without this class, but
+ * the order of the permissions is particular and this class guarantees correctness.
+ *
+ * @export
+ * @class ContainerSASPermissions
+ */
+export class ContainerSASPermissions {
+ /**
+ * Creates an {@link ContainerSASPermissions} from the specified permissions string. This method will throw an
+ * Error if it encounters a character that does not correspond to a valid permission.
+ *
+ * @static
+ * @param {string} permissions
+ * @returns
+ * @memberof ContainerSASPermissions
+ */
+ public static parse(permissions: string) {
+ const containerSASPermissions = new ContainerSASPermissions();
+
+ for (const char of permissions) {
+ switch (char) {
+ case "r":
+ containerSASPermissions.read = true;
+ break;
+ case "a":
+ containerSASPermissions.add = true;
+ break;
+ case "c":
+ containerSASPermissions.create = true;
+ break;
+ case "w":
+ containerSASPermissions.write = true;
+ break;
+ case "d":
+ containerSASPermissions.delete = true;
+ break;
+ case "l":
+ containerSASPermissions.list = true;
+ break;
+ default:
+ throw new RangeError(`Invalid permission ${char}`);
+ }
+ }
+
+ return containerSASPermissions;
+ }
+
+ /**
+ * Specifies Read access granted.
+ *
+ * @type {boolean}
+ * @memberof ContainerSASPermissions
+ */
+ public read: boolean = false;
+
+ /**
+ * Specifies Add access granted.
+ *
+ * @type {boolean}
+ * @memberof ContainerSASPermissions
+ */
+ public add: boolean = false;
+
+ /**
+ * Specifies Create access granted.
+ *
+ * @type {boolean}
+ * @memberof ContainerSASPermissions
+ */
+ public create: boolean = false;
+
+ /**
+ * Specifies Write access granted.
+ *
+ * @type {boolean}
+ * @memberof ContainerSASPermissions
+ */
+ public write: boolean = false;
+
+ /**
+ * Specifies Delete access granted.
+ *
+ * @type {boolean}
+ * @memberof ContainerSASPermissions
+ */
+ public delete: boolean = false;
+
+ /**
+ * Specifies List access granted.
+ *
+ * @type {boolean}
+ * @memberof ContainerSASPermissions
+ */
+ public list: boolean = false;
+
+ /**
+ * Converts the given permissions to a string. Using this method will guarantee the permissions are in an
+ * order accepted by the service.
+ *
+ * The order of the characters should be as specified here to ensure correctness.
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas
+ *
+ * @returns {string}
+ * @memberof ContainerSASPermissions
+ */
+ public toString(): string {
+ const permissions: string[] = [];
+ if (this.read) {
+ permissions.push("r");
+ }
+ if (this.add) {
+ permissions.push("a");
+ }
+ if (this.create) {
+ permissions.push("c");
+ }
+ if (this.write) {
+ permissions.push("w");
+ }
+ if (this.delete) {
+ permissions.push("d");
+ }
+ if (this.list) {
+ permissions.push("l");
+ }
+ return permissions.join("");
+ }
+}
diff --git a/file/lib/ContainerURL.ts b/file/lib/ContainerURL.ts
new file mode 100644
index 0000000..3aea965
--- /dev/null
+++ b/file/lib/ContainerURL.ts
@@ -0,0 +1,613 @@
+import { HttpResponse } from "ms-rest-js";
+import * as Models from "../lib/generated/models";
+import { Aborter } from "./Aborter";
+import { Container } from "./generated/operations";
+import { IContainerAccessConditions, IMetadata } from "./models";
+import { Pipeline } from "./Pipeline";
+import { ServiceURL } from "./ServiceURL";
+import { StorageURL } from "./StorageURL";
+import { ETagNone } from "./utils/constants";
+import { appendToURLPath, truncatedISO8061Date } from "./utils/utils.common";
+
+export interface IContainerCreateOptions {
+ metadata?: IMetadata;
+ access?: Models.PublicAccessType;
+}
+
+export interface IContainerGetPropertiesOptions {
+ leaseAccessConditions?: Models.LeaseAccessConditions;
+}
+
+export interface IContainerDeleteMethodOptions {
+ containerAccessConditions?: IContainerAccessConditions;
+}
+
+export interface IContainerSetMetadataOptions {
+ metadata?: IMetadata;
+ containerAccessConditions?: IContainerAccessConditions;
+}
+
+export interface IContainerGetAccessPolicyOptions {
+ leaseAccessConditions?: Models.LeaseAccessConditions;
+}
+
+export interface ISignedIdentifier {
+ /**
+ * @member {string} id a unique id
+ */
+ id: string;
+ /**
+ * @member {AccessPolicy} accessPolicy
+ */
+ accessPolicy: {
+ /**
+ * @member {Date} start the date-time the policy is active. A validate ISO string format, or Date
+ */
+ start: Date;
+ /**
+ * @member {string} expiry the date-time the policy expires. A validate ISO string format, or Date
+ */
+ expiry: Date;
+ /**
+ * @member {string} permission the permissions for the acl policy
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-container-acl
+ */
+ permission: string;
+ };
+}
+
+export declare type ContainerGetAccessPolicyResponse = {
+ signedIdentifiers: ISignedIdentifier[];
+} & Models.ContainerGetAccessPolicyHeaders & {
+ /**
+ * The underlying HTTP response.
+ */
+ _response: HttpResponse & {
+ /**
+ * The parsed HTTP response headers.
+ */
+ parsedHeaders: Models.ContainerGetAccessPolicyHeaders;
+ /**
+ * The response body as text (string format)
+ */
+ bodyAsText: string;
+ /**
+ * The response body as parsed JSON or XML
+ */
+ parsedBody: Models.SignedIdentifier[];
+ };
+ };
+
+export interface IContainerSetAccessPolicyOptions {
+ containerAccessConditions?: IContainerAccessConditions;
+}
+
+export interface IContainerAcquireLeaseOptions {
+ modifiedAccessConditions?: Models.ModifiedAccessConditions;
+}
+
+export interface IContainerReleaseLeaseOptions {
+ modifiedAccessConditions?: Models.ModifiedAccessConditions;
+}
+
+export interface IContainerRenewLeaseOptions {
+ modifiedAccessConditions?: Models.ModifiedAccessConditions;
+}
+
+export interface IContainerBreakLeaseOptions {
+ modifiedAccessConditions?: Models.ModifiedAccessConditions;
+}
+
+export interface IContainerChangeLeaseOptions {
+ modifiedAccessConditions?: Models.ModifiedAccessConditions;
+}
+
+export interface IContainerListBlobsSegmentOptions {
+ /**
+ * @member {string} [prefix] Filters the results to return only containers
+ * whose name begins with the specified prefix.
+ */
+ prefix?: string;
+ /**
+ * @member {number} [maxresults] Specifies the maximum number of containers
+ * to return. If the request does not specify maxresults, or specifies a
+ * value greater than 5000, the server will return up to 5000 items. Note
+ * that if the listing operation crosses a partition boundary, then the
+ * service will return a continuation token for retrieving the remainder of
+ * the results. For this reason, it is possible that the service will return
+ * fewer results than specified by maxresults, or than the default of 5000.
+ */
+ maxresults?: number;
+ /**
+ * @member {ListBlobsIncludeItem[]} [include] Include this parameter to
+ * specify one or more datasets to include in the response.
+ */
+ include?: Models.ListBlobsIncludeItem[];
+}
+
+/**
+ * A ContainerURL represents a URL to the Azure Storage container allowing you to manipulate its blobs.
+ *
+ * @export
+ * @class ContainerURL
+ * @extends {StorageURL}
+ */
+export class ContainerURL extends StorageURL {
+ /**
+ * Creates a ContainerURL object from ServiceURL
+ * @param serviceURL
+ * @param containerName
+ */
+ public static fromServiceURL(
+ serviceURL: ServiceURL,
+ containerName: string
+ ): ContainerURL {
+ return new ContainerURL(
+ appendToURLPath(serviceURL.url, containerName),
+ serviceURL.pipeline
+ );
+ }
+
+ /**
+ * containersContext provided by protocol layer.
+ *
+ * @private
+ * @type {Containers}
+ * @memberof ContainerURL
+ */
+ private containerContext: Container;
+
+ /**
+ * Creates an instance of ContainerURL.
+ * @param {string} url A URL string pointing to Azure Storage blob container, such as
+ * "https://myaccount.blob.core.windows.net/mycontainer". You can
+ * append a SAS if using AnonymousCredential, such as
+ * "https://myaccount.blob.core.windows.net/mycontainer?sasString".
+ * @param {Pipeline} pipeline Call StorageURL.newPipeline() to create a default
+ * pipeline, or provide a customized pipeline.
+ * @memberof ContainerURL
+ */
+ constructor(url: string, pipeline: Pipeline) {
+ super(url, pipeline);
+ this.containerContext = new Container(this.storageClientContext);
+ }
+
+ /**
+ * Creates a new ContainerURL object identical to the source but with the
+ * specified request policy pipeline.
+ *
+ * @param {Pipeline} pipeline
+ * @returns {ContainerURL}
+ * @memberof ContainerURL
+ */
+ public withPipeline(pipeline: Pipeline): ContainerURL {
+ return new ContainerURL(this.url, pipeline);
+ }
+
+ /**
+ * Creates a new container under the specified account. If the container with
+ * the same name already exists, the operation fails.
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-container
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {IContainerCreateOptions} [options]
+ * @returns {Promise}
+ * @memberof ContainerURL
+ */
+ public async create(
+ aborter: Aborter,
+ options: IContainerCreateOptions = {}
+ ): Promise {
+ // Spread operator in destructuring assignments,
+ // this will filter out unwanted properties from the response object into result object
+ return this.containerContext.create({
+ ...options,
+ abortSignal: aborter
+ });
+ }
+
+ /**
+ * Returns all user-defined metadata and system properties for the specified
+ * container. The data returned does not include the container's list of blobs.
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-container-properties
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {IContainersGetPropertiesOptions} [options]
+ * @returns {Promise}
+ * @memberof ContainerURL
+ */
+ public async getProperties(
+ aborter: Aborter,
+ options: IContainerGetPropertiesOptions = {}
+ ): Promise {
+ if (!options.leaseAccessConditions) {
+ options.leaseAccessConditions = {};
+ }
+
+ return this.containerContext.getProperties({
+ abortSignal: aborter,
+ ...options.leaseAccessConditions
+ });
+ }
+
+ /**
+ * Marks the specified container for deletion. The container and any blobs
+ * contained within it are later deleted during garbage collection.
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-container
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {Models.ContainersDeleteMethodOptionalParams} [options]
+ * @returns {Promise}
+ * @memberof ContainerURL
+ */
+ public async delete(
+ aborter: Aborter,
+ options: IContainerDeleteMethodOptions = {}
+ ): Promise {
+ if (!options.containerAccessConditions) {
+ options.containerAccessConditions = {};
+ }
+
+ if (!options.containerAccessConditions.modifiedAccessConditions) {
+ options.containerAccessConditions.modifiedAccessConditions = {};
+ }
+
+ if (!options.containerAccessConditions.leaseAccessConditions) {
+ options.containerAccessConditions.leaseAccessConditions = {};
+ }
+
+ if (
+ (options.containerAccessConditions.modifiedAccessConditions.ifMatch &&
+ options.containerAccessConditions.modifiedAccessConditions.ifMatch !==
+ ETagNone) ||
+ (options.containerAccessConditions.modifiedAccessConditions.ifNoneMatch &&
+ options.containerAccessConditions.modifiedAccessConditions
+ .ifNoneMatch !== ETagNone)
+ ) {
+ throw new RangeError(
+ "the IfMatch and IfNoneMatch access conditions must have their default\
+ values because they are ignored by the service"
+ );
+ }
+
+ return this.containerContext.deleteMethod({
+ abortSignal: aborter,
+ leaseAccessConditions:
+ options.containerAccessConditions.leaseAccessConditions,
+ modifiedAccessConditions:
+ options.containerAccessConditions.modifiedAccessConditions
+ });
+ }
+
+ /**
+ * Sets one or more user-defined name-value pairs for the specified container.
+ *
+ * If no option provided, or no metadata defined in the option parameter, the container
+ * metadata will be removed.
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-container-metadata
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {IContainerSetMetadataOptions} [options]
+ * @returns {Promise}
+ * @memberof ContainerURL
+ */
+ public async setMetadata(
+ aborter: Aborter,
+ options: IContainerSetMetadataOptions = {}
+ ): Promise {
+ if (!options.containerAccessConditions) {
+ options.containerAccessConditions = {};
+ }
+
+ if (!options.containerAccessConditions.modifiedAccessConditions) {
+ options.containerAccessConditions.modifiedAccessConditions = {};
+ }
+
+ if (!options.containerAccessConditions.leaseAccessConditions) {
+ options.containerAccessConditions.leaseAccessConditions = {};
+ }
+
+ if (
+ options.containerAccessConditions.modifiedAccessConditions
+ .ifUnmodifiedSince ||
+ (options.containerAccessConditions.modifiedAccessConditions.ifMatch &&
+ options.containerAccessConditions.modifiedAccessConditions.ifMatch !==
+ ETagNone) ||
+ (options.containerAccessConditions.modifiedAccessConditions.ifNoneMatch &&
+ options.containerAccessConditions.modifiedAccessConditions
+ .ifNoneMatch !== ETagNone)
+ ) {
+ throw new RangeError(
+ "the IfUnmodifiedSince, IfMatch, and IfNoneMatch must have their default values\
+ because they are ignored by the blob service"
+ );
+ }
+
+ return this.containerContext.setMetadata({
+ abortSignal: aborter,
+ leaseAccessConditions:
+ options.containerAccessConditions.leaseAccessConditions,
+ metadata: options.metadata,
+ modifiedAccessConditions:
+ options.containerAccessConditions.modifiedAccessConditions
+ });
+ }
+
+ /**
+ * Gets the permissions for the specified container. The permissions indicate
+ * whether container data may be accessed publicly.
+ *
+ * WARNING: JavaScript Date will potential lost precision when parsing start and expiry string.
+ * For example, new Date("2018-12-31T03:44:23.8827891Z").toISOString() will get "2018-12-31T03:44:23.882Z".
+ *
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-container-acl
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {IContainerGetAccessPolicyOptions} [options]
+ * @returns {Promise}
+ * @memberof ContainerURL
+ */
+ public async getAccessPolicy(
+ aborter: Aborter,
+ options: IContainerGetAccessPolicyOptions = {}
+ ): Promise {
+ if (!options.leaseAccessConditions) {
+ options.leaseAccessConditions = {};
+ }
+
+ const response = await this.containerContext.getAccessPolicy({
+ abortSignal: aborter,
+ leaseAccessConditions: options.leaseAccessConditions
+ });
+
+ const res: ContainerGetAccessPolicyResponse = {
+ _response: response._response,
+ blobPublicAccess: response.blobPublicAccess,
+ date: response.date,
+ eTag: response.eTag,
+ errorCode: response.errorCode,
+ lastModified: response.lastModified,
+ requestId: response.requestId,
+ signedIdentifiers: [],
+ version: response.version
+ };
+
+ for (const identifier of response) {
+ res.signedIdentifiers.push({
+ accessPolicy: {
+ expiry: new Date(identifier.accessPolicy.expiry),
+ permission: identifier.accessPolicy.permission,
+ start: new Date(identifier.accessPolicy.start)
+ },
+ id: identifier.id
+ });
+ }
+
+ return res;
+ }
+
+ /**
+ * Sets the permissions for the specified container. The permissions indicate
+ * whether blobs in a container may be accessed publicly.
+ *
+ * When you set permissions for a container, the existing permissions are replaced.
+ * If no access or containerAcl provided, the existing container ACL will be
+ * removed.
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-container-acl
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {PublicAccessType} [access]
+ * @param {ISignedIdentifier[]} [containerAcl]
+ * @param {IContainerSetAccessPolicyOptions} [options]
+ * @returns {Promise}
+ * @memberof ContainerURL
+ */
+ public async setAccessPolicy(
+ aborter: Aborter,
+ access?: Models.PublicAccessType,
+ containerAcl?: ISignedIdentifier[],
+ options: IContainerSetAccessPolicyOptions = {}
+ ): Promise {
+ options.containerAccessConditions = options.containerAccessConditions || {};
+ const acl: Models.SignedIdentifier[] = [];
+ for (const identifier of containerAcl || []) {
+ acl.push({
+ accessPolicy: {
+ expiry: truncatedISO8061Date(identifier.accessPolicy.expiry),
+ permission: identifier.accessPolicy.permission,
+ start: truncatedISO8061Date(identifier.accessPolicy.start)
+ },
+ id: identifier.id
+ });
+ }
+
+ return this.containerContext.setAccessPolicy({
+ abortSignal: aborter,
+ access,
+ containerAcl: acl,
+ leaseAccessConditions:
+ options.containerAccessConditions.leaseAccessConditions,
+ modifiedAccessConditions:
+ options.containerAccessConditions.modifiedAccessConditions
+ });
+ }
+
+ /**
+ * Establishes and manages a lock on a container for delete operations.
+ * The lock duration can be 15 to 60 seconds, or can be infinite.
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {string} proposedLeaseId Can be specified in any valid GUID string format
+ * @param {number} duration Must be between 15 to 60 seconds, or infinite (-1)
+ * @param {IContainerAcquireLeaseOptions} [options]
+ * @returns {Promise}
+ * @memberof ContainerURL
+ */
+ public async acquireLease(
+ aborter: Aborter,
+ proposedLeaseId: string,
+ duration: number,
+ options: IContainerAcquireLeaseOptions = {}
+ ): Promise {
+ return this.containerContext.acquireLease({
+ abortSignal: aborter,
+ duration,
+ modifiedAccessConditions: options.modifiedAccessConditions,
+ proposedLeaseId
+ });
+ }
+
+ /**
+ * To free the lease if it is no longer needed so that another client may
+ * immediately acquire a lease against the container.
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {string} leaseId
+ * @param {IContainerReleaseLeaseOptions} [options]
+ * @returns {Promise}
+ * @memberof ContainerURL
+ */
+ public async releaseLease(
+ aborter: Aborter,
+ leaseId: string,
+ options: IContainerReleaseLeaseOptions = {}
+ ): Promise {
+ return this.containerContext.releaseLease(leaseId, {
+ abortSignal: aborter,
+ modifiedAccessConditions: options.modifiedAccessConditions
+ });
+ }
+
+ /**
+ * To renew an existing lease.
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {string} leaseId
+ * @param {IContainerRenewLeaseOptions} [options]
+ * @returns {Promise}
+ * @memberof ContainerURL
+ */
+ public async renewLease(
+ aborter: Aborter,
+ leaseId: string,
+ options: IContainerRenewLeaseOptions = {}
+ ): Promise {
+ return this.containerContext.renewLease(leaseId, {
+ abortSignal: aborter,
+ modifiedAccessConditions: options.modifiedAccessConditions
+ });
+ }
+
+ /**
+ * To end the lease but ensure that another client cannot acquire a new lease
+ * until the current lease period has expired.
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {number} period break period
+ * @param {IContainerBreakLeaseOptions} [options]
+ * @returns {Promise}
+ * @memberof ContainerURL
+ */
+ public async breakLease(
+ aborter: Aborter,
+ period: number,
+ options: IContainerBreakLeaseOptions = {}
+ ): Promise {
+ return this.containerContext.breakLease({
+ abortSignal: aborter,
+ breakPeriod: period,
+ modifiedAccessConditions: options.modifiedAccessConditions
+ });
+ }
+
+ /**
+ * To change the ID of an existing lease.
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {string} leaseId
+ * @param {string} proposedLeaseId
+ * @param {IContainerChangeLeaseOptions} [options]
+ * @returns {Promise}
+ * @memberof ContainerURL
+ */
+ public async changeLease(
+ aborter: Aborter,
+ leaseId: string,
+ proposedLeaseId: string,
+ options: IContainerChangeLeaseOptions = {}
+ ): Promise {
+ return this.containerContext.changeLease(leaseId, proposedLeaseId, {
+ abortSignal: aborter,
+ modifiedAccessConditions: options.modifiedAccessConditions
+ });
+ }
+
+ /**
+ * listBlobFlatSegment returns a single segment of blobs starting from the
+ * specified Marker. Use an empty Marker to start enumeration from the beginning.
+ * After getting a segment, process it, and then call ListBlobsFlatSegment again
+ * (passing the the previously-returned Marker) to get the next segment.
+ * @see https://docs.microsoft.com/rest/api/storageservices/list-blobs
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {string} [marker]
+ * @param {IContainerListBlobsSegmentOptions} [options]
+ * @returns {Promise}
+ * @memberof ContainerURL
+ */
+ public async listBlobFlatSegment(
+ aborter: Aborter,
+ marker?: string,
+ options: IContainerListBlobsSegmentOptions = {}
+ ): Promise {
+ return this.containerContext.listBlobFlatSegment({
+ abortSignal: aborter,
+ marker,
+ ...options
+ });
+ }
+
+ /**
+ * listBlobHierarchySegment returns a single segment of blobs starting from
+ * the specified Marker. Use an empty Marker to start enumeration from the
+ * beginning. After getting a segment, process it, and then call ListBlobsHierarchicalSegment
+ * again (passing the the previously-returned Marker) to get the next segment.
+ * @see https://docs.microsoft.com/rest/api/storageservices/list-blobs
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {string} delimiter
+ * @param {IContainerListBlobsSegmentOptions} [options]
+ * @returns {Promise}
+ * @memberof ContainerURL
+ */
+ public async listBlobHierarchySegment(
+ aborter: Aborter,
+ delimiter: string,
+ marker?: string,
+ options: IContainerListBlobsSegmentOptions = {}
+ ): Promise {
+ return this.containerContext.listBlobHierarchySegment(delimiter, {
+ abortSignal: aborter,
+ marker,
+ ...options
+ });
+ }
+}
diff --git a/file/lib/IAccountSASSignatureValues.ts b/file/lib/IAccountSASSignatureValues.ts
new file mode 100644
index 0000000..e936716
--- /dev/null
+++ b/file/lib/IAccountSASSignatureValues.ts
@@ -0,0 +1,159 @@
+import { AccountSASPermissions } from "./AccountSASPermissions";
+import { AccountSASResourceTypes } from "./AccountSASResourceTypes";
+import { AccountSASServices } from "./AccountSASServices";
+import { SharedKeyCredential } from "./credentials/SharedKeyCredential";
+import { IIPRange, ipRangeToString } from "./IIPRange";
+import { SASProtocol, SASQueryParameters } from "./SASQueryParameters";
+import { SERVICE_VERSION } from "./utils/constants";
+import { truncatedISO8061Date } from "./utils/utils.common";
+
+/**
+ * ONLY AVAILABLE IN NODE.JS RUNTIME.
+ *
+ * IAccountSASSignatureValues is used to generate a Shared Access Signature (SAS) for an Azure Storage account. Once
+ * all the values here are set appropriately, call generateSASQueryParameters() to obtain a representation of the SAS
+ * which can actually be applied to blob urls. Note: that both this class and {@link SASQueryParameters} exist because
+ * the former is mutable and a logical representation while the latter is immutable and used to generate actual REST
+ * requests.
+ *
+ * @see https://docs.microsoft.com/en-us/azure/storage/common/storage-dotnet-shared-access-signature-part-1
+ * for more conceptual information on SAS
+ *
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas
+ * for descriptions of the parameters, including which are required
+ *
+ * @export
+ * @class IAccountSASSignatureValues
+ */
+export interface IAccountSASSignatureValues {
+ /**
+ * If not provided, this defaults to the service version targeted by this version of the library.
+ *
+ * @type {string}
+ * @memberof IAccountSASSignatureValues
+ */
+ version?: string;
+
+ /**
+ * Optional. SAS protocols allowed.
+ *
+ * @type {SASProtocol}
+ * @memberof IAccountSASSignatureValues
+ */
+ protocol?: SASProtocol;
+
+ /**
+ * Optional. When the SAS will take effect.
+ *
+ * @type {Date}
+ * @memberof IAccountSASSignatureValues
+ */
+ startTime?: Date;
+
+ /**
+ * The time after which the SAS will no longer work.
+ *
+ * @type {Date}
+ * @memberof IAccountSASSignatureValues
+ */
+ expiryTime: Date;
+
+ /**
+ * Specifies which operations the SAS user may perform. Please refer to {@link AccountSASPermissions} for help
+ * constructing the permissions string.
+ *
+ * @type {string}
+ * @memberof IAccountSASSignatureValues
+ */
+ permissions: string;
+
+ /**
+ * Optional. IP range allowed.
+ *
+ * @type {IIPRange}
+ * @memberof IAccountSASSignatureValues
+ */
+ ipRange?: IIPRange;
+
+ /**
+ * The values that indicate the services accessible with this SAS. Please refer to {@link AccountSASService} to
+ * construct this value.
+ *
+ * @type {string}
+ * @memberof IAccountSASSignatureValues
+ */
+ services: string;
+
+ /**
+ * The values that indicate the resource types accessible with this SAS. Please refer
+ * to {@link AccountSASResourceType} to construct this value.
+ *
+ * @type {string}
+ * @memberof IAccountSASSignatureValues
+ */
+ resourceTypes: string;
+}
+
+/**
+ * ONLY AVAILABLE IN NODE.JS RUNTIME.
+ *
+ * Generates a {@link SASQueryParameters} object which contains all SAS query parameters needed to make an actual
+ * REST request.
+ *
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas
+ *
+ * @param {SharedKeyCredential} sharedKeyCredential
+ * @returns {SASQueryParameters}
+ * @memberof IAccountSASSignatureValues
+ */
+export function generateAccountSASQueryParameters(
+ accountSASSignatureValues: IAccountSASSignatureValues,
+ sharedKeyCredential: SharedKeyCredential
+): SASQueryParameters {
+ const version = accountSASSignatureValues.version
+ ? accountSASSignatureValues.version
+ : SERVICE_VERSION;
+
+ const parsedPermissions = AccountSASPermissions.parse(
+ accountSASSignatureValues.permissions
+ ).toString();
+ const parsedServices = AccountSASServices.parse(
+ accountSASSignatureValues.services
+ ).toString();
+ const parsedResourceTypes = AccountSASResourceTypes.parse(
+ accountSASSignatureValues.resourceTypes
+ ).toString();
+
+ const stringToSign = [
+ sharedKeyCredential.accountName,
+ parsedPermissions,
+ parsedServices,
+ parsedResourceTypes,
+ accountSASSignatureValues.startTime
+ ? truncatedISO8061Date(accountSASSignatureValues.startTime)
+ : "",
+ truncatedISO8061Date(accountSASSignatureValues.expiryTime),
+ accountSASSignatureValues.ipRange
+ ? ipRangeToString(accountSASSignatureValues.ipRange)
+ : "",
+ accountSASSignatureValues.protocol
+ ? accountSASSignatureValues.protocol
+ : "",
+ version,
+ "" // Account SAS requires an additional newline character
+ ].join("\n");
+
+ const signature: string = sharedKeyCredential.computeHMACSHA256(stringToSign);
+
+ return new SASQueryParameters(
+ version,
+ parsedPermissions,
+ signature,
+ parsedServices,
+ parsedResourceTypes,
+ accountSASSignatureValues.protocol,
+ accountSASSignatureValues.startTime,
+ accountSASSignatureValues.expiryTime,
+ accountSASSignatureValues.ipRange
+ );
+}
diff --git a/file/lib/IBlobSASSignatureValues.ts b/file/lib/IBlobSASSignatureValues.ts
new file mode 100644
index 0000000..f414fbc
--- /dev/null
+++ b/file/lib/IBlobSASSignatureValues.ts
@@ -0,0 +1,251 @@
+import { BlobSASPermissions } from "./BlobSASPermissions";
+import { ContainerSASPermissions } from "./ContainerSASPermissions";
+import { SharedKeyCredential } from "./credentials/SharedKeyCredential";
+import { IIPRange, ipRangeToString } from "./IIPRange";
+import { SASProtocol } from "./SASQueryParameters";
+import { SASQueryParameters } from "./SASQueryParameters";
+import { SERVICE_VERSION } from "./utils/constants";
+import { truncatedISO8061Date } from "./utils/utils.common";
+
+/**
+ * ONLY AVAILABLE IN NODE.JS RUNTIME.
+ *
+ * IBlobSASSignatureValues is used to help generating Blob service SAS tokens for containers or blobs.
+ *
+ * @export
+ * @class IBlobSASSignatureValues
+ */
+export interface IBlobSASSignatureValues {
+ /**
+ * The version of the service this SAS will target. If not specified, it will default to the version targeted by the
+ * library.
+ *
+ * @type {string}
+ * @memberof IBlobSASSignatureValues
+ */
+ version?: string;
+
+ /**
+ * Optional. SAS protocols, HTTPS only or HTTPSandHTTP
+ *
+ * @type {SASProtocol}
+ * @memberof IBlobSASSignatureValues
+ */
+ protocol?: SASProtocol;
+
+ /**
+ * Optional. When the SAS will take effect.
+ *
+ * @type {Date}
+ * @memberof IBlobSASSignatureValues
+ */
+ startTime?: Date;
+
+ /**
+ * Optional only when identifier is provided. The time after which the SAS will no longer work.
+ *
+ * @type {Date}
+ * @memberof IBlobSASSignatureValues
+ */
+ expiryTime?: Date;
+
+ /**
+ * Optional only when identifier is provided.
+ * Please refer to either {@link ContainerSASPermissions} or {@link BlobSASPermissions} depending on the resource
+ * being accessed for help constructing the permissions string.
+ *
+ * @type {string}
+ * @memberof IBlobSASSignatureValues
+ */
+ permissions?: string;
+
+ /**
+ * Optional. IP ranges allowed in this SAS.
+ *
+ * @type {IIPRange}
+ * @memberof IBlobSASSignatureValues
+ */
+ ipRange?: IIPRange;
+
+ /**
+ * The name of the container the SAS user may access.
+ *
+ * @type {string}
+ * @memberof IBlobSASSignatureValues
+ */
+ containerName: string;
+
+ /**
+ * Optional. The name of the container the SAS user may access.
+ *
+ * @type {string}
+ * @memberof IBlobSASSignatureValues
+ */
+ blobName?: string;
+
+ /**
+ * Optional. The name of the access policy on the container this SAS references if any.
+ *
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/establishing-a-stored-access-policy
+ *
+ * @type {string}
+ * @memberof IBlobSASSignatureValues
+ */
+ identifier?: string;
+
+ /**
+ * Optional. The cache-control header for the SAS.
+ *
+ * @type {string}
+ * @memberof IBlobSASSignatureValues
+ */
+ cacheControl?: string;
+
+ /**
+ * Optional. The content-disposition header for the SAS.
+ *
+ * @type {string}
+ * @memberof IBlobSASSignatureValues
+ */
+ contentDisposition?: string;
+
+ /**
+ * Optional. The content-encoding header for the SAS.
+ *
+ * @type {string}
+ * @memberof IBlobSASSignatureValues
+ */
+ contentEncoding?: string;
+
+ /**
+ * Optional. The content-language header for the SAS.
+ *
+ * @type {string}
+ * @memberof IBlobSASSignatureValues
+ */
+ contentLanguage?: string;
+
+ /**
+ * Optional. The content-type header for the SAS.
+ *
+ * @type {string}
+ * @memberof IBlobSASSignatureValues
+ */
+ contentType?: string;
+}
+
+/**
+ * ONLY AVAILABLE IN NODE.JS RUNTIME.
+ *
+ * Creates an instance of SASQueryParameters.
+ *
+ * Only accepts required settings needed to create a SAS. For optional settings please
+ * set corresponding properties directly, such as permissions, startTime and identifier.
+ *
+ * WARNING: When identifier is not provided, permissions and expiryTime are required.
+ * You MUST assign value to identifier or expiryTime & permissions manually if you initial with
+ * this constructor.
+ *
+ * @export
+ * @param {IBlobSASSignatureValues} blobSASSignatureValues
+ * @param {SharedKeyCredential} sharedKeyCredential
+ * @returns {SASQueryParameters}
+ */
+export function generateBlobSASQueryParameters(
+ blobSASSignatureValues: IBlobSASSignatureValues,
+ sharedKeyCredential: SharedKeyCredential
+): SASQueryParameters {
+ if (
+ !blobSASSignatureValues.identifier &&
+ (!blobSASSignatureValues.permissions && !blobSASSignatureValues.expiryTime)
+ ) {
+ throw new RangeError(
+ "Must provide 'permissions' and 'expiryTime' for Blob SAS generation when 'identifier' is not provided."
+ );
+ }
+
+ const version = blobSASSignatureValues.version
+ ? blobSASSignatureValues.version
+ : SERVICE_VERSION;
+ let resource: string = "c";
+ let verifiedPermissions: string | undefined;
+
+ // Calling parse and toString guarantees the proper ordering and throws on invalid characters.
+ if (blobSASSignatureValues.permissions) {
+ if (blobSASSignatureValues.blobName) {
+ verifiedPermissions = BlobSASPermissions.parse(
+ blobSASSignatureValues.permissions
+ ).toString();
+ resource = "b";
+ } else {
+ verifiedPermissions = ContainerSASPermissions.parse(
+ blobSASSignatureValues.permissions
+ ).toString();
+ }
+ }
+
+ // Signature is generated on the un-url-encoded values.
+ const stringToSign = [
+ verifiedPermissions ? verifiedPermissions : "",
+ blobSASSignatureValues.startTime
+ ? truncatedISO8061Date(blobSASSignatureValues.startTime)
+ : "",
+ blobSASSignatureValues.expiryTime
+ ? truncatedISO8061Date(blobSASSignatureValues.expiryTime)
+ : "",
+ getCanonicalName(
+ sharedKeyCredential.accountName,
+ blobSASSignatureValues.containerName,
+ blobSASSignatureValues.blobName
+ ),
+ blobSASSignatureValues.identifier,
+ blobSASSignatureValues.ipRange
+ ? ipRangeToString(blobSASSignatureValues.ipRange)
+ : "",
+ blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "",
+ version,
+ blobSASSignatureValues.cacheControl
+ ? blobSASSignatureValues.cacheControl
+ : "",
+ blobSASSignatureValues.contentDisposition
+ ? blobSASSignatureValues.contentDisposition
+ : "",
+ blobSASSignatureValues.contentEncoding
+ ? blobSASSignatureValues.contentEncoding
+ : "",
+ blobSASSignatureValues.contentLanguage
+ ? blobSASSignatureValues.contentLanguage
+ : "",
+ blobSASSignatureValues.contentType ? blobSASSignatureValues.contentType : ""
+ ].join("\n");
+
+ const signature = sharedKeyCredential.computeHMACSHA256(stringToSign);
+
+ return new SASQueryParameters(
+ version,
+ signature,
+ verifiedPermissions,
+ undefined,
+ undefined,
+ blobSASSignatureValues.protocol,
+ blobSASSignatureValues.startTime,
+ blobSASSignatureValues.expiryTime,
+ blobSASSignatureValues.ipRange,
+ blobSASSignatureValues.identifier,
+ resource
+ );
+}
+
+function getCanonicalName(
+ accountName: string,
+ containerName: string,
+ blobName?: string
+): string {
+ // Container: "/blob/account/containerName"
+ // Blob: "/blob/account/containerName/blobName"
+ const elements: string[] = [`/blob/${accountName}/${containerName}`];
+ if (blobName) {
+ elements.push(`/${blobName}`);
+ }
+ return elements.join("");
+}
diff --git a/file/lib/IIPRange.ts b/file/lib/IIPRange.ts
new file mode 100644
index 0000000..aa15037
--- /dev/null
+++ b/file/lib/IIPRange.ts
@@ -0,0 +1,37 @@
+/**
+ * Allowed IP range for a SAS.
+ *
+ * @export
+ * @interface IIPRange
+ */
+export interface IIPRange {
+ /**
+ * Starting IP address in the IP range.
+ * If end IP doesn't provide, start IP will the only IP allowed.
+ *
+ * @type {string}
+ * @memberof IPRange
+ */
+ start: string;
+ /**
+ * Optional. IP address that ends the IP range.
+ * If not provided, start IP will the only IP allowed.
+ *
+ * @type {string}
+ * @memberof IPRange
+ */
+ end?: string;
+}
+
+/**
+ * Generate IPRange format string. For example:
+ *
+ * "8.8.8.8" or "1.1.1.1-255.255.255.255"
+ *
+ * @export
+ * @param {IIPRange} ipRange
+ * @returns {string}
+ */
+export function ipRangeToString(ipRange: IIPRange): string {
+ return ipRange.end ? `${ipRange.start}-${ipRange.end}` : ipRange.start;
+}
diff --git a/file/lib/IRange.ts b/file/lib/IRange.ts
new file mode 100644
index 0000000..1615bbf
--- /dev/null
+++ b/file/lib/IRange.ts
@@ -0,0 +1,48 @@
+// tslint:disable:max-line-length
+/**
+ * Range for Blob Service Operations.
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-the-range-header-for-blob-service-operations
+ *
+ * @export
+ * @interface IRange
+ */
+export interface IRange {
+ /**
+ * StartByte, larger than or equal 0.
+ *
+ * @type {string}
+ * @memberof IRange
+ */
+ offset: number;
+ /**
+ * Optional. Count of bytes, larger than 0.
+ * If not provided, will return bytes from offset to the end.
+ *
+ * @type {string}
+ * @memberof IRange
+ */
+ count?: number;
+}
+
+/**
+ * Generate a range string. For example:
+ *
+ * "bytes=255-" or "bytes=0-511"
+ *
+ * @export
+ * @param {IRange} iRange
+ * @returns {string}
+ */
+export function rangeToString(iRange: IRange): string {
+ if (iRange.offset < 0) {
+ throw new RangeError(`IRange.offset cannot be smaller than 0.`);
+ }
+ if (iRange.count && iRange.count <= 0) {
+ throw new RangeError(
+ `IRange.count must be larger than 0. Leave it undefined if you want a range from offset to the end.`
+ );
+ }
+ return iRange.count
+ ? `bytes=${iRange.offset}-${iRange.offset + iRange.count - 1}`
+ : `bytes=${iRange.offset}-`;
+}
diff --git a/file/lib/LoggingPolicyFactory.ts b/file/lib/LoggingPolicyFactory.ts
new file mode 100644
index 0000000..7120bb8
--- /dev/null
+++ b/file/lib/LoggingPolicyFactory.ts
@@ -0,0 +1,45 @@
+import {
+ RequestPolicy,
+ RequestPolicyFactory,
+ RequestPolicyOptions
+} from "ms-rest-js";
+
+import { LoggingPolicy } from "./policies/LoggingPolicy";
+
+/**
+ * RequestLogOptions configures the retry policy's behavior.
+ *
+ * @export
+ * @interface IRequestLogOptions
+ */
+export interface IRequestLogOptions {
+ /**
+ * LogWarningIfTryOverThreshold logs a warning if a tried operation takes longer than the specified
+ * duration in ms. Default is 3000ms.
+ * @type {number}
+ * @memberof IRequestLogOptions
+ */
+ logWarningIfTryOverThreshold: number;
+}
+
+/**
+ * LoggingPolicyFactory is a factory class helping generating LoggingPolicy objects.
+ *
+ * @export
+ * @class LoggingPolicyFactory
+ * @implements {RequestPolicyFactory}
+ */
+export class LoggingPolicyFactory implements RequestPolicyFactory {
+ private readonly loggingOptions?: IRequestLogOptions;
+
+ constructor(loggingOptions?: IRequestLogOptions) {
+ this.loggingOptions = loggingOptions;
+ }
+
+ public create(
+ nextPolicy: RequestPolicy,
+ options: RequestPolicyOptions
+ ): LoggingPolicy {
+ return new LoggingPolicy(nextPolicy, options, this.loggingOptions);
+ }
+}
diff --git a/file/lib/PageBlobURL.ts b/file/lib/PageBlobURL.ts
new file mode 100644
index 0000000..e2a4b29
--- /dev/null
+++ b/file/lib/PageBlobURL.ts
@@ -0,0 +1,382 @@
+import { HttpRequestBody, TransferProgressEvent } from "ms-rest-js";
+
+import * as Models from "../lib/generated/models";
+import { Aborter } from "./Aborter";
+import { BlobURL } from "./BlobURL";
+import { ContainerURL } from "./ContainerURL";
+import { PageBlob } from "./generated/operations";
+import { rangeToString } from "./IRange";
+import {
+ IBlobAccessConditions,
+ IMetadata,
+ IPageBlobAccessConditions
+} from "./models";
+import { Pipeline } from "./Pipeline";
+import { URLConstants } from "./utils/constants";
+import { appendToURLPath, setURLParameter } from "./utils/utils.common";
+
+export interface IPageBlobCreateOptions {
+ accessConditions?: IBlobAccessConditions;
+ blobSequenceNumber?: number;
+ blobHTTPHeaders?: Models.BlobHTTPHeaders;
+ metadata?: IMetadata;
+}
+
+export interface IPageBlobUploadPagesOptions {
+ accessConditions?: IPageBlobAccessConditions;
+ progress?: (progress: TransferProgressEvent) => void;
+ transactionalContentMD5?: Uint8Array;
+}
+
+export interface IPageBlobClearPagesOptions {
+ accessConditions?: IPageBlobAccessConditions;
+}
+
+export interface IPageBlobGetPageRangesOptions {
+ accessConditions?: IBlobAccessConditions;
+}
+
+export interface IPageBlobGetPageRangesDiffOptions {
+ accessConditions?: IBlobAccessConditions;
+ range?: string;
+}
+
+export interface IPageBlobResizeOptions {
+ accessConditions?: IBlobAccessConditions;
+}
+
+export interface IPageBlobUpdateSequenceNumberOptions {
+ accessConditions?: IBlobAccessConditions;
+}
+
+export interface IPageBlobStartCopyIncrementalOptions {
+ modifiedAccessConditions?: Models.ModifiedAccessConditions;
+}
+
+/**
+ * PageBlobURL defines a set of operations applicable to page blobs.
+ *
+ * @export
+ * @class PageBlobURL
+ * @extends {StorageURL}
+ */
+export class PageBlobURL extends BlobURL {
+ /**
+ * Creates a PageBlobURL object from ContainerURL instance.
+ *
+ * @static
+ * @param {ContainerURL} containerURL
+ * @param {string} blobName
+ * @returns {PageBlobURL}
+ * @memberof PageBlobURL
+ */
+ public static fromContainerURL(
+ containerURL: ContainerURL,
+ blobName: string
+ ): PageBlobURL {
+ return new PageBlobURL(
+ appendToURLPath(containerURL.url, blobName),
+ containerURL.pipeline
+ );
+ }
+
+ /**
+ * Creates a PageBlobURL object from BlobURL instance.
+ *
+ * @static
+ * @param {BlobURL} blobURL
+ * @returns {PageBlobURL}
+ * @memberof PageBlobURL
+ */
+ public static fromBlobURL(blobURL: BlobURL): PageBlobURL {
+ return new PageBlobURL(blobURL.url, blobURL.pipeline);
+ }
+
+ /**
+ * pageBlobsContext provided by protocol layer.
+ *
+ * @private
+ * @type {PageBlobs}
+ * @memberof PageBlobURL
+ */
+ private pageBlobContext: PageBlob;
+
+ /**
+ * Creates an instance of PageBlobURL.
+ * @param {string} url A URL string pointing to Azure Storage page blob, such as
+ * "https://myaccount.blob.core.windows.net/mycontainer/pageblob". You can
+ * append a SAS if using AnonymousCredential, such as
+ * "https://myaccount.blob.core.windows.net/mycontainer/pageblob?sasString".
+ * @param {Pipeline} pipeline Call StorageURL.newPipeline() to create a default
+ * pipeline, or provide a customized pipeline.
+ * @memberof PageBlobURL
+ */
+ constructor(url: string, pipeline: Pipeline) {
+ super(url, pipeline);
+ this.pageBlobContext = new PageBlob(this.storageClientContext);
+ }
+
+ /**
+ * Creates a new PageBlobURL object identical to the source but with the
+ * specified request policy pipeline.
+ *
+ * @param {Pipeline} pipeline
+ * @returns {PageBlobURL}
+ * @memberof PageBlobURL
+ */
+ public withPipeline(pipeline: Pipeline): PageBlobURL {
+ return new PageBlobURL(this.url, pipeline);
+ }
+
+ /**
+ * Creates a new PageBlobURL object identical to the source but with the
+ * specified snapshot timestamp.
+ * Provide "" will remove the snapshot and return a URL to the base blob.
+ *
+ * @param {string} snapshot
+ * @returns {PageBlobURL}
+ * @memberof PageBlobURL
+ */
+ public withSnapshot(snapshot: string): PageBlobURL {
+ return new PageBlobURL(
+ setURLParameter(
+ this.url,
+ URLConstants.Parameters.SNAPSHOT,
+ snapshot.length === 0 ? undefined : snapshot
+ ),
+ this.pipeline
+ );
+ }
+
+ /**
+ * Creates a page blob of the specified length. Call uploadPages to upload data
+ * data to a page blob.
+ * @see https://docs.microsoft.com/rest/api/storageservices/put-blob
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {number} size
+ * @param {IPageBlobCreateOptions} [options]
+ * @returns {Promise}
+ * @memberof PageBlobURL
+ */
+ public async create(
+ aborter: Aborter,
+ size: number,
+ options: IPageBlobCreateOptions = {}
+ ): Promise {
+ options.accessConditions = options.accessConditions || {};
+ return this.pageBlobContext.create(0, size, {
+ abortSignal: aborter,
+ blobHTTPHeaders: options.blobHTTPHeaders,
+ blobSequenceNumber: options.blobSequenceNumber,
+ leaseAccessConditions: options.accessConditions.leaseAccessConditions,
+ metadata: options.metadata,
+ modifiedAccessConditions:
+ options.accessConditions.modifiedAccessConditions
+ });
+ }
+
+ /**
+ * Writes 1 or more pages to the page blob. The start and end offsets must be a multiple of 512.
+ * @see https://docs.microsoft.com/rest/api/storageservices/put-page
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {HttpRequestBody} body
+ * @param {number} offset Offset of destination page blob
+ * @param {number} count Content length of body, also how many bytes to be uploaded
+ * @param {IPageBlobUploadPagesOptions} [options]
+ * @returns {Promise}
+ * @memberof PageBlobURL
+ */
+ public async uploadPages(
+ aborter: Aborter,
+ body: HttpRequestBody,
+ offset: number,
+ count: number,
+ options: IPageBlobUploadPagesOptions = {}
+ ): Promise {
+ options.accessConditions = options.accessConditions || {};
+ return this.pageBlobContext.uploadPages(body, count, {
+ abortSignal: aborter,
+ leaseAccessConditions: options.accessConditions.leaseAccessConditions,
+ modifiedAccessConditions:
+ options.accessConditions.modifiedAccessConditions,
+ onUploadProgress: options.progress,
+ range: rangeToString({ offset, count }),
+ sequenceNumberAccessConditions:
+ options.accessConditions.sequenceNumberAccessConditions,
+ transactionalContentMD5: options.transactionalContentMD5
+ });
+ }
+
+ /**
+ * Frees the specified pages from the page blob.
+ * @see https://docs.microsoft.com/rest/api/storageservices/put-page
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {number} offset
+ * @param {number} count
+ * @param {IPageBlobClearPagesOptions} [options]
+ * @returns {Promise}
+ * @memberof PageBlobURL
+ */
+ public async clearPages(
+ aborter: Aborter,
+ offset: number,
+ count: number,
+ options: IPageBlobClearPagesOptions = {}
+ ): Promise {
+ options.accessConditions = options.accessConditions || {};
+ return this.pageBlobContext.clearPages(0, {
+ abortSignal: aborter,
+ leaseAccessConditions: options.accessConditions.leaseAccessConditions,
+ modifiedAccessConditions:
+ options.accessConditions.modifiedAccessConditions,
+ range: rangeToString({ offset, count }),
+ sequenceNumberAccessConditions:
+ options.accessConditions.sequenceNumberAccessConditions
+ });
+ }
+
+ /**
+ * Returns the list of valid page ranges for a page blob or snapshot of a page blob.
+ * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {number} offset
+ * @param {number} count
+ * @param {IPageBlobGetPageRangesOptions} [options]
+ * @returns {Promise}
+ * @memberof PageBlobURL
+ */
+ public async getPageRanges(
+ aborter: Aborter,
+ offset: number,
+ count: number,
+ options: IPageBlobGetPageRangesOptions = {}
+ ): Promise {
+ options.accessConditions = options.accessConditions || {};
+ return this.pageBlobContext.getPageRanges({
+ abortSignal: aborter,
+ leaseAccessConditions: options.accessConditions.leaseAccessConditions,
+ modifiedAccessConditions:
+ options.accessConditions.modifiedAccessConditions,
+ range: rangeToString({ offset, count })
+ });
+ }
+
+ /**
+ * Gets the collection of page ranges that differ between a specified snapshot and this page blob.
+ * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {number} offset
+ * @param {number} count
+ * @param {string} prevSnapshot
+ * @param {IPageBlobGetPageRangesDiffOptions} [options]
+ * @returns {Promise}
+ * @memberof PageBlobURL
+ */
+ public async getPageRangesDiff(
+ aborter: Aborter,
+ offset: number,
+ count: number,
+ prevSnapshot: string,
+ options: IPageBlobGetPageRangesDiffOptions = {}
+ ): Promise {
+ options.accessConditions = options.accessConditions || {};
+ return this.pageBlobContext.getPageRangesDiff({
+ abortSignal: aborter,
+ leaseAccessConditions: options.accessConditions.leaseAccessConditions,
+ modifiedAccessConditions:
+ options.accessConditions.modifiedAccessConditions,
+ prevsnapshot: prevSnapshot,
+ range: rangeToString({ offset, count })
+ });
+ }
+
+ /**
+ * Resizes the page blob to the specified size (which must be a multiple of 512).
+ * @see https://docs.microsoft.com/rest/api/storageservices/set-blob-properties
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {number} size
+ * @param {IPageBlobResizeOptions} [options]
+ * @returns {Promise}
+ * @memberof PageBlobURL
+ */
+ public async resize(
+ aborter: Aborter,
+ size: number,
+ options: IPageBlobResizeOptions = {}
+ ): Promise {
+ options.accessConditions = options.accessConditions || {};
+ return this.pageBlobContext.resize(size, {
+ abortSignal: aborter,
+ leaseAccessConditions: options.accessConditions.leaseAccessConditions,
+ modifiedAccessConditions:
+ options.accessConditions.modifiedAccessConditions
+ });
+ }
+
+ /**
+ * Sets a page blob's sequence number.
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {Models.SequenceNumberActionType} sequenceNumberAction
+ * @param {number} [sequenceNumber] Required if sequenceNumberAction is max or update
+ * @param {IPageBlobUpdateSequenceNumberOptions} [options]
+ * @returns {Promise}
+ * @memberof PageBlobURL
+ */
+ public async updateSequenceNumber(
+ aborter: Aborter,
+ sequenceNumberAction: Models.SequenceNumberActionType,
+ sequenceNumber?: number,
+ options: IPageBlobUpdateSequenceNumberOptions = {}
+ ): Promise {
+ options.accessConditions = options.accessConditions || {};
+ return this.pageBlobContext.updateSequenceNumber(sequenceNumberAction, {
+ abortSignal: aborter,
+ blobSequenceNumber: sequenceNumber,
+ leaseAccessConditions: options.accessConditions.leaseAccessConditions,
+ modifiedAccessConditions:
+ options.accessConditions.modifiedAccessConditions
+ });
+ }
+
+ /**
+ * Begins an operation to start an incremental copy from one page blob's snapshot to this page blob.
+ * The snapshot is copied such that only the differential changes between the previously
+ * copied snapshot are transferred to the destination.
+ * The copied snapshots are complete copies of the original snapshot and can be read or copied from as usual.
+ * @see https://docs.microsoft.com/rest/api/storageservices/incremental-copy-blob
+ * @see https://docs.microsoft.com/en-us/azure/virtual-machines/windows/incremental-snapshots
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {string} copySource Specifies the name of the source page blob snapshot. For example,
+ * https://myaccount.blob.core.windows.net/mycontainer/myblob?snapshot=
+ * @param {IPageBlobStartCopyIncrementalOptions} [options]
+ * @returns {Promise}
+ * @memberof PageBlobURL
+ */
+ public async startCopyIncremental(
+ aborter: Aborter,
+ copySource: string,
+ options: IPageBlobStartCopyIncrementalOptions = {}
+ ): Promise {
+ return this.pageBlobContext.copyIncremental(copySource, {
+ abortSignal: aborter,
+ modifiedAccessConditions: options.modifiedAccessConditions
+ });
+ }
+}
diff --git a/file/lib/Pipeline.ts b/file/lib/Pipeline.ts
new file mode 100644
index 0000000..69b78a0
--- /dev/null
+++ b/file/lib/Pipeline.ts
@@ -0,0 +1,84 @@
+import {
+ BaseRequestPolicy,
+ HttpClient as IHttpClient,
+ HttpHeaders,
+ HttpOperationResponse,
+ HttpPipelineLogger as IHttpPipelineLogger,
+ HttpPipelineLogLevel,
+ RequestPolicy,
+ RequestPolicyFactory,
+ RequestPolicyOptions,
+ ServiceClientOptions,
+ WebResource
+} from "ms-rest-js";
+
+// Export following interfaces and types for customers who want to implement their
+// own RequestPolicy or HTTPClient
+export {
+ IHttpClient,
+ IHttpPipelineLogger,
+ HttpHeaders,
+ HttpPipelineLogLevel,
+ HttpOperationResponse,
+ WebResource,
+ BaseRequestPolicy,
+ RequestPolicyFactory,
+ RequestPolicy,
+ RequestPolicyOptions
+};
+
+/**
+ * Option interface for Pipeline constructor.
+ *
+ * @export
+ * @interface IPipelineOptions
+ */
+export interface IPipelineOptions {
+ logger?: IHttpPipelineLogger;
+ HTTPClient?: IHttpClient;
+}
+
+/**
+ * A Pipeline class containing HTTP request policies.
+ * You can create a default Pipeline by calling StorageURL.newPipeline().
+ * Or you can create a Pipeline with your own policies by the constructor of Pipeline.
+ * Refer to StorageURL.newPipeline() and provided policies as reference before
+ * implementing your customized Pipeline.
+ *
+ * @export
+ * @class Pipeline
+ */
+export class Pipeline {
+ public readonly factories: RequestPolicyFactory[];
+ public readonly options: IPipelineOptions;
+
+ /**
+ * Creates an instance of Pipeline. Customize HTTPClient by implementing IHttpClient interface.
+ *
+ * @param {RequestPolicyFactory[]} factories
+ * @param {IPipelineOptions} [options={}]
+ * @memberof Pipeline
+ */
+ constructor(
+ factories: RequestPolicyFactory[],
+ options: IPipelineOptions = {}
+ ) {
+ this.factories = factories;
+ this.options = options;
+ }
+
+ /**
+ * Transfer Pipeline object to ServiceClientOptions object which required by
+ * ServiceClient constructor.
+ *
+ * @returns {ServiceClientOptions}
+ * @memberof Pipeline
+ */
+ public toServiceClientOptions(): ServiceClientOptions {
+ return {
+ httpClient: this.options.HTTPClient,
+ httpPipelineLogger: this.options.logger,
+ requestPolicyFactories: this.factories
+ };
+ }
+}
diff --git a/file/lib/RetryPolicyFactory.ts b/file/lib/RetryPolicyFactory.ts
new file mode 100644
index 0000000..ed96359
--- /dev/null
+++ b/file/lib/RetryPolicyFactory.ts
@@ -0,0 +1,106 @@
+import {
+ RequestPolicy,
+ RequestPolicyFactory,
+ RequestPolicyOptions
+} from "ms-rest-js";
+
+import { RetryPolicy, RetryPolicyType } from "./policies/RetryPolicy";
+
+/**
+ * Retry options interface.
+ *
+ * @export
+ * @interface IRetryOptions
+ */
+export interface IRetryOptions {
+ /**
+ * Optional. RetryPolicyType, default is exponential retry policy.
+ *
+ * @type {RetryPolicyType}
+ * @memberof RetryOptions
+ */
+ readonly retryPolicyType?: RetryPolicyType;
+
+ /**
+ * Optional. Max try number of attempts, default is 4.
+ * A value of 1 means 1 try and no retries.
+ * A value smaller than 1 means default retry number of attempts.
+ *
+ * @type {number}
+ * @memberof IRetryOptions
+ */
+ readonly maxTries?: number;
+
+ /**
+ * Optional. Indicates the maximum time in seconds allowed for any single try of an HTTP request.
+ * A value of zero or undefined means that you accept our default timeout, 60s or 60 * 1000ms.
+ *
+ * NOTE: When transferring large amounts of data, the default TryTimeout will probably
+ * not be sufficient. You should override this value based on the bandwidth available to
+ * the host machine and proximity to the Storage service. A good starting point may be something
+ * like (60 seconds per MB of anticipated-payload-size)
+ *
+ * @type {number}
+ * @memberof IRetryOptions
+ */
+ readonly tryTimeout?: number;
+
+ /**
+ * Optional. Specifies the amount of delay to use before retrying an operation (default is 4s or 4 * 1000ms).
+ * The delay increases (exponentially or linearly) with each retry up to a maximum specified by
+ * maxRetryDelayInMs. If you specify 0, then you must also specify 0 for maxRetryDelayInMs.
+ *
+ * @type {number}
+ * @memberof IRetryOptions
+ */
+ readonly retryDelayInMs?: number;
+
+ /**
+ * Optional. Specifies the maximum delay allowed before retrying an operation (default is 120s or 120 * 1000ms).
+ * If you specify 0, then you must also specify 0 for retryDelayInMs.
+ *
+ * @type {number}
+ * @memberof IRetryOptions
+ */
+ readonly maxRetryDelayInMs?: number;
+
+ /**
+ * If a secondaryHost is specified, retries will be tried against this host. If secondaryHost is undefined
+ * (the default) then operations are not retried against another host.
+ *
+ * NOTE: Before setting this field, make sure you understand the issues around
+ * reading stale and potentially-inconsistent data at
+ * {@link https://docs.microsoft.com/en-us/azure/storage/common/storage-designing-ha-apps-with-ragrs}
+ *
+ * @type {string}
+ * @memberof IRetryOptions
+ */
+ readonly secondaryHost?: string;
+}
+
+/**
+ * RetryPolicyFactory is a factory class helping generating RetryPolicy objects.
+ *
+ * @export
+ * @class RetryPolicyFactory
+ * @implements {RequestPolicyFactory}
+ */
+export class RetryPolicyFactory implements RequestPolicyFactory {
+ private retryOptions?: IRetryOptions;
+
+ /**
+ * Creates an instance of RetryPolicyFactory.
+ * @param {IRetryOptions} [retryOptions]
+ * @memberof RetryPolicyFactory
+ */
+ constructor(retryOptions?: IRetryOptions) {
+ this.retryOptions = retryOptions;
+ }
+
+ public create(
+ nextPolicy: RequestPolicy,
+ options: RequestPolicyOptions
+ ): RetryPolicy {
+ return new RetryPolicy(nextPolicy, options, this.retryOptions);
+ }
+}
diff --git a/file/lib/SASQueryParameters.ts b/file/lib/SASQueryParameters.ts
new file mode 100644
index 0000000..7b7744b
--- /dev/null
+++ b/file/lib/SASQueryParameters.ts
@@ -0,0 +1,288 @@
+import { IIPRange, ipRangeToString } from "./IIPRange";
+import { truncatedISO8061Date } from "./utils/utils.common";
+
+/**
+ * Protocols for generated SAS.
+ *
+ * @export
+ * @enum {number}
+ */
+export enum SASProtocol {
+ /**
+ * Protocol that allows HTTPS only
+ */
+ HTTPS = "https",
+
+ /**
+ * Protocol that allows both HTTPS and HTTP
+ */
+ HTTPSandHTTP = "https,http"
+}
+
+/**
+ * Represents the components that make up an Azure Storage SAS' query parameters. This type is not constructed directly
+ * by the user; it is only generated by the {@link AccountSASSignatureValues} and {@link ServiceSASSignatureValues}
+ * types. Once generated, it can be encoded into a {@code String} and appended to a URL directly (though caution should
+ * be taken here in case there are existing query parameters, which might affect the appropriate means of appending
+ * these query parameters).
+ *
+ * NOTE: Instances of this class are immutable.
+ *
+ * @export
+ * @class SASQueryParameters
+ */
+export class SASQueryParameters {
+ /**
+ * The storage API version.
+ *
+ * @type {string}
+ * @memberof SASQueryParameters
+ */
+ public readonly version: string;
+
+ /**
+ * Optional. The allowed HTTP protocol(s).
+ *
+ * @type {SASProtocol}
+ * @memberof SASQueryParameters
+ */
+ public readonly protocol?: SASProtocol;
+
+ /**
+ * Optional. The start time for this SAS token.
+ *
+ * @type {Date}
+ * @memberof SASQueryParameters
+ */
+ public readonly startTime?: Date;
+
+ /**
+ * Optional only when identifier is provided. The expiry time for this SAS token.
+ *
+ * @type {Date}
+ * @memberof SASQueryParameters
+ */
+ public readonly expiryTime?: Date;
+
+ /**
+ * Optional only when identifier is provided.
+ * Please refer to {@link AccountSASPermission}, {@link BlobSASPermission}, or {@link ContainerSASPermission} for
+ * more details.
+ *
+ * @type {string}
+ * @memberof SASQueryParameters
+ */
+ public readonly permissions?: string;
+
+ /**
+ * Optional. The storage services being accessed (only for Account SAS). Please refer to {@link AccountSASServices}
+ * for more details.
+ *
+ * @type {string}
+ * @memberof SASQueryParameters
+ */
+ public readonly services?: string;
+
+ /**
+ * Optional. The storage resource types being accessed (only for Account SAS). Please refer to
+ * {@link AccountSASResourceTypes} for more details.
+ *
+ * @type {string}
+ * @memberof SASQueryParameters
+ */
+ public readonly resourceTypes?: string;
+
+ /**
+ * Optional. The signed identifier (only for {@link ServiceSASSignatureValues}).
+ *
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/establishing-a-stored-access-policy
+ *
+ * @type {string}
+ * @memberof SASQueryParameters
+ */
+ public readonly identifier?: string;
+
+ /**
+ * Optional. The storage container or blob (only for {@link ServiceSASSignatureValues}).
+ *
+ * @type {string}
+ * @memberof SASQueryParameters
+ */
+ public readonly resource?: string;
+
+ /**
+ * The signature for the SAS token.
+ *
+ * @type {string}
+ * @memberof SASQueryParameters
+ */
+ public readonly signature: string;
+
+ /**
+ * Inner value of getter ipRange.
+ *
+ * @private
+ * @type {IIPRange}
+ * @memberof SASQueryParameters
+ */
+ private readonly ipRangeInner?: IIPRange;
+
+ /**
+ * Optional. IP range allowed for this SAS.
+ *
+ * @readonly
+ * @type {(IIPRange | undefined)}
+ * @memberof SASQueryParameters
+ */
+ public get ipRange(): IIPRange | undefined {
+ if (this.ipRangeInner) {
+ return {
+ end: this.ipRangeInner.end,
+ start: this.ipRangeInner.start
+ };
+ }
+ return undefined;
+ }
+
+ /**
+ * Creates an instance of SASQueryParameters.
+ *
+ * @param {string} version Representing the storage version
+ * @param {string} signature Representing the signature for the SAS token
+ * @param {string} [permissions] Representing the storage permissions
+ * @param {string} [services] Representing the storage services being accessed (only for Account SAS)
+ * @param {string} [resourceTypes] Representing the storage resource types being accessed (only for Account SAS)
+ * @param {SASProtocol} [protocol] Representing the allowed HTTP protocol(s)
+ * @param {Date} [startTime] Representing the start time for this SAS token
+ * @param {Date} [expiryTime] Representing the expiry time for this SAS token
+ * @param {IIPRange} [ipRange] Representing the range of valid IP addresses for this SAS token
+ * @param {string} [identifier] Representing the signed identifier (only for Service SAS)
+ * @param {string} [resource] Representing the storage container or blob (only for Service SAS)
+ * @memberof SASQueryParameters
+ */
+ constructor(
+ version: string,
+ signature: string,
+ permissions?: string,
+ services?: string,
+ resourceTypes?: string,
+ protocol?: SASProtocol,
+ startTime?: Date,
+ expiryTime?: Date,
+ ipRange?: IIPRange,
+ identifier?: string,
+ resource?: string
+ ) {
+ this.version = version;
+ this.services = services;
+ this.resourceTypes = resourceTypes;
+ this.expiryTime = expiryTime;
+ this.permissions = permissions;
+ this.protocol = protocol;
+ this.startTime = startTime;
+ this.ipRangeInner = ipRange;
+ this.identifier = identifier;
+ this.resource = resource;
+ this.signature = signature;
+ }
+
+ /**
+ * Encodes all SAS query parameters into a string that can be appended to a URL.
+ *
+ * @returns {string}
+ * @memberof SASQueryParameters
+ */
+ public toString(): string {
+ const params: string[] = [
+ "sv",
+ "ss",
+ "srt",
+ "spr",
+ "st",
+ "se",
+ "sip",
+ "si",
+ "sr",
+ "sp",
+ "sig"
+ ];
+ const queries: string[] = [];
+
+ for (const param of params) {
+ switch (param) {
+ case "sv":
+ this.tryAppendQueryParameter(queries, param, this.version);
+ break;
+ case "ss":
+ this.tryAppendQueryParameter(queries, param, this.services);
+ break;
+ case "srt":
+ this.tryAppendQueryParameter(queries, param, this.resourceTypes);
+ break;
+ case "spr":
+ this.tryAppendQueryParameter(queries, param, this.protocol);
+ break;
+ case "st":
+ this.tryAppendQueryParameter(
+ queries,
+ param,
+ this.startTime ? truncatedISO8061Date(this.startTime) : undefined
+ );
+ break;
+ case "se":
+ this.tryAppendQueryParameter(
+ queries,
+ param,
+ this.expiryTime ? truncatedISO8061Date(this.expiryTime) : undefined
+ );
+ break;
+ case "sip":
+ this.tryAppendQueryParameter(
+ queries,
+ param,
+ this.ipRange ? ipRangeToString(this.ipRange) : undefined
+ );
+ break;
+ case "si":
+ this.tryAppendQueryParameter(queries, param, this.identifier);
+ break;
+ case "sr":
+ this.tryAppendQueryParameter(queries, param, this.resource);
+ break;
+ case "sp":
+ this.tryAppendQueryParameter(queries, param, this.permissions);
+ break;
+ case "sig":
+ this.tryAppendQueryParameter(queries, param, this.signature);
+ break;
+ }
+ }
+ return queries.join("&");
+ }
+
+ /**
+ * A private helper method used to filter and append query key/value pairs into an array.
+ *
+ * @private
+ * @param {string[]} queries
+ * @param {string} key
+ * @param {string} [value]
+ * @returns {void}
+ * @memberof SASQueryParameters
+ */
+ private tryAppendQueryParameter(
+ queries: string[],
+ key: string,
+ value?: string
+ ): void {
+ if (!value) {
+ return;
+ }
+
+ key = encodeURIComponent(key);
+ value = encodeURIComponent(value);
+ if (key.length > 0 && value.length > 0) {
+ queries.push(`${key}=${value}`);
+ }
+ }
+}
diff --git a/file/lib/ServiceURL.ts b/file/lib/ServiceURL.ts
new file mode 100644
index 0000000..0e2f8b3
--- /dev/null
+++ b/file/lib/ServiceURL.ts
@@ -0,0 +1,147 @@
+import * as Models from "../lib/generated/models";
+import { Aborter } from "./Aborter";
+import { Service } from "./generated/operations";
+import { Pipeline } from "./Pipeline";
+import { StorageURL } from "./StorageURL";
+
+export interface IServiceListSharesSegmentOptions {
+ /**
+ * Filters the results to return only entries whose
+ * name begins with the specified prefix.
+ *
+ * @type {string}
+ * @memberof IServiceListSharesSegmentOptions
+ */
+ prefix?: string;
+
+ /**
+ * Specifies the maximum number of entries to
+ * return. If the request does not specify maxresults, or specifies a value
+ * greater than 5,000, the server will return up to 5,000 items.
+ *
+ * @type {number}
+ * @memberof IServiceListSharesSegmentOptions
+ */
+ maxresults?: number;
+
+ /**
+ * Include this parameter to
+ * specify one or more datasets to include in the response.
+ *
+ * @type {Models.ListSharesIncludeType[]}
+ * @memberof IServiceListSharesSegmentOptions
+ */
+ include?: Models.ListSharesIncludeType[];
+}
+
+/**
+ * A ServiceURL represents a URL to the Azure Storage File service allowing you
+ * to manipulate file shares.
+ *
+ * @export
+ * @class ServiceURL
+ * @extends {StorageURL}
+ */
+export class ServiceURL extends StorageURL {
+ /**
+ * serviceContext provided by protocol layer.
+ *
+ * @private
+ * @type {Service}
+ * @memberof ServiceURL
+ */
+ private serviceContext: Service;
+
+ /**
+ * Creates an instance of ServiceURL.
+ *
+ * @param {string} url A URL string pointing to Azure Storage file service, such as
+ * "https://myaccount.file.core.windows.net". You can Append a SAS
+ * if using AnonymousCredential, such as "https://myaccount.file.core.windows.net?sasString".
+ * @param {Pipeline} pipeline Call StorageURL.newPipeline() to create a default
+ * pipeline, or provide a customized pipeline.
+ * @memberof ServiceURL
+ */
+ constructor(url: string, pipeline: Pipeline) {
+ super(url, pipeline);
+ this.serviceContext = new Service(this.storageClientContext);
+ }
+
+ /**
+ * Creates a new ServiceURL object identical to the source but with the
+ * specified request policy pipeline.
+ *
+ * @param {Pipeline} pipeline
+ * @returns {ServiceURL}
+ * @memberof ServiceURL
+ */
+ public withPipeline(pipeline: Pipeline): ServiceURL {
+ return new ServiceURL(this.url, pipeline);
+ }
+
+ /**
+ * Gets the properties of a storage account’s file service, including properties
+ * for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-file-service-properties}
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @returns {Promise}
+ * @memberof ServiceURL
+ */
+ public async getProperties(
+ aborter: Aborter
+ ): Promise {
+ return this.serviceContext.getProperties({
+ abortSignal: aborter
+ });
+ }
+
+ /**
+ * Sets properties for a storage account’s file service endpoint, including properties
+ * for Storage Analytics, CORS (Cross-Origin Resource Sharing) rules and soft delete settings.
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-file-service-properties}
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {Models.StorageServiceProperties} properties
+ * @returns {Promise}
+ * @memberof ServiceURL
+ */
+ public async setProperties(
+ aborter: Aborter,
+ properties: Models.StorageServiceProperties
+ ): Promise {
+ return this.serviceContext.setProperties(properties, {
+ abortSignal: aborter
+ });
+ }
+
+ /**
+ * Gets the properties of a storage account's File service, including properties for Storage
+ * Analytics metrics and CORS (Cross-Origin Resource Sharing) rules.
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {string} [marker] A string value that identifies the portion of
+ * the list to be returned with the next list operation. The operation
+ * returns a marker value within the response body if the list returned was
+ * not complete. The marker value may then be used in a subsequent call to
+ * request the next set of list items. The marker value is opaque to the
+ * client.
+ * @param {IServiceListSharesSegmentOptions} [options={}]
+ * @returns {Promise}
+ * @memberof ServiceURL
+ */
+ public async listSharesSegment(
+ aborter: Aborter,
+ marker?: string,
+ options: IServiceListSharesSegmentOptions = {}
+ ): Promise {
+ return this.serviceContext.listSharesSegment({
+ abortSignal: aborter,
+ marker,
+ ...options
+ });
+ }
+}
diff --git a/file/lib/ShareURL.ts b/file/lib/ShareURL.ts
new file mode 100644
index 0000000..8363020
--- /dev/null
+++ b/file/lib/ShareURL.ts
@@ -0,0 +1,440 @@
+import { HttpResponse } from "ms-rest-js";
+import { Aborter } from "./Aborter";
+import * as Models from "./generated/models";
+import { Share } from "./generated/operations";
+import { Pipeline } from "./Pipeline";
+import { ServiceURL } from "./ServiceURL";
+import { StorageURL } from "./StorageURL";
+import { ETagNone, URLConstants } from "./utils/constants";
+import {
+ appendToURLPath,
+ setURLParameter,
+ truncatedISO8061Date
+} from "./utils/utils.common";
+
+export interface IShareCreateOptions {
+ /**
+ * A name-value pair to associate with a file storage object.
+ *
+ * @type {{ [propertyName: string]: string }}
+ * @memberof IShareCreateOptions
+ */
+ metadata?: { [propertyName: string]: string };
+
+ /**
+ * Specifies the maximum size of the share, in
+ * gigabytes.
+ *
+ * @type {number}
+ * @memberof IShareCreateOptions
+ */
+ quota?: number;
+}
+
+export interface IShareGetPropertiesOptions {
+ /**
+ * The snapshot parameter is an opaque
+ * DateTime value that, when present, specifies the share snapshot to query.
+ *
+ * @type {string}
+ * @memberof IShareGetPropertiesOptions
+ */
+ sharesnapshot?: string;
+}
+
+export interface IShareDeleteMethodOptions {
+ /**
+ * The snapshot parameter is an opaque
+ * DateTime value that, when present, specifies the share snapshot to query.
+ *
+ * @type {string}
+ * @memberof IShareDeleteMethodOptions
+ */
+ sharesnapshot?: string;
+
+ /**
+ * Specifies the option
+ * include to delete the base share and all of its snapshots. Possible values
+ * include: 'include'
+ *
+ * @type {Models.DeleteSnapshotsOptionType}
+ * @memberof IShareDeleteMethodOptions
+ */
+ deleteSnapshots?: Models.DeleteSnapshotsOptionType;
+}
+
+export interface IShareSetMetadataOptions {
+ /**
+ * A name-value pair to associate with a file storage object.
+ *
+ * @type {{ [propertyName: string]: string }}
+ * @memberof IShareCreateOptions
+ */
+ metadata?: { [propertyName: string]: string };
+}
+
+export interface ISignedIdentifier {
+ /**
+ * @member {string} id a unique id
+ */
+ id: string;
+ /**
+ * @member {AccessPolicy} accessPolicy
+ */
+ accessPolicy: {
+ /**
+ * @member {Date} start the date-time the policy is active.
+ */
+ start: Date;
+ /**
+ * @member {string} expiry the date-time the policy expires.
+ */
+ expiry: Date;
+ /**
+ * @member {string} permission the permissions for the acl policy
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-share-acl
+ */
+ permission: string;
+ };
+}
+
+export declare type ShareGetAccessPolicyResponse = {
+ signedIdentifiers: ISignedIdentifier[];
+} & Models.ShareGetAccessPolicyHeaders & {
+ /**
+ * The underlying HTTP response.
+ */
+ _response: HttpResponse & {
+ /**
+ * The parsed HTTP response headers.
+ */
+ parsedHeaders: Models.ShareGetAccessPolicyHeaders;
+ /**
+ * The response body as text (string format)
+ */
+ bodyAsText: string;
+ /**
+ * The response body as parsed JSON or XML
+ */
+ parsedBody: Models.SignedIdentifier[];
+ };
+ };
+
+export interface IShareCreateSnapshotOptions {
+ /**
+ * A name-value pair to associate with a file storage object.
+ *
+ * @type {{ [propertyName: string]: string }}
+ * @memberof IShareCreateOptions
+ */
+ metadata?: { [propertyName: string]: string };
+}
+
+/**
+ * A ShareURL represents a URL to the Azure Storage share allowing you to manipulate its directories and files.
+ *
+ * @export
+ * @class ShareURL
+ * @extends {StorageURL}
+ */
+export class ShareURL extends StorageURL {
+ /**
+ * Creates a ShareURL object from ServiceURL
+ *
+ * @param serviceURL
+ * @param shareName
+ */
+ public static fromServiceURL(
+ serviceURL: ServiceURL,
+ shareName: string
+ ): ShareURL {
+ return new ShareURL(
+ appendToURLPath(serviceURL.url, shareName),
+ serviceURL.pipeline
+ );
+ }
+
+ /**
+ * Share operation context provided by protocol layer.
+ *
+ * @private
+ * @type {Share}
+ * @memberof ShareURL
+ */
+ private context: Share;
+
+ /**
+ * Creates an instance of ShareURL.
+ *
+ * @param {string} url A URL string pointing to Azure Storage file share, such as
+ * "https://myaccount.file.core.windows.net/share". You can
+ * append a SAS if using AnonymousCredential, such as
+ * "https://myaccount.file.core.windows.net/share?sasString".
+ * @param {Pipeline} pipeline Call StorageURL.newPipeline() to create a default
+ * pipeline, or provide a customized pipeline.
+ * @memberof ShareURL
+ */
+ constructor(url: string, pipeline: Pipeline) {
+ super(url, pipeline);
+ this.context = new Share(this.storageClientContext);
+ }
+
+ /**
+ * Creates a new ShareURL object identical to the source but with the
+ * specified request policy pipeline.
+ *
+ * @param {Pipeline} pipeline
+ * @returns {ShareURL}
+ * @memberof ShareURL
+ */
+ public withPipeline(pipeline: Pipeline): ShareURL {
+ return new ShareURL(this.url, pipeline);
+ }
+
+ /**
+ * Creates a new ShareURL object identical to the source but with the specified snapshot timestamp.
+ * Provide "" will remove the snapshot and return a URL to the base share.
+ *
+ * @param {string} snapshot
+ * @returns {ShareURL} A new ShareURL object identical to the source but with the specified snapshot timestamp
+ * @memberof ShareURL
+ */
+ public withSnapshot(snapshot: string): ShareURL {
+ return new ShareURL(
+ setURLParameter(
+ this.url,
+ URLConstants.Parameters.SNAPSHOT,
+ snapshot.length === 0 ? undefined : snapshot
+ ),
+ this.pipeline
+ );
+ }
+
+ /**
+ * Creates a new share under the specified account. If the share with
+ * the same name already exists, the operation fails.
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-share
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {IShareCreateOptions} [options]
+ * @returns {Promise}
+ * @memberof ShareURL
+ */
+ public async create(
+ aborter: Aborter,
+ options: IShareCreateOptions = {}
+ ): Promise {
+ return this.context.create({
+ ...options,
+ abortSignal: aborter
+ });
+ }
+
+ /**
+ * Returns all user-defined metadata and system properties for the specified
+ * share.
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-share-properties
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {IShareGetPropertiesOptions} [options]
+ * @returns {Promise}
+ * @memberof ShareURL
+ */
+ public async getProperties(
+ aborter: Aborter,
+ options: IShareGetPropertiesOptions = {}
+ ): Promise {
+ return this.context.getProperties({
+ abortSignal: aborter,
+ ...options
+ });
+ }
+
+ /**
+ * Marks the specified share for deletion. The share and any directories or files
+ * contained within it are later deleted during garbage collection.
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-share
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {Models.IShareDeleteMethodOptions} [options]
+ * @returns {Promise}
+ * @memberof ShareURL
+ */
+ public async delete(
+ aborter: Aborter,
+ options: IShareDeleteMethodOptions = {}
+ ): Promise {
+ return this.context.deleteMethod({
+ abortSignal: aborter,
+ ...options
+ });
+ }
+
+ /**
+ * Sets one or more user-defined name-value pairs for the specified share.
+ *
+ * If no option provided, or no metadata defined in the option parameter, the share
+ * metadata will be removed.
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-share-metadata
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {IShareSetMetadataOptions} [options]
+ * @returns {Promise}
+ * @memberof ShareURL
+ */
+ public async setMetadata(
+ aborter: Aborter,
+ options: IShareSetMetadataOptions = {}
+ ): Promise {
+ return this.context.setMetadata({
+ abortSignal: aborter,
+ ...options
+ });
+ }
+
+ /**
+ * Gets the permissions for the specified share. The permissions indicate
+ * whether share data may be accessed publicly.
+ *
+ * WARNING: JavaScript Date will potential lost precision when parsing start and expiry string.
+ * For example, new Date("2018-12-31T03:44:23.8827891Z").toISOString() will get "2018-12-31T03:44:23.882Z".
+ *
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-share-acl
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @returns {Promise}
+ * @memberof ShareURL
+ */
+ public async getAccessPolicy(
+ aborter: Aborter
+ ): Promise {
+ const response = await this.context.getAccessPolicy({
+ abortSignal: aborter
+ });
+
+ const res: ShareGetAccessPolicyResponse = {
+ _response: response._response,
+ date: response.date,
+ eTag: response.eTag,
+ errorCode: response.errorCode,
+ lastModified: response.lastModified,
+ requestId: response.requestId,
+ signedIdentifiers: [],
+ version: response.version
+ };
+
+ for (const identifier of response) {
+ res.signedIdentifiers.push({
+ accessPolicy: {
+ expiry: new Date(identifier.accessPolicy!.expiry!),
+ permission: identifier.accessPolicy!.permission!,
+ start: new Date(identifier.accessPolicy!.start!)
+ },
+ id: identifier.id
+ });
+ }
+
+ return res;
+ }
+
+ /**
+ * Sets the permissions for the specified share. The permissions indicate
+ * whether directories or files in a share may be accessed publicly.
+ *
+ * When you set permissions for a share, the existing permissions are replaced.
+ * If no shareAcl provided, the existing share ACL will be
+ * removed.
+ * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-share-acl
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {ISignedIdentifier[]} [shareAcl]
+ * @returns {Promise}
+ * @memberof ShareURL
+ */
+ public async setAccessPolicy(
+ aborter: Aborter,
+ shareAcl?: ISignedIdentifier[]
+ ): Promise {
+ const acl: Models.SignedIdentifier[] = [];
+ for (const identifier of shareAcl || []) {
+ acl.push({
+ accessPolicy: {
+ expiry: truncatedISO8061Date(identifier.accessPolicy.expiry),
+ permission: identifier.accessPolicy.permission,
+ start: truncatedISO8061Date(identifier.accessPolicy.start)
+ },
+ id: identifier.id
+ });
+ }
+
+ return this.context.setAccessPolicy({
+ abortSignal: aborter,
+ shareAcl: acl
+ });
+ }
+
+ /**
+ * Creates a read-only snapshot of a share.
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {IShareCreateSnapshotOptions} [options={}]
+ * @returns {Promise}
+ * @memberof ShareURL
+ */
+ public async createSnapshot(
+ aborter: Aborter,
+ options: IShareCreateSnapshotOptions = {}
+ ): Promise {
+ return this.context.createSnapshot({
+ abortSignal: aborter,
+ ...options
+ });
+ }
+
+ /**
+ * Sets quota for the specified share.
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @param {number} quotaInGB Specifies the maximum size of the share in gigabytes
+ * @returns {Promise}
+ * @memberof ShareURL
+ */
+ public async setQuota(
+ aborter: Aborter,
+ quotaInGB: number
+ ): Promise {
+ if (quotaInGB <= 0 || quotaInGB > 5120) {
+ throw new RangeError(
+ `Share quota must be greater than 0, and less than or equal to 5Tib (5120GB)`
+ );
+ }
+ return this.context.setQuota({
+ abortSignal: aborter,
+ quota: quotaInGB
+ });
+ }
+
+ /**
+ * Retrieves statistics related to the share.
+ *
+ * @param {Aborter} aborter Create a new Aborter instance with Aborter.none or Aborter.timeout(),
+ * goto documents of Aborter for more examples about request cancellation
+ * @returns {Promise}
+ * @memberof ShareURL
+ */
+ public async getStatistics(
+ aborter: Aborter
+ ): Promise {
+ return this.context.getStatistics({
+ abortSignal: aborter
+ });
+ }
+}
diff --git a/file/lib/StorageURL.ts b/file/lib/StorageURL.ts
new file mode 100644
index 0000000..46af1b4
--- /dev/null
+++ b/file/lib/StorageURL.ts
@@ -0,0 +1,118 @@
+import { deserializationPolicy, RequestPolicyFactory } from "ms-rest-js";
+
+import { BrowserPolicyFactory } from "./BrowserPolicyFactory";
+import { Credential } from "./credentials/Credential";
+import { StorageClientContext } from "./generated/storageClientContext";
+import { LoggingPolicyFactory } from "./LoggingPolicyFactory";
+import { IHttpClient, IHttpPipelineLogger, Pipeline } from "./Pipeline";
+import { IRetryOptions, RetryPolicyFactory } from "./RetryPolicyFactory";
+import {
+ ITelemetryOptions,
+ TelemetryPolicyFactory
+} from "./TelemetryPolicyFactory";
+import { UniqueRequestIDPolicyFactory } from "./UniqueRequestIDPolicyFactory";
+import { SERVICE_VERSION } from "./utils/constants";
+
+export { deserializationPolicy };
+
+/**
+ * Option interface for Pipeline.newPipeline method.
+ *
+ * @export
+ * @interface INewPipelineOptions
+ */
+export interface INewPipelineOptions {
+ /**
+ * Telemetry configures the built-in telemetry policy behavior.
+ *
+ * @type {ITelemetryOptions}
+ * @memberof INewPipelineOptions
+ */
+ telemetry?: ITelemetryOptions;
+ retryOptions?: IRetryOptions;
+
+ logger?: IHttpPipelineLogger;
+ httpClient?: IHttpClient;
+}
+
+/**
+ * A ServiceURL represents a based URL class for ServiceURL, ContainerURL and etc.
+ *
+ * @export
+ * @class StorageURL
+ */
+export abstract class StorageURL {
+ /**
+ * A static method used to create a new Pipeline object with Credential provided.
+ *
+ * @static
+ * @param {Credential} credential Such as AnonymousCredential, SharedKeyCredential or TokenCredential.
+ * @param {INewPipelineOptions} [pipelineOptions] Optional. Options.
+ * @returns {Pipeline} A new Pipeline object.
+ * @memberof Pipeline
+ */
+ public static newPipeline(
+ credential: Credential,
+ pipelineOptions: INewPipelineOptions = {}
+ ): Pipeline {
+ // Order is important. Closer to the API at the top & closer to the network at the bottom.
+ // The credential's policy factory must appear close to the wire so it can sign any
+ // changes made by other factories (like UniqueRequestIDPolicyFactory)
+ const factories: RequestPolicyFactory[] = [];
+ factories.push(new TelemetryPolicyFactory(pipelineOptions.telemetry));
+ factories.push(new UniqueRequestIDPolicyFactory());
+ factories.push(new BrowserPolicyFactory());
+ factories.push(deserializationPolicy()); // Default deserializationPolicy is provided by protocol layer
+ factories.push(new RetryPolicyFactory(pipelineOptions.retryOptions));
+ factories.push(new LoggingPolicyFactory());
+ factories.push(credential);
+
+ return new Pipeline(factories, {
+ HTTPClient: pipelineOptions.httpClient,
+ logger: pipelineOptions.logger
+ });
+ }
+
+ /**
+ * Request policy pipeline.
+ *
+ * @internal
+ * @type {Pipeline}
+ * @memberof StorageURL
+ */
+ public readonly pipeline: Pipeline;
+
+ /**
+ * URL string value.
+ *
+ * @type {string}
+ * @memberof StorageURL
+ */
+ public readonly url: string;
+
+ /**
+ * StorageClient is a reference to protocol layer operations entry, which is
+ * generated by AutoRest generator.
+ *
+ * @protected
+ * @type {StorageClient}
+ * @memberof StorageURL
+ */
+ protected readonly storageClientContext: StorageClientContext;
+
+ /**
+ * Creates an instance of StorageURL.
+ * @param {string} url
+ * @param {Pipeline} pipeline
+ * @memberof StorageURL
+ */
+ protected constructor(url: string, pipeline: Pipeline) {
+ this.url = url;
+ this.pipeline = pipeline;
+ this.storageClientContext = new StorageClientContext(
+ url,
+ SERVICE_VERSION,
+ pipeline.toServiceClientOptions()
+ );
+ }
+}
diff --git a/file/lib/TelemetryPolicyFactory.ts b/file/lib/TelemetryPolicyFactory.ts
new file mode 100644
index 0000000..53a80a0
--- /dev/null
+++ b/file/lib/TelemetryPolicyFactory.ts
@@ -0,0 +1,75 @@
+import {
+ isNode,
+ RequestPolicy,
+ RequestPolicyFactory,
+ RequestPolicyOptions
+} from "ms-rest-js";
+import * as os from "os";
+
+import { TelemetryPolicy } from "./policies/TelemetryPolicy";
+import { SDK_VERSION } from "./utils/constants";
+
+/**
+ * Interface of TelemetryPolicy options.
+ *
+ * @export
+ * @interface ITelemetryOptions
+ */
+export interface ITelemetryOptions {
+ value: string;
+}
+
+/**
+ * TelemetryPolicyFactory is a factory class helping generating TelemetryPolicy objects.
+ *
+ * @export
+ * @class TelemetryPolicyFactory
+ * @implements {RequestPolicyFactory}
+ */
+export class TelemetryPolicyFactory implements RequestPolicyFactory {
+ private telemetryString: string;
+
+ /**
+ * Creates an instance of TelemetryPolicyFactory.
+ * @param {ITelemetryOptions} [telemetry]
+ * @memberof TelemetryPolicyFactory
+ */
+ constructor(telemetry?: ITelemetryOptions) {
+ const userAgentInfo: string[] = [];
+
+ if (isNode) {
+ if (telemetry) {
+ const telemetryString = telemetry.value;
+ if (
+ telemetryString.length > 0 &&
+ userAgentInfo.indexOf(telemetryString) === -1
+ ) {
+ userAgentInfo.push(telemetryString);
+ }
+ }
+
+ // e.g. Azure-Storage/10.0.0
+ const libInfo = `Azure-Storage/${SDK_VERSION}`;
+ if (userAgentInfo.indexOf(libInfo) === -1) {
+ userAgentInfo.push(libInfo);
+ }
+
+ // e.g. (NODE-VERSION 4.9.1; Windows_NT 10.0.16299)
+ const runtimeInfo = `(NODE-VERSION ${
+ process.version
+ }; ${os.type()} ${os.release()})`;
+ if (userAgentInfo.indexOf(runtimeInfo) === -1) {
+ userAgentInfo.push(runtimeInfo);
+ }
+ }
+
+ this.telemetryString = userAgentInfo.join(" ");
+ }
+
+ public create(
+ nextPolicy: RequestPolicy,
+ options: RequestPolicyOptions
+ ): TelemetryPolicy {
+ return new TelemetryPolicy(nextPolicy, options, this.telemetryString);
+ }
+}
diff --git a/file/lib/UniqueRequestIDPolicyFactory.ts b/file/lib/UniqueRequestIDPolicyFactory.ts
new file mode 100644
index 0000000..6337534
--- /dev/null
+++ b/file/lib/UniqueRequestIDPolicyFactory.ts
@@ -0,0 +1,19 @@
+import { RequestPolicy, RequestPolicyFactory, RequestPolicyOptions } from "ms-rest-js";
+
+import { UniqueRequestIDPolicy } from "./policies/UniqueRequestIDPolicy";
+
+/**
+ * UniqueRequestIDPolicyFactory is a factory class helping generating UniqueRequestIDPolicy objects.
+ *
+ * @export
+ * @class UniqueRequestIDPolicyFactory
+ * @implements {RequestPolicyFactory}
+ */
+export class UniqueRequestIDPolicyFactory implements RequestPolicyFactory {
+ public create(
+ nextPolicy: RequestPolicy,
+ options: RequestPolicyOptions
+ ): UniqueRequestIDPolicy {
+ return new UniqueRequestIDPolicy(nextPolicy, options);
+ }
+}
diff --git a/file/lib/credentials/AnonymousCredential.ts b/file/lib/credentials/AnonymousCredential.ts
new file mode 100644
index 0000000..63d3a98
--- /dev/null
+++ b/file/lib/credentials/AnonymousCredential.ts
@@ -0,0 +1,31 @@
+import { RequestPolicy, RequestPolicyOptions } from "ms-rest-js";
+
+import { AnonymousCredentialPolicy } from "../policies/AnonymousCredentialPolicy";
+import { Credential } from "./Credential";
+
+/**
+ * AnonymousCredential provides a credentialPolicyCreator member used to create
+ * AnonymousCredentialPolicy objects. AnonymousCredentialPolicy is used with
+ * HTTP(S) requests that read public resources or for use with Shared Access
+ * Signatures (SAS).
+ *
+ * @export
+ * @class AnonymousCredential
+ * @extends {Credential}
+ */
+export class AnonymousCredential extends Credential {
+ /**
+ * Creates an AnonymousCredentialPolicy object.
+ *
+ * @param {RequestPolicy} nextPolicy
+ * @param {RequestPolicyOptions} options
+ * @returns {AnonymousCredentialPolicy}
+ * @memberof AnonymousCredential
+ */
+ public create(
+ nextPolicy: RequestPolicy,
+ options: RequestPolicyOptions
+ ): AnonymousCredentialPolicy {
+ return new AnonymousCredentialPolicy(nextPolicy, options);
+ }
+}
diff --git a/file/lib/credentials/Credential.ts b/file/lib/credentials/Credential.ts
new file mode 100644
index 0000000..c157d52
--- /dev/null
+++ b/file/lib/credentials/Credential.ts
@@ -0,0 +1,42 @@
+import {
+ RequestPolicy,
+ RequestPolicyFactory,
+ RequestPolicyOptions
+} from "ms-rest-js";
+
+import { CredentialPolicy } from "../policies/CredentialPolicy";
+
+/**
+ * Credential is an abstract class for Azure Storage HTTP requests signing. This
+ * class will host an credentialPolicyCreator factory which generates CredentialPolicy.
+ *
+ * @export
+ * @abstract
+ * @class Credential
+ */
+export abstract class Credential implements RequestPolicyFactory {
+ /**
+ * Creates a RequestPolicy object.
+ *
+ * @param {RequestPolicy} _nextPolicy
+ * @param {RequestPolicyOptions} _options
+ * @returns {RequestPolicy}
+ * @memberof Credential
+ */
+ public create(
+ // tslint:disable-next-line:variable-name
+ _nextPolicy: RequestPolicy,
+ // tslint:disable-next-line:variable-name
+ _options: RequestPolicyOptions
+ ): RequestPolicy {
+ throw new Error("Method should be implemented in children classes.");
+ }
+}
+
+/**
+ * A factory function that creates a new CredentialPolicy that uses the provided nextPolicy.
+ */
+export type CredentialPolicyCreator = (
+ nextPolicy: RequestPolicy,
+ options: RequestPolicyOptions
+) => CredentialPolicy;
diff --git a/file/lib/credentials/SharedKeyCredential.ts b/file/lib/credentials/SharedKeyCredential.ts
new file mode 100644
index 0000000..0db8299
--- /dev/null
+++ b/file/lib/credentials/SharedKeyCredential.ts
@@ -0,0 +1,72 @@
+import * as Crypto from "crypto";
+import { RequestPolicy, RequestPolicyOptions } from "ms-rest-js";
+
+import { SharedKeyCredentialPolicy } from "../policies/SharedKeyCredentialPolicy";
+import { Credential } from "./Credential";
+
+/**
+ * ONLY AVAILABLE IN NODE.JS RUNTIME.
+ *
+ * SharedKeyCredential for account key authorization of Azure Storage service.
+ *
+ * @export
+ * @class SharedKeyCredential
+ * @extends {Credential}
+ */
+export class SharedKeyCredential extends Credential {
+ /**
+ * Azure Storage account name; readonly.
+ *
+ * @type {string}
+ * @memberof SharedKeyCredential
+ */
+ public readonly accountName: string;
+
+ /**
+ * Azure Storage account key; readonly.
+ *
+ * @type {Buffer}
+ * @memberof SharedKeyCredential
+ */
+ private readonly accountKey: Buffer;
+
+ /**
+ * Creates an instance of SharedKeyCredential.
+ * @param {string} accountName
+ * @param {string} accountKey
+ * @memberof SharedKeyCredential
+ */
+ constructor(accountName: string, accountKey: string) {
+ super();
+ this.accountName = accountName;
+ this.accountKey = Buffer.from(accountKey, "base64");
+ }
+
+ /**
+ * Creates a SharedKeyCredentialPolicy object.
+ *
+ * @param {RequestPolicy} nextPolicy
+ * @param {RequestPolicyOptions} options
+ * @returns {SharedKeyCredentialPolicy}
+ * @memberof SharedKeyCredential
+ */
+ public create(
+ nextPolicy: RequestPolicy,
+ options: RequestPolicyOptions
+ ): SharedKeyCredentialPolicy {
+ return new SharedKeyCredentialPolicy(nextPolicy, options, this);
+ }
+
+ /**
+ * Generates a hash signature for an HTTP request or for a SAS.
+ *
+ * @param {string} stringToSign
+ * @returns {string}
+ * @memberof SharedKeyCredential
+ */
+ public computeHMACSHA256(stringToSign: string): string {
+ return Crypto.createHmac("sha256", this.accountKey)
+ .update(stringToSign, "utf8")
+ .digest("base64");
+ }
+}
diff --git a/file/lib/credentials/TokenCredential.ts b/file/lib/credentials/TokenCredential.ts
new file mode 100644
index 0000000..2778c04
--- /dev/null
+++ b/file/lib/credentials/TokenCredential.ts
@@ -0,0 +1,65 @@
+import { RequestPolicy, RequestPolicyOptions } from "ms-rest-js";
+
+import { Credential } from "../credentials/Credential";
+import { TokenCredentialPolicy } from "../policies/TokenCredentialPolicy";
+
+/**
+ * TokenCredential is a Credential used to generate a TokenCredentialPolicy.
+ * Renew token by setting a new token string value to token property.
+ *
+ * @example
+ * const tokenCredential = new TokenCredential("token");
+ * const pipeline = StorageURL.newPipeline(tokenCredential);
+ *
+ * // List containers
+ * const serviceURL = new ServiceURL("https://mystorageaccount.blob.core.windows.net", pipeline);
+ *
+ * // Set up a timer to refresh the token
+ * const timerID = setInterval(() => {
+ * // Update token by accessing to public tokenCredential.token
+ * tokenCredential.token = "updatedToken";
+ * // WARNING: Timer must be manually stopped! It will forbid GC of tokenCredential
+ * if (shouldStop()) {
+ * clearInterval(timerID);
+ * }
+ * }, 60 * 60 * 1000); // Set an interval time before your token expired
+ * @export
+ * @class TokenCredential
+ * @extends {Credential}
+ *
+ */
+export class TokenCredential extends Credential {
+ /**
+ * Mutable token value. You can set a renewed token value to this property,
+ * for example, when an OAuth token is expired.
+ *
+ * @type {string}
+ * @memberof TokenCredential
+ */
+ public token: string;
+
+ /**
+ * Creates an instance of TokenCredential.
+ * @param {string} token
+ * @memberof TokenCredential
+ */
+ constructor(token: string) {
+ super();
+ this.token = token;
+ }
+
+ /**
+ * Creates a TokenCredentialPolicy object.
+ *
+ * @param {RequestPolicy} nextPolicy
+ * @param {RequestPolicyOptions} options
+ * @returns {TokenCredentialPolicy}
+ * @memberof TokenCredential
+ */
+ public create(
+ nextPolicy: RequestPolicy,
+ options: RequestPolicyOptions
+ ): TokenCredentialPolicy {
+ return new TokenCredentialPolicy(nextPolicy, options, this);
+ }
+}
diff --git a/file/lib/generated/models/directoryMappers.ts b/file/lib/generated/models/directoryMappers.ts
new file mode 100644
index 0000000..72153be
--- /dev/null
+++ b/file/lib/generated/models/directoryMappers.ts
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+export {
+ discriminators,
+ DirectoryCreateHeaders,
+ StorageError,
+ DirectoryGetPropertiesHeaders,
+ DirectoryDeleteHeaders,
+ DirectorySetMetadataHeaders,
+ ListFilesAndDirectoriesSegmentResponse,
+ Entry,
+ DirectoryListFilesAndDirectoriesSegmentHeaders,
+ DirectoryItem,
+ FileItem,
+ FileProperty
+} from "../models/mappers";
+
diff --git a/file/lib/generated/models/fileMappers.ts b/file/lib/generated/models/fileMappers.ts
new file mode 100644
index 0000000..1f09fae
--- /dev/null
+++ b/file/lib/generated/models/fileMappers.ts
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+export {
+ discriminators,
+ FileCreateHeaders,
+ StorageError,
+ FileDownloadHeaders,
+ FileGetPropertiesHeaders,
+ FileDeleteHeaders,
+ FileSetHTTPHeadersHeaders,
+ FileSetMetadataHeaders,
+ FileUploadRangeHeaders,
+ Range,
+ FileGetRangeListHeaders,
+ FileStartCopyHeaders,
+ FileAbortCopyHeaders
+} from "../models/mappers";
+
diff --git a/file/lib/generated/models/index.ts b/file/lib/generated/models/index.ts
new file mode 100644
index 0000000..88ba423
--- /dev/null
+++ b/file/lib/generated/models/index.ts
@@ -0,0 +1,2877 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * 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 * as msRest from "ms-rest-js";
+
+
+/**
+ * @interface
+ * An interface representing AccessPolicy.
+ * An Access policy.
+ *
+ */
+export interface AccessPolicy {
+ /**
+ * @member {string} [start] The date-time the policy is active.
+ * **NOTE: This entity will be treated as a string instead of a Date because
+ * the API can potentially deal with a higher precision value than what is
+ * supported by JavaScript.**
+ */
+ start?: string;
+ /**
+ * @member {string} [expiry] The date-time the policy expires.
+ * **NOTE: This entity will be treated as a string instead of a Date because
+ * the API can potentially deal with a higher precision value than what is
+ * supported by JavaScript.**
+ */
+ expiry?: string;
+ /**
+ * @member {string} [permission] The permissions for the ACL policy.
+ */
+ permission?: string;
+}
+
+/**
+ * @interface
+ * An interface representing CorsRule.
+ * CORS is an HTTP feature that enables a web application running under one
+ * domain to access resources in another domain. Web browsers implement a
+ * security restriction known as same-origin policy that prevents a web page
+ * from calling APIs in a different domain; CORS provides a secure way to allow
+ * one domain (the origin domain) to call APIs in another domain.
+ *
+ */
+export interface CorsRule {
+ /**
+ * @member {string} allowedOrigins The origin domains that are permitted to
+ * make a request against the storage service via CORS. The origin domain is
+ * the domain from which the request originates. Note that the origin must be
+ * an exact case-sensitive match with the origin that the user age sends to
+ * the service. You can also use the wildcard character '*' to allow all
+ * origin domains to make requests via CORS.
+ */
+ allowedOrigins: string;
+ /**
+ * @member {string} allowedMethods The methods (HTTP request verbs) that the
+ * origin domain may use for a CORS request. (comma separated)
+ */
+ allowedMethods: string;
+ /**
+ * @member {string} allowedHeaders The request headers that the origin domain
+ * may specify on the CORS request.
+ */
+ allowedHeaders: string;
+ /**
+ * @member {string} exposedHeaders The response headers that may be sent in
+ * the response to the CORS request and exposed by the browser to the request
+ * issuer.
+ */
+ exposedHeaders: string;
+ /**
+ * @member {number} maxAgeInSeconds The maximum amount time that a browser
+ * should cache the preflight OPTIONS request.
+ */
+ maxAgeInSeconds: number;
+}
+
+/**
+ * Contains the possible cases for Entry.
+ */
+export type EntryUnion = Entry | DirectoryItem | FileItem;
+
+/**
+ * @interface
+ * An interface representing Entry.
+ * Abstract for entries that can be listed from Directory.
+ *
+ */
+export interface Entry {
+ /**
+ * @member {string} entryType Polymorphic Discriminator
+ */
+ entryType: "Entry";
+ /**
+ * @member {string} name Name of the entry.
+ */
+ name: string;
+}
+
+/**
+ * @interface
+ * An interface representing DirectoryItem.
+ * A listed directory item.
+ *
+ */
+export interface DirectoryItem {
+ /**
+ * @member {string} entryType Polymorphic Discriminator
+ */
+ entryType: "Directory";
+ /**
+ * @member {string} name Name of the entry.
+ */
+ name: string;
+}
+
+/**
+ * @interface
+ * An interface representing FileProperty.
+ * File properties.
+ *
+ */
+export interface FileProperty {
+ /**
+ * @member {number} contentLength Content length of the file. This value may
+ * not be up-to-date since an SMB client may have modified the file locally.
+ * The value of Content-Length may not reflect that fact until the handle is
+ * closed or the op-lock is broken. To retrieve current property values, call
+ * Get File Properties.
+ */
+ contentLength: number;
+}
+
+/**
+ * @interface
+ * An interface representing FileItem.
+ * A listed file item.
+ *
+ */
+export interface FileItem {
+ /**
+ * @member {string} entryType Polymorphic Discriminator
+ */
+ entryType: "File";
+ /**
+ * @member {string} name Name of the entry.
+ */
+ name: string;
+ /**
+ * @member {FileProperty} properties
+ */
+ properties: FileProperty;
+}
+
+/**
+ * @interface
+ * An interface representing ListFilesAndDirectoriesSegmentResponse.
+ * An enumeration of directories and files.
+ *
+ */
+export interface ListFilesAndDirectoriesSegmentResponse {
+ /**
+ * @member {string} serviceEndpoint
+ */
+ serviceEndpoint: string;
+ /**
+ * @member {string} shareName
+ */
+ shareName: string;
+ /**
+ * @member {string} [shareSnapshot]
+ */
+ shareSnapshot?: string;
+ /**
+ * @member {string} directoryPath
+ */
+ directoryPath: string;
+ /**
+ * @member {string} prefix
+ */
+ prefix: string;
+ /**
+ * @member {string} [marker]
+ */
+ marker?: string;
+ /**
+ * @member {number} [maxResults]
+ */
+ maxResults?: number;
+ /**
+ * @member {EntryUnion[]} [entries]
+ */
+ entries?: EntryUnion[];
+ /**
+ * @member {string} nextMarker
+ */
+ nextMarker: string;
+}
+
+/**
+ * @interface
+ * An interface representing ShareProperties.
+ * Properties of a share.
+ *
+ */
+export interface ShareProperties {
+ /**
+ * @member {Date} lastModified
+ */
+ lastModified: Date;
+ /**
+ * @member {string} etag
+ */
+ etag: string;
+ /**
+ * @member {number} quota
+ */
+ quota: number;
+}
+
+/**
+ * @interface
+ * An interface representing ShareItem.
+ * A listed Azure Storage share item.
+ *
+ */
+export interface ShareItem {
+ /**
+ * @member {string} name
+ */
+ name: string;
+ /**
+ * @member {string} [snapshot]
+ */
+ snapshot?: string;
+ /**
+ * @member {ShareProperties} properties
+ */
+ properties: ShareProperties;
+ /**
+ * @member {{ [propertyName: string]: string }} [metadata]
+ */
+ metadata?: { [propertyName: string]: string };
+}
+
+/**
+ * @interface
+ * An interface representing ListSharesResponse.
+ * An enumeration of shares.
+ *
+ */
+export interface ListSharesResponse {
+ /**
+ * @member {string} serviceEndpoint
+ */
+ serviceEndpoint: string;
+ /**
+ * @member {string} [prefix]
+ */
+ prefix?: string;
+ /**
+ * @member {string} [marker]
+ */
+ marker?: string;
+ /**
+ * @member {number} [maxResults]
+ */
+ maxResults?: number;
+ /**
+ * @member {ShareItem[]} [shareItems]
+ */
+ shareItems?: ShareItem[];
+ /**
+ * @member {string} nextMarker
+ */
+ nextMarker: string;
+}
+
+/**
+ * @interface
+ * An interface representing RetentionPolicy.
+ * The retention policy.
+ *
+ */
+export interface RetentionPolicy {
+ /**
+ * @member {boolean} enabled Indicates whether a retention policy is enabled
+ * for the File service. If false, metrics data is retained, and the user is
+ * responsible for deleting it.
+ */
+ enabled: boolean;
+ /**
+ * @member {number} [days] Indicates the number of days that metrics data
+ * should be retained. All data older than this value will be deleted.
+ * Metrics data is deleted on a best-effort basis after the retention period
+ * expires.
+ */
+ days?: number;
+}
+
+/**
+ * @interface
+ * An interface representing Metrics.
+ * Storage Analytics metrics for file service.
+ *
+ */
+export interface Metrics {
+ /**
+ * @member {string} version The version of Storage Analytics to configure.
+ */
+ version: string;
+ /**
+ * @member {boolean} enabled Indicates whether metrics are enabled for the
+ * File service.
+ */
+ enabled: boolean;
+ /**
+ * @member {boolean} [includeAPIs] Indicates whether metrics should generate
+ * summary statistics for called API operations.
+ */
+ includeAPIs?: boolean;
+ /**
+ * @member {RetentionPolicy} [retentionPolicy]
+ */
+ retentionPolicy?: RetentionPolicy;
+}
+
+/**
+ * @interface
+ * An interface representing Range.
+ * An Azure Storage file range.
+ *
+ */
+export interface Range {
+ /**
+ * @member {number} start Start of the range.
+ */
+ start: number;
+ /**
+ * @member {number} end End of the range.
+ */
+ end: number;
+}
+
+/**
+ * @interface
+ * An interface representing StorageError.
+ */
+export interface StorageError {
+ /**
+ * @member {string} [message]
+ */
+ message?: string;
+}
+
+/**
+ * @interface
+ * An interface representing ShareStats.
+ * Stats for the share.
+ *
+ */
+export interface ShareStats {
+ /**
+ * @member {number} shareUsage The approximate size of the data stored on the
+ * share, rounded up to the nearest gigabyte. Note that this value may not
+ * include all recently created or recently resized files.
+ */
+ shareUsage: number;
+}
+
+/**
+ * @interface
+ * An interface representing SignedIdentifier.
+ * Signed identifier.
+ *
+ */
+export interface SignedIdentifier {
+ /**
+ * @member {string} id A unique id.
+ */
+ id: string;
+ /**
+ * @member {AccessPolicy} [accessPolicy] The access policy.
+ */
+ accessPolicy?: AccessPolicy;
+}
+
+/**
+ * @interface
+ * An interface representing StorageServiceProperties.
+ * Storage service properties.
+ *
+ */
+export interface StorageServiceProperties {
+ /**
+ * @member {Metrics} [hourMetrics] A summary of request statistics grouped by
+ * API in hourly aggregates for files.
+ */
+ hourMetrics?: Metrics;
+ /**
+ * @member {Metrics} [minuteMetrics] A summary of request statistics grouped
+ * by API in minute aggregates for files.
+ */
+ minuteMetrics?: Metrics;
+ /**
+ * @member {CorsRule[]} [cors] The set of CORS rules.
+ */
+ cors?: CorsRule[];
+}
+
+/**
+ * @interface
+ * An interface representing ServiceSetPropertiesOptionalParams.
+ * Optional Parameters.
+ *
+ * @extends RequestOptionsBase
+ */
+export interface ServiceSetPropertiesOptionalParams extends msRest.RequestOptionsBase {
+ /**
+ * @member {number} [timeout] The timeout parameter is expressed in seconds.
+ * For more information, see Setting
+ * Timeouts for File Service Operations.
+ */
+ timeout?: number;
+}
+
+/**
+ * @interface
+ * An interface representing ServiceGetPropertiesOptionalParams.
+ * Optional Parameters.
+ *
+ * @extends RequestOptionsBase
+ */
+export interface ServiceGetPropertiesOptionalParams extends msRest.RequestOptionsBase {
+ /**
+ * @member {number} [timeout] The timeout parameter is expressed in seconds.
+ * For more information, see Setting
+ * Timeouts for File Service Operations.
+ */
+ timeout?: number;
+}
+
+/**
+ * @interface
+ * An interface representing ServiceListSharesSegmentOptionalParams.
+ * Optional Parameters.
+ *
+ * @extends RequestOptionsBase
+ */
+export interface ServiceListSharesSegmentOptionalParams extends msRest.RequestOptionsBase {
+ /**
+ * @member {string} [prefix] Filters the results to return only entries whose
+ * name begins with the specified prefix.
+ */
+ prefix?: string;
+ /**
+ * @member {string} [marker] A string value that identifies the portion of
+ * the list to be returned with the next list operation. The operation
+ * returns a marker value within the response body if the list returned was
+ * not complete. The marker value may then be used in a subsequent call to
+ * request the next set of list items. The marker value is opaque to the
+ * client.
+ */
+ marker?: string;
+ /**
+ * @member {number} [maxresults] Specifies the maximum number of entries to
+ * return. If the request does not specify maxresults, or specifies a value
+ * greater than 5,000, the server will return up to 5,000 items.
+ */
+ maxresults?: number;
+ /**
+ * @member {ListSharesIncludeType[]} [include] Include this parameter to
+ * specify one or more datasets to include in the response.
+ */
+ include?: ListSharesIncludeType[];
+ /**
+ * @member {number} [timeout] The timeout parameter is expressed in seconds.
+ * For more information, see Setting
+ * Timeouts for File Service Operations.
+ */
+ timeout?: number;
+}
+
+/**
+ * @interface
+ * An interface representing ShareCreateOptionalParams.
+ * Optional Parameters.
+ *
+ * @extends RequestOptionsBase
+ */
+export interface ShareCreateOptionalParams extends msRest.RequestOptionsBase {
+ /**
+ * @member {number} [timeout] The timeout parameter is expressed in seconds.
+ * For more information, see Setting
+ * Timeouts for File Service Operations.
+ */
+ timeout?: number;
+ /**
+ * @member {{ [propertyName: string]: string }} [metadata] A name-value pair
+ * to associate with a file storage object.
+ */
+ metadata?: { [propertyName: string]: string };
+ /**
+ * @member {number} [quota] Specifies the maximum size of the share, in
+ * gigabytes.
+ */
+ quota?: number;
+}
+
+/**
+ * @interface
+ * An interface representing ShareGetPropertiesOptionalParams.
+ * Optional Parameters.
+ *
+ * @extends RequestOptionsBase
+ */
+export interface ShareGetPropertiesOptionalParams extends msRest.RequestOptionsBase {
+ /**
+ * @member {string} [sharesnapshot] The snapshot parameter is an opaque
+ * DateTime value that, when present, specifies the share snapshot to query.
+ */
+ sharesnapshot?: string;
+ /**
+ * @member {number} [timeout] The timeout parameter is expressed in seconds.
+ * For more information, see Setting
+ * Timeouts for File Service Operations.
+ */
+ timeout?: number;
+}
+
+/**
+ * @interface
+ * An interface representing ShareDeleteMethodOptionalParams.
+ * Optional Parameters.
+ *
+ * @extends RequestOptionsBase
+ */
+export interface ShareDeleteMethodOptionalParams extends msRest.RequestOptionsBase {
+ /**
+ * @member {string} [sharesnapshot] The snapshot parameter is an opaque
+ * DateTime value that, when present, specifies the share snapshot to query.
+ */
+ sharesnapshot?: string;
+ /**
+ * @member {number} [timeout] The timeout parameter is expressed in seconds.
+ * For more information, see Setting
+ * Timeouts for File Service Operations.
+ */
+ timeout?: number;
+ /**
+ * @member {DeleteSnapshotsOptionType} [deleteSnapshots] Specifies the option
+ * include to delete the base share and all of its snapshots. Possible values
+ * include: 'include'
+ */
+ deleteSnapshots?: DeleteSnapshotsOptionType;
+}
+
+/**
+ * @interface
+ * An interface representing ShareCreateSnapshotOptionalParams.
+ * Optional Parameters.
+ *
+ * @extends RequestOptionsBase
+ */
+export interface ShareCreateSnapshotOptionalParams extends msRest.RequestOptionsBase {
+ /**
+ * @member {number} [timeout] The timeout parameter is expressed in seconds.
+ * For more information, see Setting
+ * Timeouts for File Service Operations.
+ */
+ timeout?: number;
+ /**
+ * @member {{ [propertyName: string]: string }} [metadata] A name-value pair
+ * to associate with a file storage object.
+ */
+ metadata?: { [propertyName: string]: string };
+}
+
+/**
+ * @interface
+ * An interface representing ShareSetQuotaOptionalParams.
+ * Optional Parameters.
+ *
+ * @extends RequestOptionsBase
+ */
+export interface ShareSetQuotaOptionalParams extends msRest.RequestOptionsBase {
+ /**
+ * @member {number} [timeout] The timeout parameter is expressed in seconds.
+ * For more information, see Setting
+ * Timeouts for File Service Operations.
+ */
+ timeout?: number;
+ /**
+ * @member {number} [quota] Specifies the maximum size of the share, in
+ * gigabytes.
+ */
+ quota?: number;
+}
+
+/**
+ * @interface
+ * An interface representing ShareSetMetadataOptionalParams.
+ * Optional Parameters.
+ *
+ * @extends RequestOptionsBase
+ */
+export interface ShareSetMetadataOptionalParams extends msRest.RequestOptionsBase {
+ /**
+ * @member {number} [timeout] The timeout parameter is expressed in seconds.
+ * For more information, see Setting
+ * Timeouts for File Service Operations.
+ */
+ timeout?: number;
+ /**
+ * @member {{ [propertyName: string]: string }} [metadata] A name-value pair
+ * to associate with a file storage object.
+ */
+ metadata?: { [propertyName: string]: string };
+}
+
+/**
+ * @interface
+ * An interface representing ShareGetAccessPolicyOptionalParams.
+ * Optional Parameters.
+ *
+ * @extends RequestOptionsBase
+ */
+export interface ShareGetAccessPolicyOptionalParams extends msRest.RequestOptionsBase {
+ /**
+ * @member {number} [timeout] The timeout parameter is expressed in seconds.
+ * For more information, see Setting
+ * Timeouts for File Service Operations.
+ */
+ timeout?: number;
+}
+
+/**
+ * @interface
+ * An interface representing ShareSetAccessPolicyOptionalParams.
+ * Optional Parameters.
+ *
+ * @extends RequestOptionsBase
+ */
+export interface ShareSetAccessPolicyOptionalParams extends msRest.RequestOptionsBase {
+ /**
+ * @member {SignedIdentifier[]} [shareAcl] The ACL for the share.
+ */
+ shareAcl?: SignedIdentifier[];
+ /**
+ * @member {number} [timeout] The timeout parameter is expressed in seconds.
+ * For more information, see Setting
+ * Timeouts for File Service Operations.
+ */
+ timeout?: number;
+}
+
+/**
+ * @interface
+ * An interface representing ShareGetStatisticsOptionalParams.
+ * Optional Parameters.
+ *
+ * @extends RequestOptionsBase
+ */
+export interface ShareGetStatisticsOptionalParams extends msRest.RequestOptionsBase {
+ /**
+ * @member {number} [timeout] The timeout parameter is expressed in seconds.
+ * For more information, see Setting
+ * Timeouts for File Service Operations.
+ */
+ timeout?: number;
+}
+
+/**
+ * @interface
+ * An interface representing DirectoryCreateOptionalParams.
+ * Optional Parameters.
+ *
+ * @extends RequestOptionsBase
+ */
+export interface DirectoryCreateOptionalParams extends msRest.RequestOptionsBase {
+ /**
+ * @member {number} [timeout] The timeout parameter is expressed in seconds.
+ * For more information, see Setting
+ * Timeouts for File Service Operations.
+ */
+ timeout?: number;
+ /**
+ * @member {{ [propertyName: string]: string }} [metadata] A name-value pair
+ * to associate with a file storage object.
+ */
+ metadata?: { [propertyName: string]: string };
+}
+
+/**
+ * @interface
+ * An interface representing DirectoryGetPropertiesOptionalParams.
+ * Optional Parameters.
+ *
+ * @extends RequestOptionsBase
+ */
+export interface DirectoryGetPropertiesOptionalParams extends msRest.RequestOptionsBase {
+ /**
+ * @member {string} [sharesnapshot] The snapshot parameter is an opaque
+ * DateTime value that, when present, specifies the share snapshot to query.
+ */
+ sharesnapshot?: string;
+ /**
+ * @member {number} [timeout] The timeout parameter is expressed in seconds.
+ * For more information, see Setting
+ * Timeouts for File Service Operations.
+ */
+ timeout?: number;
+}
+
+/**
+ * @interface
+ * An interface representing DirectoryDeleteMethodOptionalParams.
+ * Optional Parameters.
+ *
+ * @extends RequestOptionsBase
+ */
+export interface DirectoryDeleteMethodOptionalParams extends msRest.RequestOptionsBase {
+ /**
+ * @member {number} [timeout] The timeout parameter is expressed in seconds.
+ * For more information, see Setting
+ * Timeouts for File Service Operations.
+ */
+ timeout?: number;
+}
+
+/**
+ * @interface
+ * An interface representing DirectorySetMetadataOptionalParams.
+ * Optional Parameters.
+ *
+ * @extends RequestOptionsBase
+ */
+export interface DirectorySetMetadataOptionalParams extends msRest.RequestOptionsBase {
+ /**
+ * @member {number} [timeout] The timeout parameter is expressed in seconds.
+ * For more information, see Setting
+ * Timeouts for File Service Operations.
+ */
+ timeout?: number;
+ /**
+ * @member {{ [propertyName: string]: string }} [metadata] A name-value pair
+ * to associate with a file storage object.
+ */
+ metadata?: { [propertyName: string]: string };
+}
+
+/**
+ * @interface
+ * An interface representing DirectoryListFilesAndDirectoriesSegmentOptionalParams.
+ * Optional Parameters.
+ *
+ * @extends RequestOptionsBase
+ */
+export interface DirectoryListFilesAndDirectoriesSegmentOptionalParams extends msRest.RequestOptionsBase {
+ /**
+ * @member {string} [prefix] Filters the results to return only entries whose
+ * name begins with the specified prefix.
+ */
+ prefix?: string;
+ /**
+ * @member {string} [sharesnapshot] The snapshot parameter is an opaque
+ * DateTime value that, when present, specifies the share snapshot to query.
+ */
+ sharesnapshot?: string;
+ /**
+ * @member {string} [marker] A string value that identifies the portion of
+ * the list to be returned with the next list operation. The operation
+ * returns a marker value within the response body if the list returned was
+ * not complete. The marker value may then be used in a subsequent call to
+ * request the next set of list items. The marker value is opaque to the
+ * client.
+ */
+ marker?: string;
+ /**
+ * @member {number} [maxresults] Specifies the maximum number of entries to
+ * return. If the request does not specify maxresults, or specifies a value
+ * greater than 5,000, the server will return up to 5,000 items.
+ */
+ maxresults?: number;
+ /**
+ * @member {number} [timeout] The timeout parameter is expressed in seconds.
+ * For more information, see Setting
+ * Timeouts for File Service Operations.
+ */
+ timeout?: number;
+}
+
+/**
+ * @interface
+ * An interface representing FileCreateOptionalParams.
+ * Optional Parameters.
+ *
+ * @extends RequestOptionsBase
+ */
+export interface FileCreateOptionalParams extends msRest.RequestOptionsBase {
+ /**
+ * @member {number} [timeout] The timeout parameter is expressed in seconds.
+ * For more information, see Setting
+ * Timeouts for File Service Operations.
+ */
+ timeout?: number;
+ /**
+ * @member {string} [fileContentType] Sets the MIME content type of the file.
+ * The default type is 'application/octet-stream'.
+ */
+ fileContentType?: string;
+ /**
+ * @member {string} [fileContentEncoding] Specifies which content encodings
+ * have been applied to the file.
+ */
+ fileContentEncoding?: string;
+ /**
+ * @member {string} [fileContentLanguage] Specifies the natural languages
+ * used by this resource.
+ */
+ fileContentLanguage?: string;
+ /**
+ * @member {string} [fileCacheControl] Sets the file's cache control. The
+ * File service stores this value but does not use or modify it.
+ */
+ fileCacheControl?: string;
+ /**
+ * @member {Uint8Array} [fileContentMD5] Sets the file's MD5 hash.
+ */
+ fileContentMD5?: Uint8Array;
+ /**
+ * @member {string} [fileContentDisposition] Sets the file's
+ * Content-Disposition header.
+ */
+ fileContentDisposition?: string;
+ /**
+ * @member {{ [propertyName: string]: string }} [metadata] A name-value pair
+ * to associate with a file storage object.
+ */
+ metadata?: { [propertyName: string]: string };
+}
+
+/**
+ * @interface
+ * An interface representing FileDownloadOptionalParams.
+ * Optional Parameters.
+ *
+ * @extends RequestOptionsBase
+ */
+export interface FileDownloadOptionalParams extends msRest.RequestOptionsBase {
+ /**
+ * @member {number} [timeout] The timeout parameter is expressed in seconds.
+ * For more information, see Setting
+ * Timeouts for File Service Operations.
+ */
+ timeout?: number;
+ /**
+ * @member {string} [range] Return file data only from the specified byte
+ * range.
+ */
+ range?: string;
+ /**
+ * @member {boolean} [rangeGetContentMD5] When this header is set to true and
+ * specified together with the Range header, the service returns the MD5 hash
+ * for the range, as long as the range is less than or equal to 4 MB in size.
+ */
+ rangeGetContentMD5?: boolean;
+}
+
+/**
+ * @interface
+ * An interface representing FileGetPropertiesOptionalParams.
+ * Optional Parameters.
+ *
+ * @extends RequestOptionsBase
+ */
+export interface FileGetPropertiesOptionalParams extends msRest.RequestOptionsBase {
+ /**
+ * @member {string} [sharesnapshot] The snapshot parameter is an opaque
+ * DateTime value that, when present, specifies the share snapshot to query.
+ */
+ sharesnapshot?: string;
+ /**
+ * @member {number} [timeout] The timeout parameter is expressed in seconds.
+ * For more information, see Setting
+ * Timeouts for File Service Operations.
+ */
+ timeout?: number;
+}
+
+/**
+ * @interface
+ * An interface representing FileDeleteMethodOptionalParams.
+ * Optional Parameters.
+ *
+ * @extends RequestOptionsBase
+ */
+export interface FileDeleteMethodOptionalParams extends msRest.RequestOptionsBase {
+ /**
+ * @member {number} [timeout] The timeout parameter is expressed in seconds.
+ * For more information, see Setting
+ * Timeouts for File Service Operations.
+ */
+ timeout?: number;
+}
+
+/**
+ * @interface
+ * An interface representing FileSetHTTPHeadersOptionalParams.
+ * Optional Parameters.
+ *
+ * @extends RequestOptionsBase
+ */
+export interface FileSetHTTPHeadersOptionalParams extends msRest.RequestOptionsBase {
+ /**
+ * @member {number} [timeout] The timeout parameter is expressed in seconds.
+ * For more information, see Setting
+ * Timeouts for File Service Operations.
+ */
+ timeout?: number;
+ /**
+ * @member {number} [fileContentLength] Resizes a file to the specified size.
+ * If the specified byte value is less than the current size of the file,
+ * then all ranges above the specified byte value are cleared.
+ */
+ fileContentLength?: number;
+ /**
+ * @member {string} [fileContentType] Sets the MIME content type of the file.
+ * The default type is 'application/octet-stream'.
+ */
+ fileContentType?: string;
+ /**
+ * @member {string} [fileContentEncoding] Specifies which content encodings
+ * have been applied to the file.
+ */
+ fileContentEncoding?: string;
+ /**
+ * @member {string} [fileContentLanguage] Specifies the natural languages
+ * used by this resource.
+ */
+ fileContentLanguage?: string;
+ /**
+ * @member {string} [fileCacheControl] Sets the file's cache control. The
+ * File service stores this value but does not use or modify it.
+ */
+ fileCacheControl?: string;
+ /**
+ * @member {Uint8Array} [fileContentMD5] Sets the file's MD5 hash.
+ */
+ fileContentMD5?: Uint8Array;
+ /**
+ * @member {string} [fileContentDisposition] Sets the file's
+ * Content-Disposition header.
+ */
+ fileContentDisposition?: string;
+}
+
+/**
+ * @interface
+ * An interface representing FileSetMetadataOptionalParams.
+ * Optional Parameters.
+ *
+ * @extends RequestOptionsBase
+ */
+export interface FileSetMetadataOptionalParams extends msRest.RequestOptionsBase {
+ /**
+ * @member {number} [timeout] The timeout parameter is expressed in seconds.
+ * For more information, see Setting
+ * Timeouts for File Service Operations.
+ */
+ timeout?: number;
+ /**
+ * @member {{ [propertyName: string]: string }} [metadata] A name-value pair
+ * to associate with a file storage object.
+ */
+ metadata?: { [propertyName: string]: string };
+}
+
+/**
+ * @interface
+ * An interface representing FileUploadRangeOptionalParams.
+ * Optional Parameters.
+ *
+ * @extends RequestOptionsBase
+ */
+export interface FileUploadRangeOptionalParams extends msRest.RequestOptionsBase {
+ /**
+ * @member {msRest.HttpRequestBody} [optionalbody] Initial data.
+ */
+ optionalbody?: msRest.HttpRequestBody;
+ /**
+ * @member {number} [timeout] The timeout parameter is expressed in seconds.
+ * For more information, see Setting
+ * Timeouts for File Service Operations.
+ */
+ timeout?: number;
+ /**
+ * @member {Uint8Array} [contentMD5] An MD5 hash of the content. This hash is
+ * used to verify the integrity of the data during transport. When the
+ * Content-MD5 header is specified, the File service compares the hash of the
+ * content that has arrived with the header value that was sent. If the two
+ * hashes do not match, the operation will fail with error code 400 (Bad
+ * Request).
+ */
+ contentMD5?: Uint8Array;
+}
+
+/**
+ * @interface
+ * An interface representing FileGetRangeListOptionalParams.
+ * Optional Parameters.
+ *
+ * @extends RequestOptionsBase
+ */
+export interface FileGetRangeListOptionalParams extends msRest.RequestOptionsBase {
+ /**
+ * @member {string} [sharesnapshot] The snapshot parameter is an opaque
+ * DateTime value that, when present, specifies the share snapshot to query.
+ */
+ sharesnapshot?: string;
+ /**
+ * @member {number} [timeout] The timeout parameter is expressed in seconds.
+ * For more information, see Setting
+ * Timeouts for File Service Operations.
+ */
+ timeout?: number;
+ /**
+ * @member {string} [range] Specifies the range of bytes over which to list
+ * ranges, inclusively.
+ */
+ range?: string;
+}
+
+/**
+ * @interface
+ * An interface representing FileStartCopyOptionalParams.
+ * Optional Parameters.
+ *
+ * @extends RequestOptionsBase
+ */
+export interface FileStartCopyOptionalParams extends msRest.RequestOptionsBase {
+ /**
+ * @member {number} [timeout] The timeout parameter is expressed in seconds.
+ * For more information, see Setting
+ * Timeouts for File Service Operations.
+ */
+ timeout?: number;
+ /**
+ * @member {{ [propertyName: string]: string }} [metadata] A name-value pair
+ * to associate with a file storage object.
+ */
+ metadata?: { [propertyName: string]: string };
+}
+
+/**
+ * @interface
+ * An interface representing FileAbortCopyOptionalParams.
+ * Optional Parameters.
+ *
+ * @extends RequestOptionsBase
+ */
+export interface FileAbortCopyOptionalParams extends msRest.RequestOptionsBase {
+ /**
+ * @member {number} [timeout] The timeout parameter is expressed in seconds.
+ * For more information, see Setting
+ * Timeouts for File Service Operations.
+ */
+ timeout?: number;
+}
+
+/**
+ * @interface
+ * An interface representing ServiceSetPropertiesHeaders.
+ * Defines headers for SetProperties operation.
+ *
+ */
+export interface ServiceSetPropertiesHeaders {
+ /**
+ * @member {string} [requestId] This header uniquely identifies the request
+ * that was made and can be used for troubleshooting the request.
+ */
+ requestId?: string;
+ /**
+ * @member {string} [version] Indicates the version of the File service used
+ * to execute the request.
+ */
+ version?: string;
+ /**
+ * @member {string} [errorCode]
+ */
+ errorCode?: string;
+}
+
+/**
+ * @interface
+ * An interface representing ServiceGetPropertiesHeaders.
+ * Defines headers for GetProperties operation.
+ *
+ */
+export interface ServiceGetPropertiesHeaders {
+ /**
+ * @member {string} [requestId] This header uniquely identifies the request
+ * that was made and can be used for troubleshooting the request.
+ */
+ requestId?: string;
+ /**
+ * @member {string} [version] Indicates the version of the File service used
+ * to execute the request.
+ */
+ version?: string;
+ /**
+ * @member {string} [errorCode]
+ */
+ errorCode?: string;
+}
+
+/**
+ * @interface
+ * An interface representing ServiceListSharesSegmentHeaders.
+ * Defines headers for ListSharesSegment operation.
+ *
+ */
+export interface ServiceListSharesSegmentHeaders {
+ /**
+ * @member {string} [requestId] This header uniquely identifies the request
+ * that was made and can be used for troubleshooting the request.
+ */
+ requestId?: string;
+ /**
+ * @member {string} [version] Indicates the version of the File service used
+ * to execute the request.
+ */
+ version?: string;
+ /**
+ * @member {string} [errorCode]
+ */
+ errorCode?: string;
+}
+
+/**
+ * @interface
+ * An interface representing ShareCreateHeaders.
+ * Defines headers for Create operation.
+ *
+ */
+export interface ShareCreateHeaders {
+ /**
+ * @member {string} [eTag] The ETag contains a value which represents the
+ * version of the share, in quotes.
+ */
+ eTag?: string;
+ /**
+ * @member {Date} [lastModified] Returns the date and time the share was last
+ * modified. Any operation that modifies the share or its properties or
+ * metadata updates the last modified time. Operations on files do not affect
+ * the last modified time of the share.
+ */
+ lastModified?: Date;
+ /**
+ * @member {string} [requestId] This header uniquely identifies the request
+ * that was made and can be used for troubleshooting the request.
+ */
+ requestId?: string;
+ /**
+ * @member {string} [version] Indicates the version of the File service used
+ * to execute the request.
+ */
+ version?: string;
+ /**
+ * @member {Date} [date] A UTC date/time value generated by the service that
+ * indicates the time at which the response was initiated.
+ */
+ date?: Date;
+ /**
+ * @member {string} [errorCode]
+ */
+ errorCode?: string;
+}
+
+/**
+ * @interface
+ * An interface representing ShareGetPropertiesHeaders.
+ * Defines headers for GetProperties operation.
+ *
+ */
+export interface ShareGetPropertiesHeaders {
+ /**
+ * @member {{ [propertyName: string]: string }} [metadata]
+ */
+ metadata?: { [propertyName: string]: string };
+ /**
+ * @member {string} [eTag] The ETag contains a value that you can use to
+ * perform operations conditionally, in quotes.
+ */
+ eTag?: string;
+ /**
+ * @member {Date} [lastModified] Returns the date and time the share was last
+ * modified. Any operation that modifies the share or its properties updates
+ * the last modified time. Operations on files do not affect the last
+ * modified time of the share.
+ */
+ lastModified?: Date;
+ /**
+ * @member {string} [requestId] This header uniquely identifies the request
+ * that was made and can be used for troubleshooting the request.
+ */
+ requestId?: string;
+ /**
+ * @member {string} [version] Indicates the version of the File service used
+ * to execute the request.
+ */
+ version?: string;
+ /**
+ * @member {Date} [date] A UTC date/time value generated by the service that
+ * indicates the time at which the response was initiated.
+ */
+ date?: Date;
+ /**
+ * @member {number} [quota] Returns the current share quota in GB.
+ */
+ quota?: number;
+ /**
+ * @member {string} [errorCode]
+ */
+ errorCode?: string;
+}
+
+/**
+ * @interface
+ * An interface representing ShareDeleteHeaders.
+ * Defines headers for Delete operation.
+ *
+ */
+export interface ShareDeleteHeaders {
+ /**
+ * @member {string} [requestId] This header uniquely identifies the request
+ * that was made and can be used for troubleshooting the request.
+ */
+ requestId?: string;
+ /**
+ * @member {string} [version] Indicates the version of the File service used
+ * to execute the request.
+ */
+ version?: string;
+ /**
+ * @member {Date} [date] A UTC date/time value generated by the service that
+ * indicates the time at which the response was initiated.
+ */
+ date?: Date;
+ /**
+ * @member {string} [errorCode]
+ */
+ errorCode?: string;
+}
+
+/**
+ * @interface
+ * An interface representing ShareCreateSnapshotHeaders.
+ * Defines headers for CreateSnapshot operation.
+ *
+ */
+export interface ShareCreateSnapshotHeaders {
+ /**
+ * @member {string} [snapshot] This header is a DateTime value that uniquely
+ * identifies the share snapshot. The value of this header may be used in
+ * subsequent requests to access the share snapshot. This value is opaque.
+ */
+ snapshot?: string;
+ /**
+ * @member {string} [eTag] The ETag contains a value which represents the
+ * version of the share snapshot, in quotes. A share snapshot cannot be
+ * modified, so the ETag of a given share snapshot never changes. However, if
+ * new metadata was supplied with the Snapshot Share request then the ETag of
+ * the share snapshot differs from that of the base share. If no metadata was
+ * specified with the request, the ETag of the share snapshot is identical to
+ * that of the base share at the time the share snapshot was taken.
+ */
+ eTag?: string;
+ /**
+ * @member {Date} [lastModified] Returns the date and time the share was last
+ * modified. A share snapshot cannot be modified, so the last modified time
+ * of a given share snapshot never changes. However, if new metadata was
+ * supplied with the Snapshot Share request then the last modified time of
+ * the share snapshot differs from that of the base share. If no metadata was
+ * specified with the request, the last modified time of the share snapshot
+ * is identical to that of the base share at the time the share snapshot was
+ * taken.
+ */
+ lastModified?: Date;
+ /**
+ * @member {string} [requestId] This header uniquely identifies the request
+ * that was made and can be used for troubleshooting the request.
+ */
+ requestId?: string;
+ /**
+ * @member {string} [version] Indicates the version of the File service used
+ * to execute the request.
+ */
+ version?: string;
+ /**
+ * @member {Date} [date] A UTC date/time value generated by the service that
+ * indicates the time at which the response was initiated.
+ */
+ date?: Date;
+ /**
+ * @member {string} [errorCode]
+ */
+ errorCode?: string;
+}
+
+/**
+ * @interface
+ * An interface representing ShareSetQuotaHeaders.
+ * Defines headers for SetQuota operation.
+ *
+ */
+export interface ShareSetQuotaHeaders {
+ /**
+ * @member {string} [eTag] The ETag contains a value that you can use to
+ * perform operations conditionally, in quotes.
+ */
+ eTag?: string;
+ /**
+ * @member {Date} [lastModified] Returns the date and time the share was last
+ * modified. Any operation that modifies the share or its properties updates
+ * the last modified time. Operations on files do not affect the last
+ * modified time of the share.
+ */
+ lastModified?: Date;
+ /**
+ * @member {string} [requestId] This header uniquely identifies the request
+ * that was made and can be used for troubleshooting the request.
+ */
+ requestId?: string;
+ /**
+ * @member {string} [version] Indicates the version of the File service used
+ * to execute the request.
+ */
+ version?: string;
+ /**
+ * @member {Date} [date] A UTC date/time value generated by the service that
+ * indicates the time at which the response was initiated.
+ */
+ date?: Date;
+ /**
+ * @member {string} [errorCode]
+ */
+ errorCode?: string;
+}
+
+/**
+ * @interface
+ * An interface representing ShareSetMetadataHeaders.
+ * Defines headers for SetMetadata operation.
+ *
+ */
+export interface ShareSetMetadataHeaders {
+ /**
+ * @member {string} [eTag] The ETag contains a value that you can use to
+ * perform operations conditionally, in quotes.
+ */
+ eTag?: string;
+ /**
+ * @member {Date} [lastModified] Returns the date and time the share was last
+ * modified. Any operation that modifies the share or its properties updates
+ * the last modified time. Operations on files do not affect the last
+ * modified time of the share.
+ */
+ lastModified?: Date;
+ /**
+ * @member {string} [requestId] This header uniquely identifies the request
+ * that was made and can be used for troubleshooting the request.
+ */
+ requestId?: string;
+ /**
+ * @member {string} [version] Indicates the version of the File service used
+ * to execute the request.
+ */
+ version?: string;
+ /**
+ * @member {Date} [date] A UTC date/time value generated by the service that
+ * indicates the time at which the response was initiated.
+ */
+ date?: Date;
+ /**
+ * @member {string} [errorCode]
+ */
+ errorCode?: string;
+}
+
+/**
+ * @interface
+ * An interface representing ShareGetAccessPolicyHeaders.
+ * Defines headers for GetAccessPolicy operation.
+ *
+ */
+export interface ShareGetAccessPolicyHeaders {
+ /**
+ * @member {string} [eTag] The ETag contains a value that you can use to
+ * perform operations conditionally, in quotes.
+ */
+ eTag?: string;
+ /**
+ * @member {Date} [lastModified] Returns the date and time the share was last
+ * modified. Any operation that modifies the share or its properties updates
+ * the last modified time. Operations on files do not affect the last
+ * modified time of the share.
+ */
+ lastModified?: Date;
+ /**
+ * @member {string} [requestId] This header uniquely identifies the request
+ * that was made and can be used for troubleshooting the request.
+ */
+ requestId?: string;
+ /**
+ * @member {string} [version] Indicates the version of the File service used
+ * to execute the request.
+ */
+ version?: string;
+ /**
+ * @member {Date} [date] A UTC date/time value generated by the service that
+ * indicates the time at which the response was initiated.
+ */
+ date?: Date;
+ /**
+ * @member {string} [errorCode]
+ */
+ errorCode?: string;
+}
+
+/**
+ * @interface
+ * An interface representing ShareSetAccessPolicyHeaders.
+ * Defines headers for SetAccessPolicy operation.
+ *
+ */
+export interface ShareSetAccessPolicyHeaders {
+ /**
+ * @member {string} [eTag] The ETag contains a value that you can use to
+ * perform operations conditionally, in quotes.
+ */
+ eTag?: string;
+ /**
+ * @member {Date} [lastModified] Returns the date and time the share was last
+ * modified. Any operation that modifies the share or its properties updates
+ * the last modified time. Operations on files do not affect the last
+ * modified time of the share.
+ */
+ lastModified?: Date;
+ /**
+ * @member {string} [requestId] This header uniquely identifies the request
+ * that was made and can be used for troubleshooting the request.
+ */
+ requestId?: string;
+ /**
+ * @member {string} [version] Indicates the version of the File service used
+ * to execute the request.
+ */
+ version?: string;
+ /**
+ * @member {Date} [date] A UTC date/time value generated by the service that
+ * indicates the time at which the response was initiated.
+ */
+ date?: Date;
+ /**
+ * @member {string} [errorCode]
+ */
+ errorCode?: string;
+}
+
+/**
+ * @interface
+ * An interface representing ShareGetStatisticsHeaders.
+ * Defines headers for GetStatistics operation.
+ *
+ */
+export interface ShareGetStatisticsHeaders {
+ /**
+ * @member {string} [eTag] The ETag contains a value that you can use to
+ * perform operations conditionally, in quotes.
+ */
+ eTag?: string;
+ /**
+ * @member {Date} [lastModified] Returns the date and time the share was last
+ * modified. Any operation that modifies the share or its properties updates
+ * the last modified time. Operations on files do not affect the last
+ * modified time of the share.
+ */
+ lastModified?: Date;
+ /**
+ * @member {string} [requestId] This header uniquely identifies the request
+ * that was made and can be used for troubleshooting the request.
+ */
+ requestId?: string;
+ /**
+ * @member {string} [version] Indicates the version of the File service used
+ * to execute the request.
+ */
+ version?: string;
+ /**
+ * @member {Date} [date] A UTC date/time value generated by the service that
+ * indicates the time at which the response was initiated.
+ */
+ date?: Date;
+ /**
+ * @member {string} [errorCode]
+ */
+ errorCode?: string;
+}
+
+/**
+ * @interface
+ * An interface representing DirectoryCreateHeaders.
+ * Defines headers for Create operation.
+ *
+ */
+export interface DirectoryCreateHeaders {
+ /**
+ * @member {string} [eTag] The ETag contains a value which represents the
+ * version of the directory, in quotes.
+ */
+ eTag?: string;
+ /**
+ * @member {Date} [lastModified] Returns the date and time the share was last
+ * modified. Any operation that modifies the directory or its properties
+ * updates the last modified time. Operations on files do not affect the last
+ * modified time of the directory.
+ */
+ lastModified?: Date;
+ /**
+ * @member {string} [requestId] This header uniquely identifies the request
+ * that was made and can be used for troubleshooting the request.
+ */
+ requestId?: string;
+ /**
+ * @member {string} [version] Indicates the version of the File service used
+ * to execute the request.
+ */
+ version?: string;
+ /**
+ * @member {Date} [date] A UTC date/time value generated by the service that
+ * indicates the time at which the response was initiated.
+ */
+ date?: Date;
+ /**
+ * @member {boolean} [isServerEncrypted] The value of this header is set to
+ * true if the contents of the request are successfully encrypted using the
+ * specified algorithm, and false otherwise.
+ */
+ isServerEncrypted?: boolean;
+ /**
+ * @member {string} [errorCode]
+ */
+ errorCode?: string;
+}
+
+/**
+ * @interface
+ * An interface representing DirectoryGetPropertiesHeaders.
+ * Defines headers for GetProperties operation.
+ *
+ */
+export interface DirectoryGetPropertiesHeaders {
+ /**
+ * @member {{ [propertyName: string]: string }} [metadata]
+ */
+ metadata?: { [propertyName: string]: string };
+ /**
+ * @member {string} [eTag] The ETag contains a value that you can use to
+ * perform operations conditionally, in quotes.
+ */
+ eTag?: string;
+ /**
+ * @member {Date} [lastModified] Returns the date and time the Directory was
+ * last modified. Operations on files within the directory do not affect the
+ * last modified time of the directory.
+ */
+ lastModified?: Date;
+ /**
+ * @member {string} [requestId] This header uniquely identifies the request
+ * that was made and can be used for troubleshooting the request.
+ */
+ requestId?: string;
+ /**
+ * @member {string} [version] Indicates the version of the File service used
+ * to execute the request.
+ */
+ version?: string;
+ /**
+ * @member {Date} [date] A UTC date/time value generated by the service that
+ * indicates the time at which the response was initiated.
+ */
+ date?: Date;
+ /**
+ * @member {boolean} [isServerEncrypted] The value of this header is set to
+ * true if the directory metadata is completely encrypted using the specified
+ * algorithm. Otherwise, the value is set to false.
+ */
+ isServerEncrypted?: boolean;
+ /**
+ * @member {string} [errorCode]
+ */
+ errorCode?: string;
+}
+
+/**
+ * @interface
+ * An interface representing DirectoryDeleteHeaders.
+ * Defines headers for Delete operation.
+ *
+ */
+export interface DirectoryDeleteHeaders {
+ /**
+ * @member {string} [requestId] This header uniquely identifies the request
+ * that was made and can be used for troubleshooting the request.
+ */
+ requestId?: string;
+ /**
+ * @member {string} [version] Indicates the version of the File service used
+ * to execute the request.
+ */
+ version?: string;
+ /**
+ * @member {Date} [date] A UTC date/time value generated by the service that
+ * indicates the time at which the response was initiated.
+ */
+ date?: Date;
+ /**
+ * @member {string} [errorCode]
+ */
+ errorCode?: string;
+}
+
+/**
+ * @interface
+ * An interface representing DirectorySetMetadataHeaders.
+ * Defines headers for SetMetadata operation.
+ *
+ */
+export interface DirectorySetMetadataHeaders {
+ /**
+ * @member {string} [eTag] The ETag contains a value which represents the
+ * version of the directory, in quotes.
+ */
+ eTag?: string;
+ /**
+ * @member {string} [requestId] This header uniquely identifies the request
+ * that was made and can be used for troubleshooting the request.
+ */
+ requestId?: string;
+ /**
+ * @member {string} [version] Indicates the version of the File service used
+ * to execute the request.
+ */
+ version?: string;
+ /**
+ * @member {Date} [date] A UTC date/time value generated by the service that
+ * indicates the time at which the response was initiated.
+ */
+ date?: Date;
+ /**
+ * @member {boolean} [isServerEncrypted] The value of this header is set to
+ * true if the contents of the request are successfully encrypted using the
+ * specified algorithm, and false otherwise.
+ */
+ isServerEncrypted?: boolean;
+ /**
+ * @member {string} [errorCode]
+ */
+ errorCode?: string;
+}
+
+/**
+ * @interface
+ * An interface representing DirectoryListFilesAndDirectoriesSegmentHeaders.
+ * Defines headers for ListFilesAndDirectoriesSegment operation.
+ *
+ */
+export interface DirectoryListFilesAndDirectoriesSegmentHeaders {
+ /**
+ * @member {string} [contentType] Specifies the format in which the results
+ * are returned. Currently this value is 'application/xml'.
+ */
+ contentType?: string;
+ /**
+ * @member {string} [requestId] This header uniquely identifies the request
+ * that was made and can be used for troubleshooting the request.
+ */
+ requestId?: string;
+ /**
+ * @member {string} [version] Indicates the version of the File service used
+ * to execute the request.
+ */
+ version?: string;
+ /**
+ * @member {Date} [date] A UTC date/time value generated by the service that
+ * indicates the time at which the response was initiated.
+ */
+ date?: Date;
+ /**
+ * @member {string} [errorCode]
+ */
+ errorCode?: string;
+}
+
+/**
+ * @interface
+ * An interface representing FileCreateHeaders.
+ * Defines headers for Create operation.
+ *
+ */
+export interface FileCreateHeaders {
+ /**
+ * @member {string} [eTag] The ETag contains a value which represents the
+ * version of the file, in quotes.
+ */
+ eTag?: string;
+ /**
+ * @member {Date} [lastModified] Returns the date and time the share was last
+ * modified. Any operation that modifies the directory or its properties
+ * updates the last modified time. Operations on files do not affect the last
+ * modified time of the directory.
+ */
+ lastModified?: Date;
+ /**
+ * @member {string} [requestId] This header uniquely identifies the request
+ * that was made and can be used for troubleshooting the request.
+ */
+ requestId?: string;
+ /**
+ * @member {string} [version] Indicates the version of the File service used
+ * to execute the request.
+ */
+ version?: string;
+ /**
+ * @member {Date} [date] A UTC date/time value generated by the service that
+ * indicates the time at which the response was initiated.
+ */
+ date?: Date;
+ /**
+ * @member {boolean} [isServerEncrypted] The value of this header is set to
+ * true if the contents of the request are successfully encrypted using the
+ * specified algorithm, and false otherwise.
+ */
+ isServerEncrypted?: boolean;
+ /**
+ * @member {string} [errorCode]
+ */
+ errorCode?: string;
+}
+
+/**
+ * @interface
+ * An interface representing FileDownloadHeaders.
+ * Defines headers for Download operation.
+ *
+ */
+export interface FileDownloadHeaders {
+ /**
+ * @member {Date} [lastModified] Returns the date and time the file was last
+ * modified. Any operation that modifies the file or its properties updates
+ * the last modified time.
+ */
+ lastModified?: Date;
+ /**
+ * @member {{ [propertyName: string]: string }} [metadata]
+ */
+ metadata?: { [propertyName: string]: string };
+ /**
+ * @member {number} [contentLength] The number of bytes present in the
+ * response body.
+ */
+ contentLength?: number;
+ /**
+ * @member {string} [contentType] The content type specified for the file.
+ * The default content type is 'application/octet-stream'
+ */
+ contentType?: string;
+ /**
+ * @member {string} [contentRange] Indicates the range of bytes returned if
+ * the client requested a subset of the file by setting the Range request
+ * header.
+ */
+ contentRange?: string;
+ /**
+ * @member {string} [eTag] The ETag contains a value that you can use to
+ * perform operations conditionally, in quotes.
+ */
+ eTag?: string;
+ /**
+ * @member {Uint8Array} [contentMD5] If the file has an MD5 hash and the
+ * request is to read the full file, this response header is returned so that
+ * the client can check for message content integrity. If the request is to
+ * read a specified range and the 'x-ms-range-get-content-md5' is set to
+ * true, then the request returns an MD5 hash for the range, as long as the
+ * range size is less than or equal to 4 MB. If neither of these sets of
+ * conditions is true, then no value is returned for the 'Content-MD5'
+ * header.
+ */
+ contentMD5?: Uint8Array;
+ /**
+ * @member {string} [contentEncoding] Returns the value that was specified
+ * for the Content-Encoding request header.
+ */
+ contentEncoding?: string;
+ /**
+ * @member {string} [cacheControl] Returned if it was previously specified
+ * for the file.
+ */
+ cacheControl?: string;
+ /**
+ * @member {string} [contentDisposition] Returns the value that was specified
+ * for the 'x-ms-content-disposition' header and specifies how to process the
+ * response.
+ */
+ contentDisposition?: string;
+ /**
+ * @member {string} [contentLanguage] Returns the value that was specified
+ * for the Content-Language request header.
+ */
+ contentLanguage?: string;
+ /**
+ * @member {string} [requestId] This header uniquely identifies the request
+ * that was made and can be used for troubleshooting the request.
+ */
+ requestId?: string;
+ /**
+ * @member {string} [version] Indicates the version of the File service used
+ * to execute the request.
+ */
+ version?: string;
+ /**
+ * @member {string} [acceptRanges] Indicates that the service supports
+ * requests for partial file content.
+ */
+ acceptRanges?: string;
+ /**
+ * @member {Date} [date] A UTC date/time value generated by the service that
+ * indicates the time at which the response was initiated.
+ */
+ date?: Date;
+ /**
+ * @member {Date} [copyCompletionTime] Conclusion time of the last attempted
+ * Copy File operation where this file was the destination file. This value
+ * can specify the time of a completed, aborted, or failed copy attempt.
+ */
+ copyCompletionTime?: Date;
+ /**
+ * @member {string} [copyStatusDescription] Only appears when
+ * x-ms-copy-status is failed or pending. Describes cause of fatal or
+ * non-fatal copy operation failure.
+ */
+ copyStatusDescription?: string;
+ /**
+ * @member {string} [copyId] String identifier for the last attempted Copy
+ * File operation where this file was the destination file.
+ */
+ copyId?: string;
+ /**
+ * @member {string} [copyProgress] Contains the number of bytes copied and
+ * the total bytes in the source in the last attempted Copy File operation
+ * where this file was the destination file. Can show between 0 and
+ * Content-Length bytes copied.
+ */
+ copyProgress?: string;
+ /**
+ * @member {string} [copySource] URL up to 2KB in length that specifies the
+ * source file used in the last attempted Copy File operation where this file
+ * was the destination file.
+ */
+ copySource?: string;
+ /**
+ * @member {CopyStatusType} [copyStatus] State of the copy operation
+ * identified by 'x-ms-copy-id'. Possible values include: 'pending',
+ * 'success', 'aborted', 'failed'
+ */
+ copyStatus?: CopyStatusType;
+ /**
+ * @member {Uint8Array} [fileContentMD5] If the file has a MD5 hash, and if
+ * request contains range header (Range or x-ms-range), this response header
+ * is returned with the value of the whole file's MD5 value. This value may
+ * or may not be equal to the value returned in Content-MD5 header, with the
+ * latter calculated from the requested range.
+ */
+ fileContentMD5?: Uint8Array;
+ /**
+ * @member {boolean} [isServerEncrypted] The value of this header is set to
+ * true if the file data and application metadata are completely encrypted
+ * using the specified algorithm. Otherwise, the value is set to false (when
+ * the file is unencrypted, or if only parts of the file/application metadata
+ * are encrypted).
+ */
+ isServerEncrypted?: boolean;
+ /**
+ * @member {string} [errorCode]
+ */
+ errorCode?: string;
+}
+
+/**
+ * @interface
+ * An interface representing FileGetPropertiesHeaders.
+ * Defines headers for GetProperties operation.
+ *
+ */
+export interface FileGetPropertiesHeaders {
+ /**
+ * @member {Date} [lastModified] Returns the date and time the file was last
+ * modified. The date format follows RFC 1123. Any operation that modifies
+ * the file or its properties updates the last modified time.
+ */
+ lastModified?: Date;
+ /**
+ * @member {{ [propertyName: string]: string }} [metadata]
+ */
+ metadata?: { [propertyName: string]: string };
+ /**
+ * @member {FileType} [fileType] Returns the type File. Reserved for future
+ * use. Possible values include: 'File'
+ */
+ fileType?: FileType;
+ /**
+ * @member {number} [contentLength] The size of the file in bytes. This
+ * header returns the value of the 'x-ms-content-length' header that is
+ * stored with the file.
+ */
+ contentLength?: number;
+ /**
+ * @member {string} [contentType] The content type specified for the file.
+ * The default content type is 'application/octet-stream'
+ */
+ contentType?: string;
+ /**
+ * @member {string} [eTag] The ETag contains a value that you can use to
+ * perform operations conditionally, in quotes.
+ */
+ eTag?: string;
+ /**
+ * @member {Uint8Array} [contentMD5] If the Content-MD5 header has been set
+ * for the file, the Content-MD5 response header is returned so that the
+ * client can check for message content integrity.
+ */
+ contentMD5?: Uint8Array;
+ /**
+ * @member {string} [contentEncoding] If the Content-Encoding request header
+ * has previously been set for the file, the Content-Encoding value is
+ * returned in this header.
+ */
+ contentEncoding?: string;
+ /**
+ * @member {string} [cacheControl] If the Cache-Control request header has
+ * previously been set for the file, the Cache-Control value is returned in
+ * this header.
+ */
+ cacheControl?: string;
+ /**
+ * @member {string} [contentDisposition] Returns the value that was specified
+ * for the 'x-ms-content-disposition' header and specifies how to process the
+ * response.
+ */
+ contentDisposition?: string;
+ /**
+ * @member {string} [contentLanguage] Returns the value that was specified
+ * for the Content-Language request header.
+ */
+ contentLanguage?: string;
+ /**
+ * @member {string} [requestId] This header uniquely identifies the request
+ * that was made and can be used for troubleshooting the request.
+ */
+ requestId?: string;
+ /**
+ * @member {string} [version] Indicates the version of the File service used
+ * to execute the request.
+ */
+ version?: string;
+ /**
+ * @member {Date} [date] A UTC date/time value generated by the service that
+ * indicates the time at which the response was initiated.
+ */
+ date?: Date;
+ /**
+ * @member {Date} [copyCompletionTime] Conclusion time of the last attempted
+ * Copy File operation where this file was the destination file. This value
+ * can specify the time of a completed, aborted, or failed copy attempt.
+ */
+ copyCompletionTime?: Date;
+ /**
+ * @member {string} [copyStatusDescription] Only appears when
+ * x-ms-copy-status is failed or pending. Describes cause of fatal or
+ * non-fatal copy operation failure.
+ */
+ copyStatusDescription?: string;
+ /**
+ * @member {string} [copyId] String identifier for the last attempted Copy
+ * File operation where this file was the destination file.
+ */
+ copyId?: string;
+ /**
+ * @member {string} [copyProgress] Contains the number of bytes copied and
+ * the total bytes in the source in the last attempted Copy File operation
+ * where this file was the destination file. Can show between 0 and
+ * Content-Length bytes copied.
+ */
+ copyProgress?: string;
+ /**
+ * @member {string} [copySource] URL up to 2KB in length that specifies the
+ * source file used in the last attempted Copy File operation where this file
+ * was the destination file.
+ */
+ copySource?: string;
+ /**
+ * @member {CopyStatusType} [copyStatus] State of the copy operation
+ * identified by 'x-ms-copy-id'. Possible values include: 'pending',
+ * 'success', 'aborted', 'failed'
+ */
+ copyStatus?: CopyStatusType;
+ /**
+ * @member {boolean} [isServerEncrypted] The value of this header is set to
+ * true if the file data and application metadata are completely encrypted
+ * using the specified algorithm. Otherwise, the value is set to false (when
+ * the file is unencrypted, or if only parts of the file/application metadata
+ * are encrypted).
+ */
+ isServerEncrypted?: boolean;
+ /**
+ * @member {string} [errorCode]
+ */
+ errorCode?: string;
+}
+
+/**
+ * @interface
+ * An interface representing FileDeleteHeaders.
+ * Defines headers for Delete operation.
+ *
+ */
+export interface FileDeleteHeaders {
+ /**
+ * @member {string} [requestId] This header uniquely identifies the request
+ * that was made and can be used for troubleshooting the request.
+ */
+ requestId?: string;
+ /**
+ * @member {string} [version] Indicates the version of the File service used
+ * to execute the request.
+ */
+ version?: string;
+ /**
+ * @member {Date} [date] A UTC date/time value generated by the service that
+ * indicates the time at which the response was initiated.
+ */
+ date?: Date;
+ /**
+ * @member {string} [errorCode]
+ */
+ errorCode?: string;
+}
+
+/**
+ * @interface
+ * An interface representing FileSetHTTPHeadersHeaders.
+ * Defines headers for SetHTTPHeaders operation.
+ *
+ */
+export interface FileSetHTTPHeadersHeaders {
+ /**
+ * @member {string} [eTag] The ETag contains a value which represents the
+ * version of the file, in quotes.
+ */
+ eTag?: string;
+ /**
+ * @member {Date} [lastModified] Returns the date and time the directory was
+ * last modified. Any operation that modifies the directory or its properties
+ * updates the last modified time. Operations on files do not affect the last
+ * modified time of the directory.
+ */
+ lastModified?: Date;
+ /**
+ * @member {string} [requestId] This header uniquely identifies the request
+ * that was made and can be used for troubleshooting the request.
+ */
+ requestId?: string;
+ /**
+ * @member {string} [version] Indicates the version of the File service used
+ * to execute the request.
+ */
+ version?: string;
+ /**
+ * @member {Date} [date] A UTC date/time value generated by the service that
+ * indicates the time at which the response was initiated.
+ */
+ date?: Date;
+ /**
+ * @member {boolean} [isServerEncrypted] The value of this header is set to
+ * true if the contents of the request are successfully encrypted using the
+ * specified algorithm, and false otherwise.
+ */
+ isServerEncrypted?: boolean;
+ /**
+ * @member {string} [errorCode]
+ */
+ errorCode?: string;
+}
+
+/**
+ * @interface
+ * An interface representing FileSetMetadataHeaders.
+ * Defines headers for SetMetadata operation.
+ *
+ */
+export interface FileSetMetadataHeaders {
+ /**
+ * @member {string} [eTag] The ETag contains a value which represents the
+ * version of the file, in quotes.
+ */
+ eTag?: string;
+ /**
+ * @member {string} [requestId] This header uniquely identifies the request
+ * that was made and can be used for troubleshooting the request.
+ */
+ requestId?: string;
+ /**
+ * @member {string} [version] Indicates the version of the File service used
+ * to execute the request.
+ */
+ version?: string;
+ /**
+ * @member {Date} [date] A UTC date/time value generated by the service that
+ * indicates the time at which the response was initiated.
+ */
+ date?: Date;
+ /**
+ * @member {boolean} [isServerEncrypted] The value of this header is set to
+ * true if the contents of the request are successfully encrypted using the
+ * specified algorithm, and false otherwise.
+ */
+ isServerEncrypted?: boolean;
+ /**
+ * @member {string} [errorCode]
+ */
+ errorCode?: string;
+}
+
+/**
+ * @interface
+ * An interface representing FileUploadRangeHeaders.
+ * Defines headers for UploadRange operation.
+ *
+ */
+export interface FileUploadRangeHeaders {
+ /**
+ * @member {string} [eTag] The ETag contains a value which represents the
+ * version of the file, in quotes.
+ */
+ eTag?: string;
+ /**
+ * @member {Date} [lastModified] Returns the date and time the directory was
+ * last modified. Any operation that modifies the share or its properties or
+ * metadata updates the last modified time. Operations on files do not affect
+ * the last modified time of the share.
+ */
+ lastModified?: Date;
+ /**
+ * @member {Uint8Array} [contentMD5] This header is returned so that the
+ * client can check for message content integrity. The value of this header
+ * is computed by the File service; it is not necessarily the same value as
+ * may have been specified in the request headers.
+ */
+ contentMD5?: Uint8Array;
+ /**
+ * @member {string} [requestId] This header uniquely identifies the request
+ * that was made and can be used for troubleshooting the request.
+ */
+ requestId?: string;
+ /**
+ * @member {string} [version] Indicates the version of the File service used
+ * to execute the request.
+ */
+ version?: string;
+ /**
+ * @member {Date} [date] A UTC date/time value generated by the service that
+ * indicates the time at which the response was initiated.
+ */
+ date?: Date;
+ /**
+ * @member {boolean} [isServerEncrypted] The value of this header is set to
+ * true if the contents of the request are successfully encrypted using the
+ * specified algorithm, and false otherwise.
+ */
+ isServerEncrypted?: boolean;
+ /**
+ * @member {string} [errorCode]
+ */
+ errorCode?: string;
+}
+
+/**
+ * @interface
+ * An interface representing FileGetRangeListHeaders.
+ * Defines headers for GetRangeList operation.
+ *
+ */
+export interface FileGetRangeListHeaders {
+ /**
+ * @member {Date} [lastModified] The date/time that the file was last
+ * modified. Any operation that modifies the file, including an update of the
+ * file's metadata or properties, changes the file's last modified time.
+ */
+ lastModified?: Date;
+ /**
+ * @member {string} [eTag] The ETag contains a value which represents the
+ * version of the file, in quotes.
+ */
+ eTag?: string;
+ /**
+ * @member {number} [fileContentLength] The size of the file in bytes.
+ */
+ fileContentLength?: number;
+ /**
+ * @member {string} [requestId] This header uniquely identifies the request
+ * that was made and can be used for troubleshooting the request.
+ */
+ requestId?: string;
+ /**
+ * @member {string} [version] Indicates the version of the File service used
+ * to execute the request.
+ */
+ version?: string;
+ /**
+ * @member {Date} [date] A UTC date/time value generated by the service that
+ * indicates the time at which the response was initiated.
+ */
+ date?: Date;
+ /**
+ * @member {string} [errorCode]
+ */
+ errorCode?: string;
+}
+
+/**
+ * @interface
+ * An interface representing FileStartCopyHeaders.
+ * Defines headers for StartCopy operation.
+ *
+ */
+export interface FileStartCopyHeaders {
+ /**
+ * @member {string} [eTag] If the copy is completed, contains the ETag of the
+ * destination file. If the copy is not complete, contains the ETag of the
+ * empty file created at the start of the copy.
+ */
+ eTag?: string;
+ /**
+ * @member {Date} [lastModified] Returns the date/time that the copy
+ * operation to the destination file completed.
+ */
+ lastModified?: Date;
+ /**
+ * @member {string} [requestId] This header uniquely identifies the request
+ * that was made and can be used for troubleshooting the request.
+ */
+ requestId?: string;
+ /**
+ * @member {string} [version] Indicates the version of the File service used
+ * to execute the request.
+ */
+ version?: string;
+ /**
+ * @member {Date} [date] A UTC date/time value generated by the service that
+ * indicates the time at which the response was initiated.
+ */
+ date?: Date;
+ /**
+ * @member {string} [copyId] String identifier for this copy operation. Use
+ * with Get File or Get File Properties to check the status of this copy
+ * operation, or pass to Abort Copy File to abort a pending copy.
+ */
+ copyId?: string;
+ /**
+ * @member {CopyStatusType} [copyStatus] State of the copy operation
+ * identified by x-ms-copy-id. Possible values include: 'pending', 'success',
+ * 'aborted', 'failed'
+ */
+ copyStatus?: CopyStatusType;
+ /**
+ * @member {string} [errorCode]
+ */
+ errorCode?: string;
+}
+
+/**
+ * @interface
+ * An interface representing FileAbortCopyHeaders.
+ * Defines headers for AbortCopy operation.
+ *
+ */
+export interface FileAbortCopyHeaders {
+ /**
+ * @member {string} [requestId] This header uniquely identifies the request
+ * that was made and can be used for troubleshooting the request.
+ */
+ requestId?: string;
+ /**
+ * @member {string} [version] Indicates the version of the File service used
+ * to execute the request.
+ */
+ version?: string;
+ /**
+ * @member {Date} [date] A UTC date/time value generated by the service that
+ * indicates the time at which the response was initiated.
+ */
+ date?: Date;
+ /**
+ * @member {string} [errorCode]
+ */
+ errorCode?: string;
+}
+
+/**
+ * Defines values for DeleteSnapshotsOptionType.
+ * Possible values include: 'include'
+ * @readonly
+ * @enum {string}
+ */
+export enum DeleteSnapshotsOptionType {
+ Include = 'include',
+}
+
+/**
+ * Defines values for ListSharesIncludeType.
+ * Possible values include: 'snapshots', 'metadata'
+ * @readonly
+ * @enum {string}
+ */
+export enum ListSharesIncludeType {
+ Snapshots = 'snapshots',
+ Metadata = 'metadata',
+}
+
+/**
+ * Defines values for CopyStatusType.
+ * Possible values include: 'pending', 'success', 'aborted', 'failed'
+ * @readonly
+ * @enum {string}
+ */
+export enum CopyStatusType {
+ Pending = 'pending',
+ Success = 'success',
+ Aborted = 'aborted',
+ Failed = 'failed',
+}
+
+/**
+ * Defines values for FileRangeWriteType.
+ * Possible values include: 'update', 'clear'
+ * @readonly
+ * @enum {string}
+ */
+export enum FileRangeWriteType {
+ Update = 'update',
+ Clear = 'clear',
+}
+
+/**
+ * Defines values for FileType.
+ * Possible values include: 'File'
+ * There could be more values for this enum apart from the ones defined here.If
+ * you want to set a value that is not from the known values then you can do
+ * the following:
+ * let param: FileType = "someUnknownValueThatWillStillBeValid";
+ * @readonly
+ * @enum {string}
+ */
+export enum FileType {
+ File = 'File',
+}
+
+/**
+ * Contains response data for the setProperties operation.
+ */
+export type ServiceSetPropertiesResponse = ServiceSetPropertiesHeaders & {
+ /**
+ * The underlying HTTP response.
+ */
+ _response: msRest.HttpResponse & {
+ /**
+ * The parsed HTTP response headers.
+ */
+ parsedHeaders: ServiceSetPropertiesHeaders;
+ };
+};
+
+/**
+ * Contains response data for the getProperties operation.
+ */
+export type ServiceGetPropertiesResponse = StorageServiceProperties & ServiceGetPropertiesHeaders & {
+ /**
+ * The underlying HTTP response.
+ */
+ _response: msRest.HttpResponse & {
+ /**
+ * The parsed HTTP response headers.
+ */
+ parsedHeaders: ServiceGetPropertiesHeaders;
+ /**
+ * The response body as text (string format)
+ */
+ bodyAsText: string;
+ /**
+ * The response body as parsed JSON or XML
+ */
+ parsedBody: StorageServiceProperties;
+ };
+};
+
+/**
+ * Contains response data for the listSharesSegment operation.
+ */
+export type ServiceListSharesSegmentResponse = ListSharesResponse & ServiceListSharesSegmentHeaders & {
+ /**
+ * The underlying HTTP response.
+ */
+ _response: msRest.HttpResponse & {
+ /**
+ * The parsed HTTP response headers.
+ */
+ parsedHeaders: ServiceListSharesSegmentHeaders;
+ /**
+ * The response body as text (string format)
+ */
+ bodyAsText: string;
+ /**
+ * The response body as parsed JSON or XML
+ */
+ parsedBody: ListSharesResponse;
+ };
+};
+
+/**
+ * Contains response data for the create operation.
+ */
+export type ShareCreateResponse = ShareCreateHeaders & {
+ /**
+ * The underlying HTTP response.
+ */
+ _response: msRest.HttpResponse & {
+ /**
+ * The parsed HTTP response headers.
+ */
+ parsedHeaders: ShareCreateHeaders;
+ };
+};
+
+/**
+ * Contains response data for the getProperties operation.
+ */
+export type ShareGetPropertiesResponse = ShareGetPropertiesHeaders & {
+ /**
+ * The underlying HTTP response.
+ */
+ _response: msRest.HttpResponse & {
+ /**
+ * The parsed HTTP response headers.
+ */
+ parsedHeaders: ShareGetPropertiesHeaders;
+ };
+};
+
+/**
+ * Contains response data for the deleteMethod operation.
+ */
+export type ShareDeleteResponse = ShareDeleteHeaders & {
+ /**
+ * The underlying HTTP response.
+ */
+ _response: msRest.HttpResponse & {
+ /**
+ * The parsed HTTP response headers.
+ */
+ parsedHeaders: ShareDeleteHeaders;
+ };
+};
+
+/**
+ * Contains response data for the createSnapshot operation.
+ */
+export type ShareCreateSnapshotResponse = ShareCreateSnapshotHeaders & {
+ /**
+ * The underlying HTTP response.
+ */
+ _response: msRest.HttpResponse & {
+ /**
+ * The parsed HTTP response headers.
+ */
+ parsedHeaders: ShareCreateSnapshotHeaders;
+ };
+};
+
+/**
+ * Contains response data for the setQuota operation.
+ */
+export type ShareSetQuotaResponse = ShareSetQuotaHeaders & {
+ /**
+ * The underlying HTTP response.
+ */
+ _response: msRest.HttpResponse & {
+ /**
+ * The parsed HTTP response headers.
+ */
+ parsedHeaders: ShareSetQuotaHeaders;
+ };
+};
+
+/**
+ * Contains response data for the setMetadata operation.
+ */
+export type ShareSetMetadataResponse = ShareSetMetadataHeaders & {
+ /**
+ * The underlying HTTP response.
+ */
+ _response: msRest.HttpResponse & {
+ /**
+ * The parsed HTTP response headers.
+ */
+ parsedHeaders: ShareSetMetadataHeaders;
+ };
+};
+
+/**
+ * Contains response data for the getAccessPolicy operation.
+ */
+export type ShareGetAccessPolicyResponse = Array & ShareGetAccessPolicyHeaders & {
+ /**
+ * The underlying HTTP response.
+ */
+ _response: msRest.HttpResponse & {
+ /**
+ * The parsed HTTP response headers.
+ */
+ parsedHeaders: ShareGetAccessPolicyHeaders;
+ /**
+ * The response body as text (string format)
+ */
+ bodyAsText: string;
+ /**
+ * The response body as parsed JSON or XML
+ */
+ parsedBody: SignedIdentifier[];
+ };
+};
+
+/**
+ * Contains response data for the setAccessPolicy operation.
+ */
+export type ShareSetAccessPolicyResponse = ShareSetAccessPolicyHeaders & {
+ /**
+ * The underlying HTTP response.
+ */
+ _response: msRest.HttpResponse & {
+ /**
+ * The parsed HTTP response headers.
+ */
+ parsedHeaders: ShareSetAccessPolicyHeaders;
+ };
+};
+
+/**
+ * Contains response data for the getStatistics operation.
+ */
+export type ShareGetStatisticsResponse = ShareStats & ShareGetStatisticsHeaders & {
+ /**
+ * The underlying HTTP response.
+ */
+ _response: msRest.HttpResponse & {
+ /**
+ * The parsed HTTP response headers.
+ */
+ parsedHeaders: ShareGetStatisticsHeaders;
+ /**
+ * The response body as text (string format)
+ */
+ bodyAsText: string;
+ /**
+ * The response body as parsed JSON or XML
+ */
+ parsedBody: ShareStats;
+ };
+};
+
+/**
+ * Contains response data for the create operation.
+ */
+export type DirectoryCreateResponse = DirectoryCreateHeaders & {
+ /**
+ * The underlying HTTP response.
+ */
+ _response: msRest.HttpResponse & {
+ /**
+ * The parsed HTTP response headers.
+ */
+ parsedHeaders: DirectoryCreateHeaders;
+ };
+};
+
+/**
+ * Contains response data for the getProperties operation.
+ */
+export type DirectoryGetPropertiesResponse = DirectoryGetPropertiesHeaders & {
+ /**
+ * The underlying HTTP response.
+ */
+ _response: msRest.HttpResponse & {
+ /**
+ * The parsed HTTP response headers.
+ */
+ parsedHeaders: DirectoryGetPropertiesHeaders;
+ };
+};
+
+/**
+ * Contains response data for the deleteMethod operation.
+ */
+export type DirectoryDeleteResponse = DirectoryDeleteHeaders & {
+ /**
+ * The underlying HTTP response.
+ */
+ _response: msRest.HttpResponse & {
+ /**
+ * The parsed HTTP response headers.
+ */
+ parsedHeaders: DirectoryDeleteHeaders;
+ };
+};
+
+/**
+ * Contains response data for the setMetadata operation.
+ */
+export type DirectorySetMetadataResponse = DirectorySetMetadataHeaders & {
+ /**
+ * The underlying HTTP response.
+ */
+ _response: msRest.HttpResponse & {
+ /**
+ * The parsed HTTP response headers.
+ */
+ parsedHeaders: DirectorySetMetadataHeaders;
+ };
+};
+
+/**
+ * Contains response data for the listFilesAndDirectoriesSegment operation.
+ */
+export type DirectoryListFilesAndDirectoriesSegmentResponse = ListFilesAndDirectoriesSegmentResponse & DirectoryListFilesAndDirectoriesSegmentHeaders & {
+ /**
+ * The underlying HTTP response.
+ */
+ _response: msRest.HttpResponse & {
+ /**
+ * The parsed HTTP response headers.
+ */
+ parsedHeaders: DirectoryListFilesAndDirectoriesSegmentHeaders;
+ /**
+ * The response body as text (string format)
+ */
+ bodyAsText: string;
+ /**
+ * The response body as parsed JSON or XML
+ */
+ parsedBody: ListFilesAndDirectoriesSegmentResponse;
+ };
+};
+
+/**
+ * Contains response data for the create operation.
+ */
+export type FileCreateResponse = FileCreateHeaders & {
+ /**
+ * The underlying HTTP response.
+ */
+ _response: msRest.HttpResponse & {
+ /**
+ * The parsed HTTP response headers.
+ */
+ parsedHeaders: FileCreateHeaders;
+ };
+};
+
+/**
+ * Contains response data for the download operation.
+ */
+export type FileDownloadResponse = FileDownloadHeaders & {
+ /**
+ * BROWSER ONLY
+ *
+ * The response body as a browser Blob.
+ * Always undefined in node.js.
+ */
+ blobBody?: Promise;
+ /**
+ * NODEJS ONLY
+ *
+ * The response body as a node.js Readable stream.
+ * Always undefined in the browser.
+ */
+ readableStreamBody?: NodeJS.ReadableStream;
+ /**
+ * The underlying HTTP response.
+ */
+ _response: msRest.HttpResponse & {
+ /**
+ * The parsed HTTP response headers.
+ */
+ parsedHeaders: FileDownloadHeaders;
+ };
+};
+
+/**
+ * Contains response data for the getProperties operation.
+ */
+export type FileGetPropertiesResponse = FileGetPropertiesHeaders & {
+ /**
+ * The underlying HTTP response.
+ */
+ _response: msRest.HttpResponse & {
+ /**
+ * The parsed HTTP response headers.
+ */
+ parsedHeaders: FileGetPropertiesHeaders;
+ };
+};
+
+/**
+ * Contains response data for the deleteMethod operation.
+ */
+export type FileDeleteResponse = FileDeleteHeaders & {
+ /**
+ * The underlying HTTP response.
+ */
+ _response: msRest.HttpResponse & {
+ /**
+ * The parsed HTTP response headers.
+ */
+ parsedHeaders: FileDeleteHeaders;
+ };
+};
+
+/**
+ * Contains response data for the setHTTPHeaders operation.
+ */
+export type FileSetHTTPHeadersResponse = FileSetHTTPHeadersHeaders & {
+ /**
+ * The underlying HTTP response.
+ */
+ _response: msRest.HttpResponse & {
+ /**
+ * The parsed HTTP response headers.
+ */
+ parsedHeaders: FileSetHTTPHeadersHeaders;
+ };
+};
+
+/**
+ * Contains response data for the setMetadata operation.
+ */
+export type FileSetMetadataResponse = FileSetMetadataHeaders & {
+ /**
+ * The underlying HTTP response.
+ */
+ _response: msRest.HttpResponse & {
+ /**
+ * The parsed HTTP response headers.
+ */
+ parsedHeaders: FileSetMetadataHeaders;
+ };
+};
+
+/**
+ * Contains response data for the uploadRange operation.
+ */
+export type FileUploadRangeResponse = FileUploadRangeHeaders & {
+ /**
+ * The underlying HTTP response.
+ */
+ _response: msRest.HttpResponse & {
+ /**
+ * The parsed HTTP response headers.
+ */
+ parsedHeaders: FileUploadRangeHeaders;
+ };
+};
+
+/**
+ * Contains response data for the getRangeList operation.
+ */
+export type FileGetRangeListResponse = Array & FileGetRangeListHeaders & {
+ /**
+ * The underlying HTTP response.
+ */
+ _response: msRest.HttpResponse & {
+ /**
+ * The parsed HTTP response headers.
+ */
+ parsedHeaders: FileGetRangeListHeaders;
+ /**
+ * The response body as text (string format)
+ */
+ bodyAsText: string;
+ /**
+ * The response body as parsed JSON or XML
+ */
+ parsedBody: Range[];
+ };
+};
+
+/**
+ * Contains response data for the startCopy operation.
+ */
+export type FileStartCopyResponse = FileStartCopyHeaders & {
+ /**
+ * The underlying HTTP response.
+ */
+ _response: msRest.HttpResponse & {
+ /**
+ * The parsed HTTP response headers.
+ */
+ parsedHeaders: FileStartCopyHeaders;
+ };
+};
+
+/**
+ * Contains response data for the abortCopy operation.
+ */
+export type FileAbortCopyResponse = FileAbortCopyHeaders & {
+ /**
+ * The underlying HTTP response.
+ */
+ _response: msRest.HttpResponse & {
+ /**
+ * The parsed HTTP response headers.
+ */
+ parsedHeaders: FileAbortCopyHeaders;
+ };
+};
diff --git a/file/lib/generated/models/mappers.ts b/file/lib/generated/models/mappers.ts
new file mode 100644
index 0000000..d8db71d
--- /dev/null
+++ b/file/lib/generated/models/mappers.ts
@@ -0,0 +1,2079 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * 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 * as msRest from "ms-rest-js";
+
+
+export const AccessPolicy: msRest.CompositeMapper = {
+ serializedName: "AccessPolicy",
+ type: {
+ name: "Composite",
+ className: "AccessPolicy",
+ modelProperties: {
+ start: {
+ xmlName: "Start",
+ serializedName: "Start",
+ type: {
+ name: "String"
+ }
+ },
+ expiry: {
+ xmlName: "Expiry",
+ serializedName: "Expiry",
+ type: {
+ name: "String"
+ }
+ },
+ permission: {
+ xmlName: "Permission",
+ serializedName: "Permission",
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+};
+
+export const CorsRule: msRest.CompositeMapper = {
+ serializedName: "CorsRule",
+ type: {
+ name: "Composite",
+ className: "CorsRule",
+ modelProperties: {
+ allowedOrigins: {
+ xmlName: "AllowedOrigins",
+ required: true,
+ serializedName: "AllowedOrigins",
+ type: {
+ name: "String"
+ }
+ },
+ allowedMethods: {
+ xmlName: "AllowedMethods",
+ required: true,
+ serializedName: "AllowedMethods",
+ type: {
+ name: "String"
+ }
+ },
+ allowedHeaders: {
+ xmlName: "AllowedHeaders",
+ required: true,
+ serializedName: "AllowedHeaders",
+ type: {
+ name: "String"
+ }
+ },
+ exposedHeaders: {
+ xmlName: "ExposedHeaders",
+ required: true,
+ serializedName: "ExposedHeaders",
+ type: {
+ name: "String"
+ }
+ },
+ maxAgeInSeconds: {
+ xmlName: "MaxAgeInSeconds",
+ required: true,
+ serializedName: "MaxAgeInSeconds",
+ constraints: {
+ InclusiveMinimum: 0
+ },
+ type: {
+ name: "Number"
+ }
+ }
+ }
+ }
+};
+
+export const Entry: msRest.CompositeMapper = {
+ serializedName: "Entry",
+ type: {
+ name: "Composite",
+ polymorphicDiscriminator: {
+ serializedName: "EntryType",
+ clientName: "entryType"
+ },
+ uberParent: "Entry",
+ className: "Entry",
+ modelProperties: {
+ name: {
+ xmlName: "Name",
+ required: true,
+ serializedName: "Name",
+ type: {
+ name: "String"
+ }
+ },
+ entryType: {
+ xmlName: "entryType",
+ required: true,
+ serializedName: "EntryType",
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+};
+
+export const DirectoryItem: msRest.CompositeMapper = {
+ serializedName: "Directory",
+ type: {
+ name: "Composite",
+ className: "DirectoryItem",
+ modelProperties: {
+ ...Entry.type.modelProperties
+ }
+ }
+};
+
+export const FileProperty: msRest.CompositeMapper = {
+ serializedName: "FileProperty",
+ type: {
+ name: "Composite",
+ className: "FileProperty",
+ modelProperties: {
+ contentLength: {
+ xmlName: "Content-Length",
+ required: true,
+ serializedName: "Content-Length",
+ type: {
+ name: "Number"
+ }
+ }
+ }
+ }
+};
+
+export const FileItem: msRest.CompositeMapper = {
+ serializedName: "File",
+ type: {
+ name: "Composite",
+ className: "FileItem",
+ modelProperties: {
+ ...Entry.type.modelProperties,
+ properties: {
+ xmlName: "Properties",
+ required: true,
+ serializedName: "Properties",
+ type: {
+ name: "Composite",
+ className: "FileProperty"
+ }
+ }
+ }
+ }
+};
+
+export const ListFilesAndDirectoriesSegmentResponse: msRest.CompositeMapper = {
+ xmlName: "EnumerationResults",
+ serializedName: "ListFilesAndDirectoriesSegmentResponse",
+ type: {
+ name: "Composite",
+ className: "ListFilesAndDirectoriesSegmentResponse",
+ modelProperties: {
+ serviceEndpoint: {
+ xmlIsAttribute: true,
+ xmlName: "ServiceEndpoint",
+ required: true,
+ serializedName: "ServiceEndpoint",
+ type: {
+ name: "String"
+ }
+ },
+ shareName: {
+ xmlIsAttribute: true,
+ xmlName: "ShareName",
+ required: true,
+ serializedName: "ShareName",
+ type: {
+ name: "String"
+ }
+ },
+ shareSnapshot: {
+ xmlIsAttribute: true,
+ xmlName: "ShareSnapshot",
+ serializedName: "ShareSnapshot",
+ type: {
+ name: "String"
+ }
+ },
+ directoryPath: {
+ xmlIsAttribute: true,
+ xmlName: "DirectoryPath",
+ required: true,
+ serializedName: "DirectoryPath",
+ type: {
+ name: "String"
+ }
+ },
+ prefix: {
+ xmlName: "Prefix",
+ required: true,
+ serializedName: "Prefix",
+ type: {
+ name: "String"
+ }
+ },
+ marker: {
+ xmlName: "Marker",
+ serializedName: "Marker",
+ type: {
+ name: "String"
+ }
+ },
+ maxResults: {
+ xmlName: "MaxResults",
+ serializedName: "MaxResults",
+ type: {
+ name: "Number"
+ }
+ },
+ entries: {
+ xmlIsWrapped: true,
+ xmlName: "Entries",
+ xmlElementName: "Entry",
+ serializedName: "Entries",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "Composite",
+ polymorphicDiscriminator: {
+ serializedName: "EntryType",
+ clientName: "entryType"
+ },
+ uberParent: "Entry",
+ className: "Entry"
+ }
+ }
+ }
+ },
+ nextMarker: {
+ xmlName: "NextMarker",
+ required: true,
+ serializedName: "NextMarker",
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+};
+
+export const ShareProperties: msRest.CompositeMapper = {
+ serializedName: "ShareProperties",
+ type: {
+ name: "Composite",
+ className: "ShareProperties",
+ modelProperties: {
+ lastModified: {
+ xmlName: "Last-Modified",
+ required: true,
+ serializedName: "Last-Modified",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ etag: {
+ xmlName: "Etag",
+ required: true,
+ serializedName: "Etag",
+ type: {
+ name: "String"
+ }
+ },
+ quota: {
+ xmlName: "Quota",
+ required: true,
+ serializedName: "Quota",
+ type: {
+ name: "Number"
+ }
+ }
+ }
+ }
+};
+
+export const ShareItem: msRest.CompositeMapper = {
+ xmlName: "Share",
+ serializedName: "ShareItem",
+ type: {
+ name: "Composite",
+ className: "ShareItem",
+ modelProperties: {
+ name: {
+ xmlName: "Name",
+ required: true,
+ serializedName: "Name",
+ type: {
+ name: "String"
+ }
+ },
+ snapshot: {
+ xmlName: "Snapshot",
+ serializedName: "Snapshot",
+ type: {
+ name: "String"
+ }
+ },
+ properties: {
+ xmlName: "Properties",
+ required: true,
+ serializedName: "Properties",
+ type: {
+ name: "Composite",
+ className: "ShareProperties"
+ }
+ },
+ metadata: {
+ xmlName: "Metadata",
+ serializedName: "Metadata",
+ type: {
+ name: "Dictionary",
+ value: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+ }
+ }
+};
+
+export const ListSharesResponse: msRest.CompositeMapper = {
+ xmlName: "EnumerationResults",
+ serializedName: "ListSharesResponse",
+ type: {
+ name: "Composite",
+ className: "ListSharesResponse",
+ modelProperties: {
+ serviceEndpoint: {
+ xmlIsAttribute: true,
+ xmlName: "ServiceEndpoint",
+ required: true,
+ serializedName: "ServiceEndpoint",
+ type: {
+ name: "String"
+ }
+ },
+ prefix: {
+ xmlName: "Prefix",
+ serializedName: "Prefix",
+ type: {
+ name: "String"
+ }
+ },
+ marker: {
+ xmlName: "Marker",
+ serializedName: "Marker",
+ type: {
+ name: "String"
+ }
+ },
+ maxResults: {
+ xmlName: "MaxResults",
+ serializedName: "MaxResults",
+ type: {
+ name: "Number"
+ }
+ },
+ shareItems: {
+ xmlIsWrapped: true,
+ xmlName: "Shares",
+ xmlElementName: "Share",
+ serializedName: "ShareItems",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "Composite",
+ className: "ShareItem"
+ }
+ }
+ }
+ },
+ nextMarker: {
+ xmlName: "NextMarker",
+ required: true,
+ serializedName: "NextMarker",
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+};
+
+export const RetentionPolicy: msRest.CompositeMapper = {
+ serializedName: "RetentionPolicy",
+ type: {
+ name: "Composite",
+ className: "RetentionPolicy",
+ modelProperties: {
+ enabled: {
+ xmlName: "Enabled",
+ required: true,
+ serializedName: "Enabled",
+ type: {
+ name: "Boolean"
+ }
+ },
+ days: {
+ xmlName: "Days",
+ serializedName: "Days",
+ constraints: {
+ InclusiveMaximum: 365,
+ InclusiveMinimum: 1
+ },
+ type: {
+ name: "Number"
+ }
+ }
+ }
+ }
+};
+
+export const Metrics: msRest.CompositeMapper = {
+ serializedName: "Metrics",
+ type: {
+ name: "Composite",
+ className: "Metrics",
+ modelProperties: {
+ version: {
+ xmlName: "Version",
+ required: true,
+ serializedName: "Version",
+ type: {
+ name: "String"
+ }
+ },
+ enabled: {
+ xmlName: "Enabled",
+ required: true,
+ serializedName: "Enabled",
+ type: {
+ name: "Boolean"
+ }
+ },
+ includeAPIs: {
+ xmlName: "IncludeAPIs",
+ serializedName: "IncludeAPIs",
+ type: {
+ name: "Boolean"
+ }
+ },
+ retentionPolicy: {
+ xmlName: "RetentionPolicy",
+ serializedName: "RetentionPolicy",
+ type: {
+ name: "Composite",
+ className: "RetentionPolicy"
+ }
+ }
+ }
+ }
+};
+
+export const Range: msRest.CompositeMapper = {
+ serializedName: "Range",
+ type: {
+ name: "Composite",
+ className: "Range",
+ modelProperties: {
+ start: {
+ xmlName: "Start",
+ required: true,
+ serializedName: "Start",
+ type: {
+ name: "Number"
+ }
+ },
+ end: {
+ xmlName: "End",
+ required: true,
+ serializedName: "End",
+ type: {
+ name: "Number"
+ }
+ }
+ }
+ }
+};
+
+export const StorageError: msRest.CompositeMapper = {
+ serializedName: "StorageError",
+ type: {
+ name: "Composite",
+ className: "StorageError",
+ modelProperties: {
+ message: {
+ xmlName: "Message",
+ serializedName: "Message",
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+};
+
+export const ShareStats: msRest.CompositeMapper = {
+ serializedName: "ShareStats",
+ type: {
+ name: "Composite",
+ className: "ShareStats",
+ modelProperties: {
+ shareUsage: {
+ xmlName: "ShareUsage",
+ required: true,
+ serializedName: "ShareUsage",
+ type: {
+ name: "Number"
+ }
+ }
+ }
+ }
+};
+
+export const SignedIdentifier: msRest.CompositeMapper = {
+ serializedName: "SignedIdentifier",
+ type: {
+ name: "Composite",
+ className: "SignedIdentifier",
+ modelProperties: {
+ id: {
+ xmlName: "Id",
+ required: true,
+ serializedName: "Id",
+ type: {
+ name: "String"
+ }
+ },
+ accessPolicy: {
+ xmlName: "AccessPolicy",
+ serializedName: "AccessPolicy",
+ type: {
+ name: "Composite",
+ className: "AccessPolicy"
+ }
+ }
+ }
+ }
+};
+
+export const StorageServiceProperties: msRest.CompositeMapper = {
+ serializedName: "StorageServiceProperties",
+ type: {
+ name: "Composite",
+ className: "StorageServiceProperties",
+ modelProperties: {
+ hourMetrics: {
+ xmlName: "HourMetrics",
+ serializedName: "HourMetrics",
+ type: {
+ name: "Composite",
+ className: "Metrics"
+ }
+ },
+ minuteMetrics: {
+ xmlName: "MinuteMetrics",
+ serializedName: "MinuteMetrics",
+ type: {
+ name: "Composite",
+ className: "Metrics"
+ }
+ },
+ cors: {
+ xmlIsWrapped: true,
+ xmlName: "Cors",
+ xmlElementName: "CorsRule",
+ serializedName: "Cors",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "Composite",
+ className: "CorsRule"
+ }
+ }
+ }
+ }
+ }
+ }
+};
+
+export const ServiceSetPropertiesHeaders: msRest.CompositeMapper = {
+ serializedName: "service-setproperties-headers",
+ type: {
+ name: "Composite",
+ className: "ServiceSetPropertiesHeaders",
+ modelProperties: {
+ requestId: {
+ serializedName: "x-ms-request-id",
+ type: {
+ name: "String"
+ }
+ },
+ version: {
+ serializedName: "x-ms-version",
+ type: {
+ name: "String"
+ }
+ },
+ errorCode: {
+ serializedName: "x-ms-error-code",
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+};
+
+export const ServiceGetPropertiesHeaders: msRest.CompositeMapper = {
+ serializedName: "service-getproperties-headers",
+ type: {
+ name: "Composite",
+ className: "ServiceGetPropertiesHeaders",
+ modelProperties: {
+ requestId: {
+ serializedName: "x-ms-request-id",
+ type: {
+ name: "String"
+ }
+ },
+ version: {
+ serializedName: "x-ms-version",
+ type: {
+ name: "String"
+ }
+ },
+ errorCode: {
+ serializedName: "x-ms-error-code",
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+};
+
+export const ServiceListSharesSegmentHeaders: msRest.CompositeMapper = {
+ serializedName: "service-listsharessegment-headers",
+ type: {
+ name: "Composite",
+ className: "ServiceListSharesSegmentHeaders",
+ modelProperties: {
+ requestId: {
+ serializedName: "x-ms-request-id",
+ type: {
+ name: "String"
+ }
+ },
+ version: {
+ serializedName: "x-ms-version",
+ type: {
+ name: "String"
+ }
+ },
+ errorCode: {
+ serializedName: "x-ms-error-code",
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+};
+
+export const ShareCreateHeaders: msRest.CompositeMapper = {
+ serializedName: "share-create-headers",
+ type: {
+ name: "Composite",
+ className: "ShareCreateHeaders",
+ modelProperties: {
+ eTag: {
+ serializedName: "etag",
+ type: {
+ name: "String"
+ }
+ },
+ lastModified: {
+ serializedName: "last-modified",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ requestId: {
+ serializedName: "x-ms-request-id",
+ type: {
+ name: "String"
+ }
+ },
+ version: {
+ serializedName: "x-ms-version",
+ type: {
+ name: "String"
+ }
+ },
+ date: {
+ serializedName: "date",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ errorCode: {
+ serializedName: "x-ms-error-code",
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+};
+
+export const ShareGetPropertiesHeaders: msRest.CompositeMapper = {
+ serializedName: "share-getproperties-headers",
+ type: {
+ name: "Composite",
+ className: "ShareGetPropertiesHeaders",
+ modelProperties: {
+ metadata: {
+ serializedName: "x-ms-meta",
+ type: {
+ name: "Dictionary",
+ value: {
+ type: {
+ name: "String"
+ }
+ }
+ },
+ headerCollectionPrefix: "x-ms-meta-"
+ },
+ eTag: {
+ serializedName: "etag",
+ type: {
+ name: "String"
+ }
+ },
+ lastModified: {
+ serializedName: "last-modified",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ requestId: {
+ serializedName: "x-ms-request-id",
+ type: {
+ name: "String"
+ }
+ },
+ version: {
+ serializedName: "x-ms-version",
+ type: {
+ name: "String"
+ }
+ },
+ date: {
+ serializedName: "date",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ quota: {
+ serializedName: "x-ms-share-quota",
+ type: {
+ name: "Number"
+ }
+ },
+ errorCode: {
+ serializedName: "x-ms-error-code",
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+};
+
+export const ShareDeleteHeaders: msRest.CompositeMapper = {
+ serializedName: "share-delete-headers",
+ type: {
+ name: "Composite",
+ className: "ShareDeleteHeaders",
+ modelProperties: {
+ requestId: {
+ serializedName: "x-ms-request-id",
+ type: {
+ name: "String"
+ }
+ },
+ version: {
+ serializedName: "x-ms-version",
+ type: {
+ name: "String"
+ }
+ },
+ date: {
+ serializedName: "date",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ errorCode: {
+ serializedName: "x-ms-error-code",
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+};
+
+export const ShareCreateSnapshotHeaders: msRest.CompositeMapper = {
+ serializedName: "share-createsnapshot-headers",
+ type: {
+ name: "Composite",
+ className: "ShareCreateSnapshotHeaders",
+ modelProperties: {
+ snapshot: {
+ serializedName: "x-ms-snapshot",
+ type: {
+ name: "String"
+ }
+ },
+ eTag: {
+ serializedName: "etag",
+ type: {
+ name: "String"
+ }
+ },
+ lastModified: {
+ serializedName: "last-modified",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ requestId: {
+ serializedName: "x-ms-request-id",
+ type: {
+ name: "String"
+ }
+ },
+ version: {
+ serializedName: "x-ms-version",
+ type: {
+ name: "String"
+ }
+ },
+ date: {
+ serializedName: "date",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ errorCode: {
+ serializedName: "x-ms-error-code",
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+};
+
+export const ShareSetQuotaHeaders: msRest.CompositeMapper = {
+ serializedName: "share-setquota-headers",
+ type: {
+ name: "Composite",
+ className: "ShareSetQuotaHeaders",
+ modelProperties: {
+ eTag: {
+ serializedName: "etag",
+ type: {
+ name: "String"
+ }
+ },
+ lastModified: {
+ serializedName: "last-modified",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ requestId: {
+ serializedName: "x-ms-request-id",
+ type: {
+ name: "String"
+ }
+ },
+ version: {
+ serializedName: "x-ms-version",
+ type: {
+ name: "String"
+ }
+ },
+ date: {
+ serializedName: "date",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ errorCode: {
+ serializedName: "x-ms-error-code",
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+};
+
+export const ShareSetMetadataHeaders: msRest.CompositeMapper = {
+ serializedName: "share-setmetadata-headers",
+ type: {
+ name: "Composite",
+ className: "ShareSetMetadataHeaders",
+ modelProperties: {
+ eTag: {
+ serializedName: "etag",
+ type: {
+ name: "String"
+ }
+ },
+ lastModified: {
+ serializedName: "last-modified",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ requestId: {
+ serializedName: "x-ms-request-id",
+ type: {
+ name: "String"
+ }
+ },
+ version: {
+ serializedName: "x-ms-version",
+ type: {
+ name: "String"
+ }
+ },
+ date: {
+ serializedName: "date",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ errorCode: {
+ serializedName: "x-ms-error-code",
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+};
+
+export const ShareGetAccessPolicyHeaders: msRest.CompositeMapper = {
+ serializedName: "share-getaccesspolicy-headers",
+ type: {
+ name: "Composite",
+ className: "ShareGetAccessPolicyHeaders",
+ modelProperties: {
+ eTag: {
+ serializedName: "etag",
+ type: {
+ name: "String"
+ }
+ },
+ lastModified: {
+ serializedName: "last-modified",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ requestId: {
+ serializedName: "x-ms-request-id",
+ type: {
+ name: "String"
+ }
+ },
+ version: {
+ serializedName: "x-ms-version",
+ type: {
+ name: "String"
+ }
+ },
+ date: {
+ serializedName: "date",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ errorCode: {
+ serializedName: "x-ms-error-code",
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+};
+
+export const ShareSetAccessPolicyHeaders: msRest.CompositeMapper = {
+ serializedName: "share-setaccesspolicy-headers",
+ type: {
+ name: "Composite",
+ className: "ShareSetAccessPolicyHeaders",
+ modelProperties: {
+ eTag: {
+ serializedName: "etag",
+ type: {
+ name: "String"
+ }
+ },
+ lastModified: {
+ serializedName: "last-modified",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ requestId: {
+ serializedName: "x-ms-request-id",
+ type: {
+ name: "String"
+ }
+ },
+ version: {
+ serializedName: "x-ms-version",
+ type: {
+ name: "String"
+ }
+ },
+ date: {
+ serializedName: "date",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ errorCode: {
+ serializedName: "x-ms-error-code",
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+};
+
+export const ShareGetStatisticsHeaders: msRest.CompositeMapper = {
+ serializedName: "share-getstatistics-headers",
+ type: {
+ name: "Composite",
+ className: "ShareGetStatisticsHeaders",
+ modelProperties: {
+ eTag: {
+ serializedName: "etag",
+ type: {
+ name: "String"
+ }
+ },
+ lastModified: {
+ serializedName: "last-modified",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ requestId: {
+ serializedName: "x-ms-request-id",
+ type: {
+ name: "String"
+ }
+ },
+ version: {
+ serializedName: "x-ms-version",
+ type: {
+ name: "String"
+ }
+ },
+ date: {
+ serializedName: "date",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ errorCode: {
+ serializedName: "x-ms-error-code",
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+};
+
+export const DirectoryCreateHeaders: msRest.CompositeMapper = {
+ serializedName: "directory-create-headers",
+ type: {
+ name: "Composite",
+ className: "DirectoryCreateHeaders",
+ modelProperties: {
+ eTag: {
+ serializedName: "etag",
+ type: {
+ name: "String"
+ }
+ },
+ lastModified: {
+ serializedName: "last-modified",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ requestId: {
+ serializedName: "x-ms-request-id",
+ type: {
+ name: "String"
+ }
+ },
+ version: {
+ serializedName: "x-ms-version",
+ type: {
+ name: "String"
+ }
+ },
+ date: {
+ serializedName: "date",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ isServerEncrypted: {
+ serializedName: "x-ms-request-server-encrypted",
+ type: {
+ name: "Boolean"
+ }
+ },
+ errorCode: {
+ serializedName: "x-ms-error-code",
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+};
+
+export const DirectoryGetPropertiesHeaders: msRest.CompositeMapper = {
+ serializedName: "directory-getproperties-headers",
+ type: {
+ name: "Composite",
+ className: "DirectoryGetPropertiesHeaders",
+ modelProperties: {
+ metadata: {
+ serializedName: "x-ms-meta",
+ type: {
+ name: "Dictionary",
+ value: {
+ type: {
+ name: "String"
+ }
+ }
+ },
+ headerCollectionPrefix: "x-ms-meta-"
+ },
+ eTag: {
+ serializedName: "etag",
+ type: {
+ name: "String"
+ }
+ },
+ lastModified: {
+ serializedName: "last-modified",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ requestId: {
+ serializedName: "x-ms-request-id",
+ type: {
+ name: "String"
+ }
+ },
+ version: {
+ serializedName: "x-ms-version",
+ type: {
+ name: "String"
+ }
+ },
+ date: {
+ serializedName: "date",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ isServerEncrypted: {
+ serializedName: "x-ms-server-encrypted",
+ type: {
+ name: "Boolean"
+ }
+ },
+ errorCode: {
+ serializedName: "x-ms-error-code",
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+};
+
+export const DirectoryDeleteHeaders: msRest.CompositeMapper = {
+ serializedName: "directory-delete-headers",
+ type: {
+ name: "Composite",
+ className: "DirectoryDeleteHeaders",
+ modelProperties: {
+ requestId: {
+ serializedName: "x-ms-request-id",
+ type: {
+ name: "String"
+ }
+ },
+ version: {
+ serializedName: "x-ms-version",
+ type: {
+ name: "String"
+ }
+ },
+ date: {
+ serializedName: "date",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ errorCode: {
+ serializedName: "x-ms-error-code",
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+};
+
+export const DirectorySetMetadataHeaders: msRest.CompositeMapper = {
+ serializedName: "directory-setmetadata-headers",
+ type: {
+ name: "Composite",
+ className: "DirectorySetMetadataHeaders",
+ modelProperties: {
+ eTag: {
+ serializedName: "etag",
+ type: {
+ name: "String"
+ }
+ },
+ requestId: {
+ serializedName: "x-ms-request-id",
+ type: {
+ name: "String"
+ }
+ },
+ version: {
+ serializedName: "x-ms-version",
+ type: {
+ name: "String"
+ }
+ },
+ date: {
+ serializedName: "date",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ isServerEncrypted: {
+ serializedName: "x-ms-request-server-encrypted",
+ type: {
+ name: "Boolean"
+ }
+ },
+ errorCode: {
+ serializedName: "x-ms-error-code",
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+};
+
+export const DirectoryListFilesAndDirectoriesSegmentHeaders: msRest.CompositeMapper = {
+ serializedName: "directory-listfilesanddirectoriessegment-headers",
+ type: {
+ name: "Composite",
+ className: "DirectoryListFilesAndDirectoriesSegmentHeaders",
+ modelProperties: {
+ contentType: {
+ serializedName: "content-type",
+ type: {
+ name: "String"
+ }
+ },
+ requestId: {
+ serializedName: "x-ms-request-id",
+ type: {
+ name: "String"
+ }
+ },
+ version: {
+ serializedName: "x-ms-version",
+ type: {
+ name: "String"
+ }
+ },
+ date: {
+ serializedName: "date",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ errorCode: {
+ serializedName: "x-ms-error-code",
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+};
+
+export const FileCreateHeaders: msRest.CompositeMapper = {
+ serializedName: "file-create-headers",
+ type: {
+ name: "Composite",
+ className: "FileCreateHeaders",
+ modelProperties: {
+ eTag: {
+ serializedName: "etag",
+ type: {
+ name: "String"
+ }
+ },
+ lastModified: {
+ serializedName: "last-modified",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ requestId: {
+ serializedName: "x-ms-request-id",
+ type: {
+ name: "String"
+ }
+ },
+ version: {
+ serializedName: "x-ms-version",
+ type: {
+ name: "String"
+ }
+ },
+ date: {
+ serializedName: "date",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ isServerEncrypted: {
+ serializedName: "x-ms-request-server-encrypted",
+ type: {
+ name: "Boolean"
+ }
+ },
+ errorCode: {
+ serializedName: "x-ms-error-code",
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+};
+
+export const FileDownloadHeaders: msRest.CompositeMapper = {
+ serializedName: "file-download-headers",
+ type: {
+ name: "Composite",
+ className: "FileDownloadHeaders",
+ modelProperties: {
+ lastModified: {
+ serializedName: "last-modified",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ metadata: {
+ serializedName: "x-ms-meta",
+ type: {
+ name: "Dictionary",
+ value: {
+ type: {
+ name: "String"
+ }
+ }
+ },
+ headerCollectionPrefix: "x-ms-meta-"
+ },
+ contentLength: {
+ serializedName: "content-length",
+ type: {
+ name: "Number"
+ }
+ },
+ contentType: {
+ serializedName: "content-type",
+ type: {
+ name: "String"
+ }
+ },
+ contentRange: {
+ serializedName: "content-range",
+ type: {
+ name: "String"
+ }
+ },
+ eTag: {
+ serializedName: "etag",
+ type: {
+ name: "String"
+ }
+ },
+ contentMD5: {
+ serializedName: "content-md5",
+ type: {
+ name: "ByteArray"
+ }
+ },
+ contentEncoding: {
+ serializedName: "content-encoding",
+ type: {
+ name: "String"
+ }
+ },
+ cacheControl: {
+ serializedName: "cache-control",
+ type: {
+ name: "String"
+ }
+ },
+ contentDisposition: {
+ serializedName: "content-disposition",
+ type: {
+ name: "String"
+ }
+ },
+ contentLanguage: {
+ serializedName: "content-language",
+ type: {
+ name: "String"
+ }
+ },
+ requestId: {
+ serializedName: "x-ms-request-id",
+ type: {
+ name: "String"
+ }
+ },
+ version: {
+ serializedName: "x-ms-version",
+ type: {
+ name: "String"
+ }
+ },
+ acceptRanges: {
+ serializedName: "accept-ranges",
+ type: {
+ name: "String"
+ }
+ },
+ date: {
+ serializedName: "date",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ copyCompletionTime: {
+ serializedName: "x-ms-copy-completion-time",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ copyStatusDescription: {
+ serializedName: "x-ms-copy-status-description",
+ type: {
+ name: "String"
+ }
+ },
+ copyId: {
+ serializedName: "x-ms-copy-id",
+ type: {
+ name: "String"
+ }
+ },
+ copyProgress: {
+ serializedName: "x-ms-copy-progress",
+ type: {
+ name: "String"
+ }
+ },
+ copySource: {
+ serializedName: "x-ms-copy-source",
+ type: {
+ name: "String"
+ }
+ },
+ copyStatus: {
+ serializedName: "x-ms-copy-status",
+ type: {
+ name: "Enum",
+ allowedValues: [
+ "pending",
+ "success",
+ "aborted",
+ "failed"
+ ]
+ }
+ },
+ fileContentMD5: {
+ serializedName: "x-ms-content-md5",
+ type: {
+ name: "ByteArray"
+ }
+ },
+ isServerEncrypted: {
+ serializedName: "x-ms-server-encrypted",
+ type: {
+ name: "Boolean"
+ }
+ },
+ errorCode: {
+ serializedName: "x-ms-error-code",
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+};
+
+export const FileGetPropertiesHeaders: msRest.CompositeMapper = {
+ serializedName: "file-getproperties-headers",
+ type: {
+ name: "Composite",
+ className: "FileGetPropertiesHeaders",
+ modelProperties: {
+ lastModified: {
+ serializedName: "last-modified",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ metadata: {
+ serializedName: "x-ms-meta",
+ type: {
+ name: "Dictionary",
+ value: {
+ type: {
+ name: "String"
+ }
+ }
+ },
+ headerCollectionPrefix: "x-ms-meta-"
+ },
+ fileType: {
+ serializedName: "x-ms-type",
+ type: {
+ name: "String"
+ }
+ },
+ contentLength: {
+ serializedName: "content-length",
+ type: {
+ name: "Number"
+ }
+ },
+ contentType: {
+ serializedName: "content-type",
+ type: {
+ name: "String"
+ }
+ },
+ eTag: {
+ serializedName: "etag",
+ type: {
+ name: "String"
+ }
+ },
+ contentMD5: {
+ serializedName: "content-md5",
+ type: {
+ name: "ByteArray"
+ }
+ },
+ contentEncoding: {
+ serializedName: "content-encoding",
+ type: {
+ name: "String"
+ }
+ },
+ cacheControl: {
+ serializedName: "cache-control",
+ type: {
+ name: "String"
+ }
+ },
+ contentDisposition: {
+ serializedName: "content-disposition",
+ type: {
+ name: "String"
+ }
+ },
+ contentLanguage: {
+ serializedName: "content-language",
+ type: {
+ name: "String"
+ }
+ },
+ requestId: {
+ serializedName: "x-ms-request-id",
+ type: {
+ name: "String"
+ }
+ },
+ version: {
+ serializedName: "x-ms-version",
+ type: {
+ name: "String"
+ }
+ },
+ date: {
+ serializedName: "date",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ copyCompletionTime: {
+ serializedName: "x-ms-copy-completion-time",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ copyStatusDescription: {
+ serializedName: "x-ms-copy-status-description",
+ type: {
+ name: "String"
+ }
+ },
+ copyId: {
+ serializedName: "x-ms-copy-id",
+ type: {
+ name: "String"
+ }
+ },
+ copyProgress: {
+ serializedName: "x-ms-copy-progress",
+ type: {
+ name: "String"
+ }
+ },
+ copySource: {
+ serializedName: "x-ms-copy-source",
+ type: {
+ name: "String"
+ }
+ },
+ copyStatus: {
+ serializedName: "x-ms-copy-status",
+ type: {
+ name: "Enum",
+ allowedValues: [
+ "pending",
+ "success",
+ "aborted",
+ "failed"
+ ]
+ }
+ },
+ isServerEncrypted: {
+ serializedName: "x-ms-server-encrypted",
+ type: {
+ name: "Boolean"
+ }
+ },
+ errorCode: {
+ serializedName: "x-ms-error-code",
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+};
+
+export const FileDeleteHeaders: msRest.CompositeMapper = {
+ serializedName: "file-delete-headers",
+ type: {
+ name: "Composite",
+ className: "FileDeleteHeaders",
+ modelProperties: {
+ requestId: {
+ serializedName: "x-ms-request-id",
+ type: {
+ name: "String"
+ }
+ },
+ version: {
+ serializedName: "x-ms-version",
+ type: {
+ name: "String"
+ }
+ },
+ date: {
+ serializedName: "date",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ errorCode: {
+ serializedName: "x-ms-error-code",
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+};
+
+export const FileSetHTTPHeadersHeaders: msRest.CompositeMapper = {
+ serializedName: "file-sethttpheaders-headers",
+ type: {
+ name: "Composite",
+ className: "FileSetHTTPHeadersHeaders",
+ modelProperties: {
+ eTag: {
+ serializedName: "etag",
+ type: {
+ name: "String"
+ }
+ },
+ lastModified: {
+ serializedName: "last-modified",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ requestId: {
+ serializedName: "x-ms-request-id",
+ type: {
+ name: "String"
+ }
+ },
+ version: {
+ serializedName: "x-ms-version",
+ type: {
+ name: "String"
+ }
+ },
+ date: {
+ serializedName: "date",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ isServerEncrypted: {
+ serializedName: "x-ms-request-server-encrypted",
+ type: {
+ name: "Boolean"
+ }
+ },
+ errorCode: {
+ serializedName: "x-ms-error-code",
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+};
+
+export const FileSetMetadataHeaders: msRest.CompositeMapper = {
+ serializedName: "file-setmetadata-headers",
+ type: {
+ name: "Composite",
+ className: "FileSetMetadataHeaders",
+ modelProperties: {
+ eTag: {
+ serializedName: "etag",
+ type: {
+ name: "String"
+ }
+ },
+ requestId: {
+ serializedName: "x-ms-request-id",
+ type: {
+ name: "String"
+ }
+ },
+ version: {
+ serializedName: "x-ms-version",
+ type: {
+ name: "String"
+ }
+ },
+ date: {
+ serializedName: "date",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ isServerEncrypted: {
+ serializedName: "x-ms-request-server-encrypted",
+ type: {
+ name: "Boolean"
+ }
+ },
+ errorCode: {
+ serializedName: "x-ms-error-code",
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+};
+
+export const FileUploadRangeHeaders: msRest.CompositeMapper = {
+ serializedName: "file-uploadrange-headers",
+ type: {
+ name: "Composite",
+ className: "FileUploadRangeHeaders",
+ modelProperties: {
+ eTag: {
+ serializedName: "etag",
+ type: {
+ name: "String"
+ }
+ },
+ lastModified: {
+ serializedName: "last-modified",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ contentMD5: {
+ serializedName: "content-md5",
+ type: {
+ name: "ByteArray"
+ }
+ },
+ requestId: {
+ serializedName: "x-ms-request-id",
+ type: {
+ name: "String"
+ }
+ },
+ version: {
+ serializedName: "x-ms-version",
+ type: {
+ name: "String"
+ }
+ },
+ date: {
+ serializedName: "date",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ isServerEncrypted: {
+ serializedName: "x-ms-request-server-encrypted",
+ type: {
+ name: "Boolean"
+ }
+ },
+ errorCode: {
+ serializedName: "x-ms-error-code",
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+};
+
+export const FileGetRangeListHeaders: msRest.CompositeMapper = {
+ serializedName: "file-getrangelist-headers",
+ type: {
+ name: "Composite",
+ className: "FileGetRangeListHeaders",
+ modelProperties: {
+ lastModified: {
+ serializedName: "last-modified",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ eTag: {
+ serializedName: "etag",
+ type: {
+ name: "String"
+ }
+ },
+ fileContentLength: {
+ serializedName: "x-ms-content-length",
+ type: {
+ name: "Number"
+ }
+ },
+ requestId: {
+ serializedName: "x-ms-request-id",
+ type: {
+ name: "String"
+ }
+ },
+ version: {
+ serializedName: "x-ms-version",
+ type: {
+ name: "String"
+ }
+ },
+ date: {
+ serializedName: "date",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ errorCode: {
+ serializedName: "x-ms-error-code",
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+};
+
+export const FileStartCopyHeaders: msRest.CompositeMapper = {
+ serializedName: "file-startcopy-headers",
+ type: {
+ name: "Composite",
+ className: "FileStartCopyHeaders",
+ modelProperties: {
+ eTag: {
+ serializedName: "etag",
+ type: {
+ name: "String"
+ }
+ },
+ lastModified: {
+ serializedName: "last-modified",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ requestId: {
+ serializedName: "x-ms-request-id",
+ type: {
+ name: "String"
+ }
+ },
+ version: {
+ serializedName: "x-ms-version",
+ type: {
+ name: "String"
+ }
+ },
+ date: {
+ serializedName: "date",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ copyId: {
+ serializedName: "x-ms-copy-id",
+ type: {
+ name: "String"
+ }
+ },
+ copyStatus: {
+ serializedName: "x-ms-copy-status",
+ type: {
+ name: "Enum",
+ allowedValues: [
+ "pending",
+ "success",
+ "aborted",
+ "failed"
+ ]
+ }
+ },
+ errorCode: {
+ serializedName: "x-ms-error-code",
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+};
+
+export const FileAbortCopyHeaders: msRest.CompositeMapper = {
+ serializedName: "file-abortcopy-headers",
+ type: {
+ name: "Composite",
+ className: "FileAbortCopyHeaders",
+ modelProperties: {
+ requestId: {
+ serializedName: "x-ms-request-id",
+ type: {
+ name: "String"
+ }
+ },
+ version: {
+ serializedName: "x-ms-version",
+ type: {
+ name: "String"
+ }
+ },
+ date: {
+ serializedName: "date",
+ type: {
+ name: "DateTimeRfc1123"
+ }
+ },
+ errorCode: {
+ serializedName: "x-ms-error-code",
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+};
+
+export const discriminators = {
+ 'Entry' : Entry,
+ 'Entry.Directory' : DirectoryItem,
+ 'Entry.File' : FileItem
+};
diff --git a/file/lib/generated/models/parameters.ts b/file/lib/generated/models/parameters.ts
new file mode 100644
index 0000000..bf8e3ba
--- /dev/null
+++ b/file/lib/generated/models/parameters.ts
@@ -0,0 +1,523 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * 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 * as msRest from "ms-rest-js";
+
+export const comp0: msRest.OperationQueryParameter = {
+ parameterPath: "comp",
+ mapper: {
+ required: true,
+ isConstant: true,
+ serializedName: "comp",
+ defaultValue: 'properties',
+ type: {
+ name: "String"
+ }
+ }
+};
+export const comp1: msRest.OperationQueryParameter = {
+ parameterPath: "comp",
+ mapper: {
+ required: true,
+ isConstant: true,
+ serializedName: "comp",
+ defaultValue: 'list',
+ type: {
+ name: "String"
+ }
+ }
+};
+export const comp2: msRest.OperationQueryParameter = {
+ parameterPath: "comp",
+ mapper: {
+ required: true,
+ isConstant: true,
+ serializedName: "comp",
+ defaultValue: 'snapshot',
+ type: {
+ name: "String"
+ }
+ }
+};
+export const comp3: msRest.OperationQueryParameter = {
+ parameterPath: "comp",
+ mapper: {
+ required: true,
+ isConstant: true,
+ serializedName: "comp",
+ defaultValue: 'metadata',
+ type: {
+ name: "String"
+ }
+ }
+};
+export const comp4: msRest.OperationQueryParameter = {
+ parameterPath: "comp",
+ mapper: {
+ required: true,
+ isConstant: true,
+ serializedName: "comp",
+ defaultValue: 'acl',
+ type: {
+ name: "String"
+ }
+ }
+};
+export const comp5: msRest.OperationQueryParameter = {
+ parameterPath: "comp",
+ mapper: {
+ required: true,
+ isConstant: true,
+ serializedName: "comp",
+ defaultValue: 'stats',
+ type: {
+ name: "String"
+ }
+ }
+};
+export const comp6: msRest.OperationQueryParameter = {
+ parameterPath: "comp",
+ mapper: {
+ required: true,
+ isConstant: true,
+ serializedName: "comp",
+ defaultValue: 'range',
+ type: {
+ name: "String"
+ }
+ }
+};
+export const comp7: msRest.OperationQueryParameter = {
+ parameterPath: "comp",
+ mapper: {
+ required: true,
+ isConstant: true,
+ serializedName: "comp",
+ defaultValue: 'rangelist',
+ type: {
+ name: "String"
+ }
+ }
+};
+export const comp8: msRest.OperationQueryParameter = {
+ parameterPath: "comp",
+ mapper: {
+ required: true,
+ isConstant: true,
+ serializedName: "comp",
+ defaultValue: 'copy',
+ type: {
+ name: "String"
+ }
+ }
+};
+export const contentLength: msRest.OperationParameter = {
+ parameterPath: "contentLength",
+ mapper: {
+ required: true,
+ serializedName: "Content-Length",
+ type: {
+ name: "Number"
+ }
+ }
+};
+export const contentMD5: msRest.OperationParameter = {
+ parameterPath: [
+ "options",
+ "contentMD5"
+ ],
+ mapper: {
+ serializedName: "Content-MD5",
+ type: {
+ name: "ByteArray"
+ }
+ }
+};
+export const copyActionAbortConstant: msRest.OperationParameter = {
+ parameterPath: "copyActionAbortConstant",
+ mapper: {
+ required: true,
+ isConstant: true,
+ serializedName: "x-ms-copy-action",
+ defaultValue: 'abort',
+ type: {
+ name: "String"
+ }
+ }
+};
+export const copyId: msRest.OperationQueryParameter = {
+ parameterPath: "copyId",
+ mapper: {
+ required: true,
+ serializedName: "copyid",
+ type: {
+ name: "String"
+ }
+ }
+};
+export const copySource: msRest.OperationParameter = {
+ parameterPath: "copySource",
+ mapper: {
+ required: true,
+ serializedName: "x-ms-copy-source",
+ type: {
+ name: "String"
+ }
+ }
+};
+export const deleteSnapshots: msRest.OperationParameter = {
+ parameterPath: [
+ "options",
+ "deleteSnapshots"
+ ],
+ mapper: {
+ serializedName: "x-ms-delete-snapshots",
+ type: {
+ name: "Enum",
+ allowedValues: [
+ "include"
+ ]
+ }
+ }
+};
+export const fileCacheControl: msRest.OperationParameter = {
+ parameterPath: [
+ "options",
+ "fileCacheControl"
+ ],
+ mapper: {
+ serializedName: "x-ms-cache-control",
+ type: {
+ name: "String"
+ }
+ }
+};
+export const fileContentDisposition: msRest.OperationParameter = {
+ parameterPath: [
+ "options",
+ "fileContentDisposition"
+ ],
+ mapper: {
+ serializedName: "x-ms-content-disposition",
+ type: {
+ name: "String"
+ }
+ }
+};
+export const fileContentEncoding: msRest.OperationParameter = {
+ parameterPath: [
+ "options",
+ "fileContentEncoding"
+ ],
+ mapper: {
+ serializedName: "x-ms-content-encoding",
+ type: {
+ name: "String"
+ }
+ }
+};
+export const fileContentLanguage: msRest.OperationParameter = {
+ parameterPath: [
+ "options",
+ "fileContentLanguage"
+ ],
+ mapper: {
+ serializedName: "x-ms-content-language",
+ type: {
+ name: "String"
+ }
+ }
+};
+export const fileContentLength0: msRest.OperationParameter = {
+ parameterPath: "fileContentLength",
+ mapper: {
+ required: true,
+ serializedName: "x-ms-content-length",
+ type: {
+ name: "Number"
+ }
+ }
+};
+export const fileContentLength1: msRest.OperationParameter = {
+ parameterPath: [
+ "options",
+ "fileContentLength"
+ ],
+ mapper: {
+ serializedName: "x-ms-content-length",
+ type: {
+ name: "Number"
+ }
+ }
+};
+export const fileContentMD5: msRest.OperationParameter = {
+ parameterPath: [
+ "options",
+ "fileContentMD5"
+ ],
+ mapper: {
+ serializedName: "x-ms-content-md5",
+ type: {
+ name: "ByteArray"
+ }
+ }
+};
+export const fileContentType: msRest.OperationParameter = {
+ parameterPath: [
+ "options",
+ "fileContentType"
+ ],
+ mapper: {
+ serializedName: "x-ms-content-type",
+ type: {
+ name: "String"
+ }
+ }
+};
+export const fileRangeWrite: msRest.OperationParameter = {
+ parameterPath: "fileRangeWrite",
+ mapper: {
+ required: true,
+ serializedName: "x-ms-write",
+ defaultValue: 'update',
+ type: {
+ name: "Enum",
+ allowedValues: [
+ "update",
+ "clear"
+ ]
+ }
+ }
+};
+export const fileTypeConstant: msRest.OperationParameter = {
+ parameterPath: "fileTypeConstant",
+ mapper: {
+ required: true,
+ isConstant: true,
+ serializedName: "x-ms-type",
+ defaultValue: 'file',
+ type: {
+ name: "String"
+ }
+ }
+};
+export const include: msRest.OperationQueryParameter = {
+ parameterPath: [
+ "options",
+ "include"
+ ],
+ mapper: {
+ serializedName: "include",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "Enum",
+ allowedValues: [
+ "snapshots",
+ "metadata"
+ ]
+ }
+ }
+ }
+ },
+ collectionFormat: msRest.QueryCollectionFormat.Csv
+};
+export const marker: msRest.OperationQueryParameter = {
+ parameterPath: [
+ "options",
+ "marker"
+ ],
+ mapper: {
+ serializedName: "marker",
+ type: {
+ name: "String"
+ }
+ }
+};
+export const maxresults: msRest.OperationQueryParameter = {
+ parameterPath: [
+ "options",
+ "maxresults"
+ ],
+ mapper: {
+ serializedName: "maxresults",
+ constraints: {
+ InclusiveMinimum: 1
+ },
+ type: {
+ name: "Number"
+ }
+ }
+};
+export const metadata: msRest.OperationParameter = {
+ parameterPath: [
+ "options",
+ "metadata"
+ ],
+ mapper: {
+ serializedName: "x-ms-meta",
+ type: {
+ name: "Dictionary",
+ value: {
+ type: {
+ name: "String"
+ }
+ }
+ },
+ headerCollectionPrefix: "x-ms-meta-"
+ }
+};
+export const prefix: msRest.OperationQueryParameter = {
+ parameterPath: [
+ "options",
+ "prefix"
+ ],
+ mapper: {
+ serializedName: "prefix",
+ type: {
+ name: "String"
+ }
+ }
+};
+export const quota: msRest.OperationParameter = {
+ parameterPath: [
+ "options",
+ "quota"
+ ],
+ mapper: {
+ serializedName: "x-ms-share-quota",
+ constraints: {
+ InclusiveMinimum: 1
+ },
+ type: {
+ name: "Number"
+ }
+ }
+};
+export const range0: msRest.OperationParameter = {
+ parameterPath: [
+ "options",
+ "range"
+ ],
+ mapper: {
+ serializedName: "x-ms-range",
+ type: {
+ name: "String"
+ }
+ }
+};
+export const range1: msRest.OperationParameter = {
+ parameterPath: "range",
+ mapper: {
+ required: true,
+ serializedName: "x-ms-range",
+ type: {
+ name: "String"
+ }
+ }
+};
+export const rangeGetContentMD5: msRest.OperationParameter = {
+ parameterPath: [
+ "options",
+ "rangeGetContentMD5"
+ ],
+ mapper: {
+ serializedName: "x-ms-range-get-content-md5",
+ type: {
+ name: "Boolean"
+ }
+ }
+};
+export const restype0: msRest.OperationQueryParameter = {
+ parameterPath: "restype",
+ mapper: {
+ required: true,
+ isConstant: true,
+ serializedName: "restype",
+ defaultValue: 'service',
+ type: {
+ name: "String"
+ }
+ }
+};
+export const restype1: msRest.OperationQueryParameter = {
+ parameterPath: "restype",
+ mapper: {
+ required: true,
+ isConstant: true,
+ serializedName: "restype",
+ defaultValue: 'share',
+ type: {
+ name: "String"
+ }
+ }
+};
+export const restype2: msRest.OperationQueryParameter = {
+ parameterPath: "restype",
+ mapper: {
+ required: true,
+ isConstant: true,
+ serializedName: "restype",
+ defaultValue: 'directory',
+ type: {
+ name: "String"
+ }
+ }
+};
+export const sharesnapshot: msRest.OperationQueryParameter = {
+ parameterPath: [
+ "options",
+ "sharesnapshot"
+ ],
+ mapper: {
+ serializedName: "sharesnapshot",
+ type: {
+ name: "String"
+ }
+ }
+};
+export const timeout: msRest.OperationQueryParameter = {
+ parameterPath: [
+ "options",
+ "timeout"
+ ],
+ mapper: {
+ serializedName: "timeout",
+ constraints: {
+ InclusiveMinimum: 0
+ },
+ type: {
+ name: "Number"
+ }
+ }
+};
+export const url: msRest.OperationURLParameter = {
+ parameterPath: "url",
+ mapper: {
+ required: true,
+ serializedName: "url",
+ defaultValue: '',
+ type: {
+ name: "String"
+ }
+ },
+ skipEncoding: true
+};
+export const version: msRest.OperationParameter = {
+ parameterPath: "version",
+ mapper: {
+ required: true,
+ serializedName: "x-ms-version",
+ type: {
+ name: "String"
+ }
+ }
+};
diff --git a/file/lib/generated/models/serviceMappers.ts b/file/lib/generated/models/serviceMappers.ts
new file mode 100644
index 0000000..86e757a
--- /dev/null
+++ b/file/lib/generated/models/serviceMappers.ts
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+export {
+ discriminators,
+ StorageServiceProperties,
+ Metrics,
+ RetentionPolicy,
+ CorsRule,
+ ServiceSetPropertiesHeaders,
+ StorageError,
+ ServiceGetPropertiesHeaders,
+ ListSharesResponse,
+ ShareItem,
+ ShareProperties,
+ ServiceListSharesSegmentHeaders
+} from "../models/mappers";
+
diff --git a/file/lib/generated/models/shareMappers.ts b/file/lib/generated/models/shareMappers.ts
new file mode 100644
index 0000000..412e3d4
--- /dev/null
+++ b/file/lib/generated/models/shareMappers.ts
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+export {
+ discriminators,
+ ShareCreateHeaders,
+ StorageError,
+ ShareGetPropertiesHeaders,
+ ShareDeleteHeaders,
+ ShareCreateSnapshotHeaders,
+ ShareSetQuotaHeaders,
+ ShareSetMetadataHeaders,
+ SignedIdentifier,
+ AccessPolicy,
+ ShareGetAccessPolicyHeaders,
+ ShareSetAccessPolicyHeaders,
+ ShareStats,
+ ShareGetStatisticsHeaders
+} from "../models/mappers";
+
diff --git a/file/lib/generated/operations/directory.ts b/file/lib/generated/operations/directory.ts
new file mode 100644
index 0000000..4ec8aeb
--- /dev/null
+++ b/file/lib/generated/operations/directory.ts
@@ -0,0 +1,290 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * 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 * as msRest from "ms-rest-js";
+import * as Models from "../models";
+import * as Mappers from "../models/directoryMappers";
+import * as Parameters from "../models/parameters";
+import { StorageClientContext } from "../storageClientContext";
+
+/** Class representing a Directory. */
+export class Directory {
+ private readonly client: StorageClientContext;
+
+ /**
+ * Create a Directory.
+ * @param {StorageClientContext} client Reference to the service client.
+ */
+ constructor(client: StorageClientContext) {
+ this.client = client;
+ }
+
+ /**
+ * Creates a new directory under the specified share or parent directory.
+ *
+ * @param {DirectoryCreateOptionalParams} [options] Optional Parameters.
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} The deserialized result object.
+ *
+ * @reject {Error|ServiceError} The error object.
+ */
+ create(): Promise;
+ create(options: Models.DirectoryCreateOptionalParams): Promise;
+ create(callback: msRest.ServiceCallback): void;
+ create(options: Models.DirectoryCreateOptionalParams, callback: msRest.ServiceCallback): void;
+ create(options?: Models.DirectoryCreateOptionalParams, callback?: msRest.ServiceCallback): Promise {
+ return this.client.sendOperationRequest(
+ {
+ options
+ },
+ createOperationSpec,
+ callback) as Promise;
+ }
+
+ /**
+ * Returns all system properties for the specified directory, and can also be used to check the
+ * existence of a directory. The data returned does not include the files in the directory or any
+ * subdirectories.
+ *
+ * @param {DirectoryGetPropertiesOptionalParams} [options] Optional Parameters.
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} The deserialized result object.
+ *
+ * @reject {Error|ServiceError} The error object.
+ */
+ getProperties(): Promise;
+ getProperties(options: Models.DirectoryGetPropertiesOptionalParams): Promise;
+ getProperties(callback: msRest.ServiceCallback): void;
+ getProperties(options: Models.DirectoryGetPropertiesOptionalParams, callback: msRest.ServiceCallback): void;
+ getProperties(options?: Models.DirectoryGetPropertiesOptionalParams, callback?: msRest.ServiceCallback): Promise {
+ return this.client.sendOperationRequest(
+ {
+ options
+ },
+ getPropertiesOperationSpec,
+ callback) as Promise;
+ }
+
+ /**
+ * Removes the specified empty directory. Note that the directory must be empty before it can be
+ * deleted.
+ *
+ * @param {DirectoryDeleteMethodOptionalParams} [options] Optional Parameters.
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} The deserialized result object.
+ *
+ * @reject {Error|ServiceError} The error object.
+ */
+ deleteMethod(): Promise;
+ deleteMethod(options: Models.DirectoryDeleteMethodOptionalParams): Promise;
+ deleteMethod(callback: msRest.ServiceCallback): void;
+ deleteMethod(options: Models.DirectoryDeleteMethodOptionalParams, callback: msRest.ServiceCallback): void;
+ deleteMethod(options?: Models.DirectoryDeleteMethodOptionalParams, callback?: msRest.ServiceCallback): Promise {
+ return this.client.sendOperationRequest(
+ {
+ options
+ },
+ deleteMethodOperationSpec,
+ callback) as Promise;
+ }
+
+ /**
+ * Updates user defined metadata for the specified directory.
+ *
+ * @param {DirectorySetMetadataOptionalParams} [options] Optional Parameters.
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} The deserialized result object.
+ *
+ * @reject {Error|ServiceError} The error object.
+ */
+ setMetadata(): Promise;
+ setMetadata(options: Models.DirectorySetMetadataOptionalParams): Promise;
+ setMetadata(callback: msRest.ServiceCallback): void;
+ setMetadata(options: Models.DirectorySetMetadataOptionalParams, callback: msRest.ServiceCallback): void;
+ setMetadata(options?: Models.DirectorySetMetadataOptionalParams, callback?: msRest.ServiceCallback): Promise {
+ return this.client.sendOperationRequest(
+ {
+ options
+ },
+ setMetadataOperationSpec,
+ callback) as Promise;
+ }
+
+ /**
+ * Returns a list of files or directories under the specified share or directory. It lists the
+ * contents only for a single level of the directory hierarchy.
+ *
+ * @param {DirectoryListFilesAndDirectoriesSegmentOptionalParams} [options] Optional Parameters.
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} The deserialized result object.
+ *
+ * @reject {Error|ServiceError} The error object.
+ */
+ listFilesAndDirectoriesSegment(): Promise;
+ listFilesAndDirectoriesSegment(options: Models.DirectoryListFilesAndDirectoriesSegmentOptionalParams): Promise;
+ listFilesAndDirectoriesSegment(callback: msRest.ServiceCallback): void;
+ listFilesAndDirectoriesSegment(options: Models.DirectoryListFilesAndDirectoriesSegmentOptionalParams, callback: msRest.ServiceCallback): void;
+ listFilesAndDirectoriesSegment(options?: Models.DirectoryListFilesAndDirectoriesSegmentOptionalParams, callback?: msRest.ServiceCallback): Promise {
+ return this.client.sendOperationRequest(
+ {
+ options
+ },
+ listFilesAndDirectoriesSegmentOperationSpec,
+ callback) as Promise;
+ }
+
+}
+
+// Operation Specifications
+const serializer = new msRest.Serializer(Mappers, true);
+const createOperationSpec: msRest.OperationSpec = {
+ httpMethod: "PUT",
+ path: "{shareName}/{directory}",
+ urlParameters: [
+ Parameters.url
+ ],
+ queryParameters: [
+ Parameters.timeout,
+ Parameters.restype2
+ ],
+ headerParameters: [
+ Parameters.metadata,
+ Parameters.version
+ ],
+ responses: {
+ 201: {
+ headersMapper: Mappers.DirectoryCreateHeaders
+ },
+ default: {
+ bodyMapper: Mappers.StorageError
+ }
+ },
+ isXML: true,
+ serializer
+};
+
+const getPropertiesOperationSpec: msRest.OperationSpec = {
+ httpMethod: "GET",
+ path: "{shareName}/{directory}",
+ urlParameters: [
+ Parameters.url
+ ],
+ queryParameters: [
+ Parameters.sharesnapshot,
+ Parameters.timeout,
+ Parameters.restype2
+ ],
+ headerParameters: [
+ Parameters.version
+ ],
+ responses: {
+ 200: {
+ headersMapper: Mappers.DirectoryGetPropertiesHeaders
+ },
+ default: {
+ bodyMapper: Mappers.StorageError
+ }
+ },
+ isXML: true,
+ serializer
+};
+
+const deleteMethodOperationSpec: msRest.OperationSpec = {
+ httpMethod: "DELETE",
+ path: "{shareName}/{directory}",
+ urlParameters: [
+ Parameters.url
+ ],
+ queryParameters: [
+ Parameters.timeout,
+ Parameters.restype2
+ ],
+ headerParameters: [
+ Parameters.version
+ ],
+ responses: {
+ 202: {
+ headersMapper: Mappers.DirectoryDeleteHeaders
+ },
+ default: {
+ bodyMapper: Mappers.StorageError
+ }
+ },
+ isXML: true,
+ serializer
+};
+
+const setMetadataOperationSpec: msRest.OperationSpec = {
+ httpMethod: "PUT",
+ path: "{shareName}/{directory}",
+ urlParameters: [
+ Parameters.url
+ ],
+ queryParameters: [
+ Parameters.timeout,
+ Parameters.restype2,
+ Parameters.comp3
+ ],
+ headerParameters: [
+ Parameters.metadata,
+ Parameters.version
+ ],
+ responses: {
+ 202: {
+ headersMapper: Mappers.DirectorySetMetadataHeaders
+ },
+ default: {
+ bodyMapper: Mappers.StorageError
+ }
+ },
+ isXML: true,
+ serializer
+};
+
+const listFilesAndDirectoriesSegmentOperationSpec: msRest.OperationSpec = {
+ httpMethod: "GET",
+ path: "{shareName}/{directory}",
+ urlParameters: [
+ Parameters.url
+ ],
+ queryParameters: [
+ Parameters.prefix,
+ Parameters.sharesnapshot,
+ Parameters.marker,
+ Parameters.maxresults,
+ Parameters.timeout,
+ Parameters.restype2,
+ Parameters.comp1
+ ],
+ headerParameters: [
+ Parameters.version
+ ],
+ responses: {
+ 200: {
+ bodyMapper: Mappers.ListFilesAndDirectoriesSegmentResponse,
+ headersMapper: Mappers.DirectoryListFilesAndDirectoriesSegmentHeaders
+ },
+ default: {
+ bodyMapper: Mappers.StorageError
+ }
+ },
+ isXML: true,
+ serializer
+};
diff --git a/file/lib/generated/operations/file.ts b/file/lib/generated/operations/file.ts
new file mode 100644
index 0000000..46e7649
--- /dev/null
+++ b/file/lib/generated/operations/file.ts
@@ -0,0 +1,624 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * 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 * as msRest from "ms-rest-js";
+import * as Models from "../models";
+import * as Mappers from "../models/fileMappers";
+import * as Parameters from "../models/parameters";
+import { StorageClientContext } from "../storageClientContext";
+
+/** Class representing a File. */
+export class File {
+ private readonly client: StorageClientContext;
+
+ /**
+ * Create a File.
+ * @param {StorageClientContext} client Reference to the service client.
+ */
+ constructor(client: StorageClientContext) {
+ this.client = client;
+ }
+
+ /**
+ * Creates a new file or replaces a file. Note it only initializes the file with no content.
+ *
+ * @param {number} fileContentLength Specifies the maximum size for the file, up to 1 TB.
+ *
+ * @param {FileCreateOptionalParams} [options] Optional Parameters.
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} The deserialized result object.
+ *
+ * @reject {Error|ServiceError} The error object.
+ */
+ create(fileContentLength: number): Promise;
+ create(fileContentLength: number, options: Models.FileCreateOptionalParams): Promise;
+ create(fileContentLength: number, callback: msRest.ServiceCallback): void;
+ create(fileContentLength: number, options: Models.FileCreateOptionalParams, callback: msRest.ServiceCallback): void;
+ create(fileContentLength: number, options?: Models.FileCreateOptionalParams, callback?: msRest.ServiceCallback): Promise {
+ return this.client.sendOperationRequest(
+ {
+ fileContentLength,
+ options
+ },
+ createOperationSpec,
+ callback) as Promise;
+ }
+
+ /**
+ * Reads or downloads a file from the system, including its metadata and properties.
+ *
+ * @param {FileDownloadOptionalParams} [options] Optional Parameters.
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} The deserialized result object.
+ *
+ * @reject {Error|ServiceError} The error object.
+ */
+ download(): Promise;
+ download(options: Models.FileDownloadOptionalParams): Promise;
+ download(callback: msRest.ServiceCallback): void;
+ download(options: Models.FileDownloadOptionalParams, callback: msRest.ServiceCallback): void;
+ download(options?: Models.FileDownloadOptionalParams, callback?: msRest.ServiceCallback): Promise {
+ return this.client.sendOperationRequest(
+ {
+ options
+ },
+ downloadOperationSpec,
+ callback) as Promise;
+ }
+
+ /**
+ * Returns all user-defined metadata, standard HTTP properties, and system properties for the file.
+ * It does not return the content of the file.
+ *
+ * @param {FileGetPropertiesOptionalParams} [options] Optional Parameters.
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} The deserialized result object.
+ *
+ * @reject {Error|ServiceError} The error object.
+ */
+ getProperties(): Promise;
+ getProperties(options: Models.FileGetPropertiesOptionalParams): Promise;
+ getProperties(callback: msRest.ServiceCallback): void;
+ getProperties(options: Models.FileGetPropertiesOptionalParams, callback: msRest.ServiceCallback): void;
+ getProperties(options?: Models.FileGetPropertiesOptionalParams, callback?: msRest.ServiceCallback): Promise {
+ return this.client.sendOperationRequest(
+ {
+ options
+ },
+ getPropertiesOperationSpec,
+ callback) as Promise;
+ }
+
+ /**
+ * removes the file from the storage account.
+ *
+ * @param {FileDeleteMethodOptionalParams} [options] Optional Parameters.
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} The deserialized result object.
+ *
+ * @reject {Error|ServiceError} The error object.
+ */
+ deleteMethod(): Promise;
+ deleteMethod(options: Models.FileDeleteMethodOptionalParams): Promise;
+ deleteMethod(callback: msRest.ServiceCallback): void;
+ deleteMethod(options: Models.FileDeleteMethodOptionalParams, callback: msRest.ServiceCallback): void;
+ deleteMethod(options?: Models.FileDeleteMethodOptionalParams, callback?: msRest.ServiceCallback): Promise {
+ return this.client.sendOperationRequest(
+ {
+ options
+ },
+ deleteMethodOperationSpec,
+ callback) as Promise;
+ }
+
+ /**
+ * Sets HTTP headers on the file.
+ *
+ * @param {FileSetHTTPHeadersOptionalParams} [options] Optional Parameters.
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} The deserialized result object.
+ *
+ * @reject {Error|ServiceError} The error object.
+ */
+ setHTTPHeaders(): Promise;
+ setHTTPHeaders(options: Models.FileSetHTTPHeadersOptionalParams): Promise;
+ setHTTPHeaders(callback: msRest.ServiceCallback): void;
+ setHTTPHeaders(options: Models.FileSetHTTPHeadersOptionalParams, callback: msRest.ServiceCallback): void;
+ setHTTPHeaders(options?: Models.FileSetHTTPHeadersOptionalParams, callback?: msRest.ServiceCallback): Promise {
+ return this.client.sendOperationRequest(
+ {
+ options
+ },
+ setHTTPHeadersOperationSpec,
+ callback) as Promise;
+ }
+
+ /**
+ * Updates user-defined metadata for the specified file.
+ *
+ * @param {FileSetMetadataOptionalParams} [options] Optional Parameters.
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} The deserialized result object.
+ *
+ * @reject {Error|ServiceError} The error object.
+ */
+ setMetadata(): Promise;
+ setMetadata(options: Models.FileSetMetadataOptionalParams): Promise;
+ setMetadata(callback: msRest.ServiceCallback): void;
+ setMetadata(options: Models.FileSetMetadataOptionalParams, callback: msRest.ServiceCallback): void;
+ setMetadata(options?: Models.FileSetMetadataOptionalParams, callback?: msRest.ServiceCallback): Promise {
+ return this.client.sendOperationRequest(
+ {
+ options
+ },
+ setMetadataOperationSpec,
+ callback) as Promise;
+ }
+
+ /**
+ * Upload a range of bytes to a file.
+ *
+ * @param {string} range Specifies the range of bytes to be written. Both the start and end of the
+ * range must be specified. For an update operation, the range can be up to 4 MB in size. For a
+ * clear operation, the range can be up to the value of the file's full size. The File service
+ * accepts only a single byte range for the Range and 'x-ms-range' headers, and the byte range must
+ * be specified in the following format: bytes=startByte-endByte.
+ *
+ * @param {FileRangeWriteType} fileRangeWrite Specify one of the following options: - Update:
+ * Writes the bytes specified by the request body into the specified range. The Range and
+ * Content-Length headers must match to perform the update. - Clear: Clears the specified range and
+ * releases the space used in storage for that range. To clear a range, set the Content-Length
+ * header to zero, and set the Range header to a value that indicates the range to clear, up to
+ * maximum file size. Possible values include: 'update', 'clear'
+ *
+ * @param {number} contentLength Specifies the number of bytes being transmitted in the request
+ * body. When the x-ms-write header is set to clear, the value of this header must be set to zero.
+ *
+ * @param {FileUploadRangeOptionalParams} [options] Optional Parameters.
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} The deserialized result object.
+ *
+ * @reject {Error|ServiceError} The error object.
+ */
+ uploadRange(range: string, fileRangeWrite: Models.FileRangeWriteType, contentLength: number): Promise;
+ uploadRange(range: string, fileRangeWrite: Models.FileRangeWriteType, contentLength: number, options: Models.FileUploadRangeOptionalParams): Promise;
+ uploadRange(range: string, fileRangeWrite: Models.FileRangeWriteType, contentLength: number, callback: msRest.ServiceCallback): void;
+ uploadRange(range: string, fileRangeWrite: Models.FileRangeWriteType, contentLength: number, options: Models.FileUploadRangeOptionalParams, callback: msRest.ServiceCallback): void;
+ uploadRange(range: string, fileRangeWrite: Models.FileRangeWriteType, contentLength: number, options?: Models.FileUploadRangeOptionalParams, callback?: msRest.ServiceCallback): Promise {
+ return this.client.sendOperationRequest(
+ {
+ range,
+ fileRangeWrite,
+ contentLength,
+ options
+ },
+ uploadRangeOperationSpec,
+ callback) as Promise;
+ }
+
+ /**
+ * Returns the list of valid ranges for a file.
+ *
+ * @param {FileGetRangeListOptionalParams} [options] Optional Parameters.
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} The deserialized result object.
+ *
+ * @reject {Error|ServiceError} The error object.
+ */
+ getRangeList(): Promise;
+ getRangeList(options: Models.FileGetRangeListOptionalParams): Promise;
+ getRangeList(callback: msRest.ServiceCallback): void;
+ getRangeList(options: Models.FileGetRangeListOptionalParams, callback: msRest.ServiceCallback): void;
+ getRangeList(options?: Models.FileGetRangeListOptionalParams, callback?: msRest.ServiceCallback): Promise {
+ return this.client.sendOperationRequest(
+ {
+ options
+ },
+ getRangeListOperationSpec,
+ callback) as Promise;
+ }
+
+ /**
+ * Copies a blob or file to a destination file within the storage account.
+ *
+ * @param {string} copySource Specifies the URL of the source file or blob, up to 2 KB in length.
+ * To copy a file to another file within the same storage account, you may use Shared Key to
+ * authenticate the source file. If you are copying a file from another storage account, or if you
+ * are copying a blob from the same storage account or another storage account, then you must
+ * authenticate the source file or blob using a shared access signature. If the source is a public
+ * blob, no authentication is required to perform the copy operation. A file in a share snapshot
+ * can also be specified as a copy source.
+ *
+ * @param {FileStartCopyOptionalParams} [options] Optional Parameters.
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} The deserialized result object.
+ *
+ * @reject {Error|ServiceError} The error object.
+ */
+ startCopy(copySource: string): Promise;
+ startCopy(copySource: string, options: Models.FileStartCopyOptionalParams): Promise;
+ startCopy(copySource: string, callback: msRest.ServiceCallback): void;
+ startCopy(copySource: string, options: Models.FileStartCopyOptionalParams, callback: msRest.ServiceCallback): void;
+ startCopy(copySource: string, options?: Models.FileStartCopyOptionalParams, callback?: msRest.ServiceCallback): Promise {
+ return this.client.sendOperationRequest(
+ {
+ copySource,
+ options
+ },
+ startCopyOperationSpec,
+ callback) as Promise;
+ }
+
+ /**
+ * Aborts a pending Copy File operation, and leaves a destination file with zero length and full
+ * metadata.
+ *
+ * @param {string} copyId The copy identifier provided in the x-ms-copy-id header of the original
+ * Copy File operation.
+ *
+ * @param {FileAbortCopyOptionalParams} [options] Optional Parameters.
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} The deserialized result object.
+ *
+ * @reject {Error|ServiceError} The error object.
+ */
+ abortCopy(copyId: string): Promise;
+ abortCopy(copyId: string, options: Models.FileAbortCopyOptionalParams): Promise;
+ abortCopy(copyId: string, callback: msRest.ServiceCallback): void;
+ abortCopy(copyId: string, options: Models.FileAbortCopyOptionalParams, callback: msRest.ServiceCallback): void;
+ abortCopy(copyId: string, options?: Models.FileAbortCopyOptionalParams, callback?: msRest.ServiceCallback): Promise {
+ return this.client.sendOperationRequest(
+ {
+ copyId,
+ options
+ },
+ abortCopyOperationSpec,
+ callback) as Promise;
+ }
+
+}
+
+// Operation Specifications
+const serializer = new msRest.Serializer(Mappers, true);
+const createOperationSpec: msRest.OperationSpec = {
+ httpMethod: "PUT",
+ path: "{shareName}/{directory}/{fileName}",
+ urlParameters: [
+ Parameters.url
+ ],
+ queryParameters: [
+ Parameters.timeout
+ ],
+ headerParameters: [
+ Parameters.version,
+ Parameters.fileContentLength0,
+ Parameters.fileTypeConstant,
+ Parameters.fileContentType,
+ Parameters.fileContentEncoding,
+ Parameters.fileContentLanguage,
+ Parameters.fileCacheControl,
+ Parameters.fileContentMD5,
+ Parameters.fileContentDisposition,
+ Parameters.metadata
+ ],
+ responses: {
+ 201: {
+ headersMapper: Mappers.FileCreateHeaders
+ },
+ default: {
+ bodyMapper: Mappers.StorageError
+ }
+ },
+ isXML: true,
+ serializer
+};
+
+const downloadOperationSpec: msRest.OperationSpec = {
+ httpMethod: "GET",
+ path: "{shareName}/{directory}/{fileName}",
+ urlParameters: [
+ Parameters.url
+ ],
+ queryParameters: [
+ Parameters.timeout
+ ],
+ headerParameters: [
+ Parameters.version,
+ Parameters.range0,
+ Parameters.rangeGetContentMD5
+ ],
+ responses: {
+ 200: {
+ bodyMapper: {
+ serializedName: "parsedResponse",
+ type: {
+ name: "Stream"
+ }
+ },
+ headersMapper: Mappers.FileDownloadHeaders
+ },
+ 206: {
+ bodyMapper: {
+ serializedName: "parsedResponse",
+ type: {
+ name: "Stream"
+ }
+ },
+ headersMapper: Mappers.FileDownloadHeaders
+ },
+ default: {
+ bodyMapper: Mappers.StorageError
+ }
+ },
+ isXML: true,
+ serializer
+};
+
+const getPropertiesOperationSpec: msRest.OperationSpec = {
+ httpMethod: "HEAD",
+ path: "{shareName}/{directory}/{fileName}",
+ urlParameters: [
+ Parameters.url
+ ],
+ queryParameters: [
+ Parameters.sharesnapshot,
+ Parameters.timeout
+ ],
+ headerParameters: [
+ Parameters.version
+ ],
+ responses: {
+ 200: {
+ headersMapper: Mappers.FileGetPropertiesHeaders
+ },
+ default: {
+ bodyMapper: Mappers.StorageError
+ }
+ },
+ isXML: true,
+ serializer
+};
+
+const deleteMethodOperationSpec: msRest.OperationSpec = {
+ httpMethod: "DELETE",
+ path: "{shareName}/{directory}/{fileName}",
+ urlParameters: [
+ Parameters.url
+ ],
+ queryParameters: [
+ Parameters.timeout
+ ],
+ headerParameters: [
+ Parameters.version
+ ],
+ responses: {
+ 202: {
+ headersMapper: Mappers.FileDeleteHeaders
+ },
+ default: {
+ bodyMapper: Mappers.StorageError
+ }
+ },
+ isXML: true,
+ serializer
+};
+
+const setHTTPHeadersOperationSpec: msRest.OperationSpec = {
+ httpMethod: "PUT",
+ path: "{shareName}/{directory}/{fileName}",
+ urlParameters: [
+ Parameters.url
+ ],
+ queryParameters: [
+ Parameters.timeout,
+ Parameters.comp0
+ ],
+ headerParameters: [
+ Parameters.version,
+ Parameters.fileContentLength1,
+ Parameters.fileContentType,
+ Parameters.fileContentEncoding,
+ Parameters.fileContentLanguage,
+ Parameters.fileCacheControl,
+ Parameters.fileContentMD5,
+ Parameters.fileContentDisposition
+ ],
+ responses: {
+ 200: {
+ headersMapper: Mappers.FileSetHTTPHeadersHeaders
+ },
+ default: {
+ bodyMapper: Mappers.StorageError
+ }
+ },
+ isXML: true,
+ serializer
+};
+
+const setMetadataOperationSpec: msRest.OperationSpec = {
+ httpMethod: "PUT",
+ path: "{shareName}/{directory}/{fileName}",
+ urlParameters: [
+ Parameters.url
+ ],
+ queryParameters: [
+ Parameters.timeout,
+ Parameters.comp3
+ ],
+ headerParameters: [
+ Parameters.metadata,
+ Parameters.version
+ ],
+ responses: {
+ 202: {
+ headersMapper: Mappers.FileSetMetadataHeaders
+ },
+ default: {
+ bodyMapper: Mappers.StorageError
+ }
+ },
+ isXML: true,
+ serializer
+};
+
+const uploadRangeOperationSpec: msRest.OperationSpec = {
+ httpMethod: "PUT",
+ path: "{shareName}/{directory}/{fileName}",
+ urlParameters: [
+ Parameters.url
+ ],
+ queryParameters: [
+ Parameters.timeout,
+ Parameters.comp6
+ ],
+ headerParameters: [
+ Parameters.range1,
+ Parameters.fileRangeWrite,
+ Parameters.contentLength,
+ Parameters.contentMD5,
+ Parameters.version
+ ],
+ requestBody: {
+ parameterPath: [
+ "options",
+ "optionalbody"
+ ],
+ mapper: {
+ serializedName: "optionalbody",
+ type: {
+ name: "Stream"
+ }
+ }
+ },
+ contentType: "application/octet-stream",
+ responses: {
+ 201: {
+ headersMapper: Mappers.FileUploadRangeHeaders
+ },
+ default: {
+ bodyMapper: Mappers.StorageError
+ }
+ },
+ isXML: true,
+ serializer
+};
+
+const getRangeListOperationSpec: msRest.OperationSpec = {
+ httpMethod: "GET",
+ path: "{shareName}/{directory}/{fileName}",
+ urlParameters: [
+ Parameters.url
+ ],
+ queryParameters: [
+ Parameters.sharesnapshot,
+ Parameters.timeout,
+ Parameters.comp7
+ ],
+ headerParameters: [
+ Parameters.version,
+ Parameters.range0
+ ],
+ responses: {
+ 200: {
+ bodyMapper: {
+ xmlElementName: "Ranges",
+ serializedName: "parsedResponse",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "Composite",
+ className: "Range"
+ }
+ }
+ }
+ },
+ headersMapper: Mappers.FileGetRangeListHeaders
+ },
+ default: {
+ bodyMapper: Mappers.StorageError
+ }
+ },
+ isXML: true,
+ serializer
+};
+
+const startCopyOperationSpec: msRest.OperationSpec = {
+ httpMethod: "PUT",
+ path: "{shareName}/{directory}/{fileName}",
+ urlParameters: [
+ Parameters.url
+ ],
+ queryParameters: [
+ Parameters.timeout
+ ],
+ headerParameters: [
+ Parameters.version,
+ Parameters.metadata,
+ Parameters.copySource
+ ],
+ responses: {
+ 202: {
+ headersMapper: Mappers.FileStartCopyHeaders
+ },
+ default: {
+ bodyMapper: Mappers.StorageError
+ }
+ },
+ isXML: true,
+ serializer
+};
+
+const abortCopyOperationSpec: msRest.OperationSpec = {
+ httpMethod: "PUT",
+ path: "{shareName}/{directory}/{fileName}",
+ urlParameters: [
+ Parameters.url
+ ],
+ queryParameters: [
+ Parameters.copyId,
+ Parameters.timeout,
+ Parameters.comp8
+ ],
+ headerParameters: [
+ Parameters.copyActionAbortConstant,
+ Parameters.version
+ ],
+ responses: {
+ 204: {
+ headersMapper: Mappers.FileAbortCopyHeaders
+ },
+ default: {
+ bodyMapper: Mappers.StorageError
+ }
+ },
+ isXML: true,
+ serializer
+};
diff --git a/file/lib/generated/operations/index.ts b/file/lib/generated/operations/index.ts
new file mode 100644
index 0000000..44ac61a
--- /dev/null
+++ b/file/lib/generated/operations/index.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.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+export * from "./service";
+export * from "./share";
+export * from "./directory";
+export * from "./file";
diff --git a/file/lib/generated/operations/service.ts b/file/lib/generated/operations/service.ts
new file mode 100644
index 0000000..5469dcb
--- /dev/null
+++ b/file/lib/generated/operations/service.ts
@@ -0,0 +1,197 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * 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 * as msRest from "ms-rest-js";
+import * as Models from "../models";
+import * as Mappers from "../models/serviceMappers";
+import * as Parameters from "../models/parameters";
+import { StorageClientContext } from "../storageClientContext";
+
+/** Class representing a Service. */
+export class Service {
+ private readonly client: StorageClientContext;
+
+ /**
+ * Create a Service.
+ * @param {StorageClientContext} client Reference to the service client.
+ */
+ constructor(client: StorageClientContext) {
+ this.client = client;
+ }
+
+ /**
+ * Sets properties for a storage account's File service endpoint, including properties for Storage
+ * Analytics metrics and CORS (Cross-Origin Resource Sharing) rules.
+ *
+ * @param {StorageServiceProperties} storageServiceProperties The StorageService properties.
+ *
+ * @param {ServiceSetPropertiesOptionalParams} [options] Optional Parameters.
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} The deserialized result object.
+ *
+ * @reject {Error|ServiceError} The error object.
+ */
+ setProperties(storageServiceProperties: Models.StorageServiceProperties): Promise;
+ setProperties(storageServiceProperties: Models.StorageServiceProperties, options: Models.ServiceSetPropertiesOptionalParams): Promise;
+ setProperties(storageServiceProperties: Models.StorageServiceProperties, callback: msRest.ServiceCallback): void;
+ setProperties(storageServiceProperties: Models.StorageServiceProperties, options: Models.ServiceSetPropertiesOptionalParams, callback: msRest.ServiceCallback): void;
+ setProperties(storageServiceProperties: Models.StorageServiceProperties, options?: Models.ServiceSetPropertiesOptionalParams, callback?: msRest.ServiceCallback): Promise {
+ return this.client.sendOperationRequest(
+ {
+ storageServiceProperties,
+ options
+ },
+ setPropertiesOperationSpec,
+ callback) as Promise;
+ }
+
+ /**
+ * Gets the properties of a storage account's File service, including properties for Storage
+ * Analytics metrics and CORS (Cross-Origin Resource Sharing) rules.
+ *
+ * @param {ServiceGetPropertiesOptionalParams} [options] Optional Parameters.
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} The deserialized result object.
+ *
+ * @reject {Error|ServiceError} The error object.
+ */
+ getProperties(): Promise;
+ getProperties(options: Models.ServiceGetPropertiesOptionalParams): Promise;
+ getProperties(callback: msRest.ServiceCallback): void;
+ getProperties(options: Models.ServiceGetPropertiesOptionalParams, callback: msRest.ServiceCallback): void;
+ getProperties(options?: Models.ServiceGetPropertiesOptionalParams, callback?: msRest.ServiceCallback): Promise {
+ return this.client.sendOperationRequest(
+ {
+ options
+ },
+ getPropertiesOperationSpec,
+ callback) as Promise;
+ }
+
+ /**
+ * The List Shares Segment operation returns a list of the shares and share snapshots under the
+ * specified account.
+ *
+ * @param {ServiceListSharesSegmentOptionalParams} [options] Optional Parameters.
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} The deserialized result object.
+ *
+ * @reject {Error|ServiceError} The error object.
+ */
+ listSharesSegment(): Promise;
+ listSharesSegment(options: Models.ServiceListSharesSegmentOptionalParams): Promise;
+ listSharesSegment(callback: msRest.ServiceCallback): void;
+ listSharesSegment(options: Models.ServiceListSharesSegmentOptionalParams, callback: msRest.ServiceCallback): void;
+ listSharesSegment(options?: Models.ServiceListSharesSegmentOptionalParams, callback?: msRest.ServiceCallback): Promise {
+ return this.client.sendOperationRequest(
+ {
+ options
+ },
+ listSharesSegmentOperationSpec,
+ callback) as Promise;
+ }
+
+}
+
+// Operation Specifications
+const serializer = new msRest.Serializer(Mappers, true);
+const setPropertiesOperationSpec: msRest.OperationSpec = {
+ httpMethod: "PUT",
+ urlParameters: [
+ Parameters.url
+ ],
+ queryParameters: [
+ Parameters.timeout,
+ Parameters.restype0,
+ Parameters.comp0
+ ],
+ headerParameters: [
+ Parameters.version
+ ],
+ requestBody: {
+ parameterPath: "storageServiceProperties",
+ mapper: {
+ ...Mappers.StorageServiceProperties,
+ required: true
+ }
+ },
+ contentType: "application/xml; charset=utf-8",
+ responses: {
+ 202: {
+ headersMapper: Mappers.ServiceSetPropertiesHeaders
+ },
+ default: {
+ bodyMapper: Mappers.StorageError
+ }
+ },
+ isXML: true,
+ serializer
+};
+
+const getPropertiesOperationSpec: msRest.OperationSpec = {
+ httpMethod: "GET",
+ urlParameters: [
+ Parameters.url
+ ],
+ queryParameters: [
+ Parameters.timeout,
+ Parameters.restype0,
+ Parameters.comp0
+ ],
+ headerParameters: [
+ Parameters.version
+ ],
+ responses: {
+ 200: {
+ bodyMapper: Mappers.StorageServiceProperties,
+ headersMapper: Mappers.ServiceGetPropertiesHeaders
+ },
+ default: {
+ bodyMapper: Mappers.StorageError
+ }
+ },
+ isXML: true,
+ serializer
+};
+
+const listSharesSegmentOperationSpec: msRest.OperationSpec = {
+ httpMethod: "GET",
+ urlParameters: [
+ Parameters.url
+ ],
+ queryParameters: [
+ Parameters.prefix,
+ Parameters.marker,
+ Parameters.maxresults,
+ Parameters.include,
+ Parameters.timeout,
+ Parameters.comp1
+ ],
+ headerParameters: [
+ Parameters.version
+ ],
+ responses: {
+ 200: {
+ bodyMapper: Mappers.ListSharesResponse,
+ headersMapper: Mappers.ServiceListSharesSegmentHeaders
+ },
+ default: {
+ bodyMapper: Mappers.StorageError
+ }
+ },
+ isXML: true,
+ serializer
+};
diff --git a/file/lib/generated/operations/share.ts b/file/lib/generated/operations/share.ts
new file mode 100644
index 0000000..3668ae4
--- /dev/null
+++ b/file/lib/generated/operations/share.ts
@@ -0,0 +1,524 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * 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 * as msRest from "ms-rest-js";
+import * as Models from "../models";
+import * as Mappers from "../models/shareMappers";
+import * as Parameters from "../models/parameters";
+import { StorageClientContext } from "../storageClientContext";
+
+/** Class representing a Share. */
+export class Share {
+ private readonly client: StorageClientContext;
+
+ /**
+ * Create a Share.
+ * @param {StorageClientContext} client Reference to the service client.
+ */
+ constructor(client: StorageClientContext) {
+ this.client = client;
+ }
+
+ /**
+ * Creates a new share under the specified account. If the share with the same name already exists,
+ * the operation fails.
+ *
+ * @param {ShareCreateOptionalParams} [options] Optional Parameters.
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} The deserialized result object.
+ *
+ * @reject {Error|ServiceError} The error object.
+ */
+ create(): Promise;
+ create(options: Models.ShareCreateOptionalParams): Promise;
+ create(callback: msRest.ServiceCallback): void;
+ create(options: Models.ShareCreateOptionalParams, callback: msRest.ServiceCallback): void;
+ create(options?: Models.ShareCreateOptionalParams, callback?: msRest.ServiceCallback): Promise {
+ return this.client.sendOperationRequest(
+ {
+ options
+ },
+ createOperationSpec,
+ callback) as Promise;
+ }
+
+ /**
+ * Returns all user-defined metadata and system properties for the specified share or share
+ * snapshot. The data returned does not include the share's list of files.
+ *
+ * @param {ShareGetPropertiesOptionalParams} [options] Optional Parameters.
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} The deserialized result object.
+ *
+ * @reject {Error|ServiceError} The error object.
+ */
+ getProperties(): Promise;
+ getProperties(options: Models.ShareGetPropertiesOptionalParams): Promise;
+ getProperties(callback: msRest.ServiceCallback): void;
+ getProperties(options: Models.ShareGetPropertiesOptionalParams, callback: msRest.ServiceCallback): void;
+ getProperties(options?: Models.ShareGetPropertiesOptionalParams, callback?: msRest.ServiceCallback