-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[Storage] Make Aborter parameter optional - storage-file #2908
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
Merged
jeremymeng
merged 6 commits into
Azure:feature/storage
from
HarshaNalluru:OptionalAborterParam
May 17, 2019
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
6f1b857
Make Aborter param optional
HarshaNalluru ff7666b
Resolve merge conflicts with feature branch
HarshaNalluru 0d47757
resolve merge conflicts - 2
HarshaNalluru a083898
Remove aborter def from docs wherever unnecessary
HarshaNalluru fa2b45c
Merge branch 'feature/storage' of https://github.com/Azure/azure-sdk-…
HarshaNalluru 4b8022e
addressing the comments
HarshaNalluru File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ import { StorageClient } from "./StorageClient"; | |
| import { appendToURLPath } from "./utils/utils.common"; | ||
|
|
||
| export interface IDirectoryCreateOptions { | ||
| abortSignal?: Aborter; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to copy and paste some documentation for |
||
| /** | ||
| * A name-value pair | ||
| * to associate with a file storage object. | ||
|
|
@@ -19,6 +20,7 @@ export interface IDirectoryCreateOptions { | |
| } | ||
|
|
||
| export interface IDirectoryListFilesAndDirectoriesSegmentOptions { | ||
| abortSignal?: Aborter; | ||
| /** | ||
| * Filters the results to return only entries whose | ||
| * name begins with the specified prefix. | ||
|
|
@@ -39,6 +41,18 @@ export interface IDirectoryListFilesAndDirectoriesSegmentOptions { | |
| maxresults?: number; | ||
| } | ||
|
|
||
| export interface IDirectoryDeleteOptions { | ||
| abortSignal?: Aborter; | ||
| } | ||
|
|
||
| export interface IDirectoryGetPropertiesOptions { | ||
| abortSignal?: Aborter; | ||
| } | ||
|
|
||
| export interface IDirectorySetMetadataOptions { | ||
| abortSignal?: Aborter; | ||
| } | ||
|
|
||
| /** | ||
| * A DirectoryClient represents a URL to the Azure Storage directory allowing you to manipulate its files and directories. | ||
| * | ||
|
|
@@ -121,16 +135,14 @@ export class DirectoryClient extends StorageClient { | |
| * Creates a new directory under the specified share or parent directory. | ||
| * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-directory | ||
| * | ||
| * @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 {IDirectoryCreateOptions} [options] | ||
| * @returns {Promise<Models.DirectoryCreateResponse>} | ||
| * @memberof DirectoryClient | ||
| */ | ||
| public async create( | ||
| aborter: Aborter, | ||
| options: IDirectoryCreateOptions = {} | ||
| ): Promise<Models.DirectoryCreateResponse> { | ||
| const aborter = options.abortSignal || Aborter.none; | ||
| return this.context.create({ | ||
| ...options, | ||
| abortSignal: aborter | ||
|
|
@@ -143,12 +155,13 @@ export class DirectoryClient extends StorageClient { | |
| * subdirectories. | ||
| * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-directory-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<Models.DirectoryGetPropertiesResponse>} | ||
| * @memberof DirectoryClient | ||
| */ | ||
| public async getProperties(aborter: Aborter): Promise<Models.DirectoryGetPropertiesResponse> { | ||
| public async getProperties( | ||
| options: IDirectoryGetPropertiesOptions = {} | ||
| ): Promise<Models.DirectoryGetPropertiesResponse> { | ||
| const aborter = options.abortSignal || Aborter.none; | ||
| return this.context.getProperties({ | ||
| abortSignal: aborter | ||
| }); | ||
|
|
@@ -159,12 +172,13 @@ export class DirectoryClient extends StorageClient { | |
| * deleted. | ||
| * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-directory | ||
| * | ||
| * @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<Models.DirectoryDeleteResponse>} | ||
| * @memberof DirectoryClient | ||
| */ | ||
| public async delete(aborter: Aborter): Promise<Models.DirectoryDeleteResponse> { | ||
| public async delete( | ||
| options: IDirectoryDeleteOptions = {} | ||
| ): Promise<Models.DirectoryDeleteResponse> { | ||
| const aborter = options.abortSignal || Aborter.none; | ||
| return this.context.deleteMethod({ | ||
| abortSignal: aborter | ||
| }); | ||
|
|
@@ -174,16 +188,15 @@ export class DirectoryClient extends StorageClient { | |
| * Updates user defined metadata for the specified directory. | ||
| * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-directory-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 {IMetadata} [metadata] If no metadata provided, all existing directory metadata will be removed | ||
| * @returns {Promise<Models.DirectorySetMetadataResponse>} | ||
| * @memberof DirectoryClient | ||
| */ | ||
| public async setMetadata( | ||
| aborter: Aborter, | ||
| metadata?: IMetadata | ||
| metadata?: IMetadata, | ||
| options: IDirectorySetMetadataOptions = {} | ||
| ): Promise<Models.DirectorySetMetadataResponse> { | ||
| const aborter = options.abortSignal || Aborter.none; | ||
| return this.context.setMetadata({ | ||
| abortSignal: aborter, | ||
| metadata | ||
|
|
@@ -195,18 +208,16 @@ export class DirectoryClient extends StorageClient { | |
| * contents only for a single level of the directory hierarchy. | ||
| * @see https://docs.microsoft.com/en-us/rest/api/storageservices/list-directories-and-files | ||
| * | ||
| * @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 {IDirectoryListFilesAndDirectoriesSegmentOptions} [options] | ||
| * @returns {Promise<Models.DirectoryListFilesAndDirectoriesSegmentResponse>} | ||
| * @memberof DirectoryClient | ||
| */ | ||
| public async listFilesAndDirectoriesSegment( | ||
| aborter: Aborter, | ||
| marker?: string, | ||
| options: IDirectoryListFilesAndDirectoriesSegmentOptions = {} | ||
| ): Promise<Models.DirectoryListFilesAndDirectoriesSegmentResponse> { | ||
| const aborter = options.abortSignal || Aborter.none; | ||
| return this.context.listFilesAndDirectoriesSegment({ | ||
| abortSignal: aborter, | ||
| marker, | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.