From fc26e78a00b3adbd0fe55095804cfc7165a0a5c3 Mon Sep 17 00:00:00 2001 From: Jose Manuel Heredia Hidalgo Date: Wed, 16 Oct 2019 13:04:24 -0700 Subject: [PATCH 1/8] rename maxresults to maxResults --- sdk/storage/storage-file/src/DirectoryClient.ts | 12 ++++++------ sdk/storage/storage-file/src/FileClient.ts | 6 +++--- sdk/storage/storage-file/src/FileServiceClient.ts | 6 +++--- .../storage-file/src/generated/src/models/index.ts | 8 ++++---- .../src/generated/src/models/parameters.ts | 4 ++-- .../src/generated/src/operations/directory.ts | 4 ++-- .../src/generated/src/operations/file.ts | 2 +- .../src/generated/src/operations/service.ts | 2 +- sdk/storage/storage-file/swagger/README.md | 11 ++++++++++- 9 files changed, 32 insertions(+), 23 deletions(-) diff --git a/sdk/storage/storage-file/src/DirectoryClient.ts b/sdk/storage/storage-file/src/DirectoryClient.ts index f9a27f470555..cb894bb8e4bd 100644 --- a/sdk/storage/storage-file/src/DirectoryClient.ts +++ b/sdk/storage/storage-file/src/DirectoryClient.ts @@ -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; } /** @@ -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. @@ -862,7 +862,7 @@ export class DirectoryClient extends StorageClient { */ byPage: (settings: PageSettings = {}) => { return this.iterateFilesAndDirectoriesSegments(settings.continuationToken, { - maxresults: settings.maxPageSize, + maxResults: settings.maxPageSize, ...options }); } @@ -1047,7 +1047,7 @@ export class DirectoryClient extends StorageClient { */ byPage: (settings: PageSettings = {}) => { return this.iterateHandleSegments(settings.continuationToken, { - maxresults: settings.maxPageSize, + maxResults: settings.maxPageSize, ...options }); } diff --git a/sdk/storage/storage-file/src/FileClient.ts b/sdk/storage/storage-file/src/FileClient.ts index 2f081589120f..3a2d9edd17ac 100644 --- a/sdk/storage/storage-file/src/FileClient.ts +++ b/sdk/storage/storage-file/src/FileClient.ts @@ -438,13 +438,13 @@ export interface FileListHandlesSegmentOptions 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 FileListHandlesSegmentOptions */ - maxresults?: number; + maxResults?: number; } export interface FileListHandlesOptions extends CommonOptions { @@ -1945,7 +1945,7 @@ export class FileClient extends StorageClient { */ byPage: (settings: PageSettings = {}) => { return this.iterateHandleSegments(settings.continuationToken, { - maxresults: settings.maxPageSize, + maxResults: settings.maxPageSize, ...options }); } diff --git a/sdk/storage/storage-file/src/FileServiceClient.ts b/sdk/storage/storage-file/src/FileServiceClient.ts index 91b7677976e0..dc56a2810712 100644 --- a/sdk/storage/storage-file/src/FileServiceClient.ts +++ b/sdk/storage/storage-file/src/FileServiceClient.ts @@ -41,13 +41,13 @@ interface ServiceListSharesSegmentOptions extends CommonOptions { prefix?: string; /** * 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 ServiceListSharesSegmentOptions */ - maxresults?: number; + maxResults?: number; /** * Include this parameter to @@ -518,7 +518,7 @@ export class FileServiceClient extends StorageClient { */ byPage: (settings: PageSettings = {}) => { return this.listSegments(settings.continuationToken, { - maxresults: settings.maxPageSize, + maxResults: settings.maxPageSize, ...updatedOptions }); } diff --git a/sdk/storage/storage-file/src/generated/src/models/index.ts b/sdk/storage/storage-file/src/generated/src/models/index.ts index da65efd93ce8..fecec4b5ecf7 100644 --- a/sdk/storage/storage-file/src/generated/src/models/index.ts +++ b/sdk/storage/storage-file/src/generated/src/models/index.ts @@ -392,7 +392,7 @@ export interface ServiceListSharesSegmentOptionalParams extends coreHttp.Request * 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; + maxResults?: number; /** * Include this parameter to specify one or more datasets to include in the response. */ @@ -699,7 +699,7 @@ export interface DirectoryListFilesAndDirectoriesSegmentOptionalParams extends c * 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; + maxResults?: number; /** * The timeout parameter is expressed in seconds. For more information, see Setting @@ -723,7 +723,7 @@ export interface DirectoryListHandlesOptionalParams extends coreHttp.RequestOpti * 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; + maxResults?: number; /** * The timeout parameter is expressed in seconds. For more information, see Setting @@ -1012,7 +1012,7 @@ export interface FileListHandlesOptionalParams extends coreHttp.RequestOptionsBa * 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; + maxResults?: number; /** * The timeout parameter is expressed in seconds. For more information, see Setting diff --git a/sdk/storage/storage-file/src/generated/src/models/parameters.ts b/sdk/storage/storage-file/src/generated/src/models/parameters.ts index 1c607e3a8b0a..84db251fe61c 100644 --- a/sdk/storage/storage-file/src/generated/src/models/parameters.ts +++ b/sdk/storage/storage-file/src/generated/src/models/parameters.ts @@ -470,10 +470,10 @@ export const marker: coreHttp.OperationQueryParameter = { } } }; -export const maxresults: coreHttp.OperationQueryParameter = { +export const maxResults: coreHttp.OperationQueryParameter = { parameterPath: [ "options", - "maxresults" + "maxResults" ], mapper: { serializedName: "maxresults", diff --git a/sdk/storage/storage-file/src/generated/src/operations/directory.ts b/sdk/storage/storage-file/src/generated/src/operations/directory.ts index b458802c7f78..4a515ace26f4 100644 --- a/sdk/storage/storage-file/src/generated/src/operations/directory.ts +++ b/sdk/storage/storage-file/src/generated/src/operations/directory.ts @@ -412,7 +412,7 @@ const listFilesAndDirectoriesSegmentOperationSpec: coreHttp.OperationSpec = { Parameters.prefix, Parameters.sharesnapshot, Parameters.marker, - Parameters.maxresults, + Parameters.maxResults, Parameters.timeout, Parameters.restype2, Parameters.comp1 @@ -441,7 +441,7 @@ const listHandlesOperationSpec: coreHttp.OperationSpec = { ], queryParameters: [ Parameters.marker, - Parameters.maxresults, + Parameters.maxResults, Parameters.timeout, Parameters.sharesnapshot, Parameters.comp7 diff --git a/sdk/storage/storage-file/src/generated/src/operations/file.ts b/sdk/storage/storage-file/src/generated/src/operations/file.ts index 75a4de566497..3add25d43821 100644 --- a/sdk/storage/storage-file/src/generated/src/operations/file.ts +++ b/sdk/storage/storage-file/src/generated/src/operations/file.ts @@ -859,7 +859,7 @@ const listHandlesOperationSpec: coreHttp.OperationSpec = { ], queryParameters: [ Parameters.marker, - Parameters.maxresults, + Parameters.maxResults, Parameters.timeout, Parameters.sharesnapshot, Parameters.comp7 diff --git a/sdk/storage/storage-file/src/generated/src/operations/service.ts b/sdk/storage/storage-file/src/generated/src/operations/service.ts index 3dbd07106463..826490596843 100644 --- a/sdk/storage/storage-file/src/generated/src/operations/service.ts +++ b/sdk/storage/storage-file/src/generated/src/operations/service.ts @@ -175,7 +175,7 @@ const listSharesSegmentOperationSpec: coreHttp.OperationSpec = { queryParameters: [ Parameters.prefix, Parameters.marker, - Parameters.maxresults, + Parameters.maxResults, Parameters.include, Parameters.timeout, Parameters.comp1 diff --git a/sdk/storage/storage-file/swagger/README.md b/sdk/storage/storage-file/swagger/README.md index 2a603bb6b3be..342828639c65 100644 --- a/sdk/storage/storage-file/swagger/README.md +++ b/sdk/storage/storage-file/swagger/README.md @@ -55,4 +55,13 @@ directive: const path = def["$ref"].replace(/[#].*$/, "#/definitions/FileServiceProperties"); $.get.responses["200"].schema = { "$ref": path }; } -``` \ No newline at end of file +``` + +### Rename maxresults -> maxResults +``` yaml +directive: +- from: swagger-document + where: $.parameters.MaxResults + transform: > + $["x-ms-client-name"] = "maxResults"; +``` From a0bbc0ba62c13590ee1d006da58d3fc2fef29221 Mon Sep 17 00:00:00 2001 From: Jose Manuel Heredia Hidalgo Date: Wed, 16 Oct 2019 13:14:11 -0700 Subject: [PATCH 2/8] rename shareSnapshot --- .../src/generated/src/models/index.ts | 20 +++++++++---------- .../src/generated/src/models/parameters.ts | 4 ++-- .../src/generated/src/operations/directory.ts | 8 ++++---- .../src/generated/src/operations/file.ts | 8 ++++---- .../src/generated/src/operations/share.ts | 4 ++-- sdk/storage/storage-file/swagger/README.md | 9 +++++++++ 6 files changed, 31 insertions(+), 22 deletions(-) diff --git a/sdk/storage/storage-file/src/generated/src/models/index.ts b/sdk/storage/storage-file/src/generated/src/models/index.ts index fecec4b5ecf7..b67399b8488a 100644 --- a/sdk/storage/storage-file/src/generated/src/models/index.ts +++ b/sdk/storage/storage-file/src/generated/src/models/index.ts @@ -433,7 +433,7 @@ export interface ShareGetPropertiesOptionalParams extends coreHttp.RequestOption * The snapshot parameter is an opaque DateTime value that, when present, specifies the share * snapshot to query. */ - sharesnapshot?: string; + shareSnapshot?: string; /** * The timeout parameter is expressed in seconds. For more information, see Setting @@ -450,7 +450,7 @@ export interface ShareDeleteMethodOptionalParams extends coreHttp.RequestOptions * The snapshot parameter is an opaque DateTime value that, when present, specifies the share * snapshot to query. */ - sharesnapshot?: string; + shareSnapshot?: string; /** * The timeout parameter is expressed in seconds. For more information, see Setting @@ -613,7 +613,7 @@ export interface DirectoryGetPropertiesOptionalParams extends coreHttp.RequestOp * The snapshot parameter is an opaque DateTime value that, when present, specifies the share * snapshot to query. */ - sharesnapshot?: string; + shareSnapshot?: string; /** * The timeout parameter is expressed in seconds. For more information, see Setting @@ -687,7 +687,7 @@ export interface DirectoryListFilesAndDirectoriesSegmentOptionalParams extends c * The snapshot parameter is an opaque DateTime value that, when present, specifies the share * snapshot to query. */ - sharesnapshot?: string; + shareSnapshot?: string; /** * 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 @@ -734,7 +734,7 @@ export interface DirectoryListHandlesOptionalParams extends coreHttp.RequestOpti * The snapshot parameter is an opaque DateTime value that, when present, specifies the share * snapshot to query. */ - sharesnapshot?: string; + shareSnapshot?: string; /** * Specifies operation should apply to the directory specified in the URI, its files, its * subdirectories and their files. @@ -763,7 +763,7 @@ export interface DirectoryForceCloseHandlesOptionalParams extends coreHttp.Reque * The snapshot parameter is an opaque DateTime value that, when present, specifies the share * snapshot to query. */ - sharesnapshot?: string; + shareSnapshot?: string; /** * Specifies operation should apply to the directory specified in the URI, its files, its * subdirectories and their files. @@ -834,7 +834,7 @@ export interface FileGetPropertiesOptionalParams extends coreHttp.RequestOptions * The snapshot parameter is an opaque DateTime value that, when present, specifies the share * snapshot to query. */ - sharesnapshot?: string; + shareSnapshot?: string; /** * The timeout parameter is expressed in seconds. For more information, see Setting @@ -956,7 +956,7 @@ export interface FileGetRangeListOptionalParams extends coreHttp.RequestOptionsB * The snapshot parameter is an opaque DateTime value that, when present, specifies the share * snapshot to query. */ - sharesnapshot?: string; + shareSnapshot?: string; /** * The timeout parameter is expressed in seconds. For more information, see Setting @@ -1023,7 +1023,7 @@ export interface FileListHandlesOptionalParams extends coreHttp.RequestOptionsBa * The snapshot parameter is an opaque DateTime value that, when present, specifies the share * snapshot to query. */ - sharesnapshot?: string; + shareSnapshot?: string; } /** @@ -1047,7 +1047,7 @@ export interface FileForceCloseHandlesOptionalParams extends coreHttp.RequestOpt * The snapshot parameter is an opaque DateTime value that, when present, specifies the share * snapshot to query. */ - sharesnapshot?: string; + shareSnapshot?: string; } /** diff --git a/sdk/storage/storage-file/src/generated/src/models/parameters.ts b/sdk/storage/storage-file/src/generated/src/models/parameters.ts index 84db251fe61c..9cc9b7a400f9 100644 --- a/sdk/storage/storage-file/src/generated/src/models/parameters.ts +++ b/sdk/storage/storage-file/src/generated/src/models/parameters.ts @@ -612,10 +612,10 @@ export const restype2: coreHttp.OperationQueryParameter = { } } }; -export const sharesnapshot: coreHttp.OperationQueryParameter = { +export const shareSnapshot: coreHttp.OperationQueryParameter = { parameterPath: [ "options", - "sharesnapshot" + "shareSnapshot" ], mapper: { serializedName: "sharesnapshot", diff --git a/sdk/storage/storage-file/src/generated/src/operations/directory.ts b/sdk/storage/storage-file/src/generated/src/operations/directory.ts index 4a515ace26f4..4cae82f6255c 100644 --- a/sdk/storage/storage-file/src/generated/src/operations/directory.ts +++ b/sdk/storage/storage-file/src/generated/src/operations/directory.ts @@ -300,7 +300,7 @@ const getPropertiesOperationSpec: coreHttp.OperationSpec = { Parameters.url ], queryParameters: [ - Parameters.sharesnapshot, + Parameters.shareSnapshot, Parameters.timeout, Parameters.restype2 ], @@ -410,7 +410,7 @@ const listFilesAndDirectoriesSegmentOperationSpec: coreHttp.OperationSpec = { ], queryParameters: [ Parameters.prefix, - Parameters.sharesnapshot, + Parameters.shareSnapshot, Parameters.marker, Parameters.maxResults, Parameters.timeout, @@ -443,7 +443,7 @@ const listHandlesOperationSpec: coreHttp.OperationSpec = { Parameters.marker, Parameters.maxResults, Parameters.timeout, - Parameters.sharesnapshot, + Parameters.shareSnapshot, Parameters.comp7 ], headerParameters: [ @@ -472,7 +472,7 @@ const forceCloseHandlesOperationSpec: coreHttp.OperationSpec = { queryParameters: [ Parameters.timeout, Parameters.marker, - Parameters.sharesnapshot, + Parameters.shareSnapshot, Parameters.comp8 ], headerParameters: [ diff --git a/sdk/storage/storage-file/src/generated/src/operations/file.ts b/sdk/storage/storage-file/src/generated/src/operations/file.ts index 3add25d43821..aead8f7d25d5 100644 --- a/sdk/storage/storage-file/src/generated/src/operations/file.ts +++ b/sdk/storage/storage-file/src/generated/src/operations/file.ts @@ -578,7 +578,7 @@ const getPropertiesOperationSpec: coreHttp.OperationSpec = { Parameters.url ], queryParameters: [ - Parameters.sharesnapshot, + Parameters.shareSnapshot, Parameters.timeout ], headerParameters: [ @@ -765,7 +765,7 @@ const getRangeListOperationSpec: coreHttp.OperationSpec = { Parameters.url ], queryParameters: [ - Parameters.sharesnapshot, + Parameters.shareSnapshot, Parameters.timeout, Parameters.comp10 ], @@ -861,7 +861,7 @@ const listHandlesOperationSpec: coreHttp.OperationSpec = { Parameters.marker, Parameters.maxResults, Parameters.timeout, - Parameters.sharesnapshot, + Parameters.shareSnapshot, Parameters.comp7 ], headerParameters: [ @@ -889,7 +889,7 @@ const forceCloseHandlesOperationSpec: coreHttp.OperationSpec = { queryParameters: [ Parameters.timeout, Parameters.marker, - Parameters.sharesnapshot, + Parameters.shareSnapshot, Parameters.comp8 ], headerParameters: [ diff --git a/sdk/storage/storage-file/src/generated/src/operations/share.ts b/sdk/storage/storage-file/src/generated/src/operations/share.ts index dbe0b3f31ecf..8c64664759ab 100644 --- a/sdk/storage/storage-file/src/generated/src/operations/share.ts +++ b/sdk/storage/storage-file/src/generated/src/operations/share.ts @@ -341,7 +341,7 @@ const getPropertiesOperationSpec: coreHttp.OperationSpec = { Parameters.url ], queryParameters: [ - Parameters.sharesnapshot, + Parameters.shareSnapshot, Parameters.timeout, Parameters.restype1 ], @@ -367,7 +367,7 @@ const deleteMethodOperationSpec: coreHttp.OperationSpec = { Parameters.url ], queryParameters: [ - Parameters.sharesnapshot, + Parameters.shareSnapshot, Parameters.timeout, Parameters.restype1 ], diff --git a/sdk/storage/storage-file/swagger/README.md b/sdk/storage/storage-file/swagger/README.md index 342828639c65..60c816a5e9d2 100644 --- a/sdk/storage/storage-file/swagger/README.md +++ b/sdk/storage/storage-file/swagger/README.md @@ -65,3 +65,12 @@ directive: transform: > $["x-ms-client-name"] = "maxResults"; ``` + +### Rename sharesnapshot -> shareSnapshot +``` yaml +directive: +- from: swagger-document + where: $.parameters.ShareSnapshot + transform: > + $["x-ms-client-name"] = "shareSnapshot"; +``` From e47f39b0e0f9628fd69dd38d47891750717bb441 Mon Sep 17 00:00:00 2001 From: Jose Manuel Heredia Hidalgo Date: Wed, 16 Oct 2019 13:34:21 -0700 Subject: [PATCH 3/8] rename ACL permission to permissions --- sdk/storage/storage-file/src/ShareClient.ts | 8 +- .../src/generated/src/models/index.ts | 2 +- .../src/generated/src/models/mappers.ts | 2 +- sdk/storage/storage-file/swagger/README.md | 98 +++++++++++-------- .../storage-file/test/node/sas.spec.ts | 2 +- .../test/node/shareclient.spec.ts | 6 +- 6 files changed, 66 insertions(+), 52 deletions(-) diff --git a/sdk/storage/storage-file/src/ShareClient.ts b/sdk/storage/storage-file/src/ShareClient.ts index 2be03fe3702c..fc1bacbbc4f9 100644 --- a/sdk/storage/storage-file/src/ShareClient.ts +++ b/sdk/storage/storage-file/src/ShareClient.ts @@ -209,10 +209,10 @@ export interface SignedIdentifier { */ expiry: Date; /** - * @member {string} permission the permissions for the acl policy + * @member {string} permissions the permissions for the acl policy * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-share-acl */ - permission: string; + permissions: string; }; } @@ -766,7 +766,7 @@ export class ShareClient extends StorageClient { res.signedIdentifiers.push({ accessPolicy: { expiry: new Date(identifier.accessPolicy!.expiry!), - permission: identifier.accessPolicy!.permission!, + permissions: identifier.accessPolicy!.permissions!, start: new Date(identifier.accessPolicy!.start!) }, id: identifier.id @@ -810,7 +810,7 @@ export class ShareClient extends StorageClient { acl.push({ accessPolicy: { expiry: truncatedISO8061Date(identifier.accessPolicy.expiry), - permission: identifier.accessPolicy.permission, + permissions: identifier.accessPolicy.permissions, start: truncatedISO8061Date(identifier.accessPolicy.start) }, id: identifier.id diff --git a/sdk/storage/storage-file/src/generated/src/models/index.ts b/sdk/storage/storage-file/src/generated/src/models/index.ts index b67399b8488a..a08f3c516a7f 100644 --- a/sdk/storage/storage-file/src/generated/src/models/index.ts +++ b/sdk/storage/storage-file/src/generated/src/models/index.ts @@ -28,7 +28,7 @@ export interface AccessPolicy { /** * The permissions for the ACL policy. */ - permission?: string; + permissions?: string; } /** diff --git a/sdk/storage/storage-file/src/generated/src/models/mappers.ts b/sdk/storage/storage-file/src/generated/src/models/mappers.ts index a24e0a86c418..c09cba5d1edd 100644 --- a/sdk/storage/storage-file/src/generated/src/models/mappers.ts +++ b/sdk/storage/storage-file/src/generated/src/models/mappers.ts @@ -29,7 +29,7 @@ export const AccessPolicy: coreHttp.CompositeMapper = { name: "String" } }, - permission: { + permissions: { xmlName: "Permission", serializedName: "Permission", type: { diff --git a/sdk/storage/storage-file/swagger/README.md b/sdk/storage/storage-file/swagger/README.md index 60c816a5e9d2..812598b999fd 100644 --- a/sdk/storage/storage-file/swagger/README.md +++ b/sdk/storage/storage-file/swagger/README.md @@ -18,59 +18,73 @@ optional-response-headers: true ``` ## Customizations for Track 2 Generator + See the [AutoRest samples](https://github.com/Azure/autorest/tree/master/Samples/3b-custom-transformations) for more about how we're customizing things. ### /?restype=service&comp=properties (StorageServiceProperties renamed to FileServiceProperties) -``` yaml + +```yaml directive: -- from: swagger-document - where: $.definitions - transform: > - if (!$.FileServiceProperties) { - $.FileServiceProperties = $.StorageServiceProperties; - delete $.StorageServiceProperties; - $.FileServiceProperties.xml = { "name": "StorageServiceProperties" }; - } -- from: swagger-document - where: $.parameters - transform: > - if (!$.FileServiceProperties) { - const props = $.FileServiceProperties = $.StorageServiceProperties; - props.name = "FileServiceProperties"; - props["x-ms-client-name"] = "properties"; - props.schema = { "$ref": props.schema.$ref.replace(/[#].*$/, "#/definitions/FileServiceProperties") }; - delete $.StorageServiceProperties; - } -- from: swagger-document - where: $["x-ms-paths"]["/?restype=service&comp=properties"] - transform: > - const param = $.put.parameters[0]; - if (param && param["$ref"] && param["$ref"].endsWith("StorageServiceProperties")) { - const path = param["$ref"].replace(/[#].*$/, "#/parameters/FileServiceProperties"); - $.put.parameters[0] = { "$ref": path }; - } - const def = $.get.responses["200"].schema; - if (def && def["$ref"] && def["$ref"].endsWith("StorageServiceProperties")) { - const path = def["$ref"].replace(/[#].*$/, "#/definitions/FileServiceProperties"); - $.get.responses["200"].schema = { "$ref": path }; - } + - from: swagger-document + where: $.definitions + transform: > + if (!$.FileServiceProperties) { + $.FileServiceProperties = $.StorageServiceProperties; + delete $.StorageServiceProperties; + $.FileServiceProperties.xml = { "name": "StorageServiceProperties" }; + } + - from: swagger-document + where: $.parameters + transform: > + if (!$.FileServiceProperties) { + const props = $.FileServiceProperties = $.StorageServiceProperties; + props.name = "FileServiceProperties"; + props["x-ms-client-name"] = "properties"; + props.schema = { "$ref": props.schema.$ref.replace(/[#].*$/, "#/definitions/FileServiceProperties") }; + delete $.StorageServiceProperties; + } + - from: swagger-document + where: $["x-ms-paths"]["/?restype=service&comp=properties"] + transform: > + const param = $.put.parameters[0]; + if (param && param["$ref"] && param["$ref"].endsWith("StorageServiceProperties")) { + const path = param["$ref"].replace(/[#].*$/, "#/parameters/FileServiceProperties"); + $.put.parameters[0] = { "$ref": path }; + } + const def = $.get.responses["200"].schema; + if (def && def["$ref"] && def["$ref"].endsWith("StorageServiceProperties")) { + const path = def["$ref"].replace(/[#].*$/, "#/definitions/FileServiceProperties"); + $.get.responses["200"].schema = { "$ref": path }; + } ``` ### Rename maxresults -> maxResults -``` yaml + +```yaml directive: -- from: swagger-document - where: $.parameters.MaxResults - transform: > - $["x-ms-client-name"] = "maxResults"; + - from: swagger-document + where: $.parameters.MaxResults + transform: > + $["x-ms-client-name"] = "maxResults"; ``` ### Rename sharesnapshot -> shareSnapshot -``` yaml + +```yaml +directive: + - from: swagger-document + where: $.parameters.ShareSnapshot + transform: > + $["x-ms-client-name"] = "shareSnapshot"; +``` + +### Rename permission -> permissions + +```yaml directive: -- from: swagger-document - where: $.parameters.ShareSnapshot - transform: > - $["x-ms-client-name"] = "shareSnapshot"; + - from: swagger-document + where: $.definitions.AccessPolicy.properties.Permission + transform: > + $["x-ms-client-name"] = "permissions"; ``` diff --git a/sdk/storage/storage-file/test/node/sas.spec.ts b/sdk/storage/storage-file/test/node/sas.spec.ts index f4747f943887..e7facf24ad74 100644 --- a/sdk/storage/storage-file/test/node/sas.spec.ts +++ b/sdk/storage/storage-file/test/node/sas.spec.ts @@ -299,7 +299,7 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { { accessPolicy: { expiry: tmr, - permission: ShareSASPermissions.parse("rcwdl").toString(), + permissions: ShareSASPermissions.parse("rcwdl").toString(), start: now }, id diff --git a/sdk/storage/storage-file/test/node/shareclient.spec.ts b/sdk/storage/storage-file/test/node/shareclient.spec.ts index 54f22f3ea371..f7dd2af32827 100644 --- a/sdk/storage/storage-file/test/node/shareclient.spec.ts +++ b/sdk/storage/storage-file/test/node/shareclient.spec.ts @@ -32,7 +32,7 @@ describe("ShareClient Node.js only", () => { { accessPolicy: { expiry: tomorrow, - permission: "rwd", + permissions: "rwd", start: yesterday }, id: "MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI=" @@ -52,8 +52,8 @@ describe("ShareClient Node.js only", () => { identifiers[0].accessPolicy.start.getTime() ); assert.equal( - getAccessPolicyResponse.signedIdentifiers[0].accessPolicy.permission, - identifiers[0].accessPolicy.permission + getAccessPolicyResponse.signedIdentifiers[0].accessPolicy.permissions, + identifiers[0].accessPolicy.permissions ); }); From 9b3b544b035431c5324227eb85361f4fe69896eb Mon Sep 17 00:00:00 2001 From: Jose Manuel Heredia Hidalgo Date: Wed, 16 Oct 2019 13:46:22 -0700 Subject: [PATCH 4/8] rename nextMarker --- sdk/storage/storage-file/src/DirectoryClient.ts | 12 ++++++------ sdk/storage/storage-file/src/FileClient.ts | 2 +- sdk/storage/storage-file/src/FileServiceClient.ts | 8 ++++---- .../storage-file/src/generated/src/models/index.ts | 6 +++--- .../storage-file/src/generated/src/models/mappers.ts | 6 +++--- sdk/storage/storage-file/swagger/README.md | 10 ++++++++++ .../storage-file/test/directoryclient.spec.ts | 10 +++++----- .../storage-file/test/fileserviceclient.spec.ts | 8 ++++---- 8 files changed, 36 insertions(+), 26 deletions(-) diff --git a/sdk/storage/storage-file/src/DirectoryClient.ts b/sdk/storage/storage-file/src/DirectoryClient.ts index cb894bb8e4bd..77dde02926a8 100644 --- a/sdk/storage/storage-file/src/DirectoryClient.ts +++ b/sdk/storage/storage-file/src/DirectoryClient.ts @@ -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. @@ -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); } @@ -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() @@ -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); } @@ -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 }); diff --git a/sdk/storage/storage-file/src/FileClient.ts b/sdk/storage/storage-file/src/FileClient.ts index 3a2d9edd17ac..02755a705921 100644 --- a/sdk/storage/storage-file/src/FileClient.ts +++ b/sdk/storage/storage-file/src/FileClient.ts @@ -1884,7 +1884,7 @@ export class FileClient extends StorageClient { if (!!marker || marker === undefined) { do { listHandlesResponse = await this.listHandlesSegment(marker, options); - marker = listHandlesResponse.nextMarker; + marker = listHandlesResponse.continuationToken; yield listHandlesResponse; } while (marker); } diff --git a/sdk/storage/storage-file/src/FileServiceClient.ts b/sdk/storage/storage-file/src/FileServiceClient.ts index dc56a2810712..f22c7293999c 100644 --- a/sdk/storage/storage-file/src/FileServiceClient.ts +++ b/sdk/storage/storage-file/src/FileServiceClient.ts @@ -374,9 +374,9 @@ export class FileServiceClient extends StorageClient { * @private * @param {string} [marker] A string value that identifies the portion of * the list of shares 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 shares 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 {ServiceListSharesSegmentOptions} [options] Options to list shares operation. @@ -390,7 +390,7 @@ export class FileServiceClient extends StorageClient { let listSharesSegmentResponse; do { listSharesSegmentResponse = await this.listSharesSegment(marker, options); - marker = listSharesSegmentResponse.nextMarker; + marker = listSharesSegmentResponse.continuationToken; yield await listSharesSegmentResponse; } while (marker); } @@ -465,7 +465,7 @@ export class FileServiceClient extends StorageClient { * } * } * // Gets next marker - * let marker = response.nextMarker; + * let marker = response.continuationToken; * // Passing next marker as continuationToken * iterator = serviceClient.listShares().byPage({ continuationToken: marker, maxPageSize: 10 }); * response = (await iterator.next()).value; diff --git a/sdk/storage/storage-file/src/generated/src/models/index.ts b/sdk/storage/storage-file/src/generated/src/models/index.ts index a08f3c516a7f..aaa7e9ce9f67 100644 --- a/sdk/storage/storage-file/src/generated/src/models/index.ts +++ b/sdk/storage/storage-file/src/generated/src/models/index.ts @@ -151,7 +151,7 @@ export interface ListFilesAndDirectoriesSegmentResponse { marker?: string; maxResults?: number; segment: FilesAndDirectoriesListSegment; - nextMarker: string; + continuationToken: string; } /** @@ -159,7 +159,7 @@ export interface ListFilesAndDirectoriesSegmentResponse { */ export interface ListHandlesResponse { handleList?: HandleItem[]; - nextMarker: string; + continuationToken: string; } /** @@ -190,7 +190,7 @@ export interface ListSharesResponse { marker?: string; maxResults?: number; shareItems?: ShareItem[]; - nextMarker: string; + continuationToken: string; } /** diff --git a/sdk/storage/storage-file/src/generated/src/models/mappers.ts b/sdk/storage/storage-file/src/generated/src/models/mappers.ts index c09cba5d1edd..eca19dca7a45 100644 --- a/sdk/storage/storage-file/src/generated/src/models/mappers.ts +++ b/sdk/storage/storage-file/src/generated/src/models/mappers.ts @@ -345,7 +345,7 @@ export const ListFilesAndDirectoriesSegmentResponse: coreHttp.CompositeMapper = className: "FilesAndDirectoriesListSegment" } }, - nextMarker: { + continuationToken: { xmlName: "NextMarker", required: true, serializedName: "NextMarker", @@ -379,7 +379,7 @@ export const ListHandlesResponse: coreHttp.CompositeMapper = { } } }, - nextMarker: { + continuationToken: { xmlName: "NextMarker", required: true, serializedName: "NextMarker", @@ -524,7 +524,7 @@ export const ListSharesResponse: coreHttp.CompositeMapper = { } } }, - nextMarker: { + continuationToken: { xmlName: "NextMarker", required: true, serializedName: "NextMarker", diff --git a/sdk/storage/storage-file/swagger/README.md b/sdk/storage/storage-file/swagger/README.md index 812598b999fd..6aafba6c7732 100644 --- a/sdk/storage/storage-file/swagger/README.md +++ b/sdk/storage/storage-file/swagger/README.md @@ -88,3 +88,13 @@ directive: transform: > $["x-ms-client-name"] = "permissions"; ``` + +### Rename NextMarker -> ContinuationToken + +```yaml +directive: + - from: swagger-document + where: $.definitions..properties.NextMarker + transform: > + $["x-ms-client-name"] = "continuationToken"; +``` diff --git a/sdk/storage/storage-file/test/directoryclient.spec.ts b/sdk/storage/storage-file/test/directoryclient.spec.ts index 638f1a36768e..43152cd63a20 100644 --- a/sdk/storage/storage-file/test/directoryclient.spec.ts +++ b/sdk/storage/storage-file/test/directoryclient.spec.ts @@ -244,7 +244,7 @@ describe("DirectoryClient", () => { assert.ok(result.serviceEndpoint.length > 0); assert.ok(shareClient.url.indexOf(result.shareName)); - assert.deepStrictEqual(result.nextMarker, ""); + assert.deepStrictEqual(result.continuationToken, ""); assert.deepStrictEqual(result.segment.directoryItems.length, subDirClients.length); assert.deepStrictEqual(result.segment.fileItems.length, subFileClients.length); @@ -305,12 +305,12 @@ describe("DirectoryClient", () => { firstResult.segment.directoryItems.length + firstResult.segment.fileItems.length, firstRequestSize ); - assert.notDeepEqual(firstResult.nextMarker, undefined); + assert.notDeepEqual(firstResult.continuationToken, undefined); const secondResult = (await rootDirClient .listFilesAndDirectories({ prefix }) .byPage({ - continuationToken: firstResult.nextMarker, + continuationToken: firstResult.continuationToken, maxPageSize: firstRequestSize + secondRequestSize }) .next()).value; @@ -507,14 +507,14 @@ describe("DirectoryClient", () => { response.segment.directoryItems.length + response.segment.fileItems.length, firstRequestSize ); - assert.notDeepEqual(response.nextMarker, undefined); + assert.notDeepEqual(response.continuationToken, undefined); iter = await rootDirClient .listFilesAndDirectories({ prefix }) .byPage({ - continuationToken: response.nextMarker, + continuationToken: response.continuationToken, maxPageSize: firstRequestSize + secondRequestSize }); response = (await iter.next()).value; diff --git a/sdk/storage/storage-file/test/fileserviceclient.spec.ts b/sdk/storage/storage-file/test/fileserviceclient.spec.ts index 08d5f44335f2..a4b2cd092583 100644 --- a/sdk/storage/storage-file/test/fileserviceclient.spec.ts +++ b/sdk/storage/storage-file/test/fileserviceclient.spec.ts @@ -61,7 +61,7 @@ describe("FileServiceClient", () => { .byPage({ maxPageSize: 1 }) .next()).value; - assert.ok(result1.nextMarker); + assert.ok(result1.continuationToken); assert.equal(result1.shareItems!.length, 1); assert.ok(result1.shareItems![0].name.startsWith(shareNamePrefix)); assert.ok(result1.shareItems![0].properties.etag.length > 0); @@ -74,10 +74,10 @@ describe("FileServiceClient", () => { includeSnapshots: true, prefix: shareNamePrefix }) - .byPage({ continuationToken: result1.nextMarker, maxPageSize: 1 }) + .byPage({ continuationToken: result1.continuationToken, maxPageSize: 1 }) .next()).value; - assert.ok(!result2.nextMarker); + assert.ok(!result2.continuationToken); assert.equal(result2.shareItems!.length, 1); assert.ok(result2.shareItems![0].name.startsWith(shareNamePrefix)); assert.ok(result2.shareItems![0].properties.etag.length > 0); @@ -203,7 +203,7 @@ describe("FileServiceClient", () => { assert.deepEqual(item.metadata!.key, "val"); } // Gets next marker - const marker = response.nextMarker; + const marker = response.continuationToken; iter = serviceClient .listShares({ includeMetadata: true, From 4ea2f841eb4e5d2b3925aa1f4bd0bc962052345e Mon Sep 17 00:00:00 2001 From: Jose Manuel Heredia Hidalgo Date: Wed, 16 Oct 2019 13:55:28 -0700 Subject: [PATCH 5/8] rename timeoutParameter -> timeoutInSeconds --- .../src/generated/src/models/index.ts | 70 +++++++++---------- .../src/generated/src/models/parameters.ts | 4 +- .../src/generated/src/operations/directory.ts | 16 ++--- .../src/generated/src/operations/file.ts | 26 +++---- .../src/generated/src/operations/service.ts | 6 +- .../src/generated/src/operations/share.ts | 22 +++--- sdk/storage/storage-file/swagger/README.md | 10 +++ 7 files changed, 82 insertions(+), 72 deletions(-) diff --git a/sdk/storage/storage-file/src/generated/src/models/index.ts b/sdk/storage/storage-file/src/generated/src/models/index.ts index aaa7e9ce9f67..c56c71e31a78 100644 --- a/sdk/storage/storage-file/src/generated/src/models/index.ts +++ b/sdk/storage/storage-file/src/generated/src/models/index.ts @@ -358,7 +358,7 @@ export interface ServiceSetPropertiesOptionalParams extends coreHttp.RequestOpti * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations. */ - timeoutParameter?: number; + timeoutInSeconds?: number; } /** @@ -370,7 +370,7 @@ export interface ServiceGetPropertiesOptionalParams extends coreHttp.RequestOpti * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations. */ - timeoutParameter?: number; + timeoutInSeconds?: number; } /** @@ -402,7 +402,7 @@ export interface ServiceListSharesSegmentOptionalParams extends coreHttp.Request * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations. */ - timeoutParameter?: number; + timeoutInSeconds?: number; } /** @@ -414,7 +414,7 @@ export interface ShareCreateOptionalParams extends coreHttp.RequestOptionsBase { * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations. */ - timeoutParameter?: number; + timeoutInSeconds?: number; /** * A name-value pair to associate with a file storage object. */ @@ -439,7 +439,7 @@ export interface ShareGetPropertiesOptionalParams extends coreHttp.RequestOption * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations. */ - timeoutParameter?: number; + timeoutInSeconds?: number; } /** @@ -456,7 +456,7 @@ export interface ShareDeleteMethodOptionalParams extends coreHttp.RequestOptions * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations. */ - timeoutParameter?: number; + timeoutInSeconds?: number; /** * Specifies the option include to delete the base share and all of its snapshots. Possible * values include: 'include' @@ -473,7 +473,7 @@ export interface ShareCreateSnapshotOptionalParams extends coreHttp.RequestOptio * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations. */ - timeoutParameter?: number; + timeoutInSeconds?: number; /** * A name-value pair to associate with a file storage object. */ @@ -489,7 +489,7 @@ export interface ShareCreatePermissionOptionalParams extends coreHttp.RequestOpt * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations. */ - timeoutParameter?: number; + timeoutInSeconds?: number; } /** @@ -501,7 +501,7 @@ export interface ShareGetPermissionOptionalParams extends coreHttp.RequestOption * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations. */ - timeoutParameter?: number; + timeoutInSeconds?: number; } /** @@ -513,7 +513,7 @@ export interface ShareSetQuotaOptionalParams extends coreHttp.RequestOptionsBase * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations. */ - timeoutParameter?: number; + timeoutInSeconds?: number; /** * Specifies the maximum size of the share, in gigabytes. */ @@ -529,7 +529,7 @@ export interface ShareSetMetadataOptionalParams extends coreHttp.RequestOptionsB * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations. */ - timeoutParameter?: number; + timeoutInSeconds?: number; /** * A name-value pair to associate with a file storage object. */ @@ -545,7 +545,7 @@ export interface ShareGetAccessPolicyOptionalParams extends coreHttp.RequestOpti * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations. */ - timeoutParameter?: number; + timeoutInSeconds?: number; } /** @@ -561,7 +561,7 @@ export interface ShareSetAccessPolicyOptionalParams extends coreHttp.RequestOpti * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations. */ - timeoutParameter?: number; + timeoutInSeconds?: number; } /** @@ -573,7 +573,7 @@ export interface ShareGetStatisticsOptionalParams extends coreHttp.RequestOption * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations. */ - timeoutParameter?: number; + timeoutInSeconds?: number; } /** @@ -585,7 +585,7 @@ export interface DirectoryCreateOptionalParams extends coreHttp.RequestOptionsBa * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations. */ - timeoutParameter?: number; + timeoutInSeconds?: number; /** * A name-value pair to associate with a file storage object. */ @@ -619,7 +619,7 @@ export interface DirectoryGetPropertiesOptionalParams extends coreHttp.RequestOp * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations. */ - timeoutParameter?: number; + timeoutInSeconds?: number; } /** @@ -631,7 +631,7 @@ export interface DirectoryDeleteMethodOptionalParams extends coreHttp.RequestOpt * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations. */ - timeoutParameter?: number; + timeoutInSeconds?: number; } /** @@ -643,7 +643,7 @@ export interface DirectorySetPropertiesOptionalParams extends coreHttp.RequestOp * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations. */ - timeoutParameter?: number; + timeoutInSeconds?: number; /** * If specified the permission (security descriptor) shall be set for the directory/file. This * header can be used if Permission size is <= 8KB, else x-ms-file-permission-key header shall be @@ -668,7 +668,7 @@ export interface DirectorySetMetadataOptionalParams extends coreHttp.RequestOpti * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations. */ - timeoutParameter?: number; + timeoutInSeconds?: number; /** * A name-value pair to associate with a file storage object. */ @@ -705,7 +705,7 @@ export interface DirectoryListFilesAndDirectoriesSegmentOptionalParams extends c * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations. */ - timeoutParameter?: number; + timeoutInSeconds?: number; } /** @@ -729,7 +729,7 @@ export interface DirectoryListHandlesOptionalParams extends coreHttp.RequestOpti * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations. */ - timeoutParameter?: number; + timeoutInSeconds?: number; /** * The snapshot parameter is an opaque DateTime value that, when present, specifies the share * snapshot to query. @@ -751,7 +751,7 @@ export interface DirectoryForceCloseHandlesOptionalParams extends coreHttp.Reque * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations. */ - timeoutParameter?: number; + timeoutInSeconds?: number; /** * 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 @@ -780,7 +780,7 @@ export interface FileCreateOptionalParams extends coreHttp.RequestOptionsBase { * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations. */ - timeoutParameter?: number; + timeoutInSeconds?: number; /** * A name-value pair to associate with a file storage object. */ @@ -813,7 +813,7 @@ export interface FileDownloadOptionalParams extends coreHttp.RequestOptionsBase * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations. */ - timeoutParameter?: number; + timeoutInSeconds?: number; /** * Return file data only from the specified byte range. */ @@ -840,7 +840,7 @@ export interface FileGetPropertiesOptionalParams extends coreHttp.RequestOptions * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations. */ - timeoutParameter?: number; + timeoutInSeconds?: number; } /** @@ -852,7 +852,7 @@ export interface FileDeleteMethodOptionalParams extends coreHttp.RequestOptionsB * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations. */ - timeoutParameter?: number; + timeoutInSeconds?: number; } /** @@ -864,7 +864,7 @@ export interface FileSetHTTPHeadersOptionalParams extends coreHttp.RequestOption * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations. */ - timeoutParameter?: number; + timeoutInSeconds?: number; /** * 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. @@ -898,7 +898,7 @@ export interface FileSetMetadataOptionalParams extends coreHttp.RequestOptionsBa * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations. */ - timeoutParameter?: number; + timeoutInSeconds?: number; /** * A name-value pair to associate with a file storage object. */ @@ -918,7 +918,7 @@ export interface FileUploadRangeOptionalParams extends coreHttp.RequestOptionsBa * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations. */ - timeoutParameter?: number; + timeoutInSeconds?: number; /** * 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 @@ -937,7 +937,7 @@ export interface FileUploadRangeFromURLOptionalParams extends coreHttp.RequestOp * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations. */ - timeoutParameter?: number; + timeoutInSeconds?: number; /** * Specify the crc64 calculated for the range of bytes that must be read from the copy source. */ @@ -962,7 +962,7 @@ export interface FileGetRangeListOptionalParams extends coreHttp.RequestOptionsB * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations. */ - timeoutParameter?: number; + timeoutInSeconds?: number; /** * Specifies the range of bytes over which to list ranges, inclusively. */ @@ -978,7 +978,7 @@ export interface FileStartCopyOptionalParams extends coreHttp.RequestOptionsBase * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations. */ - timeoutParameter?: number; + timeoutInSeconds?: number; /** * A name-value pair to associate with a file storage object. */ @@ -994,7 +994,7 @@ export interface FileAbortCopyOptionalParams extends coreHttp.RequestOptionsBase * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations. */ - timeoutParameter?: number; + timeoutInSeconds?: number; } /** @@ -1018,7 +1018,7 @@ export interface FileListHandlesOptionalParams extends coreHttp.RequestOptionsBa * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations. */ - timeoutParameter?: number; + timeoutInSeconds?: number; /** * The snapshot parameter is an opaque DateTime value that, when present, specifies the share * snapshot to query. @@ -1035,7 +1035,7 @@ export interface FileForceCloseHandlesOptionalParams extends coreHttp.RequestOpt * href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting * Timeouts for File Service Operations. */ - timeoutParameter?: number; + timeoutInSeconds?: number; /** * 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 diff --git a/sdk/storage/storage-file/src/generated/src/models/parameters.ts b/sdk/storage/storage-file/src/generated/src/models/parameters.ts index 9cc9b7a400f9..b13a4e2c1bb0 100644 --- a/sdk/storage/storage-file/src/generated/src/models/parameters.ts +++ b/sdk/storage/storage-file/src/generated/src/models/parameters.ts @@ -672,10 +672,10 @@ export const sourceRange: coreHttp.OperationParameter = { } } }; -export const timeout: coreHttp.OperationQueryParameter = { +export const timeoutInSeconds: coreHttp.OperationQueryParameter = { parameterPath: [ "options", - "timeout" + "timeoutInSeconds" ], mapper: { serializedName: "timeout", diff --git a/sdk/storage/storage-file/src/generated/src/operations/directory.ts b/sdk/storage/storage-file/src/generated/src/operations/directory.ts index 4cae82f6255c..dc5722a95adb 100644 --- a/sdk/storage/storage-file/src/generated/src/operations/directory.ts +++ b/sdk/storage/storage-file/src/generated/src/operations/directory.ts @@ -269,7 +269,7 @@ const createOperationSpec: coreHttp.OperationSpec = { Parameters.url ], queryParameters: [ - Parameters.timeout, + Parameters.timeoutInSeconds, Parameters.restype2 ], headerParameters: [ @@ -301,7 +301,7 @@ const getPropertiesOperationSpec: coreHttp.OperationSpec = { ], queryParameters: [ Parameters.shareSnapshot, - Parameters.timeout, + Parameters.timeoutInSeconds, Parameters.restype2 ], headerParameters: [ @@ -326,7 +326,7 @@ const deleteMethodOperationSpec: coreHttp.OperationSpec = { Parameters.url ], queryParameters: [ - Parameters.timeout, + Parameters.timeoutInSeconds, Parameters.restype2 ], headerParameters: [ @@ -351,7 +351,7 @@ const setPropertiesOperationSpec: coreHttp.OperationSpec = { Parameters.url ], queryParameters: [ - Parameters.timeout, + Parameters.timeoutInSeconds, Parameters.restype2, Parameters.comp0 ], @@ -382,7 +382,7 @@ const setMetadataOperationSpec: coreHttp.OperationSpec = { Parameters.url ], queryParameters: [ - Parameters.timeout, + Parameters.timeoutInSeconds, Parameters.restype2, Parameters.comp4 ], @@ -413,7 +413,7 @@ const listFilesAndDirectoriesSegmentOperationSpec: coreHttp.OperationSpec = { Parameters.shareSnapshot, Parameters.marker, Parameters.maxResults, - Parameters.timeout, + Parameters.timeoutInSeconds, Parameters.restype2, Parameters.comp1 ], @@ -442,7 +442,7 @@ const listHandlesOperationSpec: coreHttp.OperationSpec = { queryParameters: [ Parameters.marker, Parameters.maxResults, - Parameters.timeout, + Parameters.timeoutInSeconds, Parameters.shareSnapshot, Parameters.comp7 ], @@ -470,7 +470,7 @@ const forceCloseHandlesOperationSpec: coreHttp.OperationSpec = { Parameters.url ], queryParameters: [ - Parameters.timeout, + Parameters.timeoutInSeconds, Parameters.marker, Parameters.shareSnapshot, Parameters.comp8 diff --git a/sdk/storage/storage-file/src/generated/src/operations/file.ts b/sdk/storage/storage-file/src/generated/src/operations/file.ts index aead8f7d25d5..4bc9e0eff108 100644 --- a/sdk/storage/storage-file/src/generated/src/operations/file.ts +++ b/sdk/storage/storage-file/src/generated/src/operations/file.ts @@ -499,7 +499,7 @@ const createOperationSpec: coreHttp.OperationSpec = { Parameters.url ], queryParameters: [ - Parameters.timeout + Parameters.timeoutInSeconds ], headerParameters: [ Parameters.version, @@ -537,7 +537,7 @@ const downloadOperationSpec: coreHttp.OperationSpec = { Parameters.url ], queryParameters: [ - Parameters.timeout + Parameters.timeoutInSeconds ], headerParameters: [ Parameters.version, @@ -579,7 +579,7 @@ const getPropertiesOperationSpec: coreHttp.OperationSpec = { ], queryParameters: [ Parameters.shareSnapshot, - Parameters.timeout + Parameters.timeoutInSeconds ], headerParameters: [ Parameters.version @@ -603,7 +603,7 @@ const deleteMethodOperationSpec: coreHttp.OperationSpec = { Parameters.url ], queryParameters: [ - Parameters.timeout + Parameters.timeoutInSeconds ], headerParameters: [ Parameters.version @@ -627,7 +627,7 @@ const setHTTPHeadersOperationSpec: coreHttp.OperationSpec = { Parameters.url ], queryParameters: [ - Parameters.timeout, + Parameters.timeoutInSeconds, Parameters.comp0 ], headerParameters: [ @@ -664,7 +664,7 @@ const setMetadataOperationSpec: coreHttp.OperationSpec = { Parameters.url ], queryParameters: [ - Parameters.timeout, + Parameters.timeoutInSeconds, Parameters.comp4 ], headerParameters: [ @@ -690,7 +690,7 @@ const uploadRangeOperationSpec: coreHttp.OperationSpec = { Parameters.url ], queryParameters: [ - Parameters.timeout, + Parameters.timeoutInSeconds, Parameters.comp9 ], headerParameters: [ @@ -732,7 +732,7 @@ const uploadRangeFromURLOperationSpec: coreHttp.OperationSpec = { Parameters.url ], queryParameters: [ - Parameters.timeout, + Parameters.timeoutInSeconds, Parameters.comp9 ], headerParameters: [ @@ -766,7 +766,7 @@ const getRangeListOperationSpec: coreHttp.OperationSpec = { ], queryParameters: [ Parameters.shareSnapshot, - Parameters.timeout, + Parameters.timeoutInSeconds, Parameters.comp10 ], headerParameters: [ @@ -805,7 +805,7 @@ const startCopyOperationSpec: coreHttp.OperationSpec = { Parameters.url ], queryParameters: [ - Parameters.timeout + Parameters.timeoutInSeconds ], headerParameters: [ Parameters.version, @@ -832,7 +832,7 @@ const abortCopyOperationSpec: coreHttp.OperationSpec = { ], queryParameters: [ Parameters.copyId, - Parameters.timeout, + Parameters.timeoutInSeconds, Parameters.comp11 ], headerParameters: [ @@ -860,7 +860,7 @@ const listHandlesOperationSpec: coreHttp.OperationSpec = { queryParameters: [ Parameters.marker, Parameters.maxResults, - Parameters.timeout, + Parameters.timeoutInSeconds, Parameters.shareSnapshot, Parameters.comp7 ], @@ -887,7 +887,7 @@ const forceCloseHandlesOperationSpec: coreHttp.OperationSpec = { Parameters.url ], queryParameters: [ - Parameters.timeout, + Parameters.timeoutInSeconds, Parameters.marker, Parameters.shareSnapshot, Parameters.comp8 diff --git a/sdk/storage/storage-file/src/generated/src/operations/service.ts b/sdk/storage/storage-file/src/generated/src/operations/service.ts index 826490596843..b1026b1304f3 100644 --- a/sdk/storage/storage-file/src/generated/src/operations/service.ts +++ b/sdk/storage/storage-file/src/generated/src/operations/service.ts @@ -114,7 +114,7 @@ const setPropertiesOperationSpec: coreHttp.OperationSpec = { Parameters.url ], queryParameters: [ - Parameters.timeout, + Parameters.timeoutInSeconds, Parameters.restype0, Parameters.comp0 ], @@ -147,7 +147,7 @@ const getPropertiesOperationSpec: coreHttp.OperationSpec = { Parameters.url ], queryParameters: [ - Parameters.timeout, + Parameters.timeoutInSeconds, Parameters.restype0, Parameters.comp0 ], @@ -177,7 +177,7 @@ const listSharesSegmentOperationSpec: coreHttp.OperationSpec = { Parameters.marker, Parameters.maxResults, Parameters.include, - Parameters.timeout, + Parameters.timeoutInSeconds, Parameters.comp1 ], headerParameters: [ diff --git a/sdk/storage/storage-file/src/generated/src/operations/share.ts b/sdk/storage/storage-file/src/generated/src/operations/share.ts index 8c64664759ab..9d1231ea450d 100644 --- a/sdk/storage/storage-file/src/generated/src/operations/share.ts +++ b/sdk/storage/storage-file/src/generated/src/operations/share.ts @@ -314,7 +314,7 @@ const createOperationSpec: coreHttp.OperationSpec = { Parameters.url ], queryParameters: [ - Parameters.timeout, + Parameters.timeoutInSeconds, Parameters.restype1 ], headerParameters: [ @@ -342,7 +342,7 @@ const getPropertiesOperationSpec: coreHttp.OperationSpec = { ], queryParameters: [ Parameters.shareSnapshot, - Parameters.timeout, + Parameters.timeoutInSeconds, Parameters.restype1 ], headerParameters: [ @@ -368,7 +368,7 @@ const deleteMethodOperationSpec: coreHttp.OperationSpec = { ], queryParameters: [ Parameters.shareSnapshot, - Parameters.timeout, + Parameters.timeoutInSeconds, Parameters.restype1 ], headerParameters: [ @@ -394,7 +394,7 @@ const createSnapshotOperationSpec: coreHttp.OperationSpec = { Parameters.url ], queryParameters: [ - Parameters.timeout, + Parameters.timeoutInSeconds, Parameters.restype1, Parameters.comp2 ], @@ -421,7 +421,7 @@ const createPermissionOperationSpec: coreHttp.OperationSpec = { Parameters.url ], queryParameters: [ - Parameters.timeout, + Parameters.timeoutInSeconds, Parameters.restype1, Parameters.comp3 ], @@ -455,7 +455,7 @@ const getPermissionOperationSpec: coreHttp.OperationSpec = { Parameters.url ], queryParameters: [ - Parameters.timeout, + Parameters.timeoutInSeconds, Parameters.restype1, Parameters.comp3 ], @@ -483,7 +483,7 @@ const setQuotaOperationSpec: coreHttp.OperationSpec = { Parameters.url ], queryParameters: [ - Parameters.timeout, + Parameters.timeoutInSeconds, Parameters.restype1, Parameters.comp0 ], @@ -510,7 +510,7 @@ const setMetadataOperationSpec: coreHttp.OperationSpec = { Parameters.url ], queryParameters: [ - Parameters.timeout, + Parameters.timeoutInSeconds, Parameters.restype1, Parameters.comp4 ], @@ -537,7 +537,7 @@ const getAccessPolicyOperationSpec: coreHttp.OperationSpec = { Parameters.url ], queryParameters: [ - Parameters.timeout, + Parameters.timeoutInSeconds, Parameters.restype1, Parameters.comp5 ], @@ -576,7 +576,7 @@ const setAccessPolicyOperationSpec: coreHttp.OperationSpec = { Parameters.url ], queryParameters: [ - Parameters.timeout, + Parameters.timeoutInSeconds, Parameters.restype1, Parameters.comp5 ], @@ -623,7 +623,7 @@ const getStatisticsOperationSpec: coreHttp.OperationSpec = { Parameters.url ], queryParameters: [ - Parameters.timeout, + Parameters.timeoutInSeconds, Parameters.restype1, Parameters.comp6 ], diff --git a/sdk/storage/storage-file/swagger/README.md b/sdk/storage/storage-file/swagger/README.md index 6aafba6c7732..aa899f8c6d4e 100644 --- a/sdk/storage/storage-file/swagger/README.md +++ b/sdk/storage/storage-file/swagger/README.md @@ -98,3 +98,13 @@ directive: transform: > $["x-ms-client-name"] = "continuationToken"; ``` + +### Rename timeoutParameter -> timeout + +```yaml +directive: + - from: swagger-document + where: $.parameters.Timeout + transform: > + $["x-ms-client-name"] = "timeoutInSeconds"; +``` From 1c1debd19f2bb5d9bccbe69637f410b98b6efe61 Mon Sep 17 00:00:00 2001 From: Jose Manuel Heredia Hidalgo Date: Wed, 16 Oct 2019 14:55:05 -0700 Subject: [PATCH 6/8] Rename copyCompletionTime to copyCompletedOn --- sdk/storage/storage-file/src/FileDownloadResponse.ts | 4 ++-- .../storage-file/src/generated/src/models/index.ts | 4 ++-- .../storage-file/src/generated/src/models/mappers.ts | 4 ++-- sdk/storage/storage-file/swagger/README.md | 10 ++++++++++ 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/sdk/storage/storage-file/src/FileDownloadResponse.ts b/sdk/storage/storage-file/src/FileDownloadResponse.ts index fbbc9c277e67..ce4d322426e8 100644 --- a/sdk/storage/storage-file/src/FileDownloadResponse.ts +++ b/sdk/storage/storage-file/src/FileDownloadResponse.ts @@ -150,8 +150,8 @@ export class FileDownloadResponse implements Models.FileDownloadResponse { * @type {(Date | undefined)} * @memberof FileDownloadResponse */ - public get copyCompletionTime(): Date | undefined { - return this.originalResponse.copyCompletionTime; + public get copyCompletedOn(): Date | undefined { + return this.originalResponse.copyCompletedOn; } /** diff --git a/sdk/storage/storage-file/src/generated/src/models/index.ts b/sdk/storage/storage-file/src/generated/src/models/index.ts index c56c71e31a78..a982f64efd74 100644 --- a/sdk/storage/storage-file/src/generated/src/models/index.ts +++ b/sdk/storage/storage-file/src/generated/src/models/index.ts @@ -1896,7 +1896,7 @@ export interface FileDownloadHeaders { * 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; + copyCompletedOn?: Date; /** * Only appears when x-ms-copy-status is failed or pending. Describes cause of fatal or non-fatal * copy operation failure. @@ -2037,7 +2037,7 @@ export interface FileGetPropertiesHeaders { * 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; + copyCompletedOn?: Date; /** * Only appears when x-ms-copy-status is failed or pending. Describes cause of fatal or non-fatal * copy operation failure. diff --git a/sdk/storage/storage-file/src/generated/src/models/mappers.ts b/sdk/storage/storage-file/src/generated/src/models/mappers.ts index eca19dca7a45..b6e7c0e1940c 100644 --- a/sdk/storage/storage-file/src/generated/src/models/mappers.ts +++ b/sdk/storage/storage-file/src/generated/src/models/mappers.ts @@ -2101,7 +2101,7 @@ export const FileDownloadHeaders: coreHttp.CompositeMapper = { name: "DateTimeRfc1123" } }, - copyCompletionTime: { + copyCompletedOn: { serializedName: "x-ms-copy-completion-time", type: { name: "DateTimeRfc1123" @@ -2303,7 +2303,7 @@ export const FileGetPropertiesHeaders: coreHttp.CompositeMapper = { name: "DateTimeRfc1123" } }, - copyCompletionTime: { + copyCompletedOn: { serializedName: "x-ms-copy-completion-time", type: { name: "DateTimeRfc1123" diff --git a/sdk/storage/storage-file/swagger/README.md b/sdk/storage/storage-file/swagger/README.md index aa899f8c6d4e..8b52ebbd1275 100644 --- a/sdk/storage/storage-file/swagger/README.md +++ b/sdk/storage/storage-file/swagger/README.md @@ -108,3 +108,13 @@ directive: transform: > $["x-ms-client-name"] = "timeoutInSeconds"; ``` + +### Rename Headers copyCompletionTime -> copyCompletedOn + +```yaml +directive: + - from: swagger-document + where: $["x-ms-paths"]["/{shareName}/{directory}/{fileName}"]..responses..headers["x-ms-copy-completion-time"] + transform: > + $["x-ms-client-name"] = "copyCompletedOn"; +``` From 97a220385980e71b7d1e8bd341921b1131436543 Mon Sep 17 00:00:00 2001 From: Jose Manuel Heredia Hidalgo Date: Wed, 16 Oct 2019 15:44:31 -0700 Subject: [PATCH 7/8] rename time to On --- .../storage-file/src/FileDownloadResponse.ts | 12 +-- .../src/generated/src/models/index.ts | 42 +++++----- .../src/generated/src/models/mappers.ts | 42 +++++----- .../src/generated/src/models/parameters.ts | 8 +- .../src/generated/src/operations/directory.ts | 56 ++++++------- .../src/generated/src/operations/file.ts | 56 ++++++------- sdk/storage/storage-file/swagger/README.md | 78 +++++++++++++++++++ .../storage-file/test/directoryclient.spec.ts | 34 ++++---- .../storage-file/test/fileclient.spec.ts | 30 +++---- 9 files changed, 218 insertions(+), 140 deletions(-) diff --git a/sdk/storage/storage-file/src/FileDownloadResponse.ts b/sdk/storage/storage-file/src/FileDownloadResponse.ts index ce4d322426e8..aa113752fc52 100644 --- a/sdk/storage/storage-file/src/FileDownloadResponse.ts +++ b/sdk/storage/storage-file/src/FileDownloadResponse.ts @@ -344,8 +344,8 @@ export class FileDownloadResponse implements Models.FileDownloadResponse { * @type {(Date | undefined)} * @memberof FileDownloadResponse */ - public get fileCreationTime(): Date | undefined { - return this.originalResponse.fileCreationTime; + public get fileCreatedOn(): Date | undefined { + return this.originalResponse.fileCreatedOn; } /** @@ -355,8 +355,8 @@ export class FileDownloadResponse implements Models.FileDownloadResponse { * @type {(string | undefined)} * @memberof FileDownloadResponse */ - public get fileLastWriteTime(): Date | undefined { - return this.originalResponse.fileLastWriteTime; + public get fileLastWriteOn(): Date | undefined { + return this.originalResponse.fileLastWriteOn; } /** @@ -366,8 +366,8 @@ export class FileDownloadResponse implements Models.FileDownloadResponse { * @type {(string | undefined)} * @memberof FileDownloadResponse */ - public get fileChangeTime(): Date | undefined { - return this.originalResponse.fileChangeTime; + public get fileChangeOn(): Date | undefined { + return this.originalResponse.fileChangeOn; } /** diff --git a/sdk/storage/storage-file/src/generated/src/models/index.ts b/sdk/storage/storage-file/src/generated/src/models/index.ts index a982f64efd74..670aa7a0271f 100644 --- a/sdk/storage/storage-file/src/generated/src/models/index.ts +++ b/sdk/storage/storage-file/src/generated/src/models/index.ts @@ -1475,15 +1475,15 @@ export interface DirectoryCreateHeaders { /** * Creation time for the directory. */ - fileCreationTime?: Date; + fileCreatedOn?: Date; /** * Last write time for the directory. */ - fileLastWriteTime?: Date; + fileLastWriteOn?: Date; /** * Change time for the directory. */ - fileChangeTime?: Date; + fileChangeOn?: Date; /** * The fileId of the directory. */ @@ -1535,15 +1535,15 @@ export interface DirectoryGetPropertiesHeaders { /** * Creation time for the directory. */ - fileCreationTime?: Date; + fileCreatedOn?: Date; /** * Last write time for the directory. */ - fileLastWriteTime?: Date; + fileLastWriteOn?: Date; /** * Change time for the directory. */ - fileChangeTime?: Date; + fileChangeOn?: Date; /** * Key of the permission set for the directory. */ @@ -1624,15 +1624,15 @@ export interface DirectorySetPropertiesHeaders { /** * Creation time for the directory. */ - fileCreationTime?: Date; + fileCreatedOn?: Date; /** * Last write time for the directory. */ - fileLastWriteTime?: Date; + fileLastWriteOn?: Date; /** * Change time for the directory. */ - fileChangeTime?: Date; + fileChangeOn?: Date; /** * The fileId of the directory. */ @@ -1800,15 +1800,15 @@ export interface FileCreateHeaders { /** * Creation time for the file. */ - fileCreationTime?: Date; + fileCreatedOn?: Date; /** * Last write time for the file. */ - fileLastWriteTime?: Date; + fileLastWriteOn?: Date; /** * Change time for the file. */ - fileChangeTime?: Date; + fileChangeOn?: Date; /** * The fileId of the file. */ @@ -1943,15 +1943,15 @@ export interface FileDownloadHeaders { /** * Creation time for the file. */ - fileCreationTime?: Date; + fileCreatedOn?: Date; /** * Last write time for the file. */ - fileLastWriteTime?: Date; + fileLastWriteOn?: Date; /** * Change time for the file. */ - fileChangeTime?: Date; + fileChangeOn?: Date; /** * Key of the permission set for the file. */ @@ -2077,15 +2077,15 @@ export interface FileGetPropertiesHeaders { /** * Creation time for the file. */ - fileCreationTime?: Date; + fileCreatedOn?: Date; /** * Last write time for the file. */ - fileLastWriteTime?: Date; + fileLastWriteOn?: Date; /** * Change time for the file. */ - fileChangeTime?: Date; + fileChangeOn?: Date; /** * Key of the permission set for the file. */ @@ -2166,15 +2166,15 @@ export interface FileSetHTTPHeadersHeaders { /** * Creation time for the file. */ - fileCreationTime?: Date; + fileCreatedOn?: Date; /** * Last write time for the file. */ - fileLastWriteTime?: Date; + fileLastWriteOn?: Date; /** * Change time for the file. */ - fileChangeTime?: Date; + fileChangeOn?: Date; /** * The fileId of the directory. */ diff --git a/sdk/storage/storage-file/src/generated/src/models/mappers.ts b/sdk/storage/storage-file/src/generated/src/models/mappers.ts index b6e7c0e1940c..a016e3d2436d 100644 --- a/sdk/storage/storage-file/src/generated/src/models/mappers.ts +++ b/sdk/storage/storage-file/src/generated/src/models/mappers.ts @@ -1459,19 +1459,19 @@ export const DirectoryCreateHeaders: coreHttp.CompositeMapper = { name: "String" } }, - fileCreationTime: { + fileCreatedOn: { serializedName: "x-ms-file-creation-time", type: { name: "DateTimeRfc1123" } }, - fileLastWriteTime: { + fileLastWriteOn: { serializedName: "x-ms-file-last-write-time", type: { name: "DateTimeRfc1123" } }, - fileChangeTime: { + fileChangeOn: { serializedName: "x-ms-file-change-time", type: { name: "DateTimeRfc1123" @@ -1559,19 +1559,19 @@ export const DirectoryGetPropertiesHeaders: coreHttp.CompositeMapper = { name: "String" } }, - fileCreationTime: { + fileCreatedOn: { serializedName: "x-ms-file-creation-time", type: { name: "DateTimeRfc1123" } }, - fileLastWriteTime: { + fileLastWriteOn: { serializedName: "x-ms-file-last-write-time", type: { name: "DateTimeRfc1123" } }, - fileChangeTime: { + fileChangeOn: { serializedName: "x-ms-file-change-time", type: { name: "DateTimeRfc1123" @@ -1693,19 +1693,19 @@ export const DirectorySetPropertiesHeaders: coreHttp.CompositeMapper = { name: "String" } }, - fileCreationTime: { + fileCreatedOn: { serializedName: "x-ms-file-creation-time", type: { name: "DateTimeRfc1123" } }, - fileLastWriteTime: { + fileLastWriteOn: { serializedName: "x-ms-file-last-write-time", type: { name: "DateTimeRfc1123" } }, - fileChangeTime: { + fileChangeOn: { serializedName: "x-ms-file-change-time", type: { name: "DateTimeRfc1123" @@ -1959,19 +1959,19 @@ export const FileCreateHeaders: coreHttp.CompositeMapper = { name: "String" } }, - fileCreationTime: { + fileCreatedOn: { serializedName: "x-ms-file-creation-time", type: { name: "DateTimeRfc1123" } }, - fileLastWriteTime: { + fileLastWriteOn: { serializedName: "x-ms-file-last-write-time", type: { name: "DateTimeRfc1123" } }, - fileChangeTime: { + fileChangeOn: { serializedName: "x-ms-file-change-time", type: { name: "DateTimeRfc1123" @@ -2161,19 +2161,19 @@ export const FileDownloadHeaders: coreHttp.CompositeMapper = { name: "String" } }, - fileCreationTime: { + fileCreatedOn: { serializedName: "x-ms-file-creation-time", type: { name: "DateTimeRfc1123" } }, - fileLastWriteTime: { + fileLastWriteOn: { serializedName: "x-ms-file-last-write-time", type: { name: "DateTimeRfc1123" } }, - fileChangeTime: { + fileChangeOn: { serializedName: "x-ms-file-change-time", type: { name: "DateTimeRfc1123" @@ -2357,19 +2357,19 @@ export const FileGetPropertiesHeaders: coreHttp.CompositeMapper = { name: "String" } }, - fileCreationTime: { + fileCreatedOn: { serializedName: "x-ms-file-creation-time", type: { name: "DateTimeRfc1123" } }, - fileLastWriteTime: { + fileLastWriteOn: { serializedName: "x-ms-file-last-write-time", type: { name: "DateTimeRfc1123" } }, - fileChangeTime: { + fileChangeOn: { serializedName: "x-ms-file-change-time", type: { name: "DateTimeRfc1123" @@ -2491,19 +2491,19 @@ export const FileSetHTTPHeadersHeaders: coreHttp.CompositeMapper = { name: "String" } }, - fileCreationTime: { + fileCreatedOn: { serializedName: "x-ms-file-creation-time", type: { name: "DateTimeRfc1123" } }, - fileLastWriteTime: { + fileLastWriteOn: { serializedName: "x-ms-file-last-write-time", type: { name: "DateTimeRfc1123" } }, - fileChangeTime: { + fileChangeOn: { serializedName: "x-ms-file-change-time", type: { name: "DateTimeRfc1123" diff --git a/sdk/storage/storage-file/src/generated/src/models/parameters.ts b/sdk/storage/storage-file/src/generated/src/models/parameters.ts index b13a4e2c1bb0..419066413680 100644 --- a/sdk/storage/storage-file/src/generated/src/models/parameters.ts +++ b/sdk/storage/storage-file/src/generated/src/models/parameters.ts @@ -333,8 +333,8 @@ export const fileContentType: coreHttp.OperationParameter = { } } }; -export const fileCreationTime: coreHttp.OperationParameter = { - parameterPath: "fileCreationTime", +export const fileCreatedOn: coreHttp.OperationParameter = { + parameterPath: "fileCreatedOn", mapper: { required: true, serializedName: "x-ms-file-creation-time", @@ -343,8 +343,8 @@ export const fileCreationTime: coreHttp.OperationParameter = { } } }; -export const fileLastWriteTime: coreHttp.OperationParameter = { - parameterPath: "fileLastWriteTime", +export const fileLastWriteOn: coreHttp.OperationParameter = { + parameterPath: "fileLastWriteOn", mapper: { required: true, serializedName: "x-ms-file-last-write-time", diff --git a/sdk/storage/storage-file/src/generated/src/operations/directory.ts b/sdk/storage/storage-file/src/generated/src/operations/directory.ts index dc5722a95adb..c5b33b1a2d82 100644 --- a/sdk/storage/storage-file/src/generated/src/operations/directory.ts +++ b/sdk/storage/storage-file/src/generated/src/operations/directory.ts @@ -30,35 +30,35 @@ export class Directory { * Creates a new directory under the specified share or parent directory. * @param fileAttributes If specified, the provided file attributes shall be set. Default value: * ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. - * @param fileLastWriteTime Last write time for the file/directory. + * @param fileCreatedOn Creation time for the file/directory. + * @param fileLastWriteOn Last write time for the file/directory. * @param [options] The optional parameters * @returns Promise */ - create(fileAttributes: string, fileCreationTime: string, fileLastWriteTime: string, options?: Models.DirectoryCreateOptionalParams): Promise; + create(fileAttributes: string, fileCreatedOn: string, fileLastWriteOn: string, options?: Models.DirectoryCreateOptionalParams): Promise; /** * @param fileAttributes If specified, the provided file attributes shall be set. Default value: * ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. - * @param fileLastWriteTime Last write time for the file/directory. + * @param fileCreatedOn Creation time for the file/directory. + * @param fileLastWriteOn Last write time for the file/directory. * @param callback The callback */ - create(fileAttributes: string, fileCreationTime: string, fileLastWriteTime: string, callback: coreHttp.ServiceCallback): void; + create(fileAttributes: string, fileCreatedOn: string, fileLastWriteOn: string, callback: coreHttp.ServiceCallback): void; /** * @param fileAttributes If specified, the provided file attributes shall be set. Default value: * ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. - * @param fileLastWriteTime Last write time for the file/directory. + * @param fileCreatedOn Creation time for the file/directory. + * @param fileLastWriteOn Last write time for the file/directory. * @param options The optional parameters * @param callback The callback */ - create(fileAttributes: string, fileCreationTime: string, fileLastWriteTime: string, options: Models.DirectoryCreateOptionalParams, callback: coreHttp.ServiceCallback): void; - create(fileAttributes: string, fileCreationTime: string, fileLastWriteTime: string, options?: Models.DirectoryCreateOptionalParams | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { + create(fileAttributes: string, fileCreatedOn: string, fileLastWriteOn: string, options: Models.DirectoryCreateOptionalParams, callback: coreHttp.ServiceCallback): void; + create(fileAttributes: string, fileCreatedOn: string, fileLastWriteOn: string, options?: Models.DirectoryCreateOptionalParams | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { return this.client.sendOperationRequest( { fileAttributes, - fileCreationTime, - fileLastWriteTime, + fileCreatedOn, + fileLastWriteOn, options }, createOperationSpec, @@ -120,35 +120,35 @@ export class Directory { * Sets properties on the directory. * @param fileAttributes If specified, the provided file attributes shall be set. Default value: * ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. - * @param fileLastWriteTime Last write time for the file/directory. + * @param fileCreatedOn Creation time for the file/directory. + * @param fileLastWriteOn Last write time for the file/directory. * @param [options] The optional parameters * @returns Promise */ - setProperties(fileAttributes: string, fileCreationTime: string, fileLastWriteTime: string, options?: Models.DirectorySetPropertiesOptionalParams): Promise; + setProperties(fileAttributes: string, fileCreatedOn: string, fileLastWriteOn: string, options?: Models.DirectorySetPropertiesOptionalParams): Promise; /** * @param fileAttributes If specified, the provided file attributes shall be set. Default value: * ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. - * @param fileLastWriteTime Last write time for the file/directory. + * @param fileCreatedOn Creation time for the file/directory. + * @param fileLastWriteOn Last write time for the file/directory. * @param callback The callback */ - setProperties(fileAttributes: string, fileCreationTime: string, fileLastWriteTime: string, callback: coreHttp.ServiceCallback): void; + setProperties(fileAttributes: string, fileCreatedOn: string, fileLastWriteOn: string, callback: coreHttp.ServiceCallback): void; /** * @param fileAttributes If specified, the provided file attributes shall be set. Default value: * ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. - * @param fileLastWriteTime Last write time for the file/directory. + * @param fileCreatedOn Creation time for the file/directory. + * @param fileLastWriteOn Last write time for the file/directory. * @param options The optional parameters * @param callback The callback */ - setProperties(fileAttributes: string, fileCreationTime: string, fileLastWriteTime: string, options: Models.DirectorySetPropertiesOptionalParams, callback: coreHttp.ServiceCallback): void; - setProperties(fileAttributes: string, fileCreationTime: string, fileLastWriteTime: string, options?: Models.DirectorySetPropertiesOptionalParams | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { + setProperties(fileAttributes: string, fileCreatedOn: string, fileLastWriteOn: string, options: Models.DirectorySetPropertiesOptionalParams, callback: coreHttp.ServiceCallback): void; + setProperties(fileAttributes: string, fileCreatedOn: string, fileLastWriteOn: string, options?: Models.DirectorySetPropertiesOptionalParams | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { return this.client.sendOperationRequest( { fileAttributes, - fileCreationTime, - fileLastWriteTime, + fileCreatedOn, + fileLastWriteOn, options }, setPropertiesOperationSpec, @@ -278,8 +278,8 @@ const createOperationSpec: coreHttp.OperationSpec = { Parameters.filePermission, Parameters.filePermissionKey1, Parameters.fileAttributes, - Parameters.fileCreationTime, - Parameters.fileLastWriteTime + Parameters.fileCreatedOn, + Parameters.fileLastWriteOn ], responses: { 201: { @@ -360,8 +360,8 @@ const setPropertiesOperationSpec: coreHttp.OperationSpec = { Parameters.filePermission, Parameters.filePermissionKey1, Parameters.fileAttributes, - Parameters.fileCreationTime, - Parameters.fileLastWriteTime + Parameters.fileCreatedOn, + Parameters.fileLastWriteOn ], responses: { 200: { diff --git a/sdk/storage/storage-file/src/generated/src/operations/file.ts b/sdk/storage/storage-file/src/generated/src/operations/file.ts index 4bc9e0eff108..0ffd5ad8d0a9 100644 --- a/sdk/storage/storage-file/src/generated/src/operations/file.ts +++ b/sdk/storage/storage-file/src/generated/src/operations/file.ts @@ -31,38 +31,38 @@ export class File { * @param fileContentLength Specifies the maximum size for the file, up to 1 TB. * @param fileAttributes If specified, the provided file attributes shall be set. Default value: * ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. - * @param fileLastWriteTime Last write time for the file/directory. + * @param fileCreatedOn Creation time for the file/directory. + * @param fileLastWriteOn Last write time for the file/directory. * @param [options] The optional parameters * @returns Promise */ - create(fileContentLength: number, fileAttributes: string, fileCreationTime: string, fileLastWriteTime: string, options?: Models.FileCreateOptionalParams): Promise; + create(fileContentLength: number, fileAttributes: string, fileCreatedOn: string, fileLastWriteOn: string, options?: Models.FileCreateOptionalParams): Promise; /** * @param fileContentLength Specifies the maximum size for the file, up to 1 TB. * @param fileAttributes If specified, the provided file attributes shall be set. Default value: * ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. - * @param fileLastWriteTime Last write time for the file/directory. + * @param fileCreatedOn Creation time for the file/directory. + * @param fileLastWriteOn Last write time for the file/directory. * @param callback The callback */ - create(fileContentLength: number, fileAttributes: string, fileCreationTime: string, fileLastWriteTime: string, callback: coreHttp.ServiceCallback): void; + create(fileContentLength: number, fileAttributes: string, fileCreatedOn: string, fileLastWriteOn: string, callback: coreHttp.ServiceCallback): void; /** * @param fileContentLength Specifies the maximum size for the file, up to 1 TB. * @param fileAttributes If specified, the provided file attributes shall be set. Default value: * ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. - * @param fileLastWriteTime Last write time for the file/directory. + * @param fileCreatedOn Creation time for the file/directory. + * @param fileLastWriteOn Last write time for the file/directory. * @param options The optional parameters * @param callback The callback */ - create(fileContentLength: number, fileAttributes: string, fileCreationTime: string, fileLastWriteTime: string, options: Models.FileCreateOptionalParams, callback: coreHttp.ServiceCallback): void; - create(fileContentLength: number, fileAttributes: string, fileCreationTime: string, fileLastWriteTime: string, options?: Models.FileCreateOptionalParams | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { + create(fileContentLength: number, fileAttributes: string, fileCreatedOn: string, fileLastWriteOn: string, options: Models.FileCreateOptionalParams, callback: coreHttp.ServiceCallback): void; + create(fileContentLength: number, fileAttributes: string, fileCreatedOn: string, fileLastWriteOn: string, options?: Models.FileCreateOptionalParams | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { return this.client.sendOperationRequest( { fileContentLength, fileAttributes, - fileCreationTime, - fileLastWriteTime, + fileCreatedOn, + fileLastWriteOn, options }, createOperationSpec, @@ -146,35 +146,35 @@ export class File { * Sets HTTP headers on the file. * @param fileAttributes If specified, the provided file attributes shall be set. Default value: * ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. - * @param fileLastWriteTime Last write time for the file/directory. + * @param fileCreatedOn Creation time for the file/directory. + * @param fileLastWriteOn Last write time for the file/directory. * @param [options] The optional parameters * @returns Promise */ - setHTTPHeaders(fileAttributes: string, fileCreationTime: string, fileLastWriteTime: string, options?: Models.FileSetHTTPHeadersOptionalParams): Promise; + setHTTPHeaders(fileAttributes: string, fileCreatedOn: string, fileLastWriteOn: string, options?: Models.FileSetHTTPHeadersOptionalParams): Promise; /** * @param fileAttributes If specified, the provided file attributes shall be set. Default value: * ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. - * @param fileLastWriteTime Last write time for the file/directory. + * @param fileCreatedOn Creation time for the file/directory. + * @param fileLastWriteOn Last write time for the file/directory. * @param callback The callback */ - setHTTPHeaders(fileAttributes: string, fileCreationTime: string, fileLastWriteTime: string, callback: coreHttp.ServiceCallback): void; + setHTTPHeaders(fileAttributes: string, fileCreatedOn: string, fileLastWriteOn: string, callback: coreHttp.ServiceCallback): void; /** * @param fileAttributes If specified, the provided file attributes shall be set. Default value: * ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. - * @param fileLastWriteTime Last write time for the file/directory. + * @param fileCreatedOn Creation time for the file/directory. + * @param fileLastWriteOn Last write time for the file/directory. * @param options The optional parameters * @param callback The callback */ - setHTTPHeaders(fileAttributes: string, fileCreationTime: string, fileLastWriteTime: string, options: Models.FileSetHTTPHeadersOptionalParams, callback: coreHttp.ServiceCallback): void; - setHTTPHeaders(fileAttributes: string, fileCreationTime: string, fileLastWriteTime: string, options?: Models.FileSetHTTPHeadersOptionalParams | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { + setHTTPHeaders(fileAttributes: string, fileCreatedOn: string, fileLastWriteOn: string, options: Models.FileSetHTTPHeadersOptionalParams, callback: coreHttp.ServiceCallback): void; + setHTTPHeaders(fileAttributes: string, fileCreatedOn: string, fileLastWriteOn: string, options?: Models.FileSetHTTPHeadersOptionalParams | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { return this.client.sendOperationRequest( { fileAttributes, - fileCreationTime, - fileLastWriteTime, + fileCreatedOn, + fileLastWriteOn, options }, setHTTPHeadersOperationSpec, @@ -509,8 +509,8 @@ const createOperationSpec: coreHttp.OperationSpec = { Parameters.filePermission, Parameters.filePermissionKey1, Parameters.fileAttributes, - Parameters.fileCreationTime, - Parameters.fileLastWriteTime, + Parameters.fileCreatedOn, + Parameters.fileLastWriteOn, Parameters.fileContentType, Parameters.fileContentEncoding, Parameters.fileContentLanguage, @@ -636,8 +636,8 @@ const setHTTPHeadersOperationSpec: coreHttp.OperationSpec = { Parameters.filePermission, Parameters.filePermissionKey1, Parameters.fileAttributes, - Parameters.fileCreationTime, - Parameters.fileLastWriteTime, + Parameters.fileCreatedOn, + Parameters.fileLastWriteOn, Parameters.fileContentType, Parameters.fileContentEncoding, Parameters.fileContentLanguage, diff --git a/sdk/storage/storage-file/swagger/README.md b/sdk/storage/storage-file/swagger/README.md index 8b52ebbd1275..830ef135c14f 100644 --- a/sdk/storage/storage-file/swagger/README.md +++ b/sdk/storage/storage-file/swagger/README.md @@ -118,3 +118,81 @@ directive: transform: > $["x-ms-client-name"] = "copyCompletedOn"; ``` + +### Rename fileCreationTime -> fileCreatedOn + +```yaml +directive: + - from: swagger-document + where: $["x-ms-paths"]["/{shareName}/{directory}/{fileName}"]..responses..headers["x-ms-file-creation-time"] + transform: > + $["x-ms-client-name"] = "fileCreatedOn"; + - from: swagger-document + where: $["x-ms-paths"]["/{shareName}/{directory}/{fileName}?comp=properties"]..responses..headers["x-ms-file-creation-time"] + transform: > + $["x-ms-client-name"] = "fileCreatedOn"; + - from: swagger-document + where: $["x-ms-paths"]["/{shareName}/{directory}?restype=directory"]..responses..headers["x-ms-file-creation-time"] + transform: > + $["x-ms-client-name"] = "fileCreatedOn"; + - from: swagger-document + where: $["x-ms-paths"]["/{shareName}/{directory}?restype=directory&comp=properties"]..responses..headers["x-ms-file-creation-time"] + transform: > + $["x-ms-client-name"] = "fileCreatedOn"; + - from: swagger-document + where: $.parameters.FileCreationTime + transform: > + $["x-ms-client-name"] = "fileCreatedOn"; +``` + +### Rename FileLastWriteTime -> FileLastWriteOn + +```yaml +directive: + - from: swagger-document + where: $["x-ms-paths"]["/{shareName}/{directory}/{fileName}?comp=properties"]..responses..headers["x-ms-file-last-write-time"] + transform: > + $["x-ms-client-name"] = "fileLastWriteOn"; + - from: swagger-document + where: $["x-ms-paths"]["/{shareName}/{directory}/{fileName}"]..responses..headers["x-ms-file-last-write-time"] + transform: > + $["x-ms-client-name"] = "fileLastWriteOn"; + - from: swagger-document + where: $["x-ms-paths"]["/{shareName}/{directory}?restype=directory"]..responses..headers["x-ms-file-last-write-time"] + transform: > + $["x-ms-client-name"] = "fileLastWriteOn"; + - from: swagger-document + where: $["x-ms-paths"]["/{shareName}/{directory}?restype=directory&comp=properties"]..responses..headers["x-ms-file-last-write-time"] + transform: > + $["x-ms-client-name"] = "fileLastWriteOn"; + - from: swagger-document + where: $.parameters.FileLastWriteTime + transform: > + $["x-ms-client-name"] = "fileLastWriteOn"; +``` + +### Rename FileChangeTime -> FileChangeOn + +```yaml +directive: + - from: swagger-document + where: $["x-ms-paths"]["/{shareName}/{directory}/{fileName}"]..responses..headers["x-ms-file-change-time"] + transform: > + $["x-ms-client-name"] = "fileChangeOn"; + - from: swagger-document + where: $["x-ms-paths"]["/{shareName}/{directory}/{fileName}?comp=properties"]..responses..headers["x-ms-file-change-time"] + transform: > + $["x-ms-client-name"] = "fileChangeOn"; + - from: swagger-document + where: $["x-ms-paths"]["/{shareName}/{directory}?restype=directory"]..responses..headers["x-ms-file-change-time"] + transform: > + $["x-ms-client-name"] = "fileChangeOn"; + - from: swagger-document + where: $["x-ms-paths"]["/{shareName}/{directory}?restype=directory&comp=properties"]..responses..headers["x-ms-file-change-time"] + transform: > + $["x-ms-client-name"] = "fileChangeOn"; + - from: swagger-document + where: $.parameters.FileChangeTime + transform: > + $["x-ms-client-name"] = "fileChangeOn"; +``` diff --git a/sdk/storage/storage-file/test/directoryclient.spec.ts b/sdk/storage/storage-file/test/directoryclient.spec.ts index 43152cd63a20..93037189f6f3 100644 --- a/sdk/storage/storage-file/test/directoryclient.spec.ts +++ b/sdk/storage/storage-file/test/directoryclient.spec.ts @@ -41,10 +41,10 @@ describe("DirectoryClient", () => { defaultDirCreateResp = await dirClient.create(); assert.equal(defaultDirCreateResp.errorCode, undefined); assert.equal(defaultDirCreateResp.fileAttributes!, "Directory"); - assert.ok(defaultDirCreateResp.fileChangeTime!); - assert.ok(defaultDirCreateResp.fileCreationTime!); + assert.ok(defaultDirCreateResp.fileChangeOn!); + assert.ok(defaultDirCreateResp.fileCreatedOn!); assert.ok(defaultDirCreateResp.fileId!); - assert.ok(defaultDirCreateResp.fileLastWriteTime!); + assert.ok(defaultDirCreateResp.fileLastWriteOn!); assert.ok(defaultDirCreateResp.fileParentId!); assert.ok(defaultDirCreateResp.filePermissionKey!); }); @@ -109,10 +109,10 @@ describe("DirectoryClient", () => { assert.ok(respFileAttributes.offline); assert.ok(respFileAttributes.notContentIndexed); assert.ok(respFileAttributes.noScrubData); - assert.equal(truncatedISO8061Date(result.fileCreationTime!), truncatedISO8061Date(now)); - assert.equal(truncatedISO8061Date(result.fileLastWriteTime!), truncatedISO8061Date(now)); + assert.equal(truncatedISO8061Date(result.fileCreatedOn!), truncatedISO8061Date(now)); + assert.equal(truncatedISO8061Date(result.fileLastWriteOn!), truncatedISO8061Date(now)); assert.equal(result.filePermissionKey!, defaultDirCreateResp.filePermissionKey!); - assert.ok(result.fileChangeTime!); + assert.ok(result.fileChangeOn!); assert.ok(result.fileId!); assert.ok(result.fileParentId!); }); @@ -144,10 +144,10 @@ describe("DirectoryClient", () => { assert.ok(respFileAttributes.offline); assert.ok(respFileAttributes.notContentIndexed); assert.ok(respFileAttributes.noScrubData); - assert.equal(truncatedISO8061Date(result.fileCreationTime!), truncatedISO8061Date(now)); - assert.equal(truncatedISO8061Date(result.fileLastWriteTime!), truncatedISO8061Date(now)); + assert.equal(truncatedISO8061Date(result.fileCreatedOn!), truncatedISO8061Date(now)); + assert.equal(truncatedISO8061Date(result.fileLastWriteOn!), truncatedISO8061Date(now)); assert.ok(result.filePermissionKey!); - assert.ok(result.fileChangeTime!); + assert.ok(result.fileChangeOn!); assert.ok(result.fileId!); assert.ok(result.fileParentId!); }); @@ -159,15 +159,15 @@ describe("DirectoryClient", () => { assert.equal(result.errorCode, undefined); assert.equal(result.fileAttributes!, defaultDirCreateResp.fileAttributes!); assert.equal( - truncatedISO8061Date(result.fileCreationTime!), - truncatedISO8061Date(defaultDirCreateResp.fileCreationTime!) + truncatedISO8061Date(result.fileCreatedOn!), + truncatedISO8061Date(defaultDirCreateResp.fileCreatedOn!) ); assert.equal( - truncatedISO8061Date(result.fileLastWriteTime!), - truncatedISO8061Date(defaultDirCreateResp.fileLastWriteTime!) + truncatedISO8061Date(result.fileLastWriteOn!), + truncatedISO8061Date(defaultDirCreateResp.fileLastWriteOn!) ); assert.equal(result.filePermissionKey!, defaultDirCreateResp.filePermissionKey!); - assert.ok(result.fileChangeTime!); + assert.ok(result.fileChangeOn!); assert.ok(result.fileId!); assert.ok(result.fileParentId!); }); @@ -197,10 +197,10 @@ describe("DirectoryClient", () => { assert.ok(respFileAttributes.offline); assert.ok(respFileAttributes.notContentIndexed); assert.ok(respFileAttributes.noScrubData); - assert.equal(truncatedISO8061Date(result.fileCreationTime!), truncatedISO8061Date(now)); - assert.equal(truncatedISO8061Date(result.fileLastWriteTime!), truncatedISO8061Date(now)); + assert.equal(truncatedISO8061Date(result.fileCreatedOn!), truncatedISO8061Date(now)); + assert.equal(truncatedISO8061Date(result.fileLastWriteOn!), truncatedISO8061Date(now)); assert.ok(result.filePermissionKey!); - assert.ok(result.fileChangeTime!); + assert.ok(result.fileChangeOn!); assert.ok(result.fileId!); assert.ok(result.fileParentId!); }); diff --git a/sdk/storage/storage-file/test/fileclient.spec.ts b/sdk/storage/storage-file/test/fileclient.spec.ts index a16d623a1cd2..49d037946abc 100644 --- a/sdk/storage/storage-file/test/fileclient.spec.ts +++ b/sdk/storage/storage-file/test/fileclient.spec.ts @@ -60,10 +60,10 @@ describe("FileClient", () => { const cResp = await fileClient.create(content.length); assert.equal(cResp.errorCode, undefined); assert.equal(cResp.fileAttributes!, "Archive"); - assert.ok(cResp.fileChangeTime!); - assert.ok(cResp.fileCreationTime!); + assert.ok(cResp.fileChangeOn!); + assert.ok(cResp.fileCreatedOn!); assert.ok(cResp.fileId!); - assert.ok(cResp.fileLastWriteTime!); + assert.ok(cResp.fileLastWriteOn!); assert.ok(cResp.fileParentId!); assert.ok(cResp.filePermissionKey!); @@ -107,10 +107,10 @@ describe("FileClient", () => { assert.ok(respFileAttributesFromDownload.notContentIndexed); assert.ok(respFileAttributesFromDownload.noScrubData); assert.ok(respFileAttributesFromDownload.temporary); - assert.equal(truncatedISO8061Date(result.fileCreationTime!), truncatedISO8061Date(now)); - assert.equal(truncatedISO8061Date(result.fileLastWriteTime!), truncatedISO8061Date(now)); + assert.equal(truncatedISO8061Date(result.fileCreatedOn!), truncatedISO8061Date(now)); + assert.equal(truncatedISO8061Date(result.fileLastWriteOn!), truncatedISO8061Date(now)); assert.equal(result.filePermissionKey!, defaultDirCreateResp.filePermissionKey!); - assert.ok(result.fileChangeTime!); + assert.ok(result.fileChangeOn!); assert.ok(result.fileId!); assert.ok(result.fileParentId!); @@ -132,10 +132,10 @@ describe("FileClient", () => { assert.ok(respFileAttributes.notContentIndexed); assert.ok(respFileAttributes.noScrubData); assert.ok(respFileAttributes.temporary); - assert.equal(truncatedISO8061Date(properties.fileCreationTime!), truncatedISO8061Date(now)); - assert.equal(truncatedISO8061Date(properties.fileLastWriteTime!), truncatedISO8061Date(now)); + assert.equal(truncatedISO8061Date(properties.fileCreatedOn!), truncatedISO8061Date(now)); + assert.equal(truncatedISO8061Date(properties.fileLastWriteOn!), truncatedISO8061Date(now)); assert.equal(properties.filePermissionKey!, defaultDirCreateResp.filePermissionKey!); - assert.ok(properties.fileChangeTime!); + assert.ok(properties.fileChangeOn!); assert.ok(properties.fileId!); assert.ok(properties.fileParentId!); }); @@ -147,10 +147,10 @@ describe("FileClient", () => { const result = await fileClient.getProperties(); assert.equal(result.errorCode, undefined); assert.equal(result.fileAttributes!, "Archive"); - assert.ok(result.fileCreationTime!); - assert.ok(result.fileLastWriteTime!); + assert.ok(result.fileCreatedOn!); + assert.ok(result.fileLastWriteOn!); assert.ok(result.filePermissionKey!); - assert.ok(result.fileChangeTime!); + assert.ok(result.fileChangeOn!); assert.ok(result.fileId!); assert.ok(result.fileParentId!); assert.ok(result.lastModified); @@ -202,10 +202,10 @@ describe("FileClient", () => { assert.ok(respFileAttributes.notContentIndexed); assert.ok(respFileAttributes.noScrubData); assert.ok(respFileAttributes.temporary); - assert.equal(truncatedISO8061Date(result.fileCreationTime!), truncatedISO8061Date(now)); - assert.equal(truncatedISO8061Date(result.fileLastWriteTime!), truncatedISO8061Date(now)); + assert.equal(truncatedISO8061Date(result.fileCreatedOn!), truncatedISO8061Date(now)); + assert.equal(truncatedISO8061Date(result.fileLastWriteOn!), truncatedISO8061Date(now)); assert.ok(result.filePermissionKey!); - assert.ok(result.fileChangeTime!); + assert.ok(result.fileChangeOn!); assert.ok(result.fileId!); assert.ok(result.fileParentId!); }); From fcbfe18a0db921ade11ba83dadb9a0ea213977fa Mon Sep 17 00:00:00 2001 From: Jose Manuel Heredia Hidalgo Date: Wed, 16 Oct 2019 16:20:36 -0700 Subject: [PATCH 8/8] Convenience layer renames --- .../samples/typescript/advanced.ts | 6 +- .../storage-file/src/DirectoryClient.ts | 8 +- sdk/storage/storage-file/src/FileClient.ts | 124 +++++++++--------- .../storage-file/src/FileServiceClient.ts | 12 +- sdk/storage/storage-file/src/Pipeline.ts | 24 ++-- .../storage-file/src/SASQueryParameters.ts | 4 +- sdk/storage/storage-file/src/ShareClient.ts | 18 +-- sdk/storage/storage-file/src/models.ts | 2 +- .../src/policies/LoggingPolicy.ts | 10 +- .../storage-file/src/utils/BufferScheduler.ts | 20 +-- .../storage-file/src/utils/constants.ts | 4 +- .../storage-file/test/fileclient.spec.ts | 18 +-- .../test/node/highlevel.node.spec.ts | 38 +++--- .../storage-file/test/node/sas.spec.ts | 12 +- sdk/storage/storage-file/test/utils/index.ts | 2 +- 15 files changed, 151 insertions(+), 151 deletions(-) diff --git a/sdk/storage/storage-file/samples/typescript/advanced.ts b/sdk/storage/storage-file/samples/typescript/advanced.ts index 37c46fa2e3d8..f6236c198320 100644 --- a/sdk/storage/storage-file/samples/typescript/advanced.ts +++ b/sdk/storage/storage-file/samples/typescript/advanced.ts @@ -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"); @@ -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) }); */ @@ -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"); diff --git a/sdk/storage/storage-file/src/DirectoryClient.ts b/sdk/storage/storage-file/src/DirectoryClient.ts index 77dde02926a8..ca028ffe799a 100644 --- a/sdk/storage/storage-file/src/DirectoryClient.ts +++ b/sdk/storage/storage-file/src/DirectoryClient.ts @@ -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"; @@ -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. * @@ -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) { diff --git a/sdk/storage/storage-file/src/FileClient.ts b/sdk/storage/storage-file/src/FileClient.ts index 02755a705921..7c87d648d4d4 100644 --- a/sdk/storage/storage-file/src/FileClient.ts +++ b/sdk/storage/storage-file/src/FileClient.ts @@ -10,7 +10,7 @@ import * as Models from "./generated/src/models"; import { File } from "./generated/src/operations"; import { Range, rangeToString } from "./Range"; import { - FileHTTPHeaders, + FileHttpHeaders, Metadata, FileAndDirectoryCreateCommonOptions, FileAndDirectorySetPropertiesCommonOptions, @@ -20,13 +20,13 @@ import { validateAndSetDefaultsForFileAndDirectoryCreateCommonOptions, validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions } from "./models"; -import { newPipeline, NewPipelineOptions, Pipeline } from "./Pipeline"; +import { newPipeline, StoragePipelineOptions, Pipeline } from "./Pipeline"; import { StorageClient, CommonOptions } from "./StorageClient"; import { DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS, FILE_MAX_SIZE_BYTES, FILE_RANGE_MAX_SIZE_BYTES, - DEFAULT_HIGH_LEVEL_PARALLELISM + DEFAULT_HIGH_LEVEL_CONCURRENCY } from "./utils/constants"; import "@azure/core-paging"; import { PageSettings, PagedAsyncIterableIterator } from "@azure/core-paging"; @@ -59,10 +59,10 @@ export interface FileCreateOptions extends FileAndDirectoryCreateCommonOptions, /** * File HTTP headers like Content-Type. * - * @type {FileHTTPHeaders} + * @type {FileHttpHeaders} * @memberof FileCreateOptions */ - fileHTTPHeaders?: FileHTTPHeaders; + fileHttpHeaders?: FileHttpHeaders; /** * A collection of key-value string pair to associate with the file storage object. @@ -85,10 +85,10 @@ export interface FileProperties extends FileAndDirectorySetPropertiesCommonOptio /** * File HTTP headers like Content-Type. * - * @type {FileHTTPHeaders} + * @type {FileHttpHeaders} * @memberof FileProperties */ - fileHTTPHeaders?: FileHTTPHeaders; + fileHttpHeaders?: FileHttpHeaders; } export interface SetPropertiesResponse extends Models.FileSetHTTPHeadersResponse {} @@ -354,9 +354,9 @@ export interface FileSetMetadataOptions extends CommonOptions { * Options to configure File - HTTP Headers operation. * * @export - * @interface FileHTTPHeadersOptions + * @interface FileSetHttpHeadersOptions */ -export interface FileSetHTTPHeadersOptions +export interface FileSetHttpHeadersOptions extends FileAndDirectorySetPropertiesCommonOptions, CommonOptions { /** @@ -364,7 +364,7 @@ export interface FileSetHTTPHeadersOptions * For example, use the @azure/abort-controller to create an `AbortSignal`. * * @type {AbortSignalLike} - * @memberof FileSetHTTPHeadersOptions + * @memberof FileSetHttpHeadersOptions */ abortSignal?: AbortSignalLike; } @@ -444,7 +444,7 @@ export interface FileListHandlesSegmentOptions extends CommonOptions { * @type {number} * @memberof FileListHandlesSegmentOptions */ - maxResults?: number; + maxPageSize?: number; } export interface FileListHandlesOptions extends CommonOptions { @@ -492,10 +492,10 @@ export interface UploadStreamToAzureFileOptions extends CommonOptions { /** * Azure File HTTP Headers. * - * @type {FileHTTPHeaders} + * @type {FileHttpHeaders} * @memberof UploadStreamToAzureFileOptions */ - fileHTTPHeaders?: FileHTTPHeaders; + fileHttpHeaders?: FileHttpHeaders; /** * Metadata of the Azure file. @@ -547,10 +547,10 @@ export interface UploadToAzureFileOptions extends CommonOptions { /** * File HTTP Headers. * - * @type {FileHTTPHeaders} + * @type {FileHttpHeaders} * @memberof UploadToAzureFileOptions */ - fileHTTPHeaders?: FileHTTPHeaders; + fileHttpHeaders?: FileHttpHeaders; /** * Metadata of an Azure file. @@ -561,13 +561,13 @@ export interface UploadToAzureFileOptions extends CommonOptions { metadata?: Metadata; /** - * Parallelism indicates the maximum number of ranges to upload in parallel. - * If not provided, 5 parallelism will be used by default. + * Concurrency indicates the maximum number of ranges to upload in parallel. + * If not provided, 5 concurrency will be used by default. * * @type {number} * @memberof UploadToAzureFileOptions */ - parallelism?: number; + concurrency?: number; } /** @@ -622,13 +622,13 @@ export interface DownloadFromAzureFileOptions extends CommonOptions { progress?: (progress: TransferProgressEvent) => void; /** - * Parallelism indicates the maximum number of ranges to download in parallel. - * If not provided, 5 parallelism will be used by default. + * Concurrency indicates the maximum number of ranges to download in parallel. + * If not provided, 5 concurrency will be used by default. * * @type {number} * @memberof DownloadFromAzureFileOptions */ - parallelism?: number; + concurrency?: number; } /** @@ -670,10 +670,10 @@ export class FileClient extends StorageClient { * Such as a file named "myfile%", the URL should be "https://myaccount.file.core.windows.net/myshare/mydirectory/myfile%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 FileClient */ - constructor(url: string, credential?: Credential, options?: NewPipelineOptions); + constructor(url: string, credential?: Credential, options?: StoragePipelineOptions); /** * Creates an instance of FileClient. * @@ -693,7 +693,7 @@ export class FileClient extends StorageClient { constructor( url: string, credentialOrPipeline?: Credential | Pipeline, - options?: NewPipelineOptions + options?: StoragePipelineOptions ) { let pipeline: Pipeline; if (credentialOrPipeline instanceof Pipeline) { @@ -740,7 +740,7 @@ export class FileClient extends StorageClient { options.fileAttributes = attributes; } - options.fileHTTPHeaders = options.fileHTTPHeaders || {}; + options.fileHttpHeaders = options.fileHttpHeaders || {}; return this.context.create( size, @@ -749,7 +749,7 @@ export class FileClient extends StorageClient { fileLastWriteTimeToString(options.lastWriteTime!), { abortSignal: options.abortSignal, - fileHTTPHeaders: options.fileHTTPHeaders, + fileHttpHeaders: options.fileHttpHeaders, metadata: options.metadata, filePermission: options.filePermission, filePermissionKey: options.filePermissionKey, @@ -907,7 +907,7 @@ export class FileClient extends StorageClient { try { properties = validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions(properties); - properties.fileHTTPHeaders = properties.fileHTTPHeaders || {}; + properties.fileHttpHeaders = properties.fileHttpHeaders || {}; return this.context.setHTTPHeaders( fileAttributesToString(properties.fileAttributes!), @@ -915,7 +915,7 @@ export class FileClient extends StorageClient { fileLastWriteTimeToString(properties.lastWriteTime!), { abortSignal: properties.abortSignal, - fileHTTPHeaders: properties.fileHTTPHeaders, + fileHTTPHeaders: properties.fileHttpHeaders, filePermission: properties.filePermission, filePermissionKey: properties.filePermissionKey, spanOptions @@ -975,15 +975,15 @@ export class FileClient extends StorageClient { * these file HTTP headers without a value will be cleared. * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-file-properties * - * @param {fileHTTPHeaders} [FileHTTPHeaders] File HTTP headers like Content-Type. + * @param {fileHttpHeaders} [FileHttpHeaders] File HTTP headers like Content-Type. * Provide undefined will remove existing HTTP headers. - * @param {FileSetHTTPHeadersOptions} [options] Options to File Set HTTP Headers operation. + * @param {FileSetHttpHeadersOptions} [options] Options to File Set HTTP Headers operation. * @returns {Promise} Response data for the File Set HTTP Headers operation. * @memberof FileClient */ - public async setHTTPHeaders( - fileHTTPHeaders: FileHTTPHeaders = {}, - options: FileSetHTTPHeadersOptions = {} + public async setHttpHeaders( + fileHttpHeaders: FileHttpHeaders = {}, + options: FileSetHttpHeadersOptions = {} ): Promise { const { span, spanOptions } = createSpan("FileClient-setHTTPHeaders", options.spanOptions); try { @@ -995,7 +995,7 @@ export class FileClient extends StorageClient { fileLastWriteTimeToString(options.lastWriteTime!), { abortSignal: options.abortSignal, - fileHTTPHeaders: fileHTTPHeaders, + fileHTTPHeaders: fileHttpHeaders, filePermission: options.filePermission, filePermissionKey: options.filePermissionKey, spanOptions @@ -1361,7 +1361,7 @@ export class FileClient extends StorageClient { const { span, spanOptions } = createSpan("FileClient-uploadBrowserData", options.spanOptions); try { const browserBlob = new Blob([browserData]); - return this.UploadSeekableBlob( + return this.uploadSeekableBlob( (offset: number, size: number): Blob => { return browserBlob.slice(offset, offset + size); }, @@ -1390,7 +1390,7 @@ export class FileClient extends StorageClient { * @param {UploadToAzureFileOptions} [options] * @returns {Promise} */ - async UploadSeekableBlob( + async uploadSeekableBlob( blobFactory: (offset: number, size: number) => Blob, size: number, options: UploadToAzureFileOptions = {} @@ -1404,21 +1404,21 @@ export class FileClient extends StorageClient { throw new RangeError(`options.rangeSize must be > 0 and <= ${FILE_RANGE_MAX_SIZE_BYTES}`); } - if (!options.fileHTTPHeaders) { - options.fileHTTPHeaders = {}; + if (!options.fileHttpHeaders) { + options.fileHttpHeaders = {}; } - if (!options.parallelism) { - options.parallelism = DEFAULT_HIGH_LEVEL_PARALLELISM; + if (!options.concurrency) { + options.concurrency = DEFAULT_HIGH_LEVEL_CONCURRENCY; } - if (options.parallelism < 0) { - throw new RangeError(`options.parallelism cannot less than 0.`); + if (options.concurrency < 0) { + throw new RangeError(`options.concurrency cannot less than 0.`); } // Create the file await this.create(size, { abortSignal: options.abortSignal, - fileHTTPHeaders: options.fileHTTPHeaders, + fileHttpHeaders: options.fileHttpHeaders, metadata: options.metadata, spanOptions }); @@ -1426,7 +1426,7 @@ export class FileClient extends StorageClient { const numBlocks: number = Math.floor((size - 1) / options.rangeSize) + 1; let transferProgress: number = 0; - const batch = new Batch(options.parallelism); + const batch = new Batch(options.concurrency); for (let i = 0; i < numBlocks; i++) { batch.addOperation( async (): Promise => { @@ -1525,28 +1525,28 @@ export class FileClient extends StorageClient { throw new RangeError(`options.rangeSize must be > 0 and <= ${FILE_RANGE_MAX_SIZE_BYTES}`); } - if (!options.fileHTTPHeaders) { - options.fileHTTPHeaders = {}; + if (!options.fileHttpHeaders) { + options.fileHttpHeaders = {}; } - if (!options.parallelism) { - options.parallelism = DEFAULT_HIGH_LEVEL_PARALLELISM; + if (!options.concurrency) { + options.concurrency = DEFAULT_HIGH_LEVEL_CONCURRENCY; } - if (options.parallelism < 0) { - throw new RangeError(`options.parallelism cannot less than 0.`); + if (options.concurrency < 0) { + throw new RangeError(`options.concurrency cannot less than 0.`); } // Create the file await this.create(size, { abortSignal: options.abortSignal, - fileHTTPHeaders: options.fileHTTPHeaders, + fileHttpHeaders: options.fileHttpHeaders, metadata: options.metadata, spanOptions }); const numBlocks: number = Math.floor((size - 1) / options.rangeSize) + 1; let transferProgress: number = 0; - const batch = new Batch(options.parallelism); + const batch = new Batch(options.concurrency); for (let i = 0; i < numBlocks; i++) { batch.addOperation( @@ -1618,11 +1618,11 @@ export class FileClient extends StorageClient { throw new RangeError("count option must be > 0"); } - if (!options.parallelism) { - options.parallelism = DEFAULT_HIGH_LEVEL_PARALLELISM; + if (!options.concurrency) { + options.concurrency = DEFAULT_HIGH_LEVEL_CONCURRENCY; } - if (options.parallelism < 0) { - throw new RangeError(`options.parallelism cannot less than 0.`); + if (options.concurrency < 0) { + throw new RangeError(`options.concurrency cannot less than 0.`); } // Customer doesn't specify length, get it @@ -1646,7 +1646,7 @@ export class FileClient extends StorageClient { } let transferProgress: number = 0; - const batch = new Batch(options.parallelism); + const batch = new Batch(options.concurrency); for (let off = offset; off < offset + count; off = off + options.rangeSize) { batch.addOperation(async () => { // Exclusive chunk end position @@ -1713,8 +1713,8 @@ export class FileClient extends StorageClient { ): Promise { const { span, spanOptions } = createSpan("FileClient-uploadStream", options.spanOptions); try { - if (!options.fileHTTPHeaders) { - options.fileHTTPHeaders = {}; + if (!options.fileHttpHeaders) { + options.fileHttpHeaders = {}; } if (bufferSize <= 0 || bufferSize > FILE_RANGE_MAX_SIZE_BYTES) { @@ -1728,7 +1728,7 @@ export class FileClient extends StorageClient { // Create the file await this.create(size, { abortSignal: options.abortSignal, - fileHTTPHeaders: options.fileHTTPHeaders, + fileHttpHeaders: options.fileHttpHeaders, metadata: options.metadata, spanOptions }); @@ -1757,7 +1757,7 @@ export class FileClient extends StorageClient { options.progress({ loadedBytes: transferProgress }); } }, - // Parallelism should set a smaller value than maxBuffers, which is helpful to + // Concurrency should set a smaller value than maxBuffers, which is helpful to // reduce the possibility when a outgoing handler waits for stream data, in // this situation, outgoing handlers are blocked. // Outgoing queue shouldn't be empty. @@ -1945,7 +1945,7 @@ export class FileClient extends StorageClient { */ byPage: (settings: PageSettings = {}) => { return this.iterateHandleSegments(settings.continuationToken, { - maxResults: settings.maxPageSize, + maxPageSize: settings.maxPageSize, ...options }); } diff --git a/sdk/storage/storage-file/src/FileServiceClient.ts b/sdk/storage/storage-file/src/FileServiceClient.ts index f22c7293999c..39e38f36018a 100644 --- a/sdk/storage/storage-file/src/FileServiceClient.ts +++ b/sdk/storage/storage-file/src/FileServiceClient.ts @@ -4,7 +4,7 @@ import { AbortSignalLike } from "@azure/abort-controller"; import * as Models from "./generated/src/models"; import { Service } from "./generated/src/operations"; -import { newPipeline, NewPipelineOptions, Pipeline } from "./Pipeline"; +import { newPipeline, StoragePipelineOptions, Pipeline } from "./Pipeline"; import { StorageClient, CommonOptions } from "./StorageClient"; import { ShareClient, ShareCreateOptions, ShareDeleteMethodOptions } from "./ShareClient"; import { appendToURLPath, extractConnectionStringParts } from "./utils/utils.common"; @@ -161,13 +161,13 @@ export class FileServiceClient extends StorageClient { * `DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net` * SAS connection string example - * `BlobEndpoint=https://myaccount.blob.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString` - * @param {NewPipelineOptions} [options] Options to configure the HTTP pipeline. + * @param {StoragePipelineOptions} [options] Options to configure the HTTP pipeline. * @returns {FileServiceClient} A new FileServiceClient from the given connection string. * @memberof FileServiceClient */ public static fromConnectionString( connectionString: string, - options?: NewPipelineOptions + options?: StoragePipelineOptions ): FileServiceClient { const extractedCreds = extractConnectionStringParts(connectionString); if (extractedCreds.kind === "AccountConnString") { @@ -199,10 +199,10 @@ export class FileServiceClient extends StorageClient { * if using AnonymousCredential, such as "https://myaccount.file.core.windows.net?sasString". * @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 FileServiceClient */ - constructor(url: string, credential?: Credential, options?: NewPipelineOptions); + constructor(url: string, credential?: Credential, options?: StoragePipelineOptions); /** * Creates an instance of FileServiceClient. * @@ -217,7 +217,7 @@ export class FileServiceClient extends StorageClient { constructor( url: string, credentialOrPipeline?: Credential | Pipeline, - options?: NewPipelineOptions + options?: StoragePipelineOptions ) { let pipeline: Pipeline; if (credentialOrPipeline instanceof Pipeline) { diff --git a/sdk/storage/storage-file/src/Pipeline.ts b/sdk/storage/storage-file/src/Pipeline.ts index b6ffcc53d24c..330a2ea0b806 100644 --- a/sdk/storage/storage-file/src/Pipeline.ts +++ b/sdk/storage/storage-file/src/Pipeline.ts @@ -66,7 +66,7 @@ export interface PipelineOptions { * @type {IHttpClient} * @memberof PipelineOptions */ - HTTPClient?: IHttpClient; + HttpClient?: IHttpClient; } /** @@ -116,7 +116,7 @@ export class Pipeline { */ public toServiceClientOptions(): ServiceClientOptions { return { - httpClient: this.options.HTTPClient, + httpClient: this.options.HttpClient, httpPipelineLogger: this.options.logger, requestPolicyFactories: this.factories }; @@ -127,43 +127,43 @@ export class Pipeline { * Option interface for newPipeline() function. * * @export - * @interface NewPipelineOptions + * @interface StoragePipelineOptions */ -export interface NewPipelineOptions { +export interface StoragePipelineOptions { proxy?: ProxySettings | string; /** * Telemetry configures the built-in telemetry policy behavior. * * @type {TelemetryOptions} - * @memberof NewPipelineOptions + * @memberof StoragePipelineOptions */ telemetry?: TelemetryOptions; /** * Configures the built-in retry policy behavior. * * @type {RetryOptions} - * @memberof NewPipelineOptions + * @memberof StoragePipelineOptions */ retryOptions?: RetryOptions; /** * Keep alive configurations. Default keep-alive is enabled. * * @type {KeepAliveOptions} - * @memberof NewPipelineOptions + * @memberof StoragePipelineOptions */ keepAliveOptions?: KeepAliveOptions; /** * Configures the HTTP pipeline logger. * * @type {IHttpPipelineLogger} - * @memberof NewPipelineOptions + * @memberof StoragePipelineOptions */ logger?: IHttpPipelineLogger; /** * Configures the HTTP client to send requests and receive responses. * * @type {IHttpClient} - * @memberof NewPipelineOptions + * @memberof StoragePipelineOptions */ httpClient?: IHttpClient; } @@ -173,13 +173,13 @@ export interface NewPipelineOptions { * * @static * @param {Credential} credential Such as AnonymousCredential, SharedKeyCredential. - * @param {NewPipelineOptions} [pipelineOptions] Optional. Options. + * @param {StoragePipelineOptions} [pipelineOptions] Optional. Options. * @returns {Pipeline} A new Pipeline object. * @memberof Pipeline */ export function newPipeline( credential: Credential, - pipelineOptions: NewPipelineOptions = {} + pipelineOptions: StoragePipelineOptions = {} ): 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 @@ -208,7 +208,7 @@ export function newPipeline( factories.push(credential); return new Pipeline(factories, { - HTTPClient: pipelineOptions.httpClient, + HttpClient: pipelineOptions.httpClient, logger: pipelineOptions.logger }); } diff --git a/sdk/storage/storage-file/src/SASQueryParameters.ts b/sdk/storage/storage-file/src/SASQueryParameters.ts index c131141404bd..ce05c7939b80 100644 --- a/sdk/storage/storage-file/src/SASQueryParameters.ts +++ b/sdk/storage/storage-file/src/SASQueryParameters.ts @@ -14,12 +14,12 @@ export enum SASProtocol { /** * Protocol that allows HTTPS only */ - HTTPS = "https", + Https = "https", /** * Protocol that allows both HTTPS and HTTP */ - HTTPSandHTTP = "https,http" + HttpsAndHttp = "https,http" } /** diff --git a/sdk/storage/storage-file/src/ShareClient.ts b/sdk/storage/storage-file/src/ShareClient.ts index fc1bacbbc4f9..b8e7b691f2d2 100644 --- a/sdk/storage/storage-file/src/ShareClient.ts +++ b/sdk/storage/storage-file/src/ShareClient.ts @@ -7,7 +7,7 @@ import { AbortSignalLike } from "@azure/abort-controller"; import * as Models from "./generated/src/models"; import { Share } from "./generated/src/operations"; import { Metadata } from "./models"; -import { newPipeline, NewPipelineOptions, Pipeline } from "./Pipeline"; +import { newPipeline, StoragePipelineOptions, Pipeline } from "./Pipeline"; import { StorageClient, CommonOptions } from "./StorageClient"; import { URLConstants } from "./utils/constants"; import { @@ -342,10 +342,10 @@ export class ShareClient extends StorageClient { * SAS connection string example - * `BlobEndpoint=https://myaccount.blob.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString` * @param {string} shareName Share name. - * @param {NewPipelineOptions} [options] Optional. Options to configure the HTTP pipeline. + * @param {StoragePipelineOptions} [options] Optional. Options to configure the HTTP pipeline. * @memberof ShareClient */ - constructor(connectionString: string, shareName: string, options?: NewPipelineOptions); + constructor(connectionString: string, shareName: string, options?: StoragePipelineOptions); /** * Creates an instance of ShareClient. * @@ -355,10 +355,10 @@ export class ShareClient extends StorageClient { * "https://myaccount.file.core.windows.net/share?sasString". * @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 ShareClient */ - constructor(url: string, credential?: Credential, options?: NewPipelineOptions); + constructor(url: string, credential?: Credential, options?: StoragePipelineOptions); /** * Creates an instance of ShareClient. * @@ -374,7 +374,7 @@ export class ShareClient extends StorageClient { constructor( urlOrConnectionString: string, credentialOrPipelineOrShareName?: Credential | Pipeline | string, - options?: NewPipelineOptions + options?: StoragePipelineOptions ) { let pipeline: Pipeline; let url: string; @@ -383,14 +383,14 @@ export class ShareClient extends StorageClient { url = urlOrConnectionString; pipeline = credentialOrPipelineOrShareName; } else if (credentialOrPipelineOrShareName instanceof Credential) { - // (url: string, credential?: Credential, options?: NewPipelineOptions) + // (url: string, credential?: Credential, options?: StoragePipelineOptions) url = urlOrConnectionString; pipeline = newPipeline(credentialOrPipelineOrShareName, options); } else if ( !credentialOrPipelineOrShareName && typeof credentialOrPipelineOrShareName !== "string" ) { - // (url: string, credential?: Credential, options?: NewPipelineOptions) + // (url: string, credential?: Credential, options?: StoragePipelineOptions) // The second parameter is undefined. Use anonymous credential. url = urlOrConnectionString; pipeline = newPipeline(new AnonymousCredential(), options); @@ -398,7 +398,7 @@ export class ShareClient extends StorageClient { credentialOrPipelineOrShareName && typeof credentialOrPipelineOrShareName === "string" ) { - // (connectionString: string, shareName: string, options?: NewPipelineOptions) + // (connectionString: string, shareName: string, options?: StoragePipelineOptions) const extractedCreds = extractConnectionStringParts(urlOrConnectionString); const shareName = credentialOrPipelineOrShareName; if (extractedCreds.kind === "AccountConnString") { diff --git a/sdk/storage/storage-file/src/models.ts b/sdk/storage/storage-file/src/models.ts index 1df2ad3c6838..8253736f5c96 100644 --- a/sdk/storage/storage-file/src/models.ts +++ b/sdk/storage/storage-file/src/models.ts @@ -6,7 +6,7 @@ export interface Metadata { [propertyName: string]: string; } -export interface FileHTTPHeaders { +export interface FileHttpHeaders { /** * @member {string} [fileCacheControl] Optional. Sets the file's cache * control. If specified, this property is stored with the file and returned diff --git a/sdk/storage/storage-file/src/policies/LoggingPolicy.ts b/sdk/storage/storage-file/src/policies/LoggingPolicy.ts index 67203bd43cf1..3eb10092d8e3 100644 --- a/sdk/storage/storage-file/src/policies/LoggingPolicy.ts +++ b/sdk/storage/storage-file/src/policies/LoggingPolicy.ts @@ -12,7 +12,7 @@ import { } from "@azure/core-http"; import { RequestLogOptions } from "../LoggingPolicyFactory"; -import { HTTPURLConnection } from "../utils/constants"; +import { HttpUrlConnection } from "../utils/constants"; import { sanitizeHeaders, sanitizeURL } from "../utils/utils.common"; // Default values of RetryOptions @@ -92,10 +92,10 @@ export class LoggingPolicy extends BaseRequestPolicy { if ( (response.status >= 400 && response.status <= 499 && - (response.status !== HTTPURLConnection.HTTP_NOT_FOUND && - response.status !== HTTPURLConnection.HTTP_CONFLICT && - response.status !== HTTPURLConnection.HTTP_PRECON_FAILED && - response.status !== HTTPURLConnection.HTTP_RANGE_NOT_SATISFIABLE)) || + (response.status !== HttpUrlConnection.HTTP_NOT_FOUND && + response.status !== HttpUrlConnection.HTTP_CONFLICT && + response.status !== HttpUrlConnection.HTTP_PRECON_FAILED && + response.status !== HttpUrlConnection.HTTP_RANGE_NOT_SATISFIABLE)) || (response.status >= 500 && response.status <= 509) ) { const errorString = `REQUEST ERROR: HTTP request failed with status code: ${response.status}. `; diff --git a/sdk/storage/storage-file/src/utils/BufferScheduler.ts b/sdk/storage/storage-file/src/utils/BufferScheduler.ts index a91e3fcb6e88..26f275a3c07e 100644 --- a/sdk/storage/storage-file/src/utils/BufferScheduler.ts +++ b/sdk/storage/storage-file/src/utils/BufferScheduler.ts @@ -26,7 +26,7 @@ export declare type OutgoingHandler = (buffer: Buffer, offset?: number) => Promi * PERFORMANCE IMPROVEMENT TIPS: * 1. Input stream highWaterMark is better to set a same value with bufferSize * parameter, which will avoid Buffer.concat() operations. - * 2. Parallelism should set a smaller value than maxBuffers, which is helpful to + * 2. Concurrency should set a smaller value than maxBuffers, which is helpful to * reduce the possibility when a outgoing handler waits for the stream data. * in this situation, outgoing handlers are blocked. * Outgoing queue shouldn't be empty. @@ -82,13 +82,13 @@ export class BufferScheduler { private readonly emitter: EventEmitter = new EventEmitter(); /** - * Concurrency of executing outgoingHandlers. (0 < parallelism <= maxBuffers) + * Concurrency of executing outgoingHandlers. (0 < concurrency <= maxBuffers) * * @private * @type {number} * @memberof BufferScheduler */ - private readonly parallelism: number; + private readonly concurrency: number; /** * An internal offset marker to track data offset in bytes of next outgoingHandler. @@ -193,7 +193,7 @@ export class BufferScheduler { * @param {OutgoingHandler} outgoingHandler An async function scheduled to be * triggered when a buffer fully filled * with stream data - * @param {number} parallelism Concurrency of executing outgoingHandlers (>0) + * @param {number} concurrency Concurrency of executing outgoingHandlers (>0) * @param {string} [encoding] [Optional] Encoding of Readable stream when it's a string stream * @memberof BufferScheduler */ @@ -202,7 +202,7 @@ export class BufferScheduler { bufferSize: number, maxBuffers: number, outgoingHandler: OutgoingHandler, - parallelism: number, + concurrency: number, encoding?: string ) { if (bufferSize <= 0) { @@ -213,15 +213,15 @@ export class BufferScheduler { throw new RangeError(`maxBuffers must be larger than 0, current is ${maxBuffers}`); } - if (parallelism <= 0) { - throw new RangeError(`parallelism must be larger than 0, current is ${parallelism}`); + if (concurrency <= 0) { + throw new RangeError(`concurrency must be larger than 0, current is ${concurrency}`); } this.bufferSize = bufferSize; this.maxBuffers = maxBuffers; this.readable = readable; this.outgoingHandler = outgoingHandler; - this.parallelism = parallelism; + this.concurrency = concurrency; this.encoding = encoding; } @@ -359,7 +359,7 @@ export class BufferScheduler { /** * Try to trigger a outgoing handler for every buffer in outgoing. Stop when - * parallelism reaches. + * concurrency reaches. * * @private * @memberof BufferScheduler @@ -367,7 +367,7 @@ export class BufferScheduler { private async triggerOutgoingHandlers() { let buffer: Buffer | undefined; do { - if (this.executingOutgoingHandlers >= this.parallelism) { + if (this.executingOutgoingHandlers >= this.concurrency) { return; } diff --git a/sdk/storage/storage-file/src/utils/constants.ts b/sdk/storage/storage-file/src/utils/constants.ts index 5f756cd1062b..bcabd5a66e31 100644 --- a/sdk/storage/storage-file/src/utils/constants.ts +++ b/sdk/storage/storage-file/src/utils/constants.ts @@ -7,7 +7,7 @@ export const SERVICE_VERSION: string = "2019-02-02"; export const FILE_MAX_SIZE_BYTES: number = 1024 * 1024 * 1024 * 1024; // 1TB export const FILE_RANGE_MAX_SIZE_BYTES: number = 4 * 1024 * 1024; // 4MB export const DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS: number = 5; -export const DEFAULT_HIGH_LEVEL_PARALLELISM: number = 5; +export const DEFAULT_HIGH_LEVEL_CONCURRENCY: number = 5; export const URLConstants = { Parameters: { @@ -18,7 +18,7 @@ export const URLConstants = { } }; -export const HTTPURLConnection = { +export const HttpUrlConnection = { HTTP_CONFLICT: 409, HTTP_NOT_FOUND: 404, HTTP_PRECON_FAILED: 412, diff --git a/sdk/storage/storage-file/test/fileclient.spec.ts b/sdk/storage/storage-file/test/fileclient.spec.ts index 49d037946abc..5cbe02582e58 100644 --- a/sdk/storage/storage-file/test/fileclient.spec.ts +++ b/sdk/storage/storage-file/test/fileclient.spec.ts @@ -78,7 +78,7 @@ describe("FileClient", () => { const now = recorder.newDate("now"); const options = { - fileHTTPHeaders: { + fileHttpHeaders: { fileCacheControl: "fileCacheControl", fileContentDisposition: "fileContentDisposition", fileContentEncoding: "fileContentEncoding", @@ -115,11 +115,11 @@ describe("FileClient", () => { assert.ok(result.fileParentId!); const properties = await fileClient.getProperties(); - assert.equal(properties.cacheControl, options.fileHTTPHeaders.fileCacheControl); - assert.equal(properties.contentDisposition, options.fileHTTPHeaders.fileContentDisposition); - assert.equal(properties.contentEncoding, options.fileHTTPHeaders.fileContentEncoding); - assert.equal(properties.contentLanguage, options.fileHTTPHeaders.fileContentLanguage); - assert.equal(properties.contentType, options.fileHTTPHeaders.fileContentType); + assert.equal(properties.cacheControl, options.fileHttpHeaders.fileCacheControl); + assert.equal(properties.contentDisposition, options.fileHttpHeaders.fileContentDisposition); + assert.equal(properties.contentEncoding, options.fileHttpHeaders.fileContentEncoding); + assert.equal(properties.contentLanguage, options.fileHttpHeaders.fileContentLanguage); + assert.equal(properties.contentType, options.fileHttpHeaders.fileContentType); assert.equal(properties.metadata!.key1, options.metadata.key1); assert.equal(properties.metadata!.key2, options.metadata.key2); assert.equal(properties.errorCode, undefined); @@ -171,7 +171,7 @@ describe("FileClient", () => { const now = recorder.newDate("now"); const options = { - fileHTTPHeaders: { + fileHttpHeaders: { fileCacheControl: "fileCacheControl", fileContentDisposition: "fileContentDisposition", fileContentEncoding: "fileContentEncoding", @@ -238,7 +238,7 @@ describe("FileClient", () => { it("setHTTPHeaders with default parameters", async () => { await fileClient.create(content.length); - await fileClient.setHTTPHeaders({}); + await fileClient.setHttpHeaders({}); const result = await fileClient.getProperties(); assert.ok(result.lastModified); @@ -264,7 +264,7 @@ describe("FileClient", () => { fileContentMD5: isNode ? Buffer.from([1, 2, 3, 4]) : new Uint8Array([1, 2, 3, 4]), fileContentType: "fileContentType" }; - await fileClient.setHTTPHeaders(headers); + await fileClient.setHttpHeaders(headers); const result = await fileClient.getProperties(); assert.ok(result.lastModified); assert.deepStrictEqual(result.metadata, {}); diff --git a/sdk/storage/storage-file/test/node/highlevel.node.spec.ts b/sdk/storage/storage-file/test/node/highlevel.node.spec.ts index 95306eb300cd..748a7d4cffe3 100644 --- a/sdk/storage/storage-file/test/node/highlevel.node.spec.ts +++ b/sdk/storage/storage-file/test/node/highlevel.node.spec.ts @@ -61,7 +61,7 @@ describe("Highlevel Node.js only", () => { it("uploadFile should success for large data", async () => { await fileClient.uploadFile(tempFileLarge, { - parallelism: 20, + concurrency: 20, rangeSize: 4 * 1024 * 1024 }); @@ -78,7 +78,7 @@ describe("Highlevel Node.js only", () => { it("uploadFile should success for small data", async () => { await fileClient.uploadFile(tempFileSmall, { - parallelism: 20, + concurrency: 20, rangeSize: 4 * 1024 * 1024 }); @@ -99,7 +99,7 @@ describe("Highlevel Node.js only", () => { try { await fileClient.uploadFile(tempFileLarge, { abortSignal: aborter, - parallelism: 20, + concurrency: 20, rangeSize: 4 * 1024 * 1024 }); assert.fail(); @@ -114,7 +114,7 @@ describe("Highlevel Node.js only", () => { try { await fileClient.uploadFile(tempFileSmall, { abortSignal: aborter, - parallelism: 20, + concurrency: 20, rangeSize: 4 * 1024 * 1024 }); assert.fail(); @@ -130,7 +130,7 @@ describe("Highlevel Node.js only", () => { try { await fileClient.uploadFile(tempFileLarge, { abortSignal: aborter.signal, - parallelism: 20, + concurrency: 20, progress: (ev) => { assert.ok(ev.loadedBytes); eventTriggered = true; @@ -151,7 +151,7 @@ describe("Highlevel Node.js only", () => { try { await fileClient.uploadFile(tempFileSmall, { abortSignal: aborter.signal, - parallelism: 20, + concurrency: 20, progress: (ev) => { assert.ok(ev.loadedBytes); eventTriggered = true; @@ -214,7 +214,7 @@ describe("Highlevel Node.js only", () => { const buf = Buffer.alloc(tempFileLargeLength); await fileClient.downloadToBuffer(buf, undefined, undefined, { - parallelism: 20, + concurrency: 20, rangeSize: 4 * 1024 * 1024 }); @@ -230,35 +230,35 @@ describe("Highlevel Node.js only", () => { await fileClient.downloadToBuffer(buf, 4, 4, { rangeSize: 4, maxRetryRequestsPerRange: 5, - parallelism: 1 + concurrency: 1 }); assert.deepStrictEqual(buf.toString(), "bbbb"); await fileClient.downloadToBuffer(buf, 3, 4, { rangeSize: 4, maxRetryRequestsPerRange: 5, - parallelism: 1 + concurrency: 1 }); assert.deepStrictEqual(buf.toString(), "abbb"); await fileClient.downloadToBuffer(buf, 2, 4, { rangeSize: 4, maxRetryRequestsPerRange: 5, - parallelism: 1 + concurrency: 1 }); assert.deepStrictEqual(buf.toString(), "aabb"); await fileClient.downloadToBuffer(buf, 1, 4, { rangeSize: 4, maxRetryRequestsPerRange: 5, - parallelism: 1 + concurrency: 1 }); assert.deepStrictEqual(buf.toString(), "aaab"); await fileClient.downloadToBuffer(buf, 0, 4, { rangeSize: 4, maxRetryRequestsPerRange: 5, - parallelism: 1 + concurrency: 1 }); assert.deepStrictEqual(buf.toString(), "aaaa"); }); @@ -271,7 +271,7 @@ describe("Highlevel Node.js only", () => { const buf = Buffer.alloc(tempFileLargeLength); await fileClient.downloadToBuffer(buf, 0, undefined, { abortSignal: AbortController.timeout(1), - parallelism: 20, + concurrency: 20, rangeSize: 4 * 1024 * 1024 }); assert.fail(); @@ -290,7 +290,7 @@ describe("Highlevel Node.js only", () => { try { await fileClient.downloadToBuffer(buf, 0, undefined, { abortSignal: aborter.signal, - parallelism: 1, + concurrency: 1, progress: () => { eventTriggered = true; aborter.abort(); @@ -306,7 +306,7 @@ describe("Highlevel Node.js only", () => { it("fileClient.download should success when internal stream unexcepted ends at the stream end", async () => { await fileClient.uploadFile(tempFileSmall, { rangeSize: 4 * 1024 * 1024, - parallelism: 20 + concurrency: 20 }); let retirableReadableStreamOptions: RetriableReadableStreamOptions; @@ -334,7 +334,7 @@ describe("Highlevel Node.js only", () => { it("fileClient.download should download full data successfully when internal stream unexcepted ends", async () => { await fileClient.uploadFile(tempFileSmall, { rangeSize: 4 * 1024 * 1024, - parallelism: 20 + concurrency: 20 }); let retirableReadableStreamOptions: RetriableReadableStreamOptions; @@ -363,7 +363,7 @@ describe("Highlevel Node.js only", () => { it("fileClient.download should download partial data when internal stream unexcepted ends", async () => { await fileClient.uploadFile(tempFileSmall, { rangeSize: 4 * 1024 * 1024, - parallelism: 20 + concurrency: 20 }); const partialSize = 10 * 1024; @@ -394,7 +394,7 @@ describe("Highlevel Node.js only", () => { it("fileClient.download should download data failed when exceeding max stream retry requests", async () => { await fileClient.uploadFile(tempFileSmall, { rangeSize: 4 * 1024 * 1024, - parallelism: 20 + concurrency: 20 }); const downloadedFile = path.join(tempFolderPath, recorder.getUniqueName("downloadfile.")); @@ -425,7 +425,7 @@ describe("Highlevel Node.js only", () => { it("fileClient.download should abort after retrys", async () => { await fileClient.uploadFile(tempFileSmall, { rangeSize: 4 * 1024 * 1024, - parallelism: 20 + concurrency: 20 }); const downloadedFile = path.join(tempFolderPath, recorder.getUniqueName("downloadfile.")); diff --git a/sdk/storage/storage-file/test/node/sas.spec.ts b/sdk/storage/storage-file/test/node/sas.spec.ts index e7facf24ad74..86e1341c947a 100644 --- a/sdk/storage/storage-file/test/node/sas.spec.ts +++ b/sdk/storage/storage-file/test/node/sas.spec.ts @@ -48,7 +48,7 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { expiryTime: tmr, ipRange: { start: "0.0.0.0", end: "255.255.255.255" }, permissions: AccountSASPermissions.parse("rwdlacup").toString(), - protocol: SASProtocol.HTTPSandHTTP, + protocol: SASProtocol.HttpsAndHttp, resourceTypes: AccountSASResourceTypes.parse("sco").toString(), services: AccountSASServices.parse("btqf").toString(), startTime: now, @@ -147,7 +147,7 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { expiryTime: tmr, ipRange: { start: "0.0.0.0", end: "255.255.255.255" }, permissions: AccountSASPermissions.parse("rwdlacup").toString(), - protocol: SASProtocol.HTTPSandHTTP, + protocol: SASProtocol.HttpsAndHttp, resourceTypes: AccountSASResourceTypes.parse("co").toString(), services: AccountSASServices.parse("btqf").toString(), version: "2016-05-31" @@ -188,7 +188,7 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { expiryTime: tmr, ipRange: { start: "0.0.0.0", end: "255.255.255.255" }, permissions: ShareSASPermissions.parse("rcwdl").toString(), - protocol: SASProtocol.HTTPSandHTTP, + protocol: SASProtocol.HttpsAndHttp, shareName: shareClient.shareName, startTime: now, version: "2018-03-28" @@ -230,7 +230,7 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { const fileName = recorder.getUniqueName("file"); const fileClient = dirClient.getFileClient(fileName); await fileClient.create(1024, { - fileHTTPHeaders: { + fileHttpHeaders: { fileContentType: "content-type-original" } }); @@ -246,7 +246,7 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { filePath: fileClient.filePath, ipRange: { start: "0.0.0.0", end: "255.255.255.255" }, permissions: FileSASPermissions.parse("rcwd").toString(), - protocol: SASProtocol.HTTPSandHTTP, + protocol: SASProtocol.HttpsAndHttp, shareName: fileClient.shareName, startTime: now, version: "2016-05-31" @@ -289,7 +289,7 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { const fileName = recorder.getUniqueName("file"); const fileClient = dirClient.getFileClient(fileName); await fileClient.create(1024, { - fileHTTPHeaders: { + fileHttpHeaders: { fileContentType: "content-type-original" } }); diff --git a/sdk/storage/storage-file/test/utils/index.ts b/sdk/storage/storage-file/test/utils/index.ts index e6394d3489ff..12a61b72556a 100644 --- a/sdk/storage/storage-file/test/utils/index.ts +++ b/sdk/storage/storage-file/test/utils/index.ts @@ -144,7 +144,7 @@ export function getSASConnectionStringFromEnvironment(): string { expiryTime: tmr, ipRange: { start: "0.0.0.0", end: "255.255.255.255" }, permissions: AccountSASPermissions.parse("rwdlacup").toString(), - protocol: SASProtocol.HTTPSandHTTP, + protocol: SASProtocol.HttpsAndHttp, resourceTypes: AccountSASResourceTypes.parse("sco").toString(), services: AccountSASServices.parse("btqf").toString(), startTime: now,