Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Storage][File] Various renames from API review #5610

Merged
merged 8 commits into from
Oct 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sdk/storage/storage-file/samples/typescript/advanced.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ async function main() {
// FileClient.uploadFile() is only available in Node.js
await fileClient.uploadFile(localFilePath, {
rangeSize: 4 * 1024 * 1024, // 4MB range size
parallelism: 20, // 20 concurrency
concurrency: 20, // 20 concurrency
progress: (ev) => console.log(ev)
});
console.log("uploadFile success");
Expand All @@ -98,7 +98,7 @@ async function main() {
const browserFile = document.getElementById("fileinput").files[0];
await fileClient.uploadBrowserData(browserFile, {
rangeSize: 4 * 1024 * 1024, // 4MB range size
parallelism: 20, // 20 concurrency
concurrency: 20, // 20 concurrency
progress: ev => console.log(ev)
});
*/
Expand All @@ -109,7 +109,7 @@ async function main() {
await fileClient.downloadToBuffer(buffer, undefined, undefined, {
abortSignal: AbortController.timeout(30 * 60 * 1000),
rangeSize: 4 * 1024 * 1024, // 4MB range size
parallelism: 20, // 20 concurrency
concurrency: 20, // 20 concurrency
progress: (ev) => console.log(ev)
});
console.log("downloadToBuffer success");
Expand Down
32 changes: 16 additions & 16 deletions sdk/storage/storage-file/src/DirectoryClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
fileLastWriteTimeToString,
validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions
} from "./models";
import { newPipeline, NewPipelineOptions, Pipeline } from "./Pipeline";
import { newPipeline, StoragePipelineOptions, Pipeline } from "./Pipeline";
import { appendToURLPath, getShareNameAndPathFromUrl } from "./utils/utils.common";
import { StorageClient, CommonOptions } from "./StorageClient";
import "@azure/core-paging";
Expand Down Expand Up @@ -88,13 +88,13 @@ interface DirectoryListFilesAndDirectoriesSegmentOptions extends CommonOptions {

/**
* Specifies the maximum number of entries to
* return. If the request does not specify maxresults, or specifies a value
* 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 DirectoryListFilesAndDirectoriesSegmentOptions
*/
maxresults?: number;
maxResults?: number;
}

/**
Expand Down Expand Up @@ -189,13 +189,13 @@ export interface DirectoryListHandlesSegmentOptions extends CommonOptions {
*/
abortSignal?: AbortSignalLike;
/**
* Specifies the maximum number of entries to return. If the request does not specify 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.
*
* @type {number}
* @memberof DirectoryListHandlesSegmentOptions
*/
maxresults?: number;
maxResults?: number;
/**
* Specifies operation should apply to the directory specified in the URI, its files, its
* subdirectories and their files.
Expand Down Expand Up @@ -312,10 +312,10 @@ export class DirectoryClient extends StorageClient {
* Such as a directory named "mydir%", the URL should be "https://myaccount.file.core.windows.net/myshare/mydir%25".
* @param {Credential} [credential] Such as AnonymousCredential, SharedKeyCredential or TokenCredential.
* If not specified, AnonymousCredential is used.
* @param {NewPipelineOptions} [options] Optional. Options to configure the HTTP pipeline.
* @param {StoragePipelineOptions} [options] Optional. Options to configure the HTTP pipeline.
* @memberof DirectoryClient
*/
constructor(url: string, credential?: Credential, options?: NewPipelineOptions);
constructor(url: string, credential?: Credential, options?: StoragePipelineOptions);
/**
* Creates an instance of DirectoryClient.
*
Expand All @@ -335,7 +335,7 @@ export class DirectoryClient extends StorageClient {
constructor(
url: string,
credentialOrPipeline?: Credential | Pipeline,
options: NewPipelineOptions = {}
options: StoragePipelineOptions = {}
) {
let pipeline: Pipeline;
if (credentialOrPipeline instanceof Pipeline) {
Expand Down Expand Up @@ -703,9 +703,9 @@ export class DirectoryClient extends StorageClient {
* @private
* @param {string} [marker] A string value that identifies the portion of
* the list of files and directories to be returned with the next listing operation. The
* operation returns the NextMarker value within the response body if the
* operation returns the ContinuationToken value within the response body if the
* listing operation did not return all files and directories remaining to be listed
* with the current page. The NextMarker value can be used as the value for
* with the current page. The ContinuationToken value can be used as the value for
* the marker parameter in a subsequent call to request the next page of list
* items. The marker value is opaque to the client.
* @param {DirectoryListFilesAndDirectoriesSegmentOptions} [options] Options to list files and directories operation.
Expand All @@ -719,7 +719,7 @@ export class DirectoryClient extends StorageClient {
let listFilesAndDirectoriesResponse;
do {
listFilesAndDirectoriesResponse = await this.listFilesAndDirectoriesSegment(marker, options);
marker = listFilesAndDirectoriesResponse.nextMarker;
marker = listFilesAndDirectoriesResponse.continuationToken;
yield await listFilesAndDirectoriesResponse;
} while (marker);
}
Expand Down Expand Up @@ -816,7 +816,7 @@ export class DirectoryClient extends StorageClient {
* console.log(`${i++} - directory\t: ${dirItem.name}`);
* }
* // Gets next marker
* let dirMarker = response.nextMarker;
* let dirMarker = response.continuationToken;
* // Passing next marker as continuationToken
* iterator = directoryClient
* .listFilesAndDirectories()
Expand Down Expand Up @@ -862,7 +862,7 @@ export class DirectoryClient extends StorageClient {
*/
byPage: (settings: PageSettings = {}) => {
return this.iterateFilesAndDirectoriesSegments(settings.continuationToken, {
maxresults: settings.maxPageSize,
maxResults: settings.maxPageSize,
...options
});
}
Expand Down Expand Up @@ -925,7 +925,7 @@ export class DirectoryClient extends StorageClient {
if (!!marker || marker === undefined) {
do {
listHandlesResponse = await this.listHandlesSegment(marker, options);
marker = listHandlesResponse.nextMarker;
marker = listHandlesResponse.continuationToken;
yield await listHandlesResponse;
} while (marker);
}
Expand Down Expand Up @@ -1006,7 +1006,7 @@ export class DirectoryClient extends StorageClient {
* }
* }
* // Gets next marker
* let marker = response.value.nextMarker;
* let marker = response.value.continuationToken;
* // Passing next marker as continuationToken
* console.log(` continuation`);
* iterator = dirClient.listHandles().byPage({ continuationToken: marker, maxPageSize: 10 });
Expand Down Expand Up @@ -1047,7 +1047,7 @@ export class DirectoryClient extends StorageClient {
*/
byPage: (settings: PageSettings = {}) => {
return this.iterateHandleSegments(settings.continuationToken, {
maxresults: settings.maxPageSize,
maxResults: settings.maxPageSize,
...options
});
}
Expand Down
Loading