@azure/storage-file-share 12.25.1-alpha.20241014.1 → 12.26.0-alpha.20241016.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. package/dist/index.js +228 -7
  2. package/dist/index.js.map +1 -1
  3. package/dist-esm/storage-blob/src/Clients.js +33 -0
  4. package/dist-esm/storage-blob/src/Clients.js.map +1 -1
  5. package/dist-esm/storage-blob/src/ContainerClient.js +30 -0
  6. package/dist-esm/storage-blob/src/ContainerClient.js.map +1 -1
  7. package/dist-esm/storage-blob/src/generated/src/models/index.js +2 -0
  8. package/dist-esm/storage-blob/src/generated/src/models/index.js.map +1 -1
  9. package/dist-esm/storage-blob/src/generated/src/models/parameters.js +1 -1
  10. package/dist-esm/storage-blob/src/generated/src/models/parameters.js.map +1 -1
  11. package/dist-esm/storage-blob/src/generated/src/operations/blob.js +18 -3
  12. package/dist-esm/storage-blob/src/generated/src/operations/blob.js.map +1 -1
  13. package/dist-esm/storage-blob/src/generated/src/storageClient.js +2 -2
  14. package/dist-esm/storage-blob/src/generated/src/storageClient.js.map +1 -1
  15. package/dist-esm/storage-blob/src/utils/constants.js +2 -2
  16. package/dist-esm/storage-blob/src/utils/constants.js.map +1 -1
  17. package/dist-esm/storage-file-share/src/Clients.js.map +1 -1
  18. package/dist-esm/storage-file-share/src/generated/src/models/index.js +4 -0
  19. package/dist-esm/storage-file-share/src/generated/src/models/index.js.map +1 -1
  20. package/dist-esm/storage-file-share/src/generated/src/models/mappers.js +196 -0
  21. package/dist-esm/storage-file-share/src/generated/src/models/mappers.js.map +1 -1
  22. package/dist-esm/storage-file-share/src/generated/src/models/parameters.js +22 -2
  23. package/dist-esm/storage-file-share/src/generated/src/models/parameters.js.map +1 -1
  24. package/dist-esm/storage-file-share/src/generated/src/operations/file.js +1 -0
  25. package/dist-esm/storage-file-share/src/generated/src/operations/file.js.map +1 -1
  26. package/dist-esm/storage-file-share/src/generated/src/operations/share.js +5 -1
  27. package/dist-esm/storage-file-share/src/generated/src/operations/share.js.map +1 -1
  28. package/dist-esm/storage-file-share/src/generated/src/storageClient.js +2 -2
  29. package/dist-esm/storage-file-share/src/generated/src/storageClient.js.map +1 -1
  30. package/dist-esm/storage-file-share/src/utils/constants.js +2 -2
  31. package/dist-esm/storage-file-share/src/utils/constants.js.map +1 -1
  32. package/package.json +1 -1
  33. package/types/latest/storage-file-share.d.ts +84 -2
@@ -1 +1 @@
1
- {"version":3,"file":"Clients.js","sourceRoot":"","sources":["../../../src/Clients.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAElC,OAAO,EAAmB,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAKtE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AA4F1C,OAAO,EAAE,cAAc,EAAE,WAAW,EAA0B,MAAM,YAAY,CAAC;AACjF,OAAO,EACL,mCAAmC,EACnC,8BAA8B,EAC9B,mBAAmB,EACnB,yBAAyB,EACzB,YAAY,EACZ,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,4BAA4B,EAC5B,0BAA0B,EAC1B,gBAAgB,EAChB,yBAAyB,EACzB,UAAU,EACV,aAAa,EACb,UAAU,EACV,kCAAkC,EAClC,oCAAoC,EAEpC,cAAc,EACd,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAC3E,OAAO,EAAE,0BAA0B,EAAE,MAAM,+DAA+D,CAAC;AAC3G,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAC7F,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAiB,MAAM,iBAAiB,CAAC;AAE/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MA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,KAAK,EAAE,cAAc,EAAE,EAAE;YACvB,OAAO,cAAc,CACnB,MAAM,IAAI,CAAC,WAAW,CAAC,UAAU,iCAC5B,cAAc,GACd,IAAI,CAAC,iBAAiB,EACzB,CACH,CAAC;QACJ,CAAC,CACF,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACI,KAAK,CAAC,UAAU,CAAC,UAAiC,EAAE;QACzD,OAAO,aAAa,CAAC,QAAQ,CAC3B,6BAA6B,EAC7B,OAAO,EACP,KAAK,EAAE,cAAc,EAAE,EAAE;YACvB,IAAI,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;gBAC7B,MAAM,IAAI,UAAU,CAAC,8DAA8D,CAAC,CAAC;YACvF,CAAC;YACD,OAAO,cAAc,CACnB,MAAM,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,kCAC1C,cAAc,GACd,IAAI,CAAC,iBAAiB,EACzB,CACH,CAAC;QACJ,CAAC,CACF,CAAC;IACJ,CAAC;CACF;AAED;;GAEG;AACH,SAAS,MAAM,CAAC,WAAyB;IACvC,OAAO,YAAY,IAAI,WAAW,CAAC;AACrC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { TokenCredential, isTokenCredential } from \"@azure/core-auth\";\nimport {\n RequestBodyType as HttpRequestBody,\n TransferProgressEvent,\n} from \"@azure/core-rest-pipeline\";\nimport { isNode } from \"@azure/core-util\";\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport {\n CopyFileSmbInfo,\n DeleteSnapshotsOptionType,\n DirectoryCreateResponse,\n DirectoryDeleteResponse,\n DirectoryGetPropertiesResponse,\n DirectoryItem,\n DirectoryListFilesAndDirectoriesSegmentResponse,\n DirectoryListHandlesResponse,\n DirectorySetMetadataResponse,\n DirectorySetPropertiesResponse,\n DirectoryForceCloseHandlesHeaders,\n FileAbortCopyResponse,\n FileCreateResponse,\n FileDeleteResponse,\n FileDownloadOptionalParams,\n FileDownloadResponseModel,\n FileForceCloseHandlesHeaders,\n FileGetPropertiesResponse,\n FileGetRangeListHeaders,\n FileGetRangeListDiffResponse,\n FileItem,\n FileListHandlesResponse,\n FilePermissionFormat,\n FileSetHTTPHeadersResponse,\n FileSetMetadataResponse,\n FileStartCopyResponse,\n FileUploadRangeFromURLResponse,\n FileUploadRangeResponse,\n HandleItem,\n LeaseAccessConditions,\n RangeModel,\n ShareCreatePermissionResponse,\n ShareCreateResponse,\n ShareCreateSnapshotResponse,\n ShareDeleteResponse,\n ShareGetAccessPolicyHeaders,\n ShareGetPermissionResponse,\n ShareGetPropertiesResponseModel,\n ShareGetStatisticsResponseModel,\n ShareSetAccessPolicyResponse,\n ShareSetMetadataResponse,\n ShareSetQuotaResponse,\n SignedIdentifierModel,\n SourceModifiedAccessConditions,\n ShareAccessTier,\n ShareSetPropertiesResponse,\n ShareRootSquash,\n FileRenameResponse,\n DirectoryRenameResponse,\n FileLastWrittenMode,\n ShareFileRangeList,\n ShareCreateHeaders,\n ShareGetPropertiesHeaders,\n ShareDeleteHeaders,\n ShareSetMetadataHeaders,\n ShareSetAccessPolicyHeaders,\n ShareCreateSnapshotHeaders,\n ShareSetPropertiesHeaders,\n ShareGetStatisticsHeaders,\n ShareStats,\n ShareCreatePermissionHeaders,\n ShareGetPermissionHeaders,\n SharePermission,\n DirectoryCreateHeaders,\n DirectorySetPropertiesHeaders,\n DirectoryGetPropertiesHeaders,\n DirectoryDeleteHeaders,\n DirectorySetMetadataHeaders,\n DirectoryListFilesAndDirectoriesSegmentHeaders,\n DirectoryListHandlesHeaders,\n DirectoryRenameHeaders,\n FileCreateHeaders,\n FileDownloadHeaders,\n FileGetPropertiesHeaders,\n FileDeleteHeaders,\n FileSetMetadataHeaders,\n FileUploadRangeHeaders,\n FileUploadRangeFromURLHeaders,\n FileStartCopyHeaders,\n FileAbortCopyHeaders,\n FileListHandlesHeaders,\n RawFileDownloadResponse,\n} from \"./generatedModels\";\nimport {\n FileRenameHeaders,\n ListFilesAndDirectoriesSegmentResponse as GeneratedListFilesAndDirectoriesSegmentResponse,\n ListHandlesResponse as GeneratedListHandlesResponse,\n} from \"./generated/src/models\";\nimport { Share, Directory, File } from \"./generated/src/operationsInterfaces\";\nimport { isPipelineLike, newPipeline, Pipeline, PipelineLike } from \"./Pipeline\";\nimport {\n DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS,\n DEFAULT_HIGH_LEVEL_CONCURRENCY,\n FILE_MAX_SIZE_BYTES,\n FILE_RANGE_MAX_SIZE_BYTES,\n URLConstants,\n FileAttributesPreserve,\n FileAttributesNone,\n} from \"./utils/constants\";\nimport {\n appendToURLPath,\n setURLParameter,\n truncatedISO8061Date,\n extractConnectionStringParts,\n getShareNameAndPathFromUrl,\n appendToURLQuery,\n httpAuthorizationToString,\n setURLPath,\n setURLQueries,\n EscapePath,\n ConvertInternalResponseOfListFiles,\n ConvertInternalResponseOfListHandles,\n WithResponse,\n assertResponse,\n removeEmptyString,\n asSharePermission,\n} from \"./utils/utils.common\";\nimport { Credential } from \"../../storage-blob/src/credentials/Credential\";\nimport { StorageSharedKeyCredential } from \"../../storage-blob/src/credentials/StorageSharedKeyCredential\";\nimport { AnonymousCredential } from \"../../storage-blob/src/credentials/AnonymousCredential\";\nimport { tracingClient } from \"./utils/tracing\";\nimport { StorageClient, CommonOptions } from \"./StorageClient\";\nimport { PageSettings, PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { FileSystemAttributes } from \"./FileSystemAttributes\";\nimport { FileDownloadResponse } from \"./FileDownloadResponse\";\nimport { Range, rangeToString } from \"./Range\";\nimport {\n CloseHandlesInfo,\n FileAndDirectoryCreateCommonOptions,\n FileAndDirectorySetPropertiesCommonOptions,\n fileAttributesToString,\n fileCreationTimeToString,\n FileHttpHeaders,\n fileLastWriteTimeToString,\n Metadata,\n validateAndSetDefaultsForFileAndDirectoryCreateCommonOptions,\n validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions,\n ShareProtocols,\n toShareProtocolsString,\n toShareProtocols,\n HttpAuthorization,\n fileChangeTimeToString,\n ShareClientOptions,\n ShareClientConfig,\n} from \"./models\";\nimport { Batch } from \"./utils/Batch\";\nimport { BufferScheduler } from \"./utils/BufferScheduler\";\nimport { Readable } from \"stream\";\nimport {\n fsStat,\n fsCreateReadStream,\n readStreamToLocalFile,\n streamToBuffer,\n} from \"./utils/utils.node\";\nimport { FileSetHttpHeadersHeaders, StorageClient as StorageClientContext } from \"./generated/src/\";\nimport { randomUUID } from \"@azure/core-util\";\nimport {\n generateFileSASQueryParameters,\n generateFileSASQueryParametersInternal,\n} from \"./FileSASSignatureValues\";\nimport { ShareSASPermissions } from \"./ShareSASPermissions\";\nimport { SASProtocol } from \"./SASQueryParameters\";\nimport { SasIPRange } from \"./SasIPRange\";\nimport { FileSASPermissions } from \"./FileSASPermissions\";\nimport { ListFilesIncludeType } from \"./generated/src\";\n\nexport { ShareClientOptions, ShareClientConfig } from \"./models\";\n\n/**\n * Options to configure the {@link ShareClient.create} operation.\n */\nexport interface ShareCreateOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * A name-value pair to associate with a file storage object.\n */\n metadata?: { [propertyName: string]: string };\n\n /**\n * Specifies the maximum size of the share, in\n * gigabytes.\n */\n quota?: number;\n\n /**\n * Specifies the access tier of the share. Possible values include: 'TransactionOptimized',\n * 'Hot', 'Cool'\n */\n accessTier?: ShareAccessTier;\n\n /**\n * Supported in version 2020-02-10 and above. Specifies the enabled protocols on the share. If not specified, the default is SMB.\n */\n protocols?: ShareProtocols;\n /**\n * Root squash to set on the share. Only valid for NFS shares. Possible values include:\n * 'NoRootSquash', 'RootSquash', 'AllSquash'.\n */\n rootSquash?: ShareRootSquash;\n\n /**\n * Specifies whether the snapshot virtual directory should be accessible at the root of share mount point when NFS is enabled.\n * If not specified, the default is true.\n */\n enableSnapshotVirtualDirectoryAccess?: boolean;\n\n /**\n * Optional. Boolean. Default if not specified is false. This property enables paid bursting.\n */\n paidBurstingEnabled?: boolean;\n\n /**\n * Optional. Integer. Default if not specified is the maximum throughput the file share can support. Current maximum for a file share is 10,340 MiB/sec.\n */\n paidBurstingMaxBandwidthMibps?: number;\n\n /**\n * Optional. Integer. Default if not specified is the maximum IOPS the file share can support. Current maximum for a file share is 102,400 IOPS.\n */\n paidBurstingMaxIops?: number;\n}\n\n/**\n * Options to configure the {@link ShareClient.delete} operation.\n */\nexport interface ShareDeleteMethodOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Specifies the option\n * include to delete the base share and all of its snapshots. Possible values\n * include: 'include'\n */\n deleteSnapshots?: DeleteSnapshotsOptionType;\n /**\n * If specified, the operation only succeeds if the resource's lease is active and matches this ID.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n}\n\n/**\n * Options to configure the {@link ShareClient.setMetadata} operation.\n */\nexport interface ShareSetMetadataOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * If specified, the operation only succeeds if the resource's lease is active and matches this ID.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n}\n\n/**\n * Options to configure the {@link ShareClient.setAccessPolicy} operation.\n */\nexport interface ShareSetAccessPolicyOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * If specified, the operation only succeeds if the resource's lease is active and matches this ID.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n}\n\n/**\n * Options to configure the {@link ShareClient.getAccessPolicy} operation.\n */\nexport interface ShareGetAccessPolicyOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * If specified, the operation only succeeds if the resource's lease is active and matches this ID.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n}\n\n/**\n * Options to configure the {@link ShareClient.exists} operation.\n */\nexport interface ShareExistsOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * If specified, the operation only succeeds if the resource's lease is active and matches this ID.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n}\n\n/**\n * Options to configure the {@link ShareClient.getProperties} operation.\n */\nexport interface ShareGetPropertiesOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * If specified, the operation only succeeds if the resource's lease is active and matches this ID.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n}\n\n/**\n * Options to configure the {@link ShareClient.setQuota} operation.\n */\nexport interface ShareSetQuotaOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * If specified, the operation only succeeds if the resource's lease is active and matches this ID.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n}\n\n/**\n * Options to configure the {@link ShareClient.setProperties} operation.\n */\nexport interface ShareSetPropertiesOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n\n /**\n * Specifies the access tier of the share. Possible values include: 'TransactionOptimized',\n * 'Hot', 'Cool'.\n */\n accessTier?: ShareAccessTier;\n\n /**\n * Specifies the maximum size of the share, in gigabytes.\n */\n quotaInGB?: number;\n\n /**\n * Root squash to set on the share. Only valid for NFS shares. Possible values include:\n * 'NoRootSquash', 'RootSquash', 'AllSquash'.\n */\n rootSquash?: ShareRootSquash;\n /**\n * If specified, the operation only succeeds if the resource's lease is active and matches this ID.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n\n /**\n * Specifies whether the snapshot virtual directory should be accessible at the root of share mount point when NFS is enabled.\n * If not specified, the default is true.\n */\n enableSnapshotVirtualDirectoryAccess?: boolean;\n\n /**\n * Optional. Boolean. Default if not specified is false. This property enables paid bursting.\n */\n paidBurstingEnabled?: boolean;\n\n /**\n * Optional. Integer. Default if not specified is the maximum throughput the file share can support. Current maximum for a file share is 10,340 MiB/sec.\n */\n paidBurstingMaxBandwidthMibps?: number;\n\n /**\n * Optional. Integer. Default if not specified is the maximum IOPS the file share can support. Current maximum for a file share is 102,400 IOPS.\n */\n paidBurstingMaxIops?: number;\n}\n\n/**\n * Options to configure the {@link ShareClient.getStatistics} operation.\n */\nexport interface ShareGetStatisticsOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * If specified, the operation only succeeds if the resource's lease is active and matches this ID.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n}\n\n/**\n * Signed Identifier\n */\nexport interface SignedIdentifier {\n /**\n * a unique id\n */\n id: string;\n /**\n * Access Policy\n */\n accessPolicy: {\n /**\n * the date-time the policy is active.\n */\n startsOn: Date;\n /**\n * the date-time the policy expires.\n */\n expiresOn: Date;\n /**\n * the permissions for the acl policy\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-share-acl\n */\n permissions: string;\n };\n}\n\nexport declare type ShareGetAccessPolicyResponse = WithResponse<\n {\n signedIdentifiers: SignedIdentifier[];\n } & ShareGetAccessPolicyHeaders,\n ShareGetAccessPolicyHeaders,\n SignedIdentifierModel[]\n>;\n\n/**\n * Options to configure the {@link ShareClient.createSnapshot} operation.\n */\nexport interface ShareCreateSnapshotOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * A name-value pair to associate with a file storage object.\n */\n metadata?: { [propertyName: string]: string };\n}\n\n/**\n * Options to configure the {@link ShareClient.createPermission} operation.\n */\nexport interface ShareCreatePermissionOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n/**\n * Options to configure the {@link ShareClient.getPermission} operation.\n */\nexport interface ShareGetPermissionOptions extends CommonOptions {\n /**\n * Optional. Available for version 2023-06-01 and later. Specifies the format in which the permission is returned.\n * Acceptable values are SDDL or binary. If x-ms-file-permission-format is unspecified or explicitly set to SDDL, the permission is returned in SDDL format.\n * If x-ms-file-permission-format is explicitly set to binary, the permission is returned as a base64 string representing the binary encoding of the permission\n */\n filePermissionFormat?: FilePermissionFormat;\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Response data for the {@link ShareClient.getStatistics} Operation.\n */\nexport type ShareGetStatisticsResponse = ShareGetStatisticsResponseModel & {\n /**\n * @deprecated shareUsage is going to be deprecated. Please use ShareUsageBytes instead.\n *\n * The approximate size of the data stored on the share, rounded up to the nearest gigabyte. Note\n * that this value may not include all recently created or recently resized files.\n */\n shareUsage: number;\n};\n\n/**\n * Contains response data for the {@link ShareClient.createIfNotExists} operation.\n */\nexport interface ShareCreateIfNotExistsResponse extends ShareCreateResponse {\n /**\n * Indicate whether the share is successfully created. Is false when the share is not changed as it already exists.\n */\n succeeded: boolean;\n}\n\n/**\n * Contains response data for the {@link ShareClient.deleteIfExists} operation.\n */\nexport interface ShareDeleteIfExistsResponse extends ShareDeleteResponse {\n /**\n * Indicate whether the share is successfully deleted. Is false if the share does not exist in the first place.\n */\n succeeded: boolean;\n}\n\n/**\n * Contains response data for the {@link ShareClient.getProperties} operation.\n */\nexport type ShareGetPropertiesResponse = ShareGetPropertiesResponseModel & {\n /**\n * The protocols that have been enabled on the share.\n */\n protocols?: ShareProtocols;\n};\n\n/**\n * Common options of the {@link ShareGenerateSasUrlOptions} and {@link FileGenerateSasUrlOptions}.\n */\nexport interface CommonGenerateSasUrlOptions {\n /**\n * The version of the service this SAS will target. If not specified, it will default to the version targeted by the\n * library.\n */\n version?: string;\n\n /**\n * Optional. SAS protocols, HTTPS only or HTTPSandHTTP\n */\n protocol?: SASProtocol;\n\n /**\n * Optional. When the SAS will take effect.\n */\n startsOn?: Date;\n\n /**\n * Optional only when identifier is provided. The time after which the SAS will no longer work.\n */\n expiresOn?: Date;\n\n /**\n * Optional. IP ranges allowed in this SAS.\n */\n ipRange?: SasIPRange;\n\n /**\n * Optional. The name of the access policy on the share this SAS references if any.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/establishing-a-stored-access-policy\n */\n identifier?: string;\n\n /**\n * Optional. The cache-control header for the SAS.\n */\n cacheControl?: string;\n\n /**\n * Optional. The content-disposition header for the SAS.\n */\n contentDisposition?: string;\n\n /**\n * Optional. The content-encoding header for the SAS.\n */\n contentEncoding?: string;\n\n /**\n * Optional. The content-language header for the SAS.\n */\n contentLanguage?: string;\n\n /**\n * Optional. The content-type header for the SAS.\n */\n contentType?: string;\n}\n\n/**\n * Options to configure {@link ShareClient.generateSasUrl} operation.\n */\nexport interface ShareGenerateSasUrlOptions extends CommonGenerateSasUrlOptions {\n /**\n * Optional only when identifier is provided. Specifies the list of permissions to be associated with the SAS.\n */\n permissions?: ShareSASPermissions;\n}\n\n/**\n * A ShareClient represents a URL to the Azure Storage share allowing you to manipulate its directories and files.\n */\nexport class ShareClient extends StorageClient {\n /**\n * Share operation context provided by protocol layer.\n */\n private context: Share;\n\n private _name: string;\n\n private shareClientConfig?: ShareClientConfig;\n\n /**\n * The name of the share\n */\n public get name(): string {\n return this._name;\n }\n\n /**\n * @param connectionString - Account connection string or a SAS connection string of an Azure storage account.\n * [ Note - Account connection string can only be used in NODE.JS runtime. ]\n * Account connection string example -\n * `DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net`\n * SAS connection string example -\n * `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`\n * @param name - Share name.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n constructor(connectionString: string, name: string, options?: ShareClientOptions);\n /**\n * Creates an instance of ShareClient.\n *\n * @param url - A URL string pointing to Azure Storage file share, such as\n * \"https://myaccount.file.core.windows.net/share\". You can\n * append a SAS if using AnonymousCredential, such as\n * \"https://myaccount.file.core.windows.net/share?sasString\".\n * @param credential - Such as AnonymousCredential or StorageSharedKeyCredential.\n * If not specified, AnonymousCredential is used.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n constructor(\n url: string,\n credential?: Credential | TokenCredential,\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n options?: ShareClientOptions,\n );\n /**\n * Creates an instance of ShareClient.\n *\n * @param url - A URL string pointing to Azure Storage file share, such as\n * \"https://myaccount.file.core.windows.net/share\". You can\n * append a SAS if using AnonymousCredential, such as\n * \"https://myaccount.file.core.windows.net/share?sasString\".\n * @param pipeline - Call newPipeline() to create a default\n * pipeline, or provide a customized pipeline.\n */\n constructor(url: string, pipeline: Pipeline, options?: ShareClientConfig);\n constructor(\n urlOrConnectionString: string,\n credentialOrPipelineOrShareName?: Credential | TokenCredential | PipelineLike | string,\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n options?: ShareClientOptions,\n ) {\n let pipeline: Pipeline;\n let url: string;\n if (isPipelineLike(credentialOrPipelineOrShareName)) {\n // (url: string, pipeline: Pipeline)\n url = urlOrConnectionString;\n pipeline = credentialOrPipelineOrShareName;\n } else if (\n credentialOrPipelineOrShareName instanceof Credential ||\n isTokenCredential(credentialOrPipelineOrShareName)\n ) {\n // (url: string, credential?: Credential, options?: ShareClientOptions)\n url = urlOrConnectionString;\n pipeline = newPipeline(credentialOrPipelineOrShareName, options);\n } else if (\n !credentialOrPipelineOrShareName &&\n typeof credentialOrPipelineOrShareName !== \"string\"\n ) {\n // (url: string, credential?: Credential, options?: ShareClientOptions)\n // The second parameter is undefined. Use anonymous credential.\n url = urlOrConnectionString;\n pipeline = newPipeline(new AnonymousCredential(), options);\n } else if (\n credentialOrPipelineOrShareName &&\n typeof credentialOrPipelineOrShareName === \"string\"\n ) {\n // (connectionString: string, name: string, options?: ShareClientOptions)\n const extractedCreds = extractConnectionStringParts(urlOrConnectionString);\n const name = credentialOrPipelineOrShareName;\n if (extractedCreds.kind === \"AccountConnString\") {\n if (isNode) {\n const sharedKeyCredential = new StorageSharedKeyCredential(\n extractedCreds.accountName!,\n extractedCreds.accountKey,\n );\n url = appendToURLPath(extractedCreds.url, name);\n pipeline = newPipeline(sharedKeyCredential, options);\n } else {\n throw new Error(\"Account connection string is only supported in Node.js environment\");\n }\n } else if (extractedCreds.kind === \"SASConnString\") {\n url = appendToURLPath(extractedCreds.url, name) + \"?\" + extractedCreds.accountSas;\n pipeline = newPipeline(new AnonymousCredential(), options);\n } else {\n throw new Error(\n \"Connection string must be either an Account connection string or a SAS connection string\",\n );\n }\n } else {\n throw new Error(\"Expecting non-empty strings for name parameter\");\n }\n super(url, pipeline);\n this._name = getShareNameAndPathFromUrl(this.url).shareName;\n this.shareClientConfig = options;\n this.context = this.storageClientContext.share;\n }\n\n /**\n * Creates a new ShareClient object identical to the source but with the specified snapshot timestamp.\n * Provide \"\" will remove the snapshot and return a URL to the base share.\n *\n * @param snapshot - The snapshot timestamp.\n * @returns A new ShareClient object identical to the source but with the specified snapshot timestamp\n */\n public withSnapshot(snapshot: string): ShareClient {\n return new ShareClient(\n setURLParameter(\n this.url,\n URLConstants.Parameters.SHARE_SNAPSHOT,\n snapshot.length === 0 ? undefined : snapshot,\n ),\n this.pipeline,\n this.shareClientConfig,\n );\n }\n\n /**\n * Creates a new share under the specified account. If the share with\n * the same name already exists, the operation fails.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-share\n *\n * @param options - Options to Share Create operation.\n * @returns Response data for the Share Create operation.\n */\n public async create(options: ShareCreateOptions = {}): Promise<ShareCreateResponse> {\n return tracingClient.withSpan(\"ShareClient-create\", options, async (updatedOptions) => {\n return assertResponse<ShareCreateHeaders, ShareCreateHeaders>(\n await this.context.create({\n ...updatedOptions,\n ...this.shareClientConfig,\n enabledProtocols: toShareProtocolsString(updatedOptions.protocols),\n }),\n );\n });\n }\n\n /**\n * Creates a new share under the specified account. If the share with\n * the same name already exists, it is not changed.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-share\n *\n * @param options -\n */\n public async createIfNotExists(\n options: ShareCreateOptions = {},\n ): Promise<ShareCreateIfNotExistsResponse> {\n return tracingClient.withSpan(\n \"ShareClient-createIfNotExists\",\n options,\n async (updatedOptions) => {\n try {\n const res = await this.create(updatedOptions);\n return {\n succeeded: true,\n ...res,\n };\n } catch (e: any) {\n if (e.details?.errorCode === \"ShareAlreadyExists\") {\n return {\n succeeded: false,\n ...e.response?.parsedHeaders,\n _response: e.response,\n };\n }\n throw e;\n }\n },\n );\n }\n\n /**\n * Creates a {@link ShareDirectoryClient} object.\n *\n * @param directoryName - A directory name\n * @returns The ShareDirectoryClient object for the given directory name.\n */\n\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-subclients */\n public getDirectoryClient(directoryName: string): ShareDirectoryClient {\n return new ShareDirectoryClient(\n appendToURLPath(this.url, EscapePath(directoryName)),\n this.pipeline,\n this.shareClientConfig,\n );\n }\n\n /**\n * Gets the directory client for the root directory of this share.\n * Note that the root directory always exists and cannot be deleted.\n *\n * @readonly A new ShareDirectoryClient object for the root directory.\n */\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-subclients */\n public get rootDirectoryClient(): ShareDirectoryClient {\n return this.getDirectoryClient(\"\");\n }\n\n /**\n * Creates a new subdirectory under this share.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-directory\n *\n * @param directoryName -\n * @param options - Options to Directory Create operation.\n * @returns Directory creation response data and the corresponding directory client.\n */\n public async createDirectory(\n directoryName: string,\n options: DirectoryCreateOptions = {},\n ): Promise<{\n directoryClient: ShareDirectoryClient;\n directoryCreateResponse: DirectoryCreateResponse;\n }> {\n return tracingClient.withSpan(\n \"ShareClient-createDirectory\",\n options,\n async (updatedOptions) => {\n const directoryClient = this.getDirectoryClient(directoryName);\n const directoryCreateResponse = await directoryClient.create(updatedOptions);\n return {\n directoryClient,\n directoryCreateResponse,\n };\n },\n );\n }\n\n /**\n * Removes the specified empty sub directory under this share.\n * Note that the directory must be empty before it can be deleted.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-directory\n *\n * @param directoryName -\n * @param options - Options to Directory Delete operation.\n * @returns Directory deletion response data.\n */\n public async deleteDirectory(\n directoryName: string,\n options: DirectoryDeleteOptions = {},\n ): Promise<DirectoryDeleteResponse> {\n return tracingClient.withSpan(\n \"ShareClient-deleteDirectory\",\n options,\n async (updatedOptions) => {\n const directoryClient = this.getDirectoryClient(directoryName);\n return directoryClient.delete(updatedOptions);\n },\n );\n }\n\n /**\n * Creates a new file or replaces a file under the root directory of this share.\n * Note it only initializes the file with no content.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-file\n *\n * @param fileName -\n * @param size - Specifies the maximum size in bytes for the file, up to 4 TB.\n * @param options - Options to File Create operation.\n * @returns File creation response data and the corresponding file client.\n */\n public async createFile(\n fileName: string,\n size: number,\n options: FileCreateOptions = {},\n ): Promise<{ fileClient: ShareFileClient; fileCreateResponse: FileCreateResponse }> {\n return tracingClient.withSpan(\"ShareClient-createFile\", options, async (updatedOptions) => {\n const directoryClient = this.rootDirectoryClient;\n const fileClient = directoryClient.getFileClient(fileName);\n const fileCreateResponse = await fileClient.create(size, updatedOptions);\n return {\n fileClient,\n fileCreateResponse,\n };\n });\n }\n\n /**\n * Removes a file under the root directory of this share from the storage account.\n * When a file is successfully deleted, it is immediately removed from the storage\n * account's index and is no longer accessible to clients. The file's data is later\n * removed from the service during garbage collection.\n *\n * Delete File will fail with status code 409 (Conflict) and error code `SharingViolation`\n * if the file is open on an SMB client.\n *\n * Delete File is not supported on a share snapshot, which is a read-only copy of\n * a share. An attempt to perform this operation on a share snapshot will fail with 400\n * (`InvalidQueryParameterValue`)\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-file2\n *\n * @param directoryName -\n * @param fileName -\n * @param options - Options to File Delete operation.\n * @returns Promise<FileDeleteResponse> File Delete response data.\n */\n public async deleteFile(\n fileName: string,\n options: FileDeleteOptions = {},\n ): Promise<FileDeleteResponse> {\n return tracingClient.withSpan(\"ShareClient-deleteFile\", options, async (updatedOptions) => {\n const directoryClient = this.rootDirectoryClient;\n const fileClient = directoryClient.getFileClient(fileName);\n return fileClient.delete(updatedOptions);\n });\n }\n\n /**\n * Returns true if the Azrue share resource represented by this client exists; false otherwise.\n *\n * NOTE: use this function with care since an existing share might be deleted by other clients or\n * applications. Vice versa new shares might be added by other clients or applications after this\n * function completes.\n *\n * @param options - options to Exists operation.\n */\n public async exists(options: ShareExistsOptions = {}): Promise<boolean> {\n return tracingClient.withSpan(\"ShareClient-exists\", options, async (updatedOptions) => {\n try {\n await this.getProperties(updatedOptions);\n return true;\n } catch (e: any) {\n if (e.statusCode === 404) {\n return false;\n }\n throw e;\n }\n });\n }\n\n /**\n * Returns all user-defined metadata and system properties for the specified\n * share.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-share-properties\n *\n * WARNING: The `metadata` object returned in the response will have its keys in lowercase, even if\n * they originally contained uppercase characters. This differs from the metadata keys returned by\n * the `listShares` method of {@link ShareServiceClient} using the `includeMetadata` option, which\n * will retain their original casing.\n *\n * @returns Response data for the Share Get Properties operation.\n */\n public async getProperties(\n options: ShareGetPropertiesOptions = {},\n ): Promise<ShareGetPropertiesResponse> {\n return tracingClient.withSpan(\"ShareClient-getProperties\", options, async (updatedOptions) => {\n const res = assertResponse<ShareGetPropertiesHeaders, ShareGetPropertiesHeaders>(\n await this.context.getProperties(updatedOptions),\n );\n return {\n ...res,\n ...this.shareClientConfig,\n protocols: toShareProtocols(res.enabledProtocols),\n };\n });\n }\n\n /**\n * Marks the specified share for deletion. The share and any directories or files\n * contained within it are later deleted during garbage collection.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-share\n *\n * @param options - Options to Share Delete operation.\n * @returns Response data for the Share Delete operation.\n */\n public async delete(options: ShareDeleteMethodOptions = {}): Promise<ShareDeleteResponse> {\n return tracingClient.withSpan(\"ShareClient-delete\", options, async (updatedOptions) => {\n return assertResponse<ShareDeleteHeaders, ShareDeleteHeaders>(\n await this.context.delete({\n ...updatedOptions,\n ...this.shareClientConfig,\n }),\n );\n });\n }\n\n /**\n * Marks the specified share for deletion if it exists. The share and any directories or files\n * contained within it are later deleted during garbage collection.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-share\n *\n * @param options -\n */\n public async deleteIfExists(\n options: ShareDeleteMethodOptions = {},\n ): Promise<ShareDeleteIfExistsResponse> {\n return tracingClient.withSpan(\"ShareClient-deleteIfExists\", options, async (updatedOptions) => {\n try {\n const res = await this.delete(updatedOptions);\n return {\n succeeded: true,\n ...res,\n };\n } catch (e: any) {\n if (e.details?.errorCode === \"ShareNotFound\") {\n return {\n succeeded: false,\n ...e.response?.parsedHeaders,\n _response: e.response,\n };\n }\n throw e;\n }\n });\n }\n\n /**\n * Sets one or more user-defined name-value pairs for the specified share.\n *\n * If no option provided, or no metadata defined in the option parameter, the share\n * metadata will be removed.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-share-metadata\n *\n * @param metadata - If no metadata provided, all existing directory metadata will be removed.\n * @param option - Options to Share Set Metadata operation.\n * @returns Response data for the Share Set Metadata operation.\n */\n public async setMetadata(\n metadata?: Metadata,\n options: ShareSetMetadataOptions = {},\n ): Promise<ShareSetMetadataResponse> {\n return tracingClient.withSpan(\"ShareClient-setMetadata\", options, async (updatedOptions) => {\n return assertResponse<ShareSetMetadataHeaders, ShareSetMetadataHeaders>(\n await this.context.setMetadata({\n ...updatedOptions,\n ...this.shareClientConfig,\n metadata,\n }),\n );\n });\n }\n\n /**\n * Gets the permissions for the specified share. The permissions indicate\n * whether share data may be accessed publicly.\n *\n * WARNING: JavaScript Date will potential lost precision when parsing start and expiry string.\n * For example, new Date(\"2018-12-31T03:44:23.8827891Z\").toISOString() will get \"2018-12-31T03:44:23.882Z\".\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-share-acl\n *\n * @param option - Options to Share Get Access Policy operation.\n * @returns Response data for the Share Get Access Policy operation.\n */\n public async getAccessPolicy(\n options: ShareGetAccessPolicyOptions = {},\n ): Promise<ShareGetAccessPolicyResponse> {\n return tracingClient.withSpan(\n \"ShareClient-getAccessPolicy\",\n options,\n async (updatedOptions) => {\n const response = assertResponse<\n ShareGetAccessPolicyHeaders & SignedIdentifierModel[],\n ShareGetAccessPolicyHeaders,\n SignedIdentifierModel[]\n >(\n await this.context.getAccessPolicy({\n ...updatedOptions,\n ...this.shareClientConfig,\n }),\n );\n\n const res: ShareGetAccessPolicyResponse = {\n _response: response._response,\n date: response.date,\n etag: response.etag,\n lastModified: response.lastModified,\n requestId: response.requestId,\n signedIdentifiers: [],\n version: response.version,\n };\n\n for (const identifier of response) {\n let accessPolicy: any = undefined;\n if (identifier.accessPolicy) {\n accessPolicy = {\n permissions: identifier.accessPolicy.permissions,\n };\n\n if (identifier.accessPolicy.expiresOn) {\n accessPolicy.expiresOn = new Date(identifier.accessPolicy.expiresOn);\n }\n\n if (identifier.accessPolicy.startsOn) {\n accessPolicy.startsOn = new Date(identifier.accessPolicy.startsOn);\n }\n }\n\n res.signedIdentifiers.push({\n accessPolicy,\n id: identifier.id,\n });\n }\n\n return res;\n },\n );\n }\n\n /**\n * Sets the permissions for the specified share. The permissions indicate\n * whether directories or files in a share may be accessed publicly.\n *\n * When you set permissions for a share, the existing permissions are replaced.\n * If no shareAcl provided, the existing share ACL will be\n * removed.\n *\n * When you establish a stored access policy on a share, it may take up to 30 seconds to take effect.\n * During this interval, a shared access signature that is associated with the stored access policy will\n * fail with status code 403 (Forbidden), until the access policy becomes active.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-share-acl\n *\n * @param shareAcl - Array of signed identifiers, each having a unique Id and details of access policy.\n * @param option - Options to Share Set Access Policy operation.\n * @returns Response data for the Share Set Access Policy operation.\n */\n public async setAccessPolicy(\n shareAcl?: SignedIdentifier[],\n options: ShareSetAccessPolicyOptions = {},\n ): Promise<ShareSetAccessPolicyResponse> {\n return tracingClient.withSpan(\n \"ShareClient-setAccessPolicy\",\n options,\n async (updatedOptions) => {\n const acl: SignedIdentifierModel[] = [];\n for (const identifier of shareAcl || []) {\n acl.push({\n accessPolicy: {\n expiresOn: identifier.accessPolicy?.expiresOn\n ? truncatedISO8061Date(identifier.accessPolicy.expiresOn)\n : undefined,\n permissions: identifier.accessPolicy?.permissions,\n startsOn: identifier.accessPolicy?.startsOn\n ? truncatedISO8061Date(identifier.accessPolicy.startsOn)\n : undefined,\n },\n id: identifier.id,\n });\n }\n\n return assertResponse<ShareSetAccessPolicyHeaders, ShareSetAccessPolicyHeaders>(\n await this.context.setAccessPolicy({\n ...updatedOptions,\n ...this.shareClientConfig,\n shareAcl: acl,\n }),\n );\n },\n );\n }\n\n /**\n * Creates a read-only snapshot of a share.\n *\n * @param options - Options to Share Create Snapshot operation.\n * @returns Response data for the Share Create Snapshot operation.\n */\n public async createSnapshot(\n options: ShareCreateSnapshotOptions = {},\n ): Promise<ShareCreateSnapshotResponse> {\n return tracingClient.withSpan(\"ShareClient-createSnapshot\", options, async (updatedOptions) => {\n return assertResponse<ShareCreateSnapshotHeaders, ShareCreateSnapshotHeaders>(\n await this.context.createSnapshot({\n ...updatedOptions,\n ...this.shareClientConfig,\n }),\n );\n });\n }\n\n /**\n * Sets quota for the specified share.\n *\n * @deprecated Use {@link ShareClient.setProperties} instead.\n *\n * @param quotaInGB - Specifies the maximum size of the share in gigabytes\n * @param option - Options to Share Set Quota operation.\n * @returns Response data for the Share Get Quota operation.\n */\n public async setQuota(\n quotaInGB: number,\n options: ShareSetQuotaOptions = {},\n ): Promise<ShareSetQuotaResponse> {\n return tracingClient.withSpan(\"ShareClient-setQuota\", options, async (updatedOptions) => {\n return assertResponse<ShareSetPropertiesHeaders, ShareSetPropertiesHeaders>(\n await this.context.setProperties({\n ...updatedOptions,\n ...this.shareClientConfig,\n quota: quotaInGB,\n }),\n );\n });\n }\n\n /**\n * Sets properties of the share.\n *\n * @param option - Options to Share Set Properties operation.\n * @returns Response data for the Share Set Properties operation.\n */\n public async setProperties(\n options: ShareSetPropertiesOptions = {},\n ): Promise<ShareSetPropertiesResponse> {\n return tracingClient.withSpan(\"ShareClient-setProperties\", options, async (updatedOptions) => {\n return assertResponse<ShareSetPropertiesHeaders, ShareSetPropertiesHeaders>(\n await this.context.setProperties({\n ...options,\n ...this.shareClientConfig,\n quota: options.quotaInGB,\n tracingOptions: updatedOptions.tracingOptions,\n }),\n );\n });\n }\n\n /**\n * Retrieves statistics related to the share.\n *\n * @param option - Options to Share Get Statistics operation.\n * @returns Response data for the Share Get Statistics operation.\n */\n public async getStatistics(\n options: ShareGetStatisticsOptions = {},\n ): Promise<ShareGetStatisticsResponse> {\n return tracingClient.withSpan(\"ShareClient-getStatistics\", options, async (updatedOptions) => {\n const response = assertResponse<\n ShareGetStatisticsHeaders & ShareStats,\n ShareGetStatisticsHeaders,\n ShareStats\n >(\n await this.context.getStatistics({\n ...updatedOptions,\n ...this.shareClientConfig,\n }),\n );\n\n const GBBytes = 1024 * 1024 * 1024;\n return { ...response, shareUsage: Math.ceil(response.shareUsageBytes / GBBytes) };\n });\n }\n\n /**\n * Creates a file permission (a security descriptor) at the share level.\n * The created security descriptor can be used for the files/directories in the share.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-permission\n *\n * @param options - Options to Share Create Permission operation.\n * @param filePermission - File permission described in the SDDL\n */\n public async createPermission(\n filePermission: string | SharePermission,\n options: ShareCreatePermissionOptions = {},\n ): Promise<ShareCreatePermissionResponse> {\n return tracingClient.withSpan(\n \"ShareClient-createPermission\",\n options,\n async (updatedOptions) => {\n return assertResponse<ShareCreatePermissionHeaders, ShareCreatePermissionHeaders>(\n await this.context.createPermission(asSharePermission(filePermission), {\n ...updatedOptions,\n ...this.shareClientConfig,\n }),\n );\n },\n );\n }\n\n /**\n * Gets the Security Descriptor Definition Language (SDDL) for a given file permission key\n * which indicates a security descriptor.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-permission\n *\n * @param options - Options to Share Create Permission operation.\n * @param filePermissionKey - File permission key which indicates the security descriptor of the permission.\n */\n public async getPermission(\n filePermissionKey: string,\n options: ShareGetPermissionOptions = {},\n ): Promise<ShareGetPermissionResponse> {\n return tracingClient.withSpan(\"ShareClient-getPermission\", options, async (updatedOptions) => {\n return assertResponse<\n ShareGetPermissionHeaders & SharePermission,\n ShareGetPermissionHeaders,\n SharePermission\n >(\n await this.context.getPermission(filePermissionKey, {\n ...updatedOptions,\n ...this.shareClientConfig,\n }),\n );\n });\n }\n\n /**\n * Get a {@link ShareLeaseClient} that manages leases on the file.\n *\n * @param proposeLeaseId - Initial proposed lease Id.\n * @returns A new ShareLeaseClient object for managing leases on the file.\n */\n public getShareLeaseClient(proposeLeaseId?: string): ShareLeaseClient {\n return new ShareLeaseClient(this, proposeLeaseId);\n }\n\n /**\n * Only available for ShareClient constructed with a shared key credential.\n *\n * Generates a Service Shared Access Signature (SAS) URI based on the client properties\n * and parameters passed in. The SAS is signed by the shared key credential of the client.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas\n *\n * @param options - Optional parameters.\n * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.\n */\n public generateSasUrl(options: ShareGenerateSasUrlOptions): string {\n if (!(this.credential instanceof StorageSharedKeyCredential)) {\n throw RangeError(\n \"Can only generate the SAS when the client is initialized with a shared key credential\",\n );\n }\n\n const sas = generateFileSASQueryParameters(\n {\n shareName: this.name,\n ...options,\n },\n this.credential,\n ).toString();\n\n return appendToURLQuery(this.url, sas);\n }\n\n /**\n * Only available for ShareClient constructed with a shared key credential.\n *\n * Generates string to sign for a Service Shared Access Signature (SAS) URI based on the client properties\n * and parameters passed in. The SAS is signed by the shared key credential of the client.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas\n *\n * @param options - Optional parameters.\n * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.\n */\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n public generateSasStringToSign(options: ShareGenerateSasUrlOptions): string {\n if (!(this.credential instanceof StorageSharedKeyCredential)) {\n throw RangeError(\n \"Can only generate the SAS when the client is initialized with a shared key credential\",\n );\n }\n\n return generateFileSASQueryParametersInternal(\n {\n shareName: this.name,\n ...options,\n },\n this.credential,\n ).stringToSign;\n }\n}\n\n/**\n * Options to configure {@link ShareDirectoryClient.create} operation.\n */\nexport interface DirectoryCreateOptions extends FileAndDirectoryCreateCommonOptions, CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * A collection of key-value string pair to associate with the file storage object.\n */\n metadata?: Metadata;\n}\n\nexport interface DirectoryProperties\n extends FileAndDirectorySetPropertiesCommonOptions,\n CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Options to configure Directory - List Files and Directories Segment operations.\n *\n * See:\n * - {@link ShareDirectoryClient.iterateFilesAndDirectoriesSegments}\n * - {@link ShareDirectoryClient.listFilesAndDirectoriesItems}\n * - {@link ShareDirectoryClient.listFilesAndDirectoriesSegment}\n */\ninterface DirectoryListFilesAndDirectoriesSegmentOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Filters the results to return only entries whose\n * name begins with the specified prefix.\n */\n prefix?: string;\n\n /**\n * Specifies the maximum number of entries to\n * return. If the request does not specify maxResults, or specifies a value\n * greater than 5,000, the server will return up to 5,000 items.\n */\n maxResults?: number;\n /** Include this parameter to specify one or more datasets to include in the response. */\n include?: ListFilesIncludeType[];\n /**\n * Optional. Specified that extended info should be included in the returned {@link FileItem} or {@link DirectoryItem}.\n * If true, the Content-Length property will be up-to-date, FileId will be returned in response.\n */\n includeExtendedInfo?: boolean;\n}\n\n/**\n * Options to configure {@link ShareDirectoryClient.listFilesAndDirectories} operation.\n */\nexport interface DirectoryListFilesAndDirectoriesOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Filters the results to return only entries whose\n * name begins with the specified prefix.\n */\n prefix?: string;\n /*\n * Optional. Specified that time stamps should be included in the response.\n */\n includeTimestamps?: boolean;\n /*\n * Optional. Specified that ETag should be included in the response.\n */\n includeEtag?: boolean;\n /*\n * Optional. Specified that file attributes should be included in the response.\n */\n includeAttributes?: boolean;\n /*\n * Optional. Specified that permission key should be included in the response.\n */\n includePermissionKey?: boolean;\n /**\n * Optional. Specified that extended info should be included in the returned {@link FileItem} or {@link DirectoryItem}.\n * If true, the Content-Length property will be up-to-date, FileId will be returned in response.\n */\n includeExtendedInfo?: boolean;\n}\n\n/**\n * Options to configure the {@link ShareDirectoryClient.delete} operation.\n */\nexport interface DirectoryDeleteOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Options to configure the {@link ShareDirectoryClient.exists} operation.\n */\nexport interface DirectoryExistsOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Options to configure the {@link ShareDirectoryClient.getProperties} operation.\n */\nexport interface DirectoryGetPropertiesOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Options to configure the {@link ShareDirectoryClient.setMetadata} operation.\n */\nexport interface DirectorySetMetadataOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Options to configure Directory - List Handles Segment operations.\n *\n * See:\n * - {@link ShareDirectoryClient.listHandlesSegment}\n * - {@link ShareDirectoryClient.iterateHandleSegments}\n * - {@link ShareDirectoryClient.listHandleItems}\n *\n */\nexport interface DirectoryListHandlesSegmentOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Specifies the maximum number of entries to return. If the request does not specify maxResults,\n * or specifies a value greater than 5,000, the server will return up to 5,000 items.\n */\n maxResults?: number;\n /**\n * Specifies operation should apply to the directory specified in the URI, its files, its\n * subdirectories and their files.\n */\n recursive?: boolean;\n}\n\n/**\n * Options to configure the {@link ShareDirectoryClient.listHandles} operation.\n */\nexport interface DirectoryListHandlesOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Specifies whether operation should apply to the directory specified in the URI, its files, its\n * subdirectories and their files.\n */\n recursive?: boolean;\n}\n\n/**\n * Options to configure Directory - Force Close Handles Segment operations.\n *\n * See:\n * - {@link ShareDirectoryClient.forceCloseHandlesSegment}\n * - {@link ShareDirectoryClient.forceCloseAllHandles}\n */\nexport interface DirectoryForceCloseHandlesSegmentOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Specifies operation should apply to the directory specified in the URI, its files, its\n * subdirectories and their files.\n */\n recursive?: boolean;\n}\n\n/**\n * Additional response header values for close handles request.\n */\nexport interface DirectoryCloseHandlesHeaders {\n /**\n * This header uniquely identifies the request that was made and can be used for troubleshooting\n * the request.\n */\n requestId?: string;\n /**\n * Indicates the version of the File service used to execute the request.\n */\n version?: string;\n /**\n * A UTC date/time value generated by the service that indicates the time at which the response\n * was initiated.\n */\n date?: Date;\n /**\n * A string describing next handle to be closed. It is returned when more handles need to be\n * closed to complete the request.\n */\n marker?: string;\n}\n\n/**\n * Response type for {@link ShareDirectoryClient.forceCloseHandle}.\n */\nexport type DirectoryForceCloseHandlesResponse = WithResponse<\n CloseHandlesInfo & DirectoryCloseHandlesHeaders,\n DirectoryForceCloseHandlesHeaders\n>;\n\n/**\n * Options to configure {@link ShareDirectoryClient.forceCloseHandle}.\n */\nexport interface DirectoryForceCloseHandlesOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Contains response data for the {@link DirectoryClient.createIfNotExists} operation.\n */\nexport interface DirectoryCreateIfNotExistsResponse extends DirectoryCreateResponse {\n /**\n * Indicate whether the directory is successfully created. Is false when the directory is not changed as it already exists.\n */\n succeeded: boolean;\n}\n\n/**\n * Contains response data for the {@link DirectoryClient.deleteIfExists} operation.\n */\nexport interface DirectoryDeleteIfExistsResponse extends DirectoryDeleteResponse {\n /**\n * Indicate whether the directory is successfully deleted. Is false if the directory does not exist in the first place.\n */\n succeeded: boolean;\n}\n\n/**\n * A ShareDirectoryClient represents a URL to the Azure Storage directory allowing you to manipulate its files and directories.\n */\nexport class ShareDirectoryClient extends StorageClient {\n /**\n * context provided by protocol layer.\n */\n private context: Directory;\n\n private _shareName: string;\n private _path: string;\n private _name: string;\n\n private shareClientConfig?: ShareClientConfig;\n\n /**\n * The share name corresponding to this directory client\n */\n public get shareName(): string {\n return this._shareName;\n }\n\n /**\n * The full path of the directory\n */\n public get path(): string {\n return this._path;\n }\n\n /**\n * The name of the directory\n */\n public get name(): string {\n return this._name;\n }\n\n /**\n * Creates an instance of DirectoryClient.\n *\n * @param url - A URL string pointing to Azure Storage file directory, such as\n * \"https://myaccount.file.core.windows.net/myshare/mydirectory\". You can\n * append a SAS if using AnonymousCredential, such as\n * \"https://myaccount.file.core.windows.net/myshare/mydirectory?sasString\".\n * This method accepts an encoded URL or non-encoded URL pointing to a directory.\n * Encoded URL string will NOT be escaped twice, only special characters in URL path will be escaped.\n * However, if a directory name includes %, directory name must be encoded in the URL.\n * Such as a directory named \"mydir%\", the URL should be \"https://myaccount.file.core.windows.net/myshare/mydir%25\".\n * @param credential - Such as AnonymousCredential or StorageSharedKeyCredential.\n * If not specified, AnonymousCredential is used.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n constructor(\n url: string,\n credential?: Credential | TokenCredential,\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n options?: ShareClientOptions,\n );\n /**\n * Creates an instance of DirectoryClient.\n *\n * @param url - A URL string pointing to Azure Storage file directory, such as\n * \"https://myaccount.file.core.windows.net/myshare/mydirectory\". You can\n * append a SAS if using AnonymousCredential, such as\n * \"https://myaccount.file.core.windows.net/myshare/mydirectory?sasString\".\n * This method accepts an encoded URL or non-encoded URL pointing to a directory.\n * Encoded URL string will NOT be escaped twice, only special characters in URL path will be escaped.\n * However, if a directory name includes %, directory name must be encoded in the URL.\n * Such as a directory named \"mydir%\", the URL should be \"https://myaccount.file.core.windows.net/myshare/mydir%25\".\n * @param pipeline - Call newPipeline() to create a default\n * pipeline, or provide a customized pipeline.\n */\n constructor(url: string, pipeline: Pipeline, options?: ShareClientConfig);\n constructor(\n url: string,\n credentialOrPipeline?: Credential | TokenCredential | Pipeline,\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n options: ShareClientOptions = {},\n ) {\n let pipeline: Pipeline;\n if (isPipelineLike(credentialOrPipeline)) {\n pipeline = credentialOrPipeline;\n } else if (\n credentialOrPipeline instanceof Credential ||\n isTokenCredential(credentialOrPipeline)\n ) {\n pipeline = newPipeline(credentialOrPipeline, options);\n } else {\n // The second parameter is undefined. Use anonymous credential.\n pipeline = newPipeline(new AnonymousCredential(), options);\n }\n\n super(url, pipeline);\n ({\n baseName: this._name,\n shareName: this._shareName,\n path: this._path,\n } = getShareNameAndPathFromUrl(this.url));\n this.shareClientConfig = options;\n this.context = this.storageClientContext.directory;\n }\n\n /**\n * Creates a new directory under the specified share or parent directory.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-directory\n *\n * @param options - Options to Directory Create operation.\n * @returns Response data for the Directory operation.\n */\n public async create(options: DirectoryCreateOptions = {}): Promise<DirectoryCreateResponse> {\n if (!options.fileAttributes) {\n options = validateAndSetDefaultsForFileAndDirectoryCreateCommonOptions(options);\n // By default set it as a directory.\n const attributes: FileSystemAttributes = new FileSystemAttributes();\n attributes.directory = true;\n options.fileAttributes = attributes;\n }\n return tracingClient.withSpan(\n \"ShareDirectoryClient-create\",\n options,\n async (updatedOptions) => {\n return assertResponse<DirectoryCreateHeaders, DirectoryCreateHeaders>(\n await this.context.create(\n updatedOptions.fileAttributes\n ? fileAttributesToString(updatedOptions.fileAttributes!)\n : FileAttributesNone,\n {\n ...updatedOptions,\n fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime),\n fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime),\n fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime),\n ...this.shareClientConfig,\n },\n ),\n );\n },\n );\n }\n\n /**\n * Creates a new directory under the specified share or parent directory if it does not already exists.\n * If the directory already exists, it is not modified.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-directory\n *\n * @param options -\n */\n public async createIfNotExists(\n options: DirectoryCreateOptions = {},\n ): Promise<DirectoryCreateIfNotExistsResponse> {\n return tracingClient.withSpan(\n \"ShareDirectoryClient-createIfNotExists\",\n options,\n async (updatedOptions) => {\n try {\n const res = await this.create(updatedOptions);\n return {\n succeeded: true,\n ...res,\n };\n } catch (e: any) {\n if (e.details?.errorCode === \"ResourceAlreadyExists\") {\n return {\n succeeded: false,\n ...e.response?.parsedHeaders,\n _response: e.response,\n };\n }\n throw e;\n }\n },\n );\n }\n\n /**\n * Sets properties on the directory.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-directory-properties\n *\n * @param DirectoryProperties - Directory properties. If no values are provided,\n * existing values will be preserved.\n */\n public async setProperties(\n properties: DirectoryProperties = {},\n ): Promise<DirectorySetPropertiesResponse> {\n properties = validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions(properties);\n return tracingClient.withSpan(\n \"ShareDirectoryClient-setProperties\",\n properties,\n async (updatedOptions) => {\n return assertResponse<DirectorySetPropertiesHeaders, DirectorySetPropertiesHeaders>(\n await this.context.setProperties(\n updatedOptions.fileAttributes\n ? fileAttributesToString(updatedOptions.fileAttributes!)\n : FileAttributesPreserve,\n {\n ...updatedOptions,\n fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime),\n fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime),\n fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime),\n ...this.shareClientConfig,\n },\n ),\n );\n },\n );\n }\n\n /**\n * Creates a ShareDirectoryClient object for a sub directory.\n *\n * @param subDirectoryName - A subdirectory name\n * @returns The ShareDirectoryClient object for the given subdirectory name.\n *\n * Example usage:\n *\n * ```js\n * const directoryClient = shareClient.getDirectoryClient(\"<directory name>\");\n * await directoryClient.create();\n * console.log(\"Created directory successfully\");\n * ```\n */\n public getDirectoryClient(subDirectoryName: string): ShareDirectoryClient {\n return new ShareDirectoryClient(\n appendToURLPath(this.url, EscapePath(subDirectoryName)),\n this.pipeline,\n this.shareClientConfig,\n );\n }\n\n /**\n * Creates a new subdirectory under this directory.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-directory\n *\n * @param directoryName -\n * @param options - Options to Directory Create operation.\n * @returns Directory create response data and the corresponding DirectoryClient instance.\n */\n public async createSubdirectory(\n directoryName: string,\n options: DirectoryCreateOptions = {},\n ): Promise<{\n directoryClient: ShareDirectoryClient;\n directoryCreateResponse: DirectoryCreateResponse;\n }> {\n return tracingClient.withSpan(\n \"ShareDirectoryClient-createSubdirectory\",\n options,\n async (updatedOptions) => {\n const directoryClient = this.getDirectoryClient(directoryName);\n const directoryCreateResponse = await directoryClient.create(updatedOptions);\n return {\n directoryClient,\n directoryCreateResponse,\n };\n },\n );\n }\n\n /**\n * Removes the specified empty sub directory under this directory.\n * Note that the directory must be empty before it can be deleted.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-directory\n *\n * @param directoryName -\n * @param options - Options to Directory Delete operation.\n * @returns Directory deletion response data.\n */\n public async deleteSubdirectory(\n directoryName: string,\n options: DirectoryDeleteOptions = {},\n ): Promise<DirectoryDeleteResponse> {\n return tracingClient.withSpan(\n \"ShareDirectoryClient-deleteSubdirectory\",\n options,\n async (updatedOptions) => {\n const directoryClient = this.getDirectoryClient(directoryName);\n return directoryClient.delete(updatedOptions);\n },\n );\n }\n\n /**\n * Creates a new file or replaces a file under this directory. Note it only initializes the file with no content.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-file\n *\n * @param fileName -\n * @param size - Specifies the maximum size in bytes for the file, up to 4 TB.\n * @param options - Options to File Create operation.\n * @returns File creation response data and the corresponding file client.\n */\n public async createFile(\n fileName: string,\n size: number,\n options: FileCreateOptions = {},\n ): Promise<{ fileClient: ShareFileClient; fileCreateResponse: FileCreateResponse }> {\n return tracingClient.withSpan(\n \"ShareDirectoryClient-createFile\",\n options,\n async (updatedOptions) => {\n const fileClient = this.getFileClient(fileName);\n const fileCreateResponse = await fileClient.create(size, updatedOptions);\n return {\n fileClient,\n fileCreateResponse,\n };\n },\n );\n }\n\n /**\n * Removes the specified file under this directory from the storage account.\n * When a file is successfully deleted, it is immediately removed from the storage\n * account's index and is no longer accessible to clients. The file's data is later\n * removed from the service during garbage collection.\n *\n * Delete File will fail with status code 409 (Conflict) and error code SharingViolation\n * if the file is open on an SMB client.\n *\n * Delete File is not supported on a share snapshot, which is a read-only copy of\n * a share. An attempt to perform this operation on a share snapshot will fail with 400 (InvalidQueryParameterValue)\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-file2\n *\n * @param fileName - Name of the file to delete\n * @param options - Options to File Delete operation.\n * @returns File deletion response data.\n */\n public async deleteFile(\n fileName: string,\n options: FileDeleteOptions = {},\n ): Promise<FileDeleteResponse> {\n return tracingClient.withSpan(\n \"ShareDirectoryClient-deleteFile\",\n options,\n async (updatedOptions) => {\n const fileClient = this.getFileClient(fileName);\n return fileClient.delete(updatedOptions);\n },\n );\n }\n\n /**\n * Creates a {@link ShareFileClient} object.\n *\n * @param fileName - A file name.\n * @returns A new ShareFileClient object for the given file name.\n *\n * Example usage:\n *\n * ```js\n * const content = \"Hello world!\"\n *\n * const fileClient = directoryClient.getFileClient(\"<file name>\");\n *\n * await fileClient.create(content.length);\n * console.log(\"Created file successfully!\");\n *\n * await fileClient.uploadRange(content, 0, content.length);\n * console.log(\"Updated file successfully!\")\n * ```\n */\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-subclients */\n public getFileClient(fileName: string): ShareFileClient {\n return new ShareFileClient(\n appendToURLPath(this.url, EscapePath(fileName)),\n this.pipeline,\n this.shareClientConfig,\n );\n }\n\n /**\n * Returns true if the specified directory exists; false otherwise.\n *\n * NOTE: use this function with care since an existing directory might be deleted by other clients or\n * applications. Vice versa new directories might be added by other clients or applications after this\n * function completes.\n *\n * @param options - options to Exists operation.\n */\n public async exists(options: DirectoryExistsOptions = {}): Promise<boolean> {\n return tracingClient.withSpan(\n \"ShareDirectoryClient-exists\",\n options,\n async (updatedOptions) => {\n try {\n await this.getProperties({ ...updatedOptions, ...this.shareClientConfig });\n return true;\n } catch (e: any) {\n if (e.statusCode === 404) {\n return false;\n }\n throw e;\n }\n },\n );\n }\n\n /**\n * Returns all system properties for the specified directory, and can also be used to check the\n * existence of a directory. The data returned does not include the files in the directory or any\n * subdirectories.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-directory-properties\n *\n * @param options - Options to Directory Get Properties operation.\n * @returns Response data for the Directory Get Properties operation.\n */\n public async getProperties(\n options: DirectoryGetPropertiesOptions = {},\n ): Promise<DirectoryGetPropertiesResponse> {\n return tracingClient.withSpan(\n \"ShareDirectoryClient-getProperties\",\n options,\n async (updatedOptions) => {\n return assertResponse<DirectoryGetPropertiesHeaders, DirectoryGetPropertiesHeaders>(\n await this.context.getProperties({ ...updatedOptions, ...this.shareClientConfig }),\n );\n },\n );\n }\n\n /**\n * Removes the specified empty directory. Note that the directory must be empty before it can be\n * deleted.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-directory\n *\n * @param options - Options to Directory Delete operation.\n * @returns Response data for the Directory Delete operation.\n */\n public async delete(options: DirectoryDeleteOptions = {}): Promise<DirectoryDeleteResponse> {\n return tracingClient.withSpan(\n \"ShareDirectoryClient-delete\",\n options,\n async (updatedOptions) => {\n return assertResponse<DirectoryDeleteHeaders, DirectoryDeleteHeaders>(\n await this.context.delete({ ...updatedOptions, ...this.shareClientConfig }),\n );\n },\n );\n }\n\n /**\n * Removes the specified empty directory if it exists. Note that the directory must be empty before it can be\n * deleted.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-directory\n *\n * @param options -\n */\n public async deleteIfExists(\n options: DirectoryDeleteOptions = {},\n ): Promise<DirectoryDeleteIfExistsResponse> {\n return tracingClient.withSpan(\n \"ShareDirectoryClient-deleteIfExists\",\n options,\n async (updatedOptions) => {\n try {\n const res = await this.delete(updatedOptions);\n return {\n succeeded: true,\n ...res,\n };\n } catch (e: any) {\n if (\n e.details?.errorCode === \"ResourceNotFound\" ||\n e.details?.errorCode === \"ParentNotFound\"\n ) {\n return {\n succeeded: false,\n ...e.response?.parsedHeaders,\n _response: e.response,\n };\n }\n throw e;\n }\n },\n );\n }\n\n /**\n * Updates user defined metadata for the specified directory.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-directory-metadata\n *\n * @param metadata - If no metadata provided, all existing directory metadata will be removed\n * @param options - Options to Directory Set Metadata operation.\n * @returns Response data for the Directory Set Metadata operation.\n */\n public async setMetadata(\n metadata?: Metadata,\n options: DirectorySetMetadataOptions = {},\n ): Promise<DirectorySetMetadataResponse> {\n return tracingClient.withSpan(\n \"ShareDirectoryClient-setMetadata\",\n options,\n async (updatedOptions) => {\n return assertResponse<DirectorySetMetadataHeaders, DirectorySetMetadataHeaders>(\n await this.context.setMetadata({\n ...updatedOptions,\n metadata,\n ...this.shareClientConfig,\n }),\n );\n },\n );\n }\n\n /**\n * Returns an AsyncIterableIterator for {@link DirectoryListFilesAndDirectoriesSegmentResponse} objects\n *\n * @param marker - A string value that identifies the portion of\n * the list of files and directories to be returned with the next listing operation. The\n * operation returns the ContinuationToken value within the response body if the\n * listing operation did not return all files and directories remaining to be listed\n * with the current page. The ContinuationToken value can be used as the value for\n * the marker parameter in a subsequent call to request the next page of list\n * items. The marker value is opaque to the client.\n * @param options - Options to list files and directories operation.\n */\n private async *iterateFilesAndDirectoriesSegments(\n marker?: string,\n options: DirectoryListFilesAndDirectoriesSegmentOptions = {},\n ): AsyncIterableIterator<DirectoryListFilesAndDirectoriesSegmentResponse> {\n if (options.prefix === \"\") {\n options.prefix = undefined;\n }\n\n let listFilesAndDirectoriesResponse;\n do {\n listFilesAndDirectoriesResponse = await this.listFilesAndDirectoriesSegment(marker, options);\n marker = listFilesAndDirectoriesResponse.continuationToken;\n yield await listFilesAndDirectoriesResponse;\n } while (marker);\n }\n\n /**\n * Returns an AsyncIterableIterator for file and directory items\n *\n * @param options - Options to list files and directories operation.\n */\n private async *listFilesAndDirectoriesItems(\n options: DirectoryListFilesAndDirectoriesSegmentOptions = {},\n ): AsyncIterableIterator<\n ({ kind: \"file\" } & FileItem) | ({ kind: \"directory\" } & DirectoryItem)\n > {\n if (options.prefix === \"\") {\n options.prefix = undefined;\n }\n\n let marker: string | undefined;\n for await (const listFilesAndDirectoriesResponse of this.iterateFilesAndDirectoriesSegments(\n marker,\n options,\n )) {\n for (const file of listFilesAndDirectoriesResponse.segment.fileItems) {\n yield { kind: \"file\", ...file };\n }\n for (const directory of listFilesAndDirectoriesResponse.segment.directoryItems) {\n yield { kind: \"directory\", ...directory };\n }\n }\n }\n\n /**\n * Returns an async iterable iterator to list all the files and directories\n * under the specified account.\n *\n * .byPage() returns an async iterable iterator to list the files and directories in pages.\n *\n * Example using `for await` syntax:\n *\n * ```js\n * let i = 1;\n * for await (const entity of directoryClient.listFilesAndDirectories()) {\n * if (entity.kind === \"directory\") {\n * console.log(`${i++} - directory\\t: ${entity.name}`);\n * } else {\n * console.log(`${i++} - file\\t: ${entity.name}`);\n * }\n * }\n * ```\n *\n * Example using `iter.next()`:\n *\n * ```js\n * let i = 1;\n * let iter = directoryClient.listFilesAndDirectories();\n * let entity = await iter.next();\n * while (!entity.done) {\n * if (entity.value.kind === \"directory\") {\n * console.log(`${i++} - directory\\t: ${entity.value.name}`);\n * } else {\n * console.log(`${i++} - file\\t: ${entity.value.name}`);\n * }\n * entity = await iter.next();\n * }\n * ```\n *\n * Example using `byPage()`:\n *\n * ```js\n * // passing optional maxPageSize in the page settings\n * let i = 1;\n * for await (const response of directoryClient\n * .listFilesAndDirectories()\n * .byPage({ maxPageSize: 20 })) {\n * for (const fileItem of response.segment.fileItems) {\n * console.log(`${i++} - file\\t: ${fileItem.name}`);\n * }\n * for (const dirItem of response.segment.directoryItems) {\n * console.log(`${i++} - directory\\t: ${dirItem.name}`);\n * }\n * }\n * ```\n *\n * Example using paging with a marker:\n *\n * ```js\n * let i = 1;\n * let iterator = directoryClient.listFilesAndDirectories().byPage({ maxPageSize: 3 });\n * let response = (await iterator.next()).value;\n *\n * // Prints 3 file and directory names\n * for (const fileItem of response.segment.fileItems) {\n * console.log(`${i++} - file\\t: ${fileItem.name}`);\n * }\n *\n * for (const dirItem of response.segment.directoryItems) {\n * console.log(`${i++} - directory\\t: ${dirItem.name}`);\n * }\n *\n * // Gets next marker\n * let dirMarker = response.continuationToken;\n *\n * // Passing next marker as continuationToken\n * iterator = directoryClient\n * .listFilesAndDirectories()\n * .byPage({ continuationToken: dirMarker, maxPageSize: 4 });\n * response = (await iterator.next()).value;\n *\n * // Prints 10 file and directory names\n * for (const fileItem of response.segment.fileItems) {\n * console.log(`${i++} - file\\t: ${fileItem.name}`);\n * }\n *\n * for (const dirItem of response.segment.directoryItems) {\n * console.log(`${i++} - directory\\t: ${dirItem.name}`);\n * }\n * ```\n *\n * @param options - Options to list files and directories operation.\n * @returns An asyncIterableIterator that supports paging.\n */\n public listFilesAndDirectories(\n options: DirectoryListFilesAndDirectoriesOptions = {},\n ): PagedAsyncIterableIterator<\n ({ kind: \"file\" } & FileItem) | ({ kind: \"directory\" } & DirectoryItem),\n DirectoryListFilesAndDirectoriesSegmentResponse\n > {\n const include: ListFilesIncludeType[] = [];\n if (options.includeTimestamps) {\n include.push(\"Timestamps\");\n }\n if (options.includeEtag) {\n include.push(\"Etag\");\n }\n if (options.includeAttributes) {\n include.push(\"Attributes\");\n }\n if (options.includePermissionKey) {\n include.push(\"PermissionKey\");\n }\n if (options.prefix === \"\") {\n options.prefix = undefined;\n }\n\n const updatedOptions: DirectoryListFilesAndDirectoriesSegmentOptions = {\n ...options,\n ...(include.length > 0 ? { include: include } : {}),\n };\n\n // AsyncIterableIterator to iterate over files and directories\n const iter = this.listFilesAndDirectoriesItems(updatedOptions);\n return {\n /**\n * The next method, part of the iteration protocol\n */\n async next() {\n return iter.next();\n },\n /**\n * The connection to the async iterator, part of the iteration protocol\n */\n [Symbol.asyncIterator]() {\n return this;\n },\n /**\n * Return an AsyncIterableIterator that works a page at a time\n */\n byPage: (settings: PageSettings = {}) => {\n return this.iterateFilesAndDirectoriesSegments(\n removeEmptyString(settings.continuationToken),\n {\n maxResults: settings.maxPageSize,\n ...updatedOptions,\n },\n );\n },\n };\n }\n\n /**\n * Returns a list of files or directories under the specified share or directory. It lists the\n * contents only for a single level of the directory hierarchy.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/list-directories-and-files\n *\n * @param marker - A string value that identifies the portion of the list to be returned with the next list operation.\n * @param options - Options to Directory List Files and Directories Segment operation.\n * @returns Response data for the Directory List Files and Directories operation.\n */\n private async listFilesAndDirectoriesSegment(\n marker?: string,\n options: DirectoryListFilesAndDirectoriesSegmentOptions = {},\n ): Promise<DirectoryListFilesAndDirectoriesSegmentResponse> {\n if (options.prefix === \"\") {\n options.prefix = undefined;\n }\n return tracingClient.withSpan(\n \"ShareDirectoryClient-listFilesAndDirectoriesSegment\",\n options,\n async (updatedOptions) => {\n const rawResponse = assertResponse<\n DirectoryListFilesAndDirectoriesSegmentHeaders &\n GeneratedListFilesAndDirectoriesSegmentResponse,\n DirectoryListFilesAndDirectoriesSegmentHeaders,\n GeneratedListFilesAndDirectoriesSegmentResponse\n >(\n await this.context.listFilesAndDirectoriesSegment({\n ...updatedOptions,\n marker,\n ...this.shareClientConfig,\n }),\n );\n const wrappedResponse: DirectoryListFilesAndDirectoriesSegmentResponse = {\n ...ConvertInternalResponseOfListFiles(rawResponse),\n _response: {\n ...rawResponse._response,\n parsedBody: ConvertInternalResponseOfListFiles(rawResponse._response.parsedBody),\n }, // _response is made non-enumerable\n };\n return wrappedResponse;\n },\n );\n }\n\n /**\n * Returns an AsyncIterableIterator for {@link DirectoryListHandlesResponse}\n *\n * @param marker - A string value that identifies the portion of the list to be\n * returned with the next list handles operation. The operation returns a\n * marker value within the response body if the list returned was not complete.\n * The marker value may then be used in a subsequent call to request the next\n * set of list items.\n * @param options - Options to list handles operation.\n */\n private async *iterateHandleSegments(\n marker?: string,\n options: DirectoryListHandlesSegmentOptions = {},\n ): AsyncIterableIterator<DirectoryListHandlesResponse> {\n let listHandlesResponse;\n if (!!marker || marker === undefined) {\n do {\n listHandlesResponse = await this.listHandlesSegment(marker, options);\n marker = listHandlesResponse.continuationToken;\n yield await listHandlesResponse;\n } while (marker);\n }\n }\n\n /**\n * Returns an AsyncIterableIterator for handles\n *\n * @param options - Options to list handles operation.\n */\n private async *listHandleItems(\n options: DirectoryListHandlesSegmentOptions = {},\n ): AsyncIterableIterator<HandleItem> {\n let marker: string | undefined;\n for await (const listHandlesResponse of this.iterateHandleSegments(marker, options)) {\n if (listHandlesResponse.handleList) {\n for (const handle of listHandlesResponse.handleList) {\n yield handle;\n }\n }\n }\n }\n\n /**\n * Returns an async iterable iterator to list all the handles.\n * under the specified account.\n *\n * .byPage() returns an async iterable iterator to list the handles in pages.\n *\n * Example using `for await` syntax:\n *\n * ```js\n * let i = 1;\n * let iter = dirClient.listHandles();\n * for await (const handle of iter) {\n * console.log(`Handle ${i++}: ${handle.path}, opened time ${handle.openTime}, clientIp ${handle.clientIp}`);\n * }\n * ```\n *\n * Example using `iter.next()`:\n *\n * ```js\n * let i = 1;\n * let iter = dirClient.listHandles();\n * let handleItem = await iter.next();\n * while (!handleItem.done) {\n * console.log(`Handle ${i++}: ${handleItem.value.path}, opened time ${handleItem.value.openTime}, clientIp ${handleItem.value.clientIp}`);\n * handleItem = await iter.next();\n * }\n * ```\n *\n * Example using `byPage()`:\n *\n * ```js\n * // passing optional maxPageSize in the page settings\n * let i = 1;\n * for await (const response of dirClient.listHandles({ recursive: true }).byPage({ maxPageSize: 20 })) {\n * if (response.handleList) {\n * for (const handle of response.handleList) {\n * console.log(`Handle ${i++}: ${handle.path}, opened time ${handle.openTime}, clientIp ${handle.clientIp}`);\n * }\n * }\n * }\n * ```\n *\n * Example using paging with a marker:\n *\n * ```js\n * let i = 1;\n * let iterator = dirClient.listHandles().byPage({ maxPageSize: 2 });\n * let response = await iterator.next();\n *\n * // Prints 2 handles\n * if (response.value.handleList) {\n * for (const handle of response.value.handleList) {\n * console.log(`Handle ${i++}: ${handle.path}, opened time ${handle.openTime}, clientIp ${handle.clientIp}`);\n * }\n * }\n *\n * // Gets next marker\n * let marker = response.value.continuationToken;\n *\n * // Passing next marker as continuationToken\n * console.log(` continuation`);\n * iterator = dirClient.listHandles().byPage({ continuationToken: marker, maxPageSize: 10 });\n * response = await iterator.next();\n *\n * // Prints 2 more handles assuming you have more than four directory/files opened\n * if (!response.done && response.value.handleList) {\n * for (const handle of response.value.handleList) {\n * console.log(`Handle ${i++}: ${handle.path}, opened time ${handle.openTime}, clientIp ${handle.clientIp}`);\n * }\n * }\n * ```\n *\n * @param options - Options to list handles operation.\n *\n * An asyncIterableIterator that supports paging.\n */\n public listHandles(\n options: DirectoryListHandlesOptions = {},\n ): PagedAsyncIterableIterator<HandleItem, DirectoryListHandlesResponse> {\n // an AsyncIterableIterator to iterate over handles\n const iter = this.listHandleItems(options);\n return {\n /**\n * The next method, part of the iteration protocol\n */\n async next() {\n return iter.next();\n },\n /**\n * The connection to the async iterator, part of the iteration protocol\n */\n [Symbol.asyncIterator]() {\n return this;\n },\n /**\n * Return an AsyncIterableIterator that works a page at a time\n */\n byPage: (settings: PageSettings = {}) => {\n return this.iterateHandleSegments(removeEmptyString(settings.continuationToken), {\n maxResults: settings.maxPageSize,\n ...options,\n });\n },\n };\n }\n\n /**\n * Lists handles for a directory.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/list-handles\n *\n * @param marker - Optional. A string value that identifies the portion of the list to be\n * returned with the next list handles operation. The operation returns a\n * marker value within the response body if the list returned was not complete.\n * The marker value may then be used in a subsequent call to request the next\n * set of list items.\n * @param options -\n */\n private async listHandlesSegment(\n marker?: string,\n options: DirectoryListHandlesSegmentOptions = {},\n ): Promise<DirectoryListHandlesResponse> {\n return tracingClient.withSpan(\n \"ShareDirectoryClient-listHandlesSegment\",\n options,\n async (updatedOptions) => {\n marker = marker === \"\" ? undefined : marker;\n const response = assertResponse<\n DirectoryListHandlesHeaders & GeneratedListHandlesResponse,\n DirectoryListHandlesHeaders,\n GeneratedListHandlesResponse\n >(\n await this.context.listHandles({\n ...updatedOptions,\n marker,\n ...this.shareClientConfig,\n }),\n );\n\n // TODO: Protocol layer issue that when handle list is in returned XML\n // response.handleList is an empty string\n if ((response.handleList as any) === \"\") {\n response.handleList = undefined;\n }\n const wrappedResponse: DirectoryListHandlesResponse = {\n ...ConvertInternalResponseOfListHandles(response),\n _response: {\n ...response._response,\n parsedBody: ConvertInternalResponseOfListHandles(response._response.parsedBody),\n },\n };\n\n return wrappedResponse;\n },\n );\n }\n\n /**\n * Force close all handles for a directory.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/force-close-handles\n *\n * @param marker - Optional. A string value that identifies the position of handles that will\n * be closed with the next force close handles operation.\n * The operation returns a marker value within the response\n * body if there are more handles to close. The marker value\n * may then be used in a subsequent call to close the next set of handles.\n * @param options -\n */\n private async forceCloseHandlesSegment(\n marker?: string,\n options: DirectoryForceCloseHandlesSegmentOptions = {},\n ): Promise<DirectoryForceCloseHandlesResponse> {\n return tracingClient.withSpan(\n \"ShareDirectoryClient-forceCloseHandlesSegment\",\n options,\n async (updatedOptions) => {\n if (marker === \"\") {\n marker = undefined;\n }\n const rawResponse = assertResponse<\n DirectoryForceCloseHandlesHeaders,\n DirectoryForceCloseHandlesHeaders\n >(\n await this.context.forceCloseHandles(\"*\", {\n ...updatedOptions,\n marker,\n ...this.shareClientConfig,\n }),\n );\n return {\n ...rawResponse,\n closedHandlesCount: rawResponse.numberOfHandlesClosed ?? 0,\n closeFailureCount: rawResponse.numberOfHandlesFailedToClose ?? 0,\n };\n },\n );\n }\n\n /**\n * Force close all handles for a directory.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/force-close-handles\n *\n * @param options -\n */\n public async forceCloseAllHandles(\n options: DirectoryForceCloseHandlesSegmentOptions = {},\n ): Promise<CloseHandlesInfo> {\n return tracingClient.withSpan(\n \"ShareDirectoryClient-forceCloseAllHandles\",\n options,\n async (updatedOptions) => {\n let handlesClosed = 0;\n let numberOfHandlesFailedToClose = 0;\n let marker: string | undefined = \"\";\n\n do {\n const response = await this.forceCloseHandlesSegment(marker, updatedOptions);\n marker = response.marker;\n if (response.closedHandlesCount) {\n handlesClosed += response.closedHandlesCount;\n }\n if (response.closeFailureCount) {\n numberOfHandlesFailedToClose += response.closeFailureCount;\n }\n } while (marker);\n\n return {\n closedHandlesCount: handlesClosed,\n closeFailureCount: numberOfHandlesFailedToClose,\n };\n },\n );\n }\n\n /**\n * Force close a specific handle for a directory.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/force-close-handles\n *\n * @param aborter - Create a new Aborter instance with Aborter.none or Aborter.timeout(),\n * goto documents of Aborter for more examples about request cancellation\n * @param handleId - Specific handle ID, cannot be asterisk \"*\".\n * Use forceCloseHandlesSegment() to close all handles.\n * @param options -\n */\n public async forceCloseHandle(\n handleId: string,\n options: DirectoryForceCloseHandlesOptions = {},\n ): Promise<DirectoryForceCloseHandlesResponse> {\n return tracingClient.withSpan(\n \"ShareDirectoryClient-forceCloseHandle\",\n options,\n async (updatedOptions) => {\n if (handleId === \"*\") {\n throw new RangeError(\n `Parameter handleID should be a specified handle ID. Use forceCloseHandlesSegment() to close all handles.`,\n );\n }\n\n const rawResponse = await this.context.forceCloseHandles(handleId, {\n ...updatedOptions,\n ...this.shareClientConfig,\n });\n const response = rawResponse as DirectoryForceCloseHandlesResponse;\n response.closedHandlesCount = rawResponse.numberOfHandlesClosed || 0;\n response.closeFailureCount = rawResponse.numberOfHandlesFailedToClose || 0;\n return response;\n },\n );\n }\n\n /**\n * Renames a directory.\n * This API only supports renaming a directory in the same share.\n *\n * @param destinationPath - Specifies the destination path to rename to. The path will be encoded to put into a URL to specify the destination.\n * @param options - Options for the renaming operation.\n * @returns Response data for the file renaming operation.\n *\n * Example usage:\n *\n * ```js\n *\n * // Rename the directory\n * await diretoryClient.rename(destinationPath);\n * console.log(\"Renamed directory successfully!\");\n * ```\n */\n public async rename(\n destinationPath: string,\n options: DirectoryRenameOptions = {},\n ): Promise<{\n destinationDirectoryClient: ShareDirectoryClient;\n directoryRenameResponse: DirectoryRenameResponse;\n }> {\n const split: string[] = destinationPath.split(\"?\");\n let destinationUrl: string;\n if (split.length === 2) {\n const pathOnly = EscapePath(split[0]);\n const renameDestination = `/${this.shareName}/${pathOnly}`;\n destinationUrl = setURLPath(this.url, renameDestination);\n destinationUrl = setURLQueries(destinationUrl, split[1]);\n } else if (split.length === 1) {\n const pathOnly = EscapePath(destinationPath);\n const renameDestination = `/${this.shareName}/${pathOnly}`;\n destinationUrl = setURLPath(this.url, renameDestination);\n } else {\n throw new RangeError(\"Destination path should not contain more than one query string\");\n }\n\n const destDirectory = new ShareDirectoryClient(\n destinationUrl,\n this.pipeline,\n this.shareClientConfig,\n );\n\n return tracingClient.withSpan(\n \"ShareDirectoryClient-rename\",\n options,\n async (updatedOptions) => {\n const response = assertResponse<DirectoryRenameHeaders, DirectoryRenameHeaders>(\n await destDirectory.context.rename(this.url, {\n ...updatedOptions,\n sourceLeaseAccessConditions: updatedOptions.sourceLeaseAccessConditions\n ? {\n sourceLeaseId: updatedOptions.sourceLeaseAccessConditions.leaseId,\n }\n : undefined,\n destinationLeaseAccessConditions: updatedOptions.destinationLeaseAccessConditions\n ? {\n destinationLeaseId: updatedOptions.destinationLeaseAccessConditions.leaseId,\n }\n : undefined,\n ...this.shareClientConfig,\n }),\n );\n\n return {\n destinationDirectoryClient: destDirectory,\n directoryRenameResponse: response,\n };\n },\n );\n }\n}\n\n/**\n * Options to configure the {@link ShareFileClient.create} operation.\n */\nexport interface FileCreateOptions extends FileAndDirectoryCreateCommonOptions, CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * File HTTP headers like Content-Type.\n */\n fileHttpHeaders?: FileHttpHeaders;\n\n /**\n * A collection of key-value string pair to associate with the file storage object.\n */\n metadata?: Metadata;\n /**\n * Lease access conditions.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n}\n\nexport interface FileProperties extends FileAndDirectorySetPropertiesCommonOptions, CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * File HTTP headers like Content-Type.\n */\n fileHttpHeaders?: FileHttpHeaders;\n /**\n * Lease access conditions.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n}\n\nexport interface SetPropertiesResponse extends FileSetHTTPHeadersResponse {}\n\n/**\n * Options to configure the {@link ShareFileClient.delete} operation.\n */\nexport interface FileDeleteOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Lease access conditions.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n}\n\n/**\n * Options to configure File - Download operations.\n *\n * See:\n * - {@link ShareFileClient.download}\n * - {@link ShareFileClient.downloadToFile}\n */\nexport interface FileDownloadOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Optional. ONLY AVAILABLE IN NODE.JS.\n *\n * How many retries will perform when original body download stream unexpected ends.\n * Above kind of ends will not trigger retry policy defined in a pipeline,\n * because they doesn't emit network errors.\n *\n * With this option, every additional retry means an additional ShareFileClient.download() request will be made\n * from the broken point, until the requested range has been successfully downloaded or maxRetryRequests is reached.\n *\n * Default value is 5, please set a larger value when loading large files in poor network.\n */\n maxRetryRequests?: number;\n\n /**\n * When this header is set to true and\n * specified together with the Range header, the service returns the MD5 hash\n * for the range, as long as the range is less than or equal to 4 MB in size.\n */\n rangeGetContentMD5?: boolean;\n\n /**\n * Download progress updating event handler.\n */\n onProgress?: (progress: TransferProgressEvent) => void;\n /**\n * Lease access conditions.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n}\n\n/**\n * Options to configure the {@link ShareFileClient.uploadRange} operation.\n */\nexport interface FileUploadRangeOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * An MD5 hash of the content. This hash is\n * used to verify the integrity of the data during transport. When the\n * Content-MD5 header is specified, the File service compares the hash of the\n * content that has arrived with the header value that was sent. If the two\n * hashes do not match, the operation will fail with error code 400 (Bad\n * Request).\n */\n contentMD5?: Uint8Array;\n\n /**\n * Progress updating event handler.\n */\n onProgress?: (progress: TransferProgressEvent) => void;\n /**\n * Lease access conditions.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n\n /**\n * The last write time for the file.\n * A value of Preserve may be passed to keep an existing value unchanged.\n * A value of Now may be used to indicate the time of the request.\n * By default, the value will be set as Now.\n */\n fileLastWrittenMode?: FileLastWrittenMode;\n}\n\n/**\n * Options to configure the {@link ShareFileClient.uploadRangeFromURL} operation.\n */\nexport interface FileUploadRangeFromURLOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * The timeout parameter is expressed in seconds. For more information, see <a\n * href=\"https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN\">Setting\n * Timeouts for File Service Operations.</a>\n */\n timeoutInSeconds?: number;\n /**\n * Specify the crc64 calculated for the range of bytes that must be read from the copy source.\n */\n sourceContentCrc64?: Uint8Array;\n /**\n * Additional parameters for the operation\n */\n sourceConditions?: SourceModifiedAccessConditions;\n /**\n * Lease access conditions.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n /**\n * Only Bearer type is supported. Credentials should be a valid OAuth access token to copy source.\n */\n sourceAuthorization?: HttpAuthorization;\n /**\n * The last write time for the file.\n * A value of preserve may be passed to keep an existing value unchanged.\n * A value of now may be used to indicate the time of the request.\n * By default, the value will be set as now.\n */\n fileLastWrittenMode?: FileLastWrittenMode;\n}\n\n/**\n * The option is defined as parity to REST definition.\n * While it's not ready to be used now, considering Crc64 of source content is\n * not accessible.\n */\n// export interface IFileUploadRangeFromURLOptions extends CommonOptions {\n// /**\n// * Crc64 of the source content.\n// *\n// * @type {Uint8Array}\n// * @memberof IFileUploadRangeFromURLOptions\n// */\n// sourceContentCrc64?: Uint8Array;\n\n// /**\n// * Source modified access condition.\n// *\n// * @type {SourceModifiedAccessConditions}\n// * @memberof IFileUploadRangeFromURLOptions\n// */\n// sourceModifiedAccessConditions?: SourceModifiedAccessConditions;\n// }\n\n/**\n * Options to configure the {@link ShareFileClient.getRangeList} operation.\n */\nexport interface FileGetRangeListOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Optional. Specifies the range of bytes over which to list ranges, inclusively.\n */\n range?: Range;\n /**\n * Lease access conditions.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n /**\n * This header is allowed only when prevShareSnapshot parameter is set.\n * Determines whether the changed ranges for a file that has been renamed or moved between the target snapshot (or the live file) and the previous snapshot should be listed.\n * If the value is true, the valid changed ranges for the file will be returned. If the value is false, the operation will result in a failure with 409 (Conflict) response.\n * The default value is false.\n */\n includeRenames?: boolean;\n}\n\n/**\n * Options to configure the {@link ShareFileClient.exists} operation.\n */\nexport interface FileExistsOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Options to configure the {@link ShareFileClient.getProperties} operation.\n */\nexport interface FileGetPropertiesOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Lease access conditions.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n}\n\n/**\n * Contains response data for the {@link ShareFileClient.getRangeList} operation.\n */\nexport type FileGetRangeListResponse = WithResponse<\n FileGetRangeListHeaders & {\n /**\n * Range list for an Azure file.\n */\n rangeList: RangeModel[];\n },\n FileGetRangeListHeaders,\n RangeModel[]\n>;\n\n/**\n * Options to configure the {@link ShareFileClient.startCopyFromURL} operation.\n */\nexport interface FileStartCopyOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * A collection of key-value string pair to associate with the file storage object.\n */\n metadata?: Metadata;\n /**\n * Lease access conditions.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n /**\n * If specified the permission (security descriptor) shall be set for the directory/file. This\n * header can be used if Permission size is lesser than or equal to 8KB, else x-ms-file-permission-key header shall be\n * used. Default value: Inherit. If SDDL is specified as input, it must have owner, group and\n * dacl. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be\n * specified.\n */\n filePermission?: string;\n /**\n * Key of the permission to be set for the directory/file. Note: Only one of the\n * x-ms-file-permission or x-ms-file-permission-key should be specified.\n */\n filePermissionKey?: string;\n /**\n * SMB info.\n */\n copyFileSmbInfo?: CopyFileSmbInfo;\n}\n\n/**\n * Options to configure the {@link ShareFileClient.setMetadata} operation.\n */\nexport interface FileSetMetadataOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Lease access conditions.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n}\n\n/**\n * Options to configure the {@link ShareFileClient.setHttpHeaders} operation.\n */\nexport interface FileSetHttpHeadersOptions\n extends FileAndDirectorySetPropertiesCommonOptions,\n CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Lease access conditions.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n}\n\n/**\n * Options to configure the {@link ShareFileClient.abortCopyFromURL} operation.\n */\nexport interface FileAbortCopyFromURLOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Lease access conditions.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n}\n\n/**\n * Options to configure the {@link ShareFileClient.resize} operation.\n */\nexport interface FileResizeOptions\n extends FileAndDirectorySetPropertiesCommonOptions,\n CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Lease access conditions.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n}\n\n/**\n * Options to configure the {@link ShareFileClient.clearRange} operation.\n */\nexport interface FileClearRangeOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Lease access conditions.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n /**\n * The last write time for the file.\n * A value of preserve may be passed to keep an existing value unchanged.\n * A value of now may be used to indicate the time of the request.\n * By default, the value will be set as now.\n */\n fileLastWrittenMode?: FileLastWrittenMode;\n}\n\n/**\n * Options to configure File - List Handles Segment operations.\n *\n * See:\n * - {@link ShareFileClient.listHandlesSegment}\n * - {@link ShareFileClient.iterateHandleSegments}\n * - {@link ShareFileClient.listHandleItems}\n */\nexport interface FileListHandlesSegmentOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Specifies the maximum number of entries to return. If the request does not specify maxResults,\n * or specifies a value greater than 5,000, the server will return up to 5,000 items.\n */\n maxPageSize?: number;\n}\n\nexport interface FileListHandlesOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Options to configure File - Force Close Handles operations.\n *\n * See:\n * - {@link ShareFileClient.forceCloseHandlesSegment}\n * - {@link ShareFileClient.forceCloseAllHandles}\n * - {@link ShareFileClient.forceCloseHandle}\n */\nexport interface FileForceCloseHandlesOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Additional response header values for close handles request.\n */\nexport interface FileCloseHandlesHeaders {\n /**\n * This header uniquely identifies the request that was made and can be used for troubleshooting\n * the request.\n */\n requestId?: string;\n /**\n * Indicates the version of the File service used to execute the request.\n */\n version?: string;\n /**\n * A UTC date/time value generated by the service that indicates the time at which the response\n * was initiated.\n */\n date?: Date;\n /**\n * A string describing next handle to be closed. It is returned when more handles need to be\n * closed to complete the request.\n */\n marker?: string;\n}\n\n/**\n * Response type for {@link ShareFileClient.forceCloseHandle}.\n */\nexport type FileForceCloseHandlesResponse = WithResponse<\n CloseHandlesInfo & FileCloseHandlesHeaders,\n FileForceCloseHandlesHeaders\n>;\n\n/**\n * Option interface for ShareFileClient.uploadStream().\n */\nexport interface FileUploadStreamOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Azure File HTTP Headers.\n */\n fileHttpHeaders?: FileHttpHeaders;\n\n /**\n * Metadata of the Azure file.\n */\n metadata?: Metadata;\n\n /**\n * Progress updater.\n */\n onProgress?: (progress: TransferProgressEvent) => void;\n /**\n * Lease access conditions.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n}\n\n/**\n * Option interface for File - Upload operations\n *\n * See:\n * - {@link ShareFileClient.uploadFile}\n * - {@link ShareFileClient.uploadSeekableStream}\n */\nexport interface FileParallelUploadOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * RangeSize specifies the range size to use in each parallel upload,\n * the default (and maximum size) is FILE_RANGE_MAX_SIZE_BYTES.\n */\n rangeSize?: number;\n\n /**\n * Progress updater.\n */\n onProgress?: (progress: TransferProgressEvent) => void;\n\n /**\n * File HTTP Headers.\n */\n fileHttpHeaders?: FileHttpHeaders;\n\n /**\n * Metadata of an Azure file.\n */\n metadata?: Metadata;\n\n /**\n * Concurrency indicates the maximum number of ranges to upload in parallel.\n * If not provided, 5 concurrency will be used by default.\n */\n concurrency?: number;\n /**\n * Lease access conditions.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n}\n\n/**\n * Option interface for the {@link ShareFileClient.downloadToBuffer} operation.\n */\nexport interface FileDownloadToBufferOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * When downloading Azure files, download method will try to split large file into small ranges.\n * Every small range will be downloaded via a separate request.\n * This option defines size data every small request trying to download.\n * Must be greater than 0, will use the default value if undefined,\n */\n rangeSize?: number;\n\n /**\n * Optional. ONLY AVAILABLE IN NODE.JS.\n *\n * How many retries will perform when original range download stream unexpected ends.\n * Above kind of ends will not trigger retry policy defined in a pipeline,\n * because they doesn't emit network errors.\n *\n * With this option, every additional retry means an additional ShareFileClient.download() request will be made\n * from the broken point, until the requested range has been successfully downloaded or\n * maxRetryRequestsPerRange is reached.\n *\n * Default value is 5, please set a larger value when in poor network.\n */\n maxRetryRequestsPerRange?: number;\n\n /**\n * Progress updater.\n */\n onProgress?: (progress: TransferProgressEvent) => void;\n\n /**\n * Concurrency indicates the maximum number of ranges to download in parallel.\n * If not provided, 5 concurrency will be used by default.\n */\n concurrency?: number;\n /**\n * Lease access conditions.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n}\n\n/**\n * Contains response data for the {@link ShareFileClient.deleteIfExists} operation.\n */\nexport interface FileDeleteIfExistsResponse extends FileDeleteResponse {\n /**\n * Indicate whether the file is successfully deleted. Is false if the file does not exist in the first place.\n */\n succeeded: boolean;\n}\n\n/**\n * Options to configure {@link ShareFileClient.generateSasUrl} operation.\n */\nexport interface FileGenerateSasUrlOptions extends CommonGenerateSasUrlOptions {\n /**\n * Optional only when identifier is provided. Specifies the list of permissions to be associated with the SAS.\n */\n permissions?: FileSASPermissions;\n}\n\n/**\n * Options to configure the {@link ShareFileClient.rename} operation.\n */\nexport interface FileRenameOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n\n /**\n * Lease access condition for source file. Required if the source file has an active infinite lease.\n */\n sourceLeaseAccessConditions?: LeaseAccessConditions;\n\n /**\n * Lease access condition for destination file. Required if the destination file has an active infinite lease.\n */\n destinationLeaseAccessConditions?: LeaseAccessConditions;\n\n /**\n * Optional.\n * Specifies the option to copy file security descriptor from source file or to set it using the value which is defined by the header value of x-ms-file-permission or x-ms-file-permission-key.\n */\n copyFileSmbInfo?: CopyFileSmbInfo;\n\n /**\n * A name-value pair to associate with a file storage object.\n */\n metadata?: Metadata;\n\n /**\n * Optional.\n * The timeout parameter is expressed in seconds. For more information, see <a href=\"https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN\">Setting Timeouts for File Service Operations.</a>\n */\n timeoutInSeconds?: number;\n\n /**\n * Optional.\n * If specified the permission (security descriptor) shall be set for the directory/file.\n */\n filePermission?: string;\n\n /**\n * Optional. Available for version 2023-06-01 and later. Specifies the format in which the permission is returned.\n * Acceptable values are SDDL or binary. If x-ms-file-permission-format is unspecified or explicitly set to SDDL, the permission is returned in SDDL format.\n * If x-ms-file-permission-format is explicitly set to binary, the permission is returned as a base64 string representing the binary encoding of the permission\n */\n filePermissionFormat?: FilePermissionFormat;\n\n /**\n * Optional.\n * Key of the permission to be set for the directory/file. Note: Only one of the filePermission or filePermissionKey should be specified.\n */\n filePermissionKey?: string;\n\n /**\n * Optional.\n * A boolean value for if the destination file already exists, whether this request will overwrite the file or not. If true, the rename will succeed and will overwrite the destination file. If not provided or if false and the destination file does exist, the request will not overwrite the destination file. If provided and the destination file doesn’t exist, the rename will succeed. Note: This value does not override the x-ms-file-copy-ignore-read-only header value.\n */\n replaceIfExists?: boolean;\n\n /**\n * Optional.\n * A boolean value that specifies whether the ReadOnly attribute on a preexisting destination file should be respected. If true, the rename will succeed, otherwise, a previous file at the destination with the ReadOnly attribute set will cause the rename to fail.\n */\n ignoreReadOnly?: boolean;\n\n /**\n * Optional.\n * Content type to set on the File.\n */\n contentType?: string;\n}\n\n/**\n * Options to configure the {@link ShareDirectoryClient.rename} operation.\n */\nexport interface DirectoryRenameOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n\n /**\n * Lease access condition for source file. Required if the source file has an active infinite lease.\n */\n sourceLeaseAccessConditions?: LeaseAccessConditions;\n\n /**\n * Lease access condition for destination file. Required if the destination file has an active infinite lease.\n */\n destinationLeaseAccessConditions?: LeaseAccessConditions;\n\n /**\n * Optional.\n * Specifies the option to copy file security descriptor from source file or to set it using the value which is defined by the header value of x-ms-file-permission or x-ms-file-permission-key.\n */\n copyFileSmbInfo?: CopyFileSmbInfo;\n\n /**\n * Optional.\n * The timeout parameter is expressed in seconds. For more information, see <a href=\"https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN\">Setting Timeouts for File Service Operations.</a>\n */\n timeoutInSeconds?: number;\n\n /**\n * Optional.\n * A name-value pair to associate with a file storage object.\n */\n metadata?: Metadata;\n\n /**\n * Optional.\n * If specified the permission (security descriptor) shall be set for the directory/file.\n */\n filePermission?: string;\n\n /**\n * Optional. Available for version 2023-06-01 and later. Specifies the format in which the permission is returned.\n * Acceptable values are SDDL or binary. If x-ms-file-permission-format is unspecified or explicitly set to SDDL, the permission is returned in SDDL format.\n * If x-ms-file-permission-format is explicitly set to binary, the permission is returned as a base64 string representing the binary encoding of the permission\n */\n filePermissionFormat?: FilePermissionFormat;\n\n /**\n * Optional.\n * Key of the permission to be set for the directory/file. Note: Only one of the filePermission or filePermissionKey should be specified.\n */\n filePermissionKey?: string;\n /**\n * Optional.\n * A boolean value for if the destination file already exists, whether this request will overwrite the file or not. If true, the rename will succeed and will overwrite the destination file. If not provided or if false and the destination file does exist, the request will not overwrite the destination file. If provided and the destination file doesn’t exist, the rename will succeed. Note: This value does not override the x-ms-file-copy-ignore-read-only header value.\n */\n replaceIfExists?: boolean;\n\n /**\n * Optional.\n * A boolean value that specifies whether the ReadOnly attribute on a preexisting destination file should be respected. If true, the rename will succeed, otherwise, a previous file at the destination with the ReadOnly attribute set will cause the rename to fail.\n */\n ignoreReadOnly?: boolean;\n}\n\n/**\n * A ShareFileClient represents a URL to an Azure Storage file.\n */\nexport class ShareFileClient extends StorageClient {\n /**\n * context provided by protocol layer.\n */\n private context: File;\n\n private _shareName: string;\n private _path: string;\n private _name: string;\n\n private shareClientConfig?: ShareClientConfig;\n\n /**\n * The share name corresponding to this file client\n */\n public get shareName(): string {\n return this._shareName;\n }\n\n /**\n * The full path of the file\n */\n public get path(): string {\n return this._path;\n }\n\n /**\n * The name of the file\n */\n public get name(): string {\n return this._name;\n }\n\n /**\n * Creates an instance of ShareFileClient.\n *\n * @param url - A URL string pointing to Azure Storage file, such as\n * \"https://myaccount.file.core.windows.net/myshare/mydirectory/file\". You can\n * append a SAS if using AnonymousCredential, such as\n * \"https://myaccount.file.core.windows.net/myshare/mydirectory/file?sasString\".\n * This method accepts an encoded URL or non-encoded URL pointing to a file.\n * Encoded URL string will NOT be escaped twice, only special characters in URL path will be escaped.\n * However, if a file or directory name includes %, file or directory name must be encoded in the URL.\n * Such as a file named \"myfile%\", the URL should be \"https://myaccount.file.core.windows.net/myshare/mydirectory/myfile%25\".\n * @param credential - Such as , StorageSharedKeyCredential or TokenCredential,\n * If not specified, AnonymousCredential is used.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n constructor(\n url: string,\n credential?: Credential | TokenCredential,\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n options?: ShareClientOptions,\n );\n /**\n * Creates an instance of ShareFileClient.\n *\n * @param url - A URL string pointing to Azure Storage file, such as\n * \"https://myaccount.file.core.windows.net/myshare/mydirectory/file\". You can\n * append a SAS if using AnonymousCredential, such as\n * \"https://myaccount.file.core.windows.net/myshare/mydirectory/file?sasString\".\n * This method accepts an encoded URL or non-encoded URL pointing to a file.\n * Encoded URL string will NOT be escaped twice, only special characters in URL path will be escaped.\n * However, if a file or directory name includes %, file or directory name must be encoded in the URL.\n * Such as a file named \"myfile%\", the URL should be \"https://myaccount.file.core.windows.net/myshare/mydirectory/myfile%25\".\n * @param pipeline - Call newPipeline() to create a default\n * pipeline, or provide a customized pipeline.\n */\n constructor(url: string, pipeline: Pipeline, options?: ShareClientConfig);\n constructor(\n url: string,\n credentialOrPipeline?: Credential | TokenCredential | Pipeline,\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n options?: ShareClientOptions,\n ) {\n let pipeline: Pipeline;\n if (isPipelineLike(credentialOrPipeline)) {\n pipeline = credentialOrPipeline;\n } else if (\n credentialOrPipeline instanceof Credential ||\n isTokenCredential(credentialOrPipeline)\n ) {\n pipeline = newPipeline(credentialOrPipeline, options);\n } else {\n // The second parameter is undefined. Use anonymous credential.\n pipeline = newPipeline(new AnonymousCredential(), options);\n }\n\n super(url, pipeline);\n ({\n baseName: this._name,\n shareName: this._shareName,\n path: this._path,\n } = getShareNameAndPathFromUrl(this.url));\n this.shareClientConfig = options;\n this.context = this.storageClientContext.file;\n }\n\n /**\n * Creates a new ShareFileClient object identical to the source but with the specified share snapshot timestamp.\n * Provide \"\" will remove the snapshot and return a URL to the base ShareFileClient.\n *\n * @param shareSnapshot - The share snapshot timestamp.\n * @returns A new ShareFileClient object identical to the source but with the specified share snapshot timestamp.\n */\n public withShareSnapshot(shareSnapshot: string): ShareFileClient {\n return new ShareFileClient(\n setURLParameter(\n this.url,\n URLConstants.Parameters.SHARE_SNAPSHOT,\n shareSnapshot.length === 0 ? undefined : shareSnapshot,\n ),\n this.pipeline,\n this.shareClientConfig,\n );\n }\n\n /**\n * Creates a new file or replaces a file. Note it only initializes the file with no content.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-file\n *\n * @param size - Specifies the maximum size in bytes for the file, up to 4 TB.\n * @param options - Options to File Create operation.\n * @returns Response data for the File Create operation.\n *\n * Example usage:\n *\n * ```js\n * const content = \"Hello world!\";\n *\n * // Create the file\n * await fileClient.create(content.length);\n * console.log(\"Created file successfully!\");\n *\n * // Then upload data to the file\n * await fileClient.uploadRange(content, 0, content.length);\n * console.log(\"Updated file successfully!\")\n * ```\n */\n public async create(size: number, options: FileCreateOptions = {}): Promise<FileCreateResponse> {\n if (size < 0 || size > FILE_MAX_SIZE_BYTES) {\n throw new RangeError(`File size must >= 0 and < ${FILE_MAX_SIZE_BYTES}.`);\n }\n options = validateAndSetDefaultsForFileAndDirectoryCreateCommonOptions(options);\n\n options.fileHttpHeaders = options.fileHttpHeaders || {};\n return tracingClient.withSpan(\"ShareFileClient-create\", options, async (updatedOptions) => {\n return assertResponse<FileCreateHeaders, FileCreateHeaders>(\n await this.context.create(\n size,\n updatedOptions.fileAttributes\n ? fileAttributesToString(updatedOptions.fileAttributes!)\n : FileAttributesNone,\n {\n ...updatedOptions,\n fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime),\n fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime),\n fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime),\n ...this.shareClientConfig,\n },\n ),\n );\n });\n }\n\n /**\n * Reads or downloads a file from the system, including its metadata and properties.\n *\n * * In Node.js, data returns in a Readable stream `readableStreamBody`\n * * In browsers, data returns in a promise `contentAsBlob`\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-file\n *\n * @param offset - From which position of the file to download, greater than or equal to 0\n * @param count - How much data to be downloaded, greater than 0. Will download to the end when undefined\n * @param options - Options to File Download operation.\n * @returns Response data for the File Download operation.\n *\n * Example usage (Node.js):\n *\n * ```js\n * // Download a file to a string\n * const downloadFileResponse = await fileClient.download();\n * console.log(\n * \"Downloaded file content:\",\n * (await streamToBuffer(downloadFileResponse.readableStreamBody)).toString()}\n * );\n *\n * // A helper method used to read a Node.js readable stream into string\n * async function streamToBuffer(readableStream) {\n * return new Promise((resolve, reject) => {\n * const chunks = [];\n * readableStream.on(\"data\", (data) => {\n * chunks.push(data instanceof Buffer ? data : Buffer.from(data));\n * });\n * readableStream.on(\"end\", () => {\n * resolve(Buffer.concat(chunks));\n * });\n * readableStream.on(\"error\", reject);\n * });\n * }\n * ```\n *\n * Example usage (browsers):\n *\n * ```js\n * // Download a file to a string\n * const downloadFileResponse = await fileClient.download(0);\n * console.log(\n * \"Downloaded file content:\",\n * await blobToString(await downloadFileResponse.blobBody)}\n * );\n *\n * // A helper method used to convert a browser Blob into string.\n * export async function blobToString(blob: Blob): Promise<string> {\n * const fileReader = new FileReader();\n * return new Promise<string>((resolve, reject) => {\n * fileReader.onloadend = (ev: any) => {\n * resolve(ev.target!.result);\n * };\n * fileReader.onerror = reject;\n * fileReader.readAsText(blob);\n * });\n * }\n * ```\n */\n public async download(\n offset: number = 0,\n count?: number,\n options: FileDownloadOptions = {},\n ): Promise<FileDownloadResponseModel> {\n return tracingClient.withSpan(\"ShareFileClient-download\", options, async (updatedOptions) => {\n if (updatedOptions.rangeGetContentMD5 && offset === 0 && count === undefined) {\n throw new RangeError(`rangeGetContentMD5 only works with partial data downloading`);\n }\n\n const downloadFullFile = offset === 0 && !count;\n const res = assertResponse<RawFileDownloadResponse, FileDownloadHeaders>(\n await this.context.download({\n ...updatedOptions,\n requestOptions: {\n onDownloadProgress: isNode ? undefined : updatedOptions.onProgress, // for Node.js, progress is reported by RetriableReadableStream\n },\n range: downloadFullFile ? undefined : rangeToString({ offset, count }),\n ...this.shareClientConfig,\n }),\n );\n\n // Return browser response immediately\n if (!isNode) {\n return res;\n }\n\n // We support retrying when download stream unexpected ends in Node.js runtime\n // Following code shouldn't be bundled into browser build, however some\n // bundlers may try to bundle following code and \"FileReadResponse.ts\".\n // In this case, \"FileDownloadResponse.browser.ts\" will be used as a shim of \"FileDownloadResponse.ts\"\n // The config is in package.json \"browser\" field\n if (updatedOptions.maxRetryRequests === undefined || updatedOptions.maxRetryRequests < 0) {\n // TODO: Default value or make it a required parameter?\n updatedOptions.maxRetryRequests = DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS;\n }\n\n if (res.contentLength === undefined) {\n throw new RangeError(`File download response doesn't contain valid content length header`);\n }\n\n return new FileDownloadResponse(\n res,\n async (start: number): Promise<NodeJS.ReadableStream> => {\n const updatedDownloadOptions: FileDownloadOptionalParams = {\n range: rangeToString({\n count: offset + res.contentLength! - start,\n offset: start,\n }),\n };\n\n // Debug purpose only\n // console.log(\n // `Read from internal stream, range: ${\n // chunkDownloadOptions.range\n // }, options: ${JSON.stringify(chunkDownloadOptions)}`\n // );\n\n const downloadRes = await this.context.download({\n ...updatedOptions,\n ...updatedDownloadOptions,\n ...this.shareClientConfig, // TODO: confirm whether this is needed\n });\n\n if (!(downloadRes.etag === res.etag)) {\n throw new Error(\"File has been modified concurrently\");\n }\n return downloadRes.readableStreamBody!;\n },\n offset,\n res.contentLength!,\n {\n maxRetryRequests: updatedOptions.maxRetryRequests,\n onProgress: updatedOptions.onProgress,\n },\n );\n });\n }\n\n /**\n * Returns true if the specified file exists; false otherwise.\n *\n * NOTE: use this function with care since an existing file might be deleted by other clients or\n * applications. Vice versa new files might be added by other clients or applications after this\n * function completes.\n *\n * @param options - options to Exists operation.\n */\n public async exists(options: FileExistsOptions = {}): Promise<boolean> {\n return tracingClient.withSpan(\"ShareFileClient-exists\", options, async (updatedOptions) => {\n try {\n await this.getProperties(updatedOptions);\n return true;\n } catch (e: any) {\n if (e.statusCode === 404) {\n return false;\n }\n throw e;\n }\n });\n }\n\n /**\n * Returns all user-defined metadata, standard HTTP properties, and system properties\n * for the file. It does not return the content of the file.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-file-properties\n *\n * @param options - Options to File Get Properties operation.\n * @returns Response data for the File Get Properties operation.\n */\n public async getProperties(\n options: FileGetPropertiesOptions = {},\n ): Promise<FileGetPropertiesResponse> {\n return tracingClient.withSpan(\n \"ShareFileClient-getProperties\",\n options,\n async (updatedOptions) => {\n return assertResponse<FileGetPropertiesHeaders, FileGetPropertiesHeaders>(\n await this.context.getProperties({ ...updatedOptions, ...this.shareClientConfig }),\n );\n },\n );\n }\n\n /**\n * Sets properties on the file.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-file-properties\n *\n * @param properties - File properties. For file HTTP headers(e.g. Content-Type),\n * if no values are provided, existing HTTP headers will be removed.\n * For other file properties(e.g. fileAttributes), if no values are provided,\n * existing values will be preserved.\n */\n public async setProperties(properties: FileProperties = {}): Promise<SetPropertiesResponse> {\n properties = validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions(properties);\n properties.fileHttpHeaders = properties.fileHttpHeaders || {};\n return tracingClient.withSpan(\n \"ShareFileClient-setProperties\",\n properties,\n async (updatedOptions) => {\n return assertResponse<FileSetHttpHeadersHeaders, FileSetHttpHeadersHeaders>(\n await this.context.setHttpHeaders(\n updatedOptions.fileAttributes\n ? fileAttributesToString(updatedOptions.fileAttributes!)\n : FileAttributesPreserve,\n {\n ...updatedOptions,\n fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime),\n fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime),\n fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime),\n ...this.shareClientConfig,\n },\n ),\n );\n },\n );\n }\n\n /**\n * Removes the file from the storage account.\n * When a file is successfully deleted, it is immediately removed from the storage\n * account's index and is no longer accessible to clients. The file's data is later\n * removed from the service during garbage collection.\n *\n * Delete File will fail with status code 409 (Conflict) and error code SharingViolation\n * if the file is open on an SMB client.\n *\n * Delete File is not supported on a share snapshot, which is a read-only copy of\n * a share. An attempt to perform this operation on a share snapshot will fail with 400 (InvalidQueryParameterValue)\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-file2\n *\n * @param options - Options to File Delete operation.\n * @returns Response data for the File Delete operation.\n */\n public async delete(options: FileDeleteOptions = {}): Promise<FileDeleteResponse> {\n return tracingClient.withSpan(\"ShareFileClient-delete\", options, async (updatedOptions) => {\n return assertResponse<FileDeleteHeaders, FileDeleteHeaders>(\n await this.context.delete({ ...updatedOptions, ...this.shareClientConfig }),\n );\n });\n }\n\n /**\n * Removes the file from the storage account if it exists.\n * When a file is successfully deleted, it is immediately removed from the storage\n * account's index and is no longer accessible to clients. The file's data is later\n * removed from the service during garbage collection.\n *\n * Delete File will fail with status code 409 (Conflict) and error code SharingViolation\n * if the file is open on an SMB client.\n *\n * Delete File is not supported on a share snapshot, which is a read-only copy of\n * a share. An attempt to perform this operation on a share snapshot will fail with 400 (InvalidQueryParameterValue)\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-file2\n *\n * @param options -\n */\n public async deleteIfExists(\n options: FileDeleteOptions = {},\n ): Promise<FileDeleteIfExistsResponse> {\n return tracingClient.withSpan(\n \"ShareFileClient-deleteIfExists\",\n options,\n async (updatedOptions) => {\n try {\n const res = await this.delete(updatedOptions);\n return {\n succeeded: true,\n ...res,\n };\n } catch (e: any) {\n if (\n e.details?.errorCode === \"ResourceNotFound\" ||\n e.details?.errorCode === \"ParentNotFound\"\n ) {\n return {\n succeeded: false,\n ...e.response?.parsedHeaders,\n _response: e.response,\n };\n }\n throw e;\n }\n },\n );\n }\n\n /**\n * Sets HTTP headers on the file.\n *\n * If no option provided, or no value provided for the file HTTP headers in the options,\n * these file HTTP headers without a value will be cleared.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-file-properties\n *\n * @param FileHttpHeaders - File HTTP headers like Content-Type.\n * Provide undefined will remove existing HTTP headers.\n * @param options - Options to File Set HTTP Headers operation.\n * @returns Response data for the File Set HTTP Headers operation.\n */\n public async setHttpHeaders(\n fileHttpHeaders: FileHttpHeaders = {},\n options: FileSetHttpHeadersOptions = {},\n ): Promise<FileSetHTTPHeadersResponse> {\n // FileAttributes, filePermission, createTime, lastWriteTime will all be preserved\n options = validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions(options);\n return tracingClient.withSpan(\n \"ShareFileClient-setHTTPHeaders\",\n options,\n async (updatedOptions) => {\n return assertResponse<FileSetHttpHeadersHeaders, FileSetHttpHeadersHeaders>(\n await this.context.setHttpHeaders(\n updatedOptions.fileAttributes\n ? fileAttributesToString(updatedOptions.fileAttributes!)\n : FileAttributesPreserve,\n {\n ...updatedOptions,\n fileHttpHeaders,\n fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime),\n fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime),\n fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime),\n ...this.shareClientConfig,\n },\n ),\n );\n },\n );\n }\n\n /**\n * Resize file.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-file-properties\n *\n * @param length - Resizes a file to the specified size in bytes.\n * If the specified byte value is less than the current size of the file,\n * then all ranges above the specified byte value are cleared.\n * @param options - Options to File Resize operation.\n * @returns Response data for the File Set HTTP Headers operation.\n */\n public async resize(\n length: number,\n options: FileResizeOptions = {},\n ): Promise<FileSetHTTPHeadersResponse> {\n if (length < 0) {\n throw new RangeError(`Size cannot less than 0 when resizing file.`);\n }\n // FileAttributes, filePermission, createTime, lastWriteTime will all be preserved.\n options = validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions(options);\n return tracingClient.withSpan(\"ShareFileClient-resize\", options, async (updatedOptions) => {\n return assertResponse<FileSetHttpHeadersHeaders, FileSetHttpHeadersHeaders>(\n await this.context.setHttpHeaders(fileAttributesToString(updatedOptions.fileAttributes!), {\n ...updatedOptions,\n fileContentLength: length,\n fileChangeOn: fileChangeTimeToString(options.changeTime),\n fileCreatedOn: fileCreationTimeToString(options.creationTime),\n fileLastWriteOn: fileLastWriteTimeToString(options.lastWriteTime),\n ...this.shareClientConfig,\n }),\n );\n });\n }\n\n /**\n * Updates user-defined metadata for the specified file.\n *\n * If no metadata defined in the option parameter, the file\n * metadata will be removed.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-file-metadata\n *\n * @param metadata - If no metadata provided, all existing directory metadata will be removed\n * @param options - Options to File Set Metadata operation.\n * @returns Response data for the File Set Metadata operation.\n */\n public async setMetadata(\n metadata: Metadata = {},\n options: FileSetMetadataOptions = {},\n ): Promise<FileSetMetadataResponse> {\n return tracingClient.withSpan(\n \"ShareFileClient-setMetadata\",\n options,\n async (updatedOptions) => {\n return assertResponse<FileSetMetadataHeaders, FileSetMetadataHeaders>(\n await this.context.setMetadata({\n ...updatedOptions,\n metadata,\n ...this.shareClientConfig,\n }),\n );\n },\n );\n }\n\n /**\n * Upload a range of bytes to a file. This operation can only be called on an existing file.\n * It won't change the size, properties or metadata of the file.\n * Both the start and count of the range must be specified. The range can be up to 4 MB in size.\n *\n * @param body - Blob, string, ArrayBuffer, ArrayBufferView or a function\n * which returns a new Readable stream whose offset is from data source beginning.\n * @param offset - Offset position of the destination Azure File to upload.\n * @param contentLength - Length of body in bytes. Use Buffer.byteLength() to calculate body length for a\n * string including non non-Base64/Hex-encoded characters.\n * @param options - Options to File Upload Range operation.\n * @returns Response data for the File Upload Range operation.\n *\n * Example usage:\n *\n * ```js\n * const content = \"Hello world!\";\n *\n * // Create the file\n * await fileClient.create(content.length);\n * console.log(\"Created file successfully!\");\n *\n * // Then upload data to the file\n * await fileClient.uploadRange(content, 0, content.length);\n * console.log(\"Updated file successfully!\")\n * ```\n */\n public async uploadRange(\n body: HttpRequestBody,\n offset: number,\n contentLength: number,\n options: FileUploadRangeOptions = {},\n ): Promise<FileUploadRangeResponse> {\n return tracingClient.withSpan(\n \"ShareFileClient-uploadRange\",\n options,\n async (updatedOptions) => {\n if (offset < 0) {\n throw new RangeError(`offset must be >= 0`);\n }\n\n if (contentLength <= 0 || contentLength > FILE_RANGE_MAX_SIZE_BYTES) {\n throw new RangeError(\n `contentLength must be > 0 and <= ${FILE_RANGE_MAX_SIZE_BYTES} bytes`,\n );\n }\n\n if (contentLength > FILE_RANGE_MAX_SIZE_BYTES) {\n throw new RangeError(`offset must be < ${FILE_RANGE_MAX_SIZE_BYTES} bytes`);\n }\n\n return assertResponse<FileUploadRangeHeaders, FileUploadRangeHeaders>(\n await this.context.uploadRange(\n rangeToString({ count: contentLength, offset }),\n \"update\",\n contentLength,\n {\n ...updatedOptions,\n requestOptions: {\n onUploadProgress: updatedOptions.onProgress,\n },\n body,\n ...this.shareClientConfig,\n },\n ),\n );\n },\n );\n }\n\n /**\n * Upload a range of bytes to a file where the contents are read from a another file's URL.\n * The range can be up to 4 MB in size.\n *\n * @param sourceURL - Specify a URL to the copy source, Shared Access Signature(SAS) maybe needed for authentication.\n * @param sourceOffset - The source offset to copy from. Pass 0 to copy from the beginning of source file.\n * @param destOffset - Offset of destination file.\n * @param count - Number of bytes to be uploaded from source file.\n * @param options - Options to configure File - Upload Range from URL operation.\n */\n public async uploadRangeFromURL(\n sourceURL: string,\n sourceOffset: number,\n destOffset: number,\n count: number,\n options: FileUploadRangeFromURLOptions = {},\n ): Promise<FileUploadRangeFromURLResponse> {\n return tracingClient.withSpan(\n \"ShareFileClient-uploadRangeFromURL\",\n options,\n async (updatedOptions) => {\n if (sourceOffset < 0 || destOffset < 0) {\n throw new RangeError(`sourceOffset and destOffset must be >= 0`);\n }\n\n if (count <= 0 || count > FILE_RANGE_MAX_SIZE_BYTES) {\n throw new RangeError(`count must be > 0 and <= ${FILE_RANGE_MAX_SIZE_BYTES} bytes`);\n }\n\n return assertResponse<FileUploadRangeFromURLHeaders, FileUploadRangeFromURLHeaders>(\n await this.context.uploadRangeFromURL(\n rangeToString({ offset: destOffset, count }),\n sourceURL,\n 0,\n {\n ...updatedOptions,\n sourceRange: rangeToString({ offset: sourceOffset, count }),\n sourceModifiedAccessConditions: updatedOptions.sourceConditions,\n copySourceAuthorization: httpAuthorizationToString(\n updatedOptions.sourceAuthorization,\n ),\n ...this.shareClientConfig,\n },\n ),\n );\n },\n );\n }\n /**\n * Clears the specified range and\n * releases the space used in storage for that range.\n *\n * @param offset -\n * @param contentLength -\n * @param options - Options to File Clear Range operation.\n */\n public async clearRange(\n offset: number,\n contentLength: number,\n options: FileClearRangeOptions = {},\n ): Promise<FileUploadRangeResponse> {\n return tracingClient.withSpan(\"ShareFileClient-clearRange\", options, async (updatedOptions) => {\n if (offset < 0 || contentLength <= 0) {\n throw new RangeError(`offset must >= 0 and contentLength must be > 0`);\n }\n\n return assertResponse<FileUploadRangeHeaders, FileUploadRangeHeaders>(\n await this.context.uploadRange(\n rangeToString({ count: contentLength, offset }),\n \"clear\",\n 0,\n { ...updatedOptions, ...this.shareClientConfig },\n ),\n );\n });\n }\n\n /**\n * Returns the list of valid ranges for a file.\n *\n * @param options - Options to File Get range List operation.\n */\n public async getRangeList(\n options: FileGetRangeListOptions = {},\n ): Promise<FileGetRangeListResponse> {\n return tracingClient.withSpan(\n \"ShareFileClient-getRangeList\",\n options,\n async (updatedOptions) => {\n const originalResponse = assertResponse<\n FileGetRangeListHeaders & ShareFileRangeList,\n FileGetRangeListHeaders,\n ShareFileRangeList\n >(\n await this.context.getRangeList({\n ...updatedOptions,\n range: updatedOptions.range ? rangeToString(updatedOptions.range) : undefined,\n ...this.shareClientConfig,\n }),\n );\n\n // Only returns ranges, ignoring clearRanges.\n const parsedBody = originalResponse._response.parsedBody.ranges\n ? originalResponse._response.parsedBody.ranges\n : [];\n return {\n ...originalResponse,\n _response: { ...originalResponse._response, parsedBody },\n rangeList: originalResponse.ranges ? originalResponse.ranges : [],\n };\n },\n );\n }\n\n /**\n * Returns the list of ranges that differ between a previous share snapshot and this file.\n *\n * @param prevShareSnapshot - The previous snapshot parameter is an opaque DateTime value that specifies the previous share snapshot to compare with.\n * @param options -\n */\n public async getRangeListDiff(\n prevShareSnapshot: string,\n options: FileGetRangeListOptions = {},\n ): Promise<FileGetRangeListDiffResponse> {\n return tracingClient.withSpan(\n \"ShareFileClient-getRangeListDiff\",\n options,\n async (updatedOptions) => {\n return assertResponse<\n FileGetRangeListHeaders & ShareFileRangeList,\n FileGetRangeListHeaders,\n ShareFileRangeList\n >(\n await this.context.getRangeList({\n ...updatedOptions,\n prevsharesnapshot: prevShareSnapshot,\n supportRename: options.includeRenames,\n range: updatedOptions.range ? rangeToString(updatedOptions.range) : undefined,\n ...this.shareClientConfig,\n }),\n );\n },\n );\n }\n\n /**\n * Copies a blob or file to a destination file within the storage account.\n *\n * @param copySource - Specifies the URL of the source file or blob, up to 2 KB in length.\n * To copy a file to another file within the same storage account, you may use Shared Key to\n * authenticate the source file. If you are copying a file from another storage account, or if you\n * are copying a blob from the same storage account or another storage account, then you must\n * authenticate the source file or blob using a shared access signature. If the source is a public\n * blob, no authentication is required to perform the copy operation. A file in a share snapshot\n * can also be specified as a copy source.\n * @param options - Options to File Start Copy operation.\n */\n public async startCopyFromURL(\n copySource: string,\n options: FileStartCopyOptions = {},\n ): Promise<FileStartCopyResponse> {\n return tracingClient.withSpan(\n \"ShareFileClient-startCopyFromURL\",\n options,\n async (updatedOptions) => {\n return assertResponse<FileStartCopyHeaders, FileStartCopyHeaders>(\n await this.context.startCopy(copySource, {\n ...updatedOptions,\n ...this.shareClientConfig,\n }),\n );\n },\n );\n }\n\n /**\n * Aborts a pending Copy File operation, and leaves a destination file with zero length and full\n * metadata.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/abort-copy-file\n *\n * @param copyId - Id of the Copy File operation to abort.\n * @param options - Options to File Abort Copy From URL operation.\n */\n public async abortCopyFromURL(\n copyId: string,\n options: FileAbortCopyFromURLOptions = {},\n ): Promise<FileAbortCopyResponse> {\n return tracingClient.withSpan(\n \"ShareFileClient-abortCopyFromURL\",\n options,\n async (updatedOptions) => {\n return assertResponse<FileAbortCopyHeaders, FileAbortCopyHeaders>(\n await this.context.abortCopy(copyId, { ...updatedOptions, ...this.shareClientConfig }),\n );\n },\n );\n }\n\n // High Level functions\n\n /**\n * Creates a new Azure File or replaces an existing Azure File, and then uploads a Buffer(Node)/Blob/ArrayBuffer/ArrayBufferView to it.\n *\n * @param data - Buffer(Node), Blob, ArrayBuffer or ArrayBufferView\n * @param options -\n */\n public async uploadData(\n data: Buffer | Blob | ArrayBuffer | ArrayBufferView,\n options: FileParallelUploadOptions = {},\n ): Promise<void> {\n return tracingClient.withSpan(\"ShareFileClient-uploadData\", options, async (updatedOptions) => {\n if (isNode) {\n let buffer: Buffer;\n if (data instanceof Buffer) {\n buffer = data;\n } else if (data instanceof ArrayBuffer) {\n buffer = Buffer.from(data);\n } else {\n data = data as ArrayBufferView;\n buffer = Buffer.from(data.buffer, data.byteOffset, data.byteLength);\n }\n\n return this.uploadSeekableInternal(\n (offset: number, size: number): Buffer => buffer.slice(offset, offset + size),\n buffer.byteLength,\n updatedOptions,\n );\n } else {\n const browserBlob = new Blob([data]);\n return this.uploadSeekableInternal(\n (offset: number, size: number): Blob => browserBlob.slice(offset, offset + size),\n browserBlob.size,\n updatedOptions,\n );\n }\n });\n }\n\n /**\n * ONLY AVAILABLE IN BROWSERS.\n *\n * Uploads a browser Blob object to an Azure file. Requires a blobFactory as the data source,\n * which need to return a Blob object with the offset and size provided.\n *\n * @param blobFactory -\n * @param size -\n * @param options -\n */\n async uploadSeekableBlob(\n blobFactory: (offset: number, size: number) => Blob,\n size: number,\n options: FileParallelUploadOptions = {},\n ): Promise<void> {\n return tracingClient.withSpan(\n \"ShareFileClient-UploadSeekableBlob\",\n options,\n async (updatedOptions) => {\n return this.uploadSeekableInternal(blobFactory, size, updatedOptions);\n },\n );\n }\n\n /**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * Creates a new Azure File or replaces an existing Azure File, and then uploads a local file to it.\n *\n * @param filePath - Full path of local file\n * @param fileClient - ShareFileClient\n * @param options -\n */\n public async uploadFile(\n filePath: string,\n options: FileParallelUploadOptions = {},\n ): Promise<void> {\n return tracingClient.withSpan(\"ShareFileClient-uploadFile\", options, async (updatedOptions) => {\n const size = (await fsStat(filePath)).size;\n return this.uploadSeekableInternal(\n (offset, count) => {\n return () =>\n fsCreateReadStream(filePath, {\n autoClose: true,\n end: count ? offset + count - 1 : Infinity,\n start: offset,\n });\n },\n size,\n updatedOptions,\n );\n });\n }\n\n /**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * Accepts a Node.js Readable stream factory, and uploads in blocks to an Azure File.\n * The Readable stream factory must returns a Node.js Readable stream starting from the offset defined. The offset\n * is the offset in the Azure file to be uploaded.\n *\n * @param streamFactory - Returns a Node.js Readable stream starting\n * from the offset defined\n * @param size - Size of the Azure file\n * @param fileClient - ShareFileClient\n * @param options -\n */\n async uploadResetableStream(\n streamFactory: (offset: number, count?: number) => NodeJS.ReadableStream,\n size: number,\n options: FileParallelUploadOptions = {},\n ): Promise<void> {\n return tracingClient.withSpan(\n \"ShareFileClient-uploadResetableStream\",\n options,\n async (updatedOptions) => {\n return this.uploadSeekableInternal(\n (offset: number, count?: number) => {\n return () => streamFactory(offset, count);\n },\n size,\n updatedOptions,\n );\n },\n );\n }\n\n /**\n *\n * @param bodyFactory -\n * @param size - Size of the Azure file\n * @param fileClient - ShareFileClient\n * @param options -\n */\n private async uploadSeekableInternal(\n bodyFactory: (offset: number, count: number) => HttpRequestBody,\n size: number,\n options: FileParallelUploadOptions = {},\n ): Promise<void> {\n return tracingClient.withSpan(\n \"ShareFileClient-uploadSeekableInternal\",\n options,\n async (updatedOptions) => {\n if (!options.rangeSize) {\n options.rangeSize = FILE_RANGE_MAX_SIZE_BYTES;\n }\n if (options.rangeSize < 0 || options.rangeSize > FILE_RANGE_MAX_SIZE_BYTES) {\n throw new RangeError(`options.rangeSize must be > 0 and <= ${FILE_RANGE_MAX_SIZE_BYTES}`);\n }\n\n if (!options.fileHttpHeaders) {\n options.fileHttpHeaders = {};\n }\n\n if (!options.concurrency) {\n options.concurrency = DEFAULT_HIGH_LEVEL_CONCURRENCY;\n }\n if (options.concurrency < 0) {\n throw new RangeError(`options.concurrency cannot less than 0.`);\n }\n\n // Create the file\n await this.create(size, {\n abortSignal: options.abortSignal,\n fileHttpHeaders: options.fileHttpHeaders,\n metadata: options.metadata,\n leaseAccessConditions: options.leaseAccessConditions,\n tracingOptions: updatedOptions.tracingOptions,\n });\n\n const numBlocks: number = Math.floor((size - 1) / options.rangeSize) + 1;\n let transferProgress: number = 0;\n const batch = new Batch(options.concurrency);\n\n for (let i = 0; i < numBlocks; i++) {\n batch.addOperation(async (): Promise<any> => {\n const start = options.rangeSize! * i;\n const end = i === numBlocks - 1 ? size : start + options.rangeSize!;\n const contentLength = end - start;\n await this.uploadRange(bodyFactory(start, contentLength), start, contentLength, {\n abortSignal: options.abortSignal,\n leaseAccessConditions: options.leaseAccessConditions,\n tracingOptions: updatedOptions.tracingOptions,\n });\n // Update progress after block is successfully uploaded to server, in case of block trying\n transferProgress += contentLength;\n if (options.onProgress) {\n options.onProgress({ loadedBytes: transferProgress });\n }\n });\n }\n return batch.do();\n },\n );\n }\n\n /**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * Downloads an Azure file in parallel to a buffer.\n * Offset and count are optional, pass 0 for both to download the entire file.\n *\n * Warning: Buffers can only support files up to about one gigabyte on 32-bit systems or about two\n * gigabytes on 64-bit systems due to limitations of Node.js/V8. For files larger than this size,\n * consider {@link downloadToFile}.\n *\n * @param buffer - Buffer to be fill, must have length larger than count\n * @param offset - From which position of the Azure File to download\n * @param count - How much data to be downloaded. Will download to the end when passing undefined\n * @param options -\n */\n public async downloadToBuffer(\n buffer: Buffer,\n offset?: number,\n count?: number,\n options?: FileDownloadToBufferOptions,\n ): Promise<Buffer>;\n\n /**\n * ONLY AVAILABLE IN NODE.JS RUNTIME\n *\n * Downloads an Azure file in parallel to a buffer.\n * Offset and count are optional, pass 0 for both to download the entire file\n *\n * Warning: Buffers can only support files up to about one gigabyte on 32-bit systems or about two\n * gigabytes on 64-bit systems due to limitations of Node.js/V8. For files larger than this size,\n * consider {@link downloadToFile}.\n *\n * @param offset - From which position of the Azure file to download\n * @param count - How much data to be downloaded. Will download to the end when passing undefined\n * @param options -\n */\n public async downloadToBuffer(\n offset?: number,\n count?: number,\n options?: FileDownloadToBufferOptions,\n ): Promise<Buffer>;\n\n public async downloadToBuffer(\n bufferOrOffset?: Buffer | number,\n offsetOrCount?: number,\n countOrOptions?: FileDownloadToBufferOptions | number,\n optOptions: FileDownloadToBufferOptions = {},\n ): Promise<Buffer> {\n let buffer: Buffer | undefined = undefined;\n let offset: number;\n let count: number;\n let options: FileDownloadToBufferOptions = optOptions;\n\n if (bufferOrOffset instanceof Buffer) {\n buffer = bufferOrOffset;\n offset = offsetOrCount || 0;\n count = typeof countOrOptions === \"number\" ? countOrOptions : 0;\n } else {\n offset = typeof bufferOrOffset === \"number\" ? bufferOrOffset : 0;\n count = typeof offsetOrCount === \"number\" ? offsetOrCount : 0;\n options = (countOrOptions as FileDownloadToBufferOptions) || {};\n }\n\n return tracingClient.withSpan(\n \"ShareFileClient-downloadToBuffer\",\n options,\n async (updatedOptions) => {\n if (!options.rangeSize) {\n options.rangeSize = FILE_RANGE_MAX_SIZE_BYTES;\n }\n if (options.rangeSize < 0) {\n throw new RangeError(\"rangeSize option must be > 0\");\n }\n\n if (offset < 0) {\n throw new RangeError(\"offset option must be >= 0\");\n }\n\n if (count && count <= 0) {\n throw new RangeError(\"count option must be > 0\");\n }\n\n if (!options.concurrency) {\n options.concurrency = DEFAULT_HIGH_LEVEL_CONCURRENCY;\n }\n if (options.concurrency < 0) {\n throw new RangeError(`options.concurrency cannot less than 0.`);\n }\n\n // Customer doesn't specify length, get it\n if (!count) {\n const response = await this.getProperties({\n abortSignal: options.abortSignal,\n leaseAccessConditions: options.leaseAccessConditions,\n tracingOptions: updatedOptions.tracingOptions,\n });\n count = response.contentLength! - offset;\n if (count < 0) {\n throw new RangeError(\n `offset ${offset} shouldn't be larger than file size ${response.contentLength!}`,\n );\n }\n }\n\n if (!buffer) {\n try {\n buffer = Buffer.alloc(count);\n } catch (error: any) {\n throw new Error(\n `Unable to allocate a buffer of size: ${count} bytes. Please try passing your own Buffer to ` +\n 'the \"downloadToBuffer method or try using other methods like \"download\" or \"downloadToFile\".' +\n `\\t ${error.message}`,\n );\n }\n }\n\n if (buffer.length < count) {\n throw new RangeError(\n `The buffer's size should be equal to or larger than the request count of bytes: ${count}`,\n );\n }\n\n let transferProgress: number = 0;\n const batch = new Batch(options.concurrency);\n for (let off = offset; off < offset + count; off = off + options.rangeSize) {\n batch.addOperation(async () => {\n // Exclusive chunk end position\n let chunkEnd = offset + count!;\n if (off + options.rangeSize! < chunkEnd) {\n chunkEnd = off + options.rangeSize!;\n }\n const response = await this.download(off, chunkEnd - off, {\n abortSignal: options.abortSignal,\n maxRetryRequests: options.maxRetryRequestsPerRange,\n leaseAccessConditions: options.leaseAccessConditions,\n tracingOptions: updatedOptions.tracingOptions,\n });\n const stream = response.readableStreamBody!;\n await streamToBuffer(stream, buffer!, off - offset, chunkEnd - offset);\n // Update progress after block is downloaded, in case of block trying\n // Could provide finer grained progress updating inside HTTP requests,\n // only if convenience layer download try is enabled\n transferProgress += chunkEnd - off;\n if (options.onProgress) {\n options.onProgress({ loadedBytes: transferProgress });\n }\n });\n }\n await batch.do();\n return buffer;\n },\n );\n }\n\n /**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * Creates a new Azure File or replaces an existing Azure File, and then uploads a Node.js Readable stream into it.\n * This method will try to create an Azure File, then starts uploading chunk by chunk.\n * Size of chunk is defined by `bufferSize` parameter.\n * Please make sure potential size of stream doesn't exceed file size.\n *\n * PERFORMANCE IMPROVEMENT TIPS:\n * * Input stream highWaterMark is better to set a same value with bufferSize\n * parameter, which will avoid Buffer.concat() operations.\n *\n * @param stream - Node.js Readable stream. Must be less or equal than file size.\n * @param size - Size of file to be created. Maximum size allowed is 4 TB.\n * If this value is larger than stream size, there will be empty bytes in file tail.\n * @param bufferSize - Size of every buffer allocated in bytes, also the chunk/range size during\n * the uploaded file. Size must be greater than 0 and lesser than or equal to 4 * 1024 * 1024 (4MB)\n * @param maxBuffers - Max buffers will allocate during uploading, positive correlation\n * with max uploading concurrency\n * @param options -\n */\n public async uploadStream(\n stream: Readable,\n size: number,\n bufferSize: number,\n maxBuffers: number,\n options: FileUploadStreamOptions = {},\n ): Promise<void> {\n return tracingClient.withSpan(\n \"ShareFileClient-uploadStream\",\n options,\n async (updatedOptions) => {\n if (!options.fileHttpHeaders) {\n options.fileHttpHeaders = {};\n }\n\n if (bufferSize <= 0 || bufferSize > FILE_RANGE_MAX_SIZE_BYTES) {\n throw new RangeError(`bufferSize must be > 0 and <= ${FILE_RANGE_MAX_SIZE_BYTES}`);\n }\n\n if (maxBuffers < 0) {\n throw new RangeError(`maxBuffers must be > 0.`);\n }\n\n // Create the file\n await this.create(size, {\n abortSignal: options.abortSignal,\n fileHttpHeaders: options.fileHttpHeaders,\n metadata: options.metadata,\n leaseAccessConditions: options.leaseAccessConditions,\n tracingOptions: updatedOptions.tracingOptions,\n });\n\n let transferProgress: number = 0;\n const scheduler = new BufferScheduler(\n stream,\n bufferSize,\n maxBuffers,\n async (buffer: Buffer, offset?: number) => {\n if (transferProgress + buffer.length > size) {\n throw new RangeError(\n `Stream size is larger than file size ${size} bytes, uploading failed. ` +\n `Please make sure stream length is less or equal than file size.`,\n );\n }\n\n await this.uploadRange(buffer, offset!, buffer.length, {\n abortSignal: options.abortSignal,\n leaseAccessConditions: options.leaseAccessConditions,\n tracingOptions: updatedOptions.tracingOptions,\n });\n\n // Update progress after block is successfully uploaded to server, in case of block trying\n transferProgress += buffer.length;\n if (options.onProgress) {\n options.onProgress({ loadedBytes: transferProgress });\n }\n },\n // Concurrency should set a smaller value than maxBuffers, which is helpful to\n // reduce the possibility when a outgoing handler waits for stream data, in\n // this situation, outgoing handlers are blocked.\n // Outgoing queue shouldn't be empty.\n Math.ceil((maxBuffers / 4) * 3),\n );\n return scheduler.do();\n },\n );\n }\n\n /**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * Downloads an Azure Blob to a local file.\n * Fails if the the given file path already exits.\n * Offset and count are optional, pass 0 and undefined respectively to download the entire blob.\n *\n * @param filePath -\n * @param offset - From which position of the block blob to download.\n * @param count - How much data to be downloaded. Will download to the end when passing undefined.\n * @param options - Options to Blob download options.\n * @returns The response data for blob download operation,\n * but with readableStreamBody set to undefined since its\n * content is already read and written into a local file\n * at the specified path.\n */\n public async downloadToFile(\n filePath: string,\n offset: number = 0,\n count?: number,\n options: FileDownloadOptions = {},\n ): Promise<FileDownloadResponseModel> {\n return tracingClient.withSpan(\n \"ShareFileClient-downloadToFile\",\n options,\n async (updatedOptions) => {\n const response = await this.download(offset, count, updatedOptions);\n if (response.readableStreamBody) {\n await readStreamToLocalFile(response.readableStreamBody, filePath);\n }\n\n // The stream is no longer accessible so setting it to undefined.\n (response as any).fileDownloadStream = undefined;\n return response;\n },\n );\n }\n\n /**\n * Lists handles for a file.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/list-handles\n *\n * @param marker - Optional. A string value that identifies the portion of the list to be\n * returned with the next list handles operation. The operation returns a\n * marker value within the response body if the list returned was not complete.\n * The marker value may then be used in a subsequent call to request the next\n * set of list items.\n * @param options -\n */\n private async listHandlesSegment(\n marker?: string,\n options: FileListHandlesSegmentOptions = {},\n ): Promise<FileListHandlesResponse> {\n return tracingClient.withSpan(\n \"ShareFileClient-listHandlesSegment\",\n options,\n async (updatedOptions) => {\n marker = marker === \"\" ? undefined : marker;\n const response = assertResponse<\n FileListHandlesHeaders & GeneratedListHandlesResponse,\n FileListHandlesHeaders,\n GeneratedListHandlesResponse\n >(\n await this.context.listHandles({\n ...updatedOptions,\n ...this.shareClientConfig,\n marker,\n }),\n );\n\n // TODO: Protocol layer issue that when handle list is in returned XML\n // response.handleList is an empty string\n if ((response.handleList as any) === \"\") {\n response.handleList = undefined;\n }\n\n const wrappedResponse: DirectoryListHandlesResponse = {\n ...ConvertInternalResponseOfListHandles(response),\n _response: {\n ...response._response,\n parsedBody: ConvertInternalResponseOfListHandles(response._response.parsedBody),\n },\n };\n\n return wrappedResponse;\n },\n );\n }\n\n /**\n * Returns an AsyncIterableIterator for FileListHandlesResponse\n *\n * @param marker - A string value that identifies the portion of the list to be\n * returned with the next list handles operation. The operation returns a\n * marker value within the response body if the list returned was not complete.\n * The marker value may then be used in a subsequent call to request the next\n * set of list items.\n * @param options - Options to list handles operation.\n */\n private async *iterateHandleSegments(\n marker?: string,\n options: FileListHandlesSegmentOptions = {},\n ): AsyncIterableIterator<FileListHandlesResponse> {\n let listHandlesResponse;\n if (!!marker || marker === undefined) {\n do {\n listHandlesResponse = await this.listHandlesSegment(marker, options);\n marker = listHandlesResponse.continuationToken;\n yield listHandlesResponse;\n } while (marker);\n }\n }\n\n /**\n * Returns an AsyncIterableIterator for handles\n *\n * @param options - Options to list handles operation.\n */\n private async *listHandleItems(\n options: FileListHandlesSegmentOptions = {},\n ): AsyncIterableIterator<HandleItem> {\n let marker: string | undefined;\n for await (const listHandlesResponse of this.iterateHandleSegments(marker, options)) {\n if (listHandlesResponse.handleList) {\n for (const handle of listHandlesResponse.handleList) {\n yield handle;\n }\n }\n }\n }\n\n /**\n * Returns an async iterable iterator to list all the handles.\n * under the specified account.\n *\n * .byPage() returns an async iterable iterator to list the handles in pages.\n *\n * @param options - Options to list handles operation.\n *\n * An asyncIterableIterator that supports paging.\n */\n public listHandles(\n options: FileListHandlesOptions = {},\n ): PagedAsyncIterableIterator<HandleItem, FileListHandlesResponse> {\n // an AsyncIterableIterator to iterate over handles\n const iter = this.listHandleItems(options);\n return {\n /**\n * The next method, part of the iteration protocol\n */\n async next() {\n return iter.next();\n },\n /**\n * The connection to the async iterator, part of the iteration protocol\n */\n [Symbol.asyncIterator]() {\n return this;\n },\n /**\n * Return an AsyncIterableIterator that works a page at a time\n */\n byPage: (settings: PageSettings = {}) => {\n return this.iterateHandleSegments(removeEmptyString(settings.continuationToken), {\n maxPageSize: settings.maxPageSize,\n ...options,\n });\n },\n };\n }\n\n /**\n * Force close all handles for a file.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/force-close-handles\n *\n * @param marker - Optional. A string value that identifies the position of handles that will\n * be closed with the next force close handles operation.\n * The operation returns a marker value within the response\n * body if there are more handles to close. The marker value\n * may then be used in a subsequent call to close the next set of handles.\n * @param options - Options to force close handles operation.\n */\n private async forceCloseHandlesSegment(\n marker?: string,\n options: FileForceCloseHandlesOptions = {},\n ): Promise<FileForceCloseHandlesResponse> {\n return tracingClient.withSpan(\n \"ShareFileClient-forceCloseHandlesSegment\",\n options,\n async (updatedOptions) => {\n marker = marker === \"\" ? undefined : marker;\n const rawResponse = await this.context.forceCloseHandles(\"*\", {\n ...updatedOptions,\n ...this.shareClientConfig,\n marker,\n });\n const response = rawResponse as FileForceCloseHandlesResponse;\n response.closedHandlesCount = rawResponse.numberOfHandlesClosed || 0;\n response.closeFailureCount = rawResponse.numberOfHandlesFailedToClose || 0;\n return response;\n },\n );\n }\n\n /**\n * Force close all handles for a file.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/force-close-handles\n *\n * @param options - Options to force close handles operation.\n */\n public async forceCloseAllHandles(\n options: FileForceCloseHandlesOptions = {},\n ): Promise<CloseHandlesInfo> {\n return tracingClient.withSpan(\n \"ShareFileClient-forceCloseAllHandles\",\n options,\n async (updatedOptions) => {\n let handlesClosed = 0;\n let numberOfHandlesFailedToClose = 0;\n let marker: string | undefined = \"\";\n\n do {\n const response: FileForceCloseHandlesResponse = await this.forceCloseHandlesSegment(\n marker,\n { tracingOptions: updatedOptions.tracingOptions },\n );\n marker = response.marker;\n if (response.closedHandlesCount) {\n handlesClosed += response.closedHandlesCount;\n }\n if (response.closeFailureCount) {\n numberOfHandlesFailedToClose += response.closeFailureCount;\n }\n } while (marker);\n\n return {\n closedHandlesCount: handlesClosed,\n closeFailureCount: numberOfHandlesFailedToClose,\n };\n },\n );\n }\n\n /**\n * Force close a specific handle for a file.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/force-close-handles\n *\n * @param handleId - Specific handle ID, cannot be asterisk \"*\".\n * Use forceCloseAllHandles() to close all handles.\n * @param FileForceCloseHandlesOptions - Options to force close handles operation.\n */\n public async forceCloseHandle(\n handleId: string,\n options: FileForceCloseHandlesOptions = {},\n ): Promise<FileForceCloseHandlesResponse> {\n return tracingClient.withSpan(\n \"ShareFileClient-forceCloseHandle\",\n options,\n async (updatedOptions) => {\n if (handleId === \"*\") {\n throw new RangeError(\n `Parameter handleID should be a specified handle ID. Use forceCloseHandlesSegment() to close all handles.`,\n );\n }\n\n const rawResponse = await this.context.forceCloseHandles(handleId, {\n ...updatedOptions,\n ...this.shareClientConfig,\n });\n const response = rawResponse as FileForceCloseHandlesResponse;\n response.closedHandlesCount = rawResponse.numberOfHandlesClosed || 0;\n response.closeFailureCount = rawResponse.numberOfHandlesFailedToClose || 0;\n return response;\n },\n );\n }\n\n /**\n * Get a {@link ShareLeaseClient} that manages leases on the file.\n *\n * @param proposeLeaseId - Initial proposed lease Id.\n * @returns A new ShareLeaseClient object for managing leases on the file.\n */\n public getShareLeaseClient(proposeLeaseId?: string): ShareLeaseClient {\n return new ShareLeaseClient(this, proposeLeaseId);\n }\n\n /**\n * Only available for clients constructed with a shared key credential.\n *\n * Generates a Service Shared Access Signature (SAS) URI based on the client properties\n * and parameters passed in. The SAS is signed by the shared key credential of the client.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas\n *\n * @param options - Optional parameters.\n * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.\n */\n public generateSasUrl(options: FileGenerateSasUrlOptions): string {\n if (!(this.credential instanceof StorageSharedKeyCredential)) {\n throw RangeError(\n \"Can only generate the SAS when the client is initialized with a shared key credential\",\n );\n }\n\n const sas = generateFileSASQueryParameters(\n {\n shareName: this.shareName,\n filePath: this.path,\n ...options,\n },\n this.credential,\n ).toString();\n\n return appendToURLQuery(this.url, sas);\n }\n\n /**\n * Only available for clients constructed with a shared key credential.\n *\n * Generates string to sign for a Service Shared Access Signature (SAS) URI based on the client properties\n * and parameters passed in. The SAS is signed by the shared key credential of the client.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas\n *\n * @param options - Optional parameters.\n * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.\n */\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n public generateSasStringToSign(options: FileGenerateSasUrlOptions): string {\n if (!(this.credential instanceof StorageSharedKeyCredential)) {\n throw RangeError(\n \"Can only generate the SAS when the client is initialized with a shared key credential\",\n );\n }\n\n return generateFileSASQueryParametersInternal(\n {\n shareName: this.shareName,\n filePath: this.path,\n ...options,\n },\n this.credential,\n ).stringToSign;\n }\n\n /**\n * Renames a file.\n * This API only supports renaming a file in the same share.\n *\n * @param destinationPath - Specifies the destination path to rename to. The path will be encoded to put into a URL to specify the destination.\n * @param options - Options for the renaming operation.\n * @returns Response data for the file renaming operation.\n *\n * Example usage:\n *\n * ```js\n *\n * // Rename the file\n * await fileClient.rename(destinationPath);\n * console.log(\"Renamed file successfully!\");\n * ```\n */\n public async rename(\n destinationPath: string,\n options: FileRenameOptions = {},\n ): Promise<{\n destinationFileClient: ShareFileClient;\n fileRenameResponse: FileRenameResponse;\n }> {\n const split: string[] = destinationPath.split(\"?\");\n let destinationUrl: string;\n if (split.length === 2) {\n const pathOnly = EscapePath(split[0]);\n const renameDestination = `/${this.shareName}/${pathOnly}`;\n destinationUrl = setURLPath(this.url, renameDestination);\n destinationUrl = setURLQueries(destinationUrl, split[1]);\n } else if (split.length === 1) {\n const pathOnly = EscapePath(destinationPath);\n const renameDestination = `/${this.shareName}/${pathOnly}`;\n destinationUrl = setURLPath(this.url, renameDestination);\n } else {\n throw new RangeError(\"Destination path should not contain more than one query string\");\n }\n\n const destFile = new ShareFileClient(destinationUrl, this.pipeline, this.shareClientConfig);\n return tracingClient.withSpan(\"ShareFileClient-rename\", options, async (updatedOptions) => {\n const response = assertResponse<FileRenameHeaders, FileRenameHeaders>(\n await destFile.context.rename(this.url, {\n ...updatedOptions,\n sourceLeaseAccessConditions: updatedOptions.sourceLeaseAccessConditions\n ? {\n sourceLeaseId: updatedOptions.sourceLeaseAccessConditions.leaseId,\n }\n : undefined,\n destinationLeaseAccessConditions: updatedOptions.destinationLeaseAccessConditions\n ? {\n destinationLeaseId: updatedOptions.destinationLeaseAccessConditions.leaseId,\n }\n : undefined,\n fileHttpHeaders: options.contentType\n ? {\n fileContentType: options.contentType,\n }\n : undefined,\n ...this.shareClientConfig,\n }),\n );\n\n return {\n destinationFileClient: destFile,\n fileRenameResponse: response,\n };\n });\n }\n}\n\n/**\n * The details of the response for a specific lease operation.\n */\nexport interface LeaseOperationResponseHeaders {\n /**\n * The ETag contains a value that you can use to perform operations conditionally. If the request\n * version is 2011-08-18 or newer, the ETag value will be in quotes.\n */\n etag?: string;\n /**\n * Returns the date and time the file was last modified. Any operation that modifies the file,\n * including an update of the file's metadata or properties, changes the last-modified time of\n * the file.\n */\n lastModified?: Date;\n /**\n * Approximate time remaining in the lease period, in seconds. Only availabe for {@link ShareLeaseClient.breakLease} for share lease.\n */\n leaseTimeInSeconds?: number;\n /**\n * Uniquely identifies a file's lease, won't be set when returned by releaseLease.\n */\n leaseId?: string;\n /**\n * This header uniquely identifies the request that was made and can be used for troubleshooting\n * the request.\n */\n requestId?: string;\n /**\n * Indicates the version of the Blob service used to execute the request. This header is returned\n * for requests made against version 2009-09-19 and above.\n */\n version?: string;\n /**\n * UTC date/time value generated by the service that indicates the time at which the response was\n * initiated\n */\n date?: Date;\n errorCode?: string;\n}\n\n/**\n * Contains the response data for operations that acquire, change, break or release a lease.\n *\n * See {@link ShareLeaseClient}.\n */\nexport type LeaseOperationResponse = WithResponse<\n LeaseOperationResponseHeaders,\n LeaseOperationResponseHeaders\n>;\n\n/**\n * lease operations options.\n */\nexport interface LeaseOperationOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * A client that manages leases for a {@link ShareFileClient} or {@link ShareClient}.\n * @see https://docs.microsoft.com/rest/api/storageservices/lease-file\n * and\n * @see https://docs.microsoft.com/rest/api/storageservices/lease-share\n */\nexport class ShareLeaseClient {\n private _leaseId: string;\n private _url: string;\n private fileOrShare: File | Share;\n\n private shareClientConfig?: ShareClientConfig;\n /**\n * Gets the lease Id.\n *\n * @readonly\n */\n public get leaseId(): string {\n return this._leaseId;\n }\n\n /**\n * Gets the url.\n *\n * @readonly\n */\n public get url(): string {\n return this._url;\n }\n\n /**\n * Creates an instance of ShareLeaseClient.\n * @param client - The client to make the lease operation requests.\n * @param leaseId - Initial proposed lease id.\n */\n constructor(client: ShareFileClient | ShareClient, leaseId?: string) {\n const clientContext: StorageClientContext = client[\"storageClientContext\"];\n\n if (client instanceof ShareClient) {\n this.fileOrShare = clientContext.share;\n this.shareClientConfig = client[\"shareClientConfig\"];\n } else {\n this.fileOrShare = clientContext.file;\n this.shareClientConfig = client[\"shareClientConfig\"];\n }\n this._url = client.url;\n\n if (!leaseId) {\n leaseId = randomUUID();\n }\n this._leaseId = leaseId;\n }\n\n /**\n * Establishes and manages a lock on a file, share or share snapshot for write and delete operations.\n *\n * @param duration - Specifies the duration of lease in seconds. For file, the only allowed value is -1 for a lease that never expires. For share, must be -1 or between 15 to 60.\n * @param options - Options for the lease management operation.\n * @returns Response data for acquire lease operation.\n */\n public async acquireLease(\n duration: number = -1,\n options: LeaseOperationOptions = {},\n ): Promise<LeaseOperationResponse> {\n return tracingClient.withSpan(\n \"ShareLeaseClient-acquireLease\",\n options,\n async (updatedOptions) => {\n return assertResponse<LeaseOperationResponseHeaders, LeaseOperationResponseHeaders>(\n await this.fileOrShare.acquireLease({\n ...updatedOptions,\n ...this.shareClientConfig,\n duration,\n proposedLeaseId: this._leaseId,\n }),\n );\n },\n );\n }\n\n /**\n * To change the ID of an existing lease.\n *\n * @param proposedLeaseId - the proposed new lease Id.\n * @param options - Options for the lease management operation.\n * @returns Response data for change lease operation.\n */\n public async changeLease(\n proposedLeaseId: string,\n options: LeaseOperationOptions = {},\n ): Promise<LeaseOperationResponse> {\n return tracingClient.withSpan(\n \"ShareLeaseClient-changeLease\",\n options,\n async (updatedOptions) => {\n const response = assertResponse<\n LeaseOperationResponseHeaders,\n LeaseOperationResponseHeaders\n >(\n await this.fileOrShare.changeLease(this._leaseId, {\n ...updatedOptions,\n ...this.shareClientConfig,\n proposedLeaseId,\n }),\n );\n this._leaseId = proposedLeaseId;\n return response;\n },\n );\n }\n\n /**\n * To free the lease if it is no longer needed so that another client may\n * immediately acquire a lease.\n *\n * @param options - Options for the lease management operation.\n * @returns Response data for release lease operation.\n */\n public async releaseLease(options: LeaseOperationOptions = {}): Promise<LeaseOperationResponse> {\n return tracingClient.withSpan(\n \"ShareLeaseClient-releaseLease\",\n options,\n async (updatedOptions) => {\n return assertResponse<LeaseOperationResponseHeaders, LeaseOperationResponseHeaders>(\n await this.fileOrShare.releaseLease(this._leaseId, {\n ...updatedOptions,\n ...this.shareClientConfig,\n }),\n );\n },\n );\n }\n\n /**\n * To force end the lease.\n *\n * @param options - Options for the lease management operation.\n * @returns Response data for break lease operation.\n */\n public async breakLease(options: LeaseOperationOptions = {}): Promise<LeaseOperationResponse> {\n return tracingClient.withSpan(\n \"ShareLeaseClient-breakLease\",\n options,\n async (updatedOptions) => {\n return assertResponse<LeaseOperationResponseHeaders, LeaseOperationResponseHeaders>(\n await this.fileOrShare.breakLease({\n ...updatedOptions,\n ...this.shareClientConfig,\n }),\n );\n },\n );\n }\n\n /**\n * To renew the lease. Only available for lease on share or share snapshot.\n * Note that the lease may be renewed even if it has expired as long as the share has not been leased again since the expiration of that lease.\n * When you renew a lease, the lease duration clock resets.\n *\n * @param options - Options for the lease management operation.\n * @returns Response data for renew lease operation.\n */\n public async renewLease(options: LeaseOperationOptions = {}): Promise<LeaseOperationResponse> {\n return tracingClient.withSpan(\n \"ShareLeaseClient-renewLease\",\n options,\n async (updatedOptions) => {\n if (isFile(this.fileOrShare)) {\n throw new RangeError(\"The renewLease operation is not available for lease on file.\");\n }\n return assertResponse<LeaseOperationResponseHeaders, LeaseOperationResponseHeaders>(\n await this.fileOrShare.renewLease(this._leaseId, {\n ...updatedOptions,\n ...this.shareClientConfig,\n }),\n );\n },\n );\n }\n}\n\n/**\n * @internal\n */\nfunction isFile(fileOrShare: File | Share): fileOrShare is File {\n return \"renewLease\" in fileOrShare;\n}\n"]}
1
+ {"version":3,"file":"Clients.js","sourceRoot":"","sources":["../../../src/Clients.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAElC,OAAO,EAAmB,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAKtE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AA4F1C,OAA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ACvF,CAAC;YACD,OAAO,cAAc,CACnB,MAAM,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,kCAC1C,cAAc,GACd,IAAI,CAAC,iBAAiB,EACzB,CACH,CAAC;QACJ,CAAC,CACF,CAAC;IACJ,CAAC;CACF;AAED;;GAEG;AACH,SAAS,MAAM,CAAC,WAAyB;IACvC,OAAO,YAAY,IAAI,WAAW,CAAC;AACrC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { TokenCredential, isTokenCredential } from \"@azure/core-auth\";\nimport {\n RequestBodyType as HttpRequestBody,\n TransferProgressEvent,\n} from \"@azure/core-rest-pipeline\";\nimport { isNode } from \"@azure/core-util\";\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport {\n CopyFileSmbInfo,\n DeleteSnapshotsOptionType,\n DirectoryCreateResponse,\n DirectoryDeleteResponse,\n DirectoryGetPropertiesResponse,\n DirectoryItem,\n DirectoryListFilesAndDirectoriesSegmentResponse,\n DirectoryListHandlesResponse,\n DirectorySetMetadataResponse,\n DirectorySetPropertiesResponse,\n DirectoryForceCloseHandlesHeaders,\n FileAbortCopyResponse,\n FileCreateResponse,\n FileDeleteResponse,\n FileDownloadOptionalParams,\n FileDownloadResponseModel,\n FileForceCloseHandlesHeaders,\n FileGetPropertiesResponse,\n FileGetRangeListHeaders,\n FileGetRangeListDiffResponse,\n FileItem,\n FileListHandlesResponse,\n FilePermissionFormat,\n FileSetHTTPHeadersResponse,\n FileSetMetadataResponse,\n FileStartCopyResponse,\n FileUploadRangeFromURLResponse,\n FileUploadRangeResponse,\n HandleItem,\n LeaseAccessConditions,\n RangeModel,\n ShareCreatePermissionResponse,\n ShareCreateResponse,\n ShareCreateSnapshotResponse,\n ShareDeleteResponse,\n ShareGetAccessPolicyHeaders,\n ShareGetPermissionResponse,\n ShareGetPropertiesResponseModel,\n ShareGetStatisticsResponseModel,\n ShareSetAccessPolicyResponse,\n ShareSetMetadataResponse,\n ShareSetQuotaResponse,\n SignedIdentifierModel,\n SourceModifiedAccessConditions,\n ShareAccessTier,\n ShareSetPropertiesResponse,\n ShareRootSquash,\n FileRenameResponse,\n DirectoryRenameResponse,\n FileLastWrittenMode,\n ShareFileRangeList,\n ShareCreateHeaders,\n ShareGetPropertiesHeaders,\n ShareDeleteHeaders,\n ShareSetMetadataHeaders,\n ShareSetAccessPolicyHeaders,\n ShareCreateSnapshotHeaders,\n ShareSetPropertiesHeaders,\n ShareGetStatisticsHeaders,\n ShareStats,\n ShareCreatePermissionHeaders,\n ShareGetPermissionHeaders,\n SharePermission,\n DirectoryCreateHeaders,\n DirectorySetPropertiesHeaders,\n DirectoryGetPropertiesHeaders,\n DirectoryDeleteHeaders,\n DirectorySetMetadataHeaders,\n DirectoryListFilesAndDirectoriesSegmentHeaders,\n DirectoryListHandlesHeaders,\n DirectoryRenameHeaders,\n FileCreateHeaders,\n FileDownloadHeaders,\n FileGetPropertiesHeaders,\n FileDeleteHeaders,\n FileSetMetadataHeaders,\n FileUploadRangeHeaders,\n FileUploadRangeFromURLHeaders,\n FileStartCopyHeaders,\n FileAbortCopyHeaders,\n FileListHandlesHeaders,\n RawFileDownloadResponse,\n} from \"./generatedModels\";\nimport {\n FileRenameHeaders,\n ListFilesAndDirectoriesSegmentResponse as GeneratedListFilesAndDirectoriesSegmentResponse,\n ListHandlesResponse as GeneratedListHandlesResponse,\n} from \"./generated/src/models\";\nimport { Share, Directory, File } from \"./generated/src/operationsInterfaces\";\nimport { isPipelineLike, newPipeline, Pipeline, PipelineLike } from \"./Pipeline\";\nimport {\n DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS,\n DEFAULT_HIGH_LEVEL_CONCURRENCY,\n FILE_MAX_SIZE_BYTES,\n FILE_RANGE_MAX_SIZE_BYTES,\n URLConstants,\n FileAttributesPreserve,\n FileAttributesNone,\n} from \"./utils/constants\";\nimport {\n appendToURLPath,\n setURLParameter,\n truncatedISO8061Date,\n extractConnectionStringParts,\n getShareNameAndPathFromUrl,\n appendToURLQuery,\n httpAuthorizationToString,\n setURLPath,\n setURLQueries,\n EscapePath,\n ConvertInternalResponseOfListFiles,\n ConvertInternalResponseOfListHandles,\n WithResponse,\n assertResponse,\n removeEmptyString,\n asSharePermission,\n} from \"./utils/utils.common\";\nimport { Credential } from \"../../storage-blob/src/credentials/Credential\";\nimport { StorageSharedKeyCredential } from \"../../storage-blob/src/credentials/StorageSharedKeyCredential\";\nimport { AnonymousCredential } from \"../../storage-blob/src/credentials/AnonymousCredential\";\nimport { tracingClient } from \"./utils/tracing\";\nimport { StorageClient, CommonOptions } from \"./StorageClient\";\nimport { PageSettings, PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { FileSystemAttributes } from \"./FileSystemAttributes\";\nimport { FileDownloadResponse } from \"./FileDownloadResponse\";\nimport { Range, rangeToString } from \"./Range\";\nimport {\n CloseHandlesInfo,\n FileAndDirectoryCreateCommonOptions,\n FileAndDirectorySetPropertiesCommonOptions,\n fileAttributesToString,\n fileCreationTimeToString,\n FileHttpHeaders,\n fileLastWriteTimeToString,\n Metadata,\n validateAndSetDefaultsForFileAndDirectoryCreateCommonOptions,\n validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions,\n ShareProtocols,\n toShareProtocolsString,\n toShareProtocols,\n HttpAuthorization,\n fileChangeTimeToString,\n ShareClientOptions,\n ShareClientConfig,\n} from \"./models\";\nimport { Batch } from \"./utils/Batch\";\nimport { BufferScheduler } from \"./utils/BufferScheduler\";\nimport { Readable } from \"stream\";\nimport {\n fsStat,\n fsCreateReadStream,\n readStreamToLocalFile,\n streamToBuffer,\n} from \"./utils/utils.node\";\nimport { FileSetHttpHeadersHeaders, StorageClient as StorageClientContext } from \"./generated/src/\";\nimport { randomUUID } from \"@azure/core-util\";\nimport {\n generateFileSASQueryParameters,\n generateFileSASQueryParametersInternal,\n} from \"./FileSASSignatureValues\";\nimport { ShareSASPermissions } from \"./ShareSASPermissions\";\nimport { SASProtocol } from \"./SASQueryParameters\";\nimport { SasIPRange } from \"./SasIPRange\";\nimport { FileSASPermissions } from \"./FileSASPermissions\";\nimport { ListFilesIncludeType } from \"./generated/src\";\n\nexport { ShareClientOptions, ShareClientConfig } from \"./models\";\n\n/**\n * Options to configure the {@link ShareClient.create} operation.\n */\nexport interface ShareCreateOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * A name-value pair to associate with a file storage object.\n */\n metadata?: { [propertyName: string]: string };\n\n /**\n * Specifies the maximum size of the share, in\n * gigabytes.\n */\n quota?: number;\n\n /**\n * Specifies the access tier of the share. Possible values include: 'TransactionOptimized',\n * 'Hot', 'Cool'\n */\n accessTier?: ShareAccessTier;\n\n /**\n * Supported in version 2020-02-10 and above. Specifies the enabled protocols on the share. If not specified, the default is SMB.\n */\n protocols?: ShareProtocols;\n /**\n * Root squash to set on the share. Only valid for NFS shares. Possible values include:\n * 'NoRootSquash', 'RootSquash', 'AllSquash'.\n */\n rootSquash?: ShareRootSquash;\n\n /**\n * Specifies whether the snapshot virtual directory should be accessible at the root of share mount point when NFS is enabled.\n * If not specified, the default is true.\n */\n enableSnapshotVirtualDirectoryAccess?: boolean;\n\n /**\n * Optional. Boolean. Default if not specified is false. This property enables paid bursting.\n */\n paidBurstingEnabled?: boolean;\n\n /**\n * Optional. Integer. Default if not specified is the maximum throughput the file share can support. Current maximum for a file share is 10,340 MiB/sec.\n */\n paidBurstingMaxBandwidthMibps?: number;\n\n /**\n * Optional. Integer. Default if not specified is the maximum IOPS the file share can support. Current maximum for a file share is 102,400 IOPS.\n */\n paidBurstingMaxIops?: number;\n /**\n * Optional. Supported in version 2025-01-05 and later. Only allowed for provisioned v2 file shares.\n * Specifies the provisioned number of input/output operations per second (IOPS) of the share. If this is not specified, the provisioned IOPS is set to value calculated based on recommendation formula.\n */\n shareProvisionedIops?: number;\n\n /** Optional. Supported in version 2025-01-05 and later. Only allowed for provisioned v2 file shares. Specifies the provisioned bandwidth of the share, in mebibytes per second (MiBps). If this is not specified, the provisioned bandwidth is set to value calculated based on recommendation formula. */\n shareProvisionedBandwidthMibps?: number;\n}\n\n/**\n * Options to configure the {@link ShareClient.delete} operation.\n */\nexport interface ShareDeleteMethodOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Specifies the option\n * include to delete the base share and all of its snapshots. Possible values\n * include: 'include'\n */\n deleteSnapshots?: DeleteSnapshotsOptionType;\n /**\n * If specified, the operation only succeeds if the resource's lease is active and matches this ID.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n}\n\n/**\n * Options to configure the {@link ShareClient.setMetadata} operation.\n */\nexport interface ShareSetMetadataOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * If specified, the operation only succeeds if the resource's lease is active and matches this ID.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n}\n\n/**\n * Options to configure the {@link ShareClient.setAccessPolicy} operation.\n */\nexport interface ShareSetAccessPolicyOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * If specified, the operation only succeeds if the resource's lease is active and matches this ID.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n}\n\n/**\n * Options to configure the {@link ShareClient.getAccessPolicy} operation.\n */\nexport interface ShareGetAccessPolicyOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * If specified, the operation only succeeds if the resource's lease is active and matches this ID.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n}\n\n/**\n * Options to configure the {@link ShareClient.exists} operation.\n */\nexport interface ShareExistsOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * If specified, the operation only succeeds if the resource's lease is active and matches this ID.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n}\n\n/**\n * Options to configure the {@link ShareClient.getProperties} operation.\n */\nexport interface ShareGetPropertiesOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * If specified, the operation only succeeds if the resource's lease is active and matches this ID.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n}\n\n/**\n * Options to configure the {@link ShareClient.setQuota} operation.\n */\nexport interface ShareSetQuotaOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * If specified, the operation only succeeds if the resource's lease is active and matches this ID.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n}\n\n/**\n * Options to configure the {@link ShareClient.setProperties} operation.\n */\nexport interface ShareSetPropertiesOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n\n /**\n * Specifies the access tier of the share. Possible values include: 'TransactionOptimized',\n * 'Hot', 'Cool'.\n */\n accessTier?: ShareAccessTier;\n\n /**\n * Specifies the maximum size of the share, in gigabytes.\n */\n quotaInGB?: number;\n\n /**\n * Root squash to set on the share. Only valid for NFS shares. Possible values include:\n * 'NoRootSquash', 'RootSquash', 'AllSquash'.\n */\n rootSquash?: ShareRootSquash;\n /**\n * If specified, the operation only succeeds if the resource's lease is active and matches this ID.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n\n /**\n * Specifies whether the snapshot virtual directory should be accessible at the root of share mount point when NFS is enabled.\n * If not specified, the default is true.\n */\n enableSnapshotVirtualDirectoryAccess?: boolean;\n\n /**\n * Optional. Boolean. Default if not specified is false. This property enables paid bursting.\n */\n paidBurstingEnabled?: boolean;\n\n /**\n * Optional. Integer. Default if not specified is the maximum throughput the file share can support. Current maximum for a file share is 10,340 MiB/sec.\n */\n paidBurstingMaxBandwidthMibps?: number;\n\n /**\n * Optional. Integer. Default if not specified is the maximum IOPS the file share can support. Current maximum for a file share is 102,400 IOPS.\n */\n paidBurstingMaxIops?: number;\n /**\n * Optional. Supported in version 2025-01-05 and later. Only allowed for provisioned v2 file shares.\n * Specifies the provisioned number of input/output operations per second (IOPS) of the share. If this is not specified, the provisioned IOPS is set to value calculated based on recommendation formula.\n */\n shareProvisionedIops?: number;\n /** Optional. Supported in version 2025-01-05 and later. Only allowed for provisioned v2 file shares. Specifies the provisioned bandwidth of the share, in mebibytes per second (MiBps). If this is not specified, the provisioned bandwidth is set to value calculated based on recommendation formula. */\n shareProvisionedBandwidthMibps?: number;\n}\n\n/**\n * Options to configure the {@link ShareClient.getStatistics} operation.\n */\nexport interface ShareGetStatisticsOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * If specified, the operation only succeeds if the resource's lease is active and matches this ID.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n}\n\n/**\n * Signed Identifier\n */\nexport interface SignedIdentifier {\n /**\n * a unique id\n */\n id: string;\n /**\n * Access Policy\n */\n accessPolicy: {\n /**\n * the date-time the policy is active.\n */\n startsOn: Date;\n /**\n * the date-time the policy expires.\n */\n expiresOn: Date;\n /**\n * the permissions for the acl policy\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-share-acl\n */\n permissions: string;\n };\n}\n\nexport declare type ShareGetAccessPolicyResponse = WithResponse<\n {\n signedIdentifiers: SignedIdentifier[];\n } & ShareGetAccessPolicyHeaders,\n ShareGetAccessPolicyHeaders,\n SignedIdentifierModel[]\n>;\n\n/**\n * Options to configure the {@link ShareClient.createSnapshot} operation.\n */\nexport interface ShareCreateSnapshotOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * A name-value pair to associate with a file storage object.\n */\n metadata?: { [propertyName: string]: string };\n}\n\n/**\n * Options to configure the {@link ShareClient.createPermission} operation.\n */\nexport interface ShareCreatePermissionOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n/**\n * Options to configure the {@link ShareClient.getPermission} operation.\n */\nexport interface ShareGetPermissionOptions extends CommonOptions {\n /**\n * Optional. Available for version 2023-06-01 and later. Specifies the format in which the permission is returned.\n * Acceptable values are SDDL or binary. If x-ms-file-permission-format is unspecified or explicitly set to SDDL, the permission is returned in SDDL format.\n * If x-ms-file-permission-format is explicitly set to binary, the permission is returned as a base64 string representing the binary encoding of the permission\n */\n filePermissionFormat?: FilePermissionFormat;\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Response data for the {@link ShareClient.getStatistics} Operation.\n */\nexport type ShareGetStatisticsResponse = ShareGetStatisticsResponseModel & {\n /**\n * @deprecated shareUsage is going to be deprecated. Please use ShareUsageBytes instead.\n *\n * The approximate size of the data stored on the share, rounded up to the nearest gigabyte. Note\n * that this value may not include all recently created or recently resized files.\n */\n shareUsage: number;\n};\n\n/**\n * Contains response data for the {@link ShareClient.createIfNotExists} operation.\n */\nexport interface ShareCreateIfNotExistsResponse extends ShareCreateResponse {\n /**\n * Indicate whether the share is successfully created. Is false when the share is not changed as it already exists.\n */\n succeeded: boolean;\n}\n\n/**\n * Contains response data for the {@link ShareClient.deleteIfExists} operation.\n */\nexport interface ShareDeleteIfExistsResponse extends ShareDeleteResponse {\n /**\n * Indicate whether the share is successfully deleted. Is false if the share does not exist in the first place.\n */\n succeeded: boolean;\n}\n\n/**\n * Contains response data for the {@link ShareClient.getProperties} operation.\n */\nexport type ShareGetPropertiesResponse = ShareGetPropertiesResponseModel & {\n /**\n * The protocols that have been enabled on the share.\n */\n protocols?: ShareProtocols;\n};\n\n/**\n * Common options of the {@link ShareGenerateSasUrlOptions} and {@link FileGenerateSasUrlOptions}.\n */\nexport interface CommonGenerateSasUrlOptions {\n /**\n * The version of the service this SAS will target. If not specified, it will default to the version targeted by the\n * library.\n */\n version?: string;\n\n /**\n * Optional. SAS protocols, HTTPS only or HTTPSandHTTP\n */\n protocol?: SASProtocol;\n\n /**\n * Optional. When the SAS will take effect.\n */\n startsOn?: Date;\n\n /**\n * Optional only when identifier is provided. The time after which the SAS will no longer work.\n */\n expiresOn?: Date;\n\n /**\n * Optional. IP ranges allowed in this SAS.\n */\n ipRange?: SasIPRange;\n\n /**\n * Optional. The name of the access policy on the share this SAS references if any.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/establishing-a-stored-access-policy\n */\n identifier?: string;\n\n /**\n * Optional. The cache-control header for the SAS.\n */\n cacheControl?: string;\n\n /**\n * Optional. The content-disposition header for the SAS.\n */\n contentDisposition?: string;\n\n /**\n * Optional. The content-encoding header for the SAS.\n */\n contentEncoding?: string;\n\n /**\n * Optional. The content-language header for the SAS.\n */\n contentLanguage?: string;\n\n /**\n * Optional. The content-type header for the SAS.\n */\n contentType?: string;\n}\n\n/**\n * Options to configure {@link ShareClient.generateSasUrl} operation.\n */\nexport interface ShareGenerateSasUrlOptions extends CommonGenerateSasUrlOptions {\n /**\n * Optional only when identifier is provided. Specifies the list of permissions to be associated with the SAS.\n */\n permissions?: ShareSASPermissions;\n}\n\n/**\n * A ShareClient represents a URL to the Azure Storage share allowing you to manipulate its directories and files.\n */\nexport class ShareClient extends StorageClient {\n /**\n * Share operation context provided by protocol layer.\n */\n private context: Share;\n\n private _name: string;\n\n private shareClientConfig?: ShareClientConfig;\n\n /**\n * The name of the share\n */\n public get name(): string {\n return this._name;\n }\n\n /**\n * @param connectionString - Account connection string or a SAS connection string of an Azure storage account.\n * [ Note - Account connection string can only be used in NODE.JS runtime. ]\n * Account connection string example -\n * `DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net`\n * SAS connection string example -\n * `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`\n * @param name - Share name.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n constructor(connectionString: string, name: string, options?: ShareClientOptions);\n /**\n * Creates an instance of ShareClient.\n *\n * @param url - A URL string pointing to Azure Storage file share, such as\n * \"https://myaccount.file.core.windows.net/share\". You can\n * append a SAS if using AnonymousCredential, such as\n * \"https://myaccount.file.core.windows.net/share?sasString\".\n * @param credential - Such as AnonymousCredential or StorageSharedKeyCredential.\n * If not specified, AnonymousCredential is used.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n constructor(\n url: string,\n credential?: Credential | TokenCredential,\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n options?: ShareClientOptions,\n );\n /**\n * Creates an instance of ShareClient.\n *\n * @param url - A URL string pointing to Azure Storage file share, such as\n * \"https://myaccount.file.core.windows.net/share\". You can\n * append a SAS if using AnonymousCredential, such as\n * \"https://myaccount.file.core.windows.net/share?sasString\".\n * @param pipeline - Call newPipeline() to create a default\n * pipeline, or provide a customized pipeline.\n */\n constructor(url: string, pipeline: Pipeline, options?: ShareClientConfig);\n constructor(\n urlOrConnectionString: string,\n credentialOrPipelineOrShareName?: Credential | TokenCredential | PipelineLike | string,\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n options?: ShareClientOptions,\n ) {\n let pipeline: Pipeline;\n let url: string;\n if (isPipelineLike(credentialOrPipelineOrShareName)) {\n // (url: string, pipeline: Pipeline)\n url = urlOrConnectionString;\n pipeline = credentialOrPipelineOrShareName;\n } else if (\n credentialOrPipelineOrShareName instanceof Credential ||\n isTokenCredential(credentialOrPipelineOrShareName)\n ) {\n // (url: string, credential?: Credential, options?: ShareClientOptions)\n url = urlOrConnectionString;\n pipeline = newPipeline(credentialOrPipelineOrShareName, options);\n } else if (\n !credentialOrPipelineOrShareName &&\n typeof credentialOrPipelineOrShareName !== \"string\"\n ) {\n // (url: string, credential?: Credential, options?: ShareClientOptions)\n // The second parameter is undefined. Use anonymous credential.\n url = urlOrConnectionString;\n pipeline = newPipeline(new AnonymousCredential(), options);\n } else if (\n credentialOrPipelineOrShareName &&\n typeof credentialOrPipelineOrShareName === \"string\"\n ) {\n // (connectionString: string, name: string, options?: ShareClientOptions)\n const extractedCreds = extractConnectionStringParts(urlOrConnectionString);\n const name = credentialOrPipelineOrShareName;\n if (extractedCreds.kind === \"AccountConnString\") {\n if (isNode) {\n const sharedKeyCredential = new StorageSharedKeyCredential(\n extractedCreds.accountName!,\n extractedCreds.accountKey,\n );\n url = appendToURLPath(extractedCreds.url, name);\n pipeline = newPipeline(sharedKeyCredential, options);\n } else {\n throw new Error(\"Account connection string is only supported in Node.js environment\");\n }\n } else if (extractedCreds.kind === \"SASConnString\") {\n url = appendToURLPath(extractedCreds.url, name) + \"?\" + extractedCreds.accountSas;\n pipeline = newPipeline(new AnonymousCredential(), options);\n } else {\n throw new Error(\n \"Connection string must be either an Account connection string or a SAS connection string\",\n );\n }\n } else {\n throw new Error(\"Expecting non-empty strings for name parameter\");\n }\n super(url, pipeline);\n this._name = getShareNameAndPathFromUrl(this.url).shareName;\n this.shareClientConfig = options;\n this.context = this.storageClientContext.share;\n }\n\n /**\n * Creates a new ShareClient object identical to the source but with the specified snapshot timestamp.\n * Provide \"\" will remove the snapshot and return a URL to the base share.\n *\n * @param snapshot - The snapshot timestamp.\n * @returns A new ShareClient object identical to the source but with the specified snapshot timestamp\n */\n public withSnapshot(snapshot: string): ShareClient {\n return new ShareClient(\n setURLParameter(\n this.url,\n URLConstants.Parameters.SHARE_SNAPSHOT,\n snapshot.length === 0 ? undefined : snapshot,\n ),\n this.pipeline,\n this.shareClientConfig,\n );\n }\n\n /**\n * Creates a new share under the specified account. If the share with\n * the same name already exists, the operation fails.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-share\n *\n * @param options - Options to Share Create operation.\n * @returns Response data for the Share Create operation.\n */\n public async create(options: ShareCreateOptions = {}): Promise<ShareCreateResponse> {\n return tracingClient.withSpan(\"ShareClient-create\", options, async (updatedOptions) => {\n return assertResponse<ShareCreateHeaders, ShareCreateHeaders>(\n await this.context.create({\n ...updatedOptions,\n ...this.shareClientConfig,\n enabledProtocols: toShareProtocolsString(updatedOptions.protocols),\n }),\n );\n });\n }\n\n /**\n * Creates a new share under the specified account. If the share with\n * the same name already exists, it is not changed.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-share\n *\n * @param options -\n */\n public async createIfNotExists(\n options: ShareCreateOptions = {},\n ): Promise<ShareCreateIfNotExistsResponse> {\n return tracingClient.withSpan(\n \"ShareClient-createIfNotExists\",\n options,\n async (updatedOptions) => {\n try {\n const res = await this.create(updatedOptions);\n return {\n succeeded: true,\n ...res,\n };\n } catch (e: any) {\n if (e.details?.errorCode === \"ShareAlreadyExists\") {\n return {\n succeeded: false,\n ...e.response?.parsedHeaders,\n _response: e.response,\n };\n }\n throw e;\n }\n },\n );\n }\n\n /**\n * Creates a {@link ShareDirectoryClient} object.\n *\n * @param directoryName - A directory name\n * @returns The ShareDirectoryClient object for the given directory name.\n */\n\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-subclients */\n public getDirectoryClient(directoryName: string): ShareDirectoryClient {\n return new ShareDirectoryClient(\n appendToURLPath(this.url, EscapePath(directoryName)),\n this.pipeline,\n this.shareClientConfig,\n );\n }\n\n /**\n * Gets the directory client for the root directory of this share.\n * Note that the root directory always exists and cannot be deleted.\n *\n * @readonly A new ShareDirectoryClient object for the root directory.\n */\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-subclients */\n public get rootDirectoryClient(): ShareDirectoryClient {\n return this.getDirectoryClient(\"\");\n }\n\n /**\n * Creates a new subdirectory under this share.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-directory\n *\n * @param directoryName -\n * @param options - Options to Directory Create operation.\n * @returns Directory creation response data and the corresponding directory client.\n */\n public async createDirectory(\n directoryName: string,\n options: DirectoryCreateOptions = {},\n ): Promise<{\n directoryClient: ShareDirectoryClient;\n directoryCreateResponse: DirectoryCreateResponse;\n }> {\n return tracingClient.withSpan(\n \"ShareClient-createDirectory\",\n options,\n async (updatedOptions) => {\n const directoryClient = this.getDirectoryClient(directoryName);\n const directoryCreateResponse = await directoryClient.create(updatedOptions);\n return {\n directoryClient,\n directoryCreateResponse,\n };\n },\n );\n }\n\n /**\n * Removes the specified empty sub directory under this share.\n * Note that the directory must be empty before it can be deleted.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-directory\n *\n * @param directoryName -\n * @param options - Options to Directory Delete operation.\n * @returns Directory deletion response data.\n */\n public async deleteDirectory(\n directoryName: string,\n options: DirectoryDeleteOptions = {},\n ): Promise<DirectoryDeleteResponse> {\n return tracingClient.withSpan(\n \"ShareClient-deleteDirectory\",\n options,\n async (updatedOptions) => {\n const directoryClient = this.getDirectoryClient(directoryName);\n return directoryClient.delete(updatedOptions);\n },\n );\n }\n\n /**\n * Creates a new file or replaces a file under the root directory of this share.\n * Note it only initializes the file with no content.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-file\n *\n * @param fileName -\n * @param size - Specifies the maximum size in bytes for the file, up to 4 TB.\n * @param options - Options to File Create operation.\n * @returns File creation response data and the corresponding file client.\n */\n public async createFile(\n fileName: string,\n size: number,\n options: FileCreateOptions = {},\n ): Promise<{ fileClient: ShareFileClient; fileCreateResponse: FileCreateResponse }> {\n return tracingClient.withSpan(\"ShareClient-createFile\", options, async (updatedOptions) => {\n const directoryClient = this.rootDirectoryClient;\n const fileClient = directoryClient.getFileClient(fileName);\n const fileCreateResponse = await fileClient.create(size, updatedOptions);\n return {\n fileClient,\n fileCreateResponse,\n };\n });\n }\n\n /**\n * Removes a file under the root directory of this share from the storage account.\n * When a file is successfully deleted, it is immediately removed from the storage\n * account's index and is no longer accessible to clients. The file's data is later\n * removed from the service during garbage collection.\n *\n * Delete File will fail with status code 409 (Conflict) and error code `SharingViolation`\n * if the file is open on an SMB client.\n *\n * Delete File is not supported on a share snapshot, which is a read-only copy of\n * a share. An attempt to perform this operation on a share snapshot will fail with 400\n * (`InvalidQueryParameterValue`)\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-file2\n *\n * @param directoryName -\n * @param fileName -\n * @param options - Options to File Delete operation.\n * @returns Promise<FileDeleteResponse> File Delete response data.\n */\n public async deleteFile(\n fileName: string,\n options: FileDeleteOptions = {},\n ): Promise<FileDeleteResponse> {\n return tracingClient.withSpan(\"ShareClient-deleteFile\", options, async (updatedOptions) => {\n const directoryClient = this.rootDirectoryClient;\n const fileClient = directoryClient.getFileClient(fileName);\n return fileClient.delete(updatedOptions);\n });\n }\n\n /**\n * Returns true if the Azrue share resource represented by this client exists; false otherwise.\n *\n * NOTE: use this function with care since an existing share might be deleted by other clients or\n * applications. Vice versa new shares might be added by other clients or applications after this\n * function completes.\n *\n * @param options - options to Exists operation.\n */\n public async exists(options: ShareExistsOptions = {}): Promise<boolean> {\n return tracingClient.withSpan(\"ShareClient-exists\", options, async (updatedOptions) => {\n try {\n await this.getProperties(updatedOptions);\n return true;\n } catch (e: any) {\n if (e.statusCode === 404) {\n return false;\n }\n throw e;\n }\n });\n }\n\n /**\n * Returns all user-defined metadata and system properties for the specified\n * share.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-share-properties\n *\n * WARNING: The `metadata` object returned in the response will have its keys in lowercase, even if\n * they originally contained uppercase characters. This differs from the metadata keys returned by\n * the `listShares` method of {@link ShareServiceClient} using the `includeMetadata` option, which\n * will retain their original casing.\n *\n * @returns Response data for the Share Get Properties operation.\n */\n public async getProperties(\n options: ShareGetPropertiesOptions = {},\n ): Promise<ShareGetPropertiesResponse> {\n return tracingClient.withSpan(\"ShareClient-getProperties\", options, async (updatedOptions) => {\n const res = assertResponse<ShareGetPropertiesHeaders, ShareGetPropertiesHeaders>(\n await this.context.getProperties(updatedOptions),\n );\n return {\n ...res,\n ...this.shareClientConfig,\n protocols: toShareProtocols(res.enabledProtocols),\n };\n });\n }\n\n /**\n * Marks the specified share for deletion. The share and any directories or files\n * contained within it are later deleted during garbage collection.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-share\n *\n * @param options - Options to Share Delete operation.\n * @returns Response data for the Share Delete operation.\n */\n public async delete(options: ShareDeleteMethodOptions = {}): Promise<ShareDeleteResponse> {\n return tracingClient.withSpan(\"ShareClient-delete\", options, async (updatedOptions) => {\n return assertResponse<ShareDeleteHeaders, ShareDeleteHeaders>(\n await this.context.delete({\n ...updatedOptions,\n ...this.shareClientConfig,\n }),\n );\n });\n }\n\n /**\n * Marks the specified share for deletion if it exists. The share and any directories or files\n * contained within it are later deleted during garbage collection.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-share\n *\n * @param options -\n */\n public async deleteIfExists(\n options: ShareDeleteMethodOptions = {},\n ): Promise<ShareDeleteIfExistsResponse> {\n return tracingClient.withSpan(\"ShareClient-deleteIfExists\", options, async (updatedOptions) => {\n try {\n const res = await this.delete(updatedOptions);\n return {\n succeeded: true,\n ...res,\n };\n } catch (e: any) {\n if (e.details?.errorCode === \"ShareNotFound\") {\n return {\n succeeded: false,\n ...e.response?.parsedHeaders,\n _response: e.response,\n };\n }\n throw e;\n }\n });\n }\n\n /**\n * Sets one or more user-defined name-value pairs for the specified share.\n *\n * If no option provided, or no metadata defined in the option parameter, the share\n * metadata will be removed.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-share-metadata\n *\n * @param metadata - If no metadata provided, all existing directory metadata will be removed.\n * @param option - Options to Share Set Metadata operation.\n * @returns Response data for the Share Set Metadata operation.\n */\n public async setMetadata(\n metadata?: Metadata,\n options: ShareSetMetadataOptions = {},\n ): Promise<ShareSetMetadataResponse> {\n return tracingClient.withSpan(\"ShareClient-setMetadata\", options, async (updatedOptions) => {\n return assertResponse<ShareSetMetadataHeaders, ShareSetMetadataHeaders>(\n await this.context.setMetadata({\n ...updatedOptions,\n ...this.shareClientConfig,\n metadata,\n }),\n );\n });\n }\n\n /**\n * Gets the permissions for the specified share. The permissions indicate\n * whether share data may be accessed publicly.\n *\n * WARNING: JavaScript Date will potential lost precision when parsing start and expiry string.\n * For example, new Date(\"2018-12-31T03:44:23.8827891Z\").toISOString() will get \"2018-12-31T03:44:23.882Z\".\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-share-acl\n *\n * @param option - Options to Share Get Access Policy operation.\n * @returns Response data for the Share Get Access Policy operation.\n */\n public async getAccessPolicy(\n options: ShareGetAccessPolicyOptions = {},\n ): Promise<ShareGetAccessPolicyResponse> {\n return tracingClient.withSpan(\n \"ShareClient-getAccessPolicy\",\n options,\n async (updatedOptions) => {\n const response = assertResponse<\n ShareGetAccessPolicyHeaders & SignedIdentifierModel[],\n ShareGetAccessPolicyHeaders,\n SignedIdentifierModel[]\n >(\n await this.context.getAccessPolicy({\n ...updatedOptions,\n ...this.shareClientConfig,\n }),\n );\n\n const res: ShareGetAccessPolicyResponse = {\n _response: response._response,\n date: response.date,\n etag: response.etag,\n lastModified: response.lastModified,\n requestId: response.requestId,\n signedIdentifiers: [],\n version: response.version,\n };\n\n for (const identifier of response) {\n let accessPolicy: any = undefined;\n if (identifier.accessPolicy) {\n accessPolicy = {\n permissions: identifier.accessPolicy.permissions,\n };\n\n if (identifier.accessPolicy.expiresOn) {\n accessPolicy.expiresOn = new Date(identifier.accessPolicy.expiresOn);\n }\n\n if (identifier.accessPolicy.startsOn) {\n accessPolicy.startsOn = new Date(identifier.accessPolicy.startsOn);\n }\n }\n\n res.signedIdentifiers.push({\n accessPolicy,\n id: identifier.id,\n });\n }\n\n return res;\n },\n );\n }\n\n /**\n * Sets the permissions for the specified share. The permissions indicate\n * whether directories or files in a share may be accessed publicly.\n *\n * When you set permissions for a share, the existing permissions are replaced.\n * If no shareAcl provided, the existing share ACL will be\n * removed.\n *\n * When you establish a stored access policy on a share, it may take up to 30 seconds to take effect.\n * During this interval, a shared access signature that is associated with the stored access policy will\n * fail with status code 403 (Forbidden), until the access policy becomes active.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-share-acl\n *\n * @param shareAcl - Array of signed identifiers, each having a unique Id and details of access policy.\n * @param option - Options to Share Set Access Policy operation.\n * @returns Response data for the Share Set Access Policy operation.\n */\n public async setAccessPolicy(\n shareAcl?: SignedIdentifier[],\n options: ShareSetAccessPolicyOptions = {},\n ): Promise<ShareSetAccessPolicyResponse> {\n return tracingClient.withSpan(\n \"ShareClient-setAccessPolicy\",\n options,\n async (updatedOptions) => {\n const acl: SignedIdentifierModel[] = [];\n for (const identifier of shareAcl || []) {\n acl.push({\n accessPolicy: {\n expiresOn: identifier.accessPolicy?.expiresOn\n ? truncatedISO8061Date(identifier.accessPolicy.expiresOn)\n : undefined,\n permissions: identifier.accessPolicy?.permissions,\n startsOn: identifier.accessPolicy?.startsOn\n ? truncatedISO8061Date(identifier.accessPolicy.startsOn)\n : undefined,\n },\n id: identifier.id,\n });\n }\n\n return assertResponse<ShareSetAccessPolicyHeaders, ShareSetAccessPolicyHeaders>(\n await this.context.setAccessPolicy({\n ...updatedOptions,\n ...this.shareClientConfig,\n shareAcl: acl,\n }),\n );\n },\n );\n }\n\n /**\n * Creates a read-only snapshot of a share.\n *\n * @param options - Options to Share Create Snapshot operation.\n * @returns Response data for the Share Create Snapshot operation.\n */\n public async createSnapshot(\n options: ShareCreateSnapshotOptions = {},\n ): Promise<ShareCreateSnapshotResponse> {\n return tracingClient.withSpan(\"ShareClient-createSnapshot\", options, async (updatedOptions) => {\n return assertResponse<ShareCreateSnapshotHeaders, ShareCreateSnapshotHeaders>(\n await this.context.createSnapshot({\n ...updatedOptions,\n ...this.shareClientConfig,\n }),\n );\n });\n }\n\n /**\n * Sets quota for the specified share.\n *\n * @deprecated Use {@link ShareClient.setProperties} instead.\n *\n * @param quotaInGB - Specifies the maximum size of the share in gigabytes\n * @param option - Options to Share Set Quota operation.\n * @returns Response data for the Share Get Quota operation.\n */\n public async setQuota(\n quotaInGB: number,\n options: ShareSetQuotaOptions = {},\n ): Promise<ShareSetQuotaResponse> {\n return tracingClient.withSpan(\"ShareClient-setQuota\", options, async (updatedOptions) => {\n return assertResponse<ShareSetPropertiesHeaders, ShareSetPropertiesHeaders>(\n await this.context.setProperties({\n ...updatedOptions,\n ...this.shareClientConfig,\n quota: quotaInGB,\n }),\n );\n });\n }\n\n /**\n * Sets properties of the share.\n *\n * @param option - Options to Share Set Properties operation.\n * @returns Response data for the Share Set Properties operation.\n */\n public async setProperties(\n options: ShareSetPropertiesOptions = {},\n ): Promise<ShareSetPropertiesResponse> {\n return tracingClient.withSpan(\"ShareClient-setProperties\", options, async (updatedOptions) => {\n return assertResponse<ShareSetPropertiesHeaders, ShareSetPropertiesHeaders>(\n await this.context.setProperties({\n ...options,\n ...this.shareClientConfig,\n quota: options.quotaInGB,\n tracingOptions: updatedOptions.tracingOptions,\n }),\n );\n });\n }\n\n /**\n * Retrieves statistics related to the share.\n *\n * @param option - Options to Share Get Statistics operation.\n * @returns Response data for the Share Get Statistics operation.\n */\n public async getStatistics(\n options: ShareGetStatisticsOptions = {},\n ): Promise<ShareGetStatisticsResponse> {\n return tracingClient.withSpan(\"ShareClient-getStatistics\", options, async (updatedOptions) => {\n const response = assertResponse<\n ShareGetStatisticsHeaders & ShareStats,\n ShareGetStatisticsHeaders,\n ShareStats\n >(\n await this.context.getStatistics({\n ...updatedOptions,\n ...this.shareClientConfig,\n }),\n );\n\n const GBBytes = 1024 * 1024 * 1024;\n return { ...response, shareUsage: Math.ceil(response.shareUsageBytes / GBBytes) };\n });\n }\n\n /**\n * Creates a file permission (a security descriptor) at the share level.\n * The created security descriptor can be used for the files/directories in the share.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-permission\n *\n * @param options - Options to Share Create Permission operation.\n * @param filePermission - File permission described in the SDDL\n */\n public async createPermission(\n filePermission: string | SharePermission,\n options: ShareCreatePermissionOptions = {},\n ): Promise<ShareCreatePermissionResponse> {\n return tracingClient.withSpan(\n \"ShareClient-createPermission\",\n options,\n async (updatedOptions) => {\n return assertResponse<ShareCreatePermissionHeaders, ShareCreatePermissionHeaders>(\n await this.context.createPermission(asSharePermission(filePermission), {\n ...updatedOptions,\n ...this.shareClientConfig,\n }),\n );\n },\n );\n }\n\n /**\n * Gets the Security Descriptor Definition Language (SDDL) for a given file permission key\n * which indicates a security descriptor.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-permission\n *\n * @param options - Options to Share Create Permission operation.\n * @param filePermissionKey - File permission key which indicates the security descriptor of the permission.\n */\n public async getPermission(\n filePermissionKey: string,\n options: ShareGetPermissionOptions = {},\n ): Promise<ShareGetPermissionResponse> {\n return tracingClient.withSpan(\"ShareClient-getPermission\", options, async (updatedOptions) => {\n return assertResponse<\n ShareGetPermissionHeaders & SharePermission,\n ShareGetPermissionHeaders,\n SharePermission\n >(\n await this.context.getPermission(filePermissionKey, {\n ...updatedOptions,\n ...this.shareClientConfig,\n }),\n );\n });\n }\n\n /**\n * Get a {@link ShareLeaseClient} that manages leases on the file.\n *\n * @param proposeLeaseId - Initial proposed lease Id.\n * @returns A new ShareLeaseClient object for managing leases on the file.\n */\n public getShareLeaseClient(proposeLeaseId?: string): ShareLeaseClient {\n return new ShareLeaseClient(this, proposeLeaseId);\n }\n\n /**\n * Only available for ShareClient constructed with a shared key credential.\n *\n * Generates a Service Shared Access Signature (SAS) URI based on the client properties\n * and parameters passed in. The SAS is signed by the shared key credential of the client.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas\n *\n * @param options - Optional parameters.\n * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.\n */\n public generateSasUrl(options: ShareGenerateSasUrlOptions): string {\n if (!(this.credential instanceof StorageSharedKeyCredential)) {\n throw RangeError(\n \"Can only generate the SAS when the client is initialized with a shared key credential\",\n );\n }\n\n const sas = generateFileSASQueryParameters(\n {\n shareName: this.name,\n ...options,\n },\n this.credential,\n ).toString();\n\n return appendToURLQuery(this.url, sas);\n }\n\n /**\n * Only available for ShareClient constructed with a shared key credential.\n *\n * Generates string to sign for a Service Shared Access Signature (SAS) URI based on the client properties\n * and parameters passed in. The SAS is signed by the shared key credential of the client.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas\n *\n * @param options - Optional parameters.\n * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.\n */\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n public generateSasStringToSign(options: ShareGenerateSasUrlOptions): string {\n if (!(this.credential instanceof StorageSharedKeyCredential)) {\n throw RangeError(\n \"Can only generate the SAS when the client is initialized with a shared key credential\",\n );\n }\n\n return generateFileSASQueryParametersInternal(\n {\n shareName: this.name,\n ...options,\n },\n this.credential,\n ).stringToSign;\n }\n}\n\n/**\n * Options to configure {@link ShareDirectoryClient.create} operation.\n */\nexport interface DirectoryCreateOptions extends FileAndDirectoryCreateCommonOptions, CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * A collection of key-value string pair to associate with the file storage object.\n */\n metadata?: Metadata;\n}\n\nexport interface DirectoryProperties\n extends FileAndDirectorySetPropertiesCommonOptions,\n CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Options to configure Directory - List Files and Directories Segment operations.\n *\n * See:\n * - {@link ShareDirectoryClient.iterateFilesAndDirectoriesSegments}\n * - {@link ShareDirectoryClient.listFilesAndDirectoriesItems}\n * - {@link ShareDirectoryClient.listFilesAndDirectoriesSegment}\n */\ninterface DirectoryListFilesAndDirectoriesSegmentOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Filters the results to return only entries whose\n * name begins with the specified prefix.\n */\n prefix?: string;\n\n /**\n * Specifies the maximum number of entries to\n * return. If the request does not specify maxResults, or specifies a value\n * greater than 5,000, the server will return up to 5,000 items.\n */\n maxResults?: number;\n /** Include this parameter to specify one or more datasets to include in the response. */\n include?: ListFilesIncludeType[];\n /**\n * Optional. Specified that extended info should be included in the returned {@link FileItem} or {@link DirectoryItem}.\n * If true, the Content-Length property will be up-to-date, FileId will be returned in response.\n */\n includeExtendedInfo?: boolean;\n}\n\n/**\n * Options to configure {@link ShareDirectoryClient.listFilesAndDirectories} operation.\n */\nexport interface DirectoryListFilesAndDirectoriesOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Filters the results to return only entries whose\n * name begins with the specified prefix.\n */\n prefix?: string;\n /*\n * Optional. Specified that time stamps should be included in the response.\n */\n includeTimestamps?: boolean;\n /*\n * Optional. Specified that ETag should be included in the response.\n */\n includeEtag?: boolean;\n /*\n * Optional. Specified that file attributes should be included in the response.\n */\n includeAttributes?: boolean;\n /*\n * Optional. Specified that permission key should be included in the response.\n */\n includePermissionKey?: boolean;\n /**\n * Optional. Specified that extended info should be included in the returned {@link FileItem} or {@link DirectoryItem}.\n * If true, the Content-Length property will be up-to-date, FileId will be returned in response.\n */\n includeExtendedInfo?: boolean;\n}\n\n/**\n * Options to configure the {@link ShareDirectoryClient.delete} operation.\n */\nexport interface DirectoryDeleteOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Options to configure the {@link ShareDirectoryClient.exists} operation.\n */\nexport interface DirectoryExistsOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Options to configure the {@link ShareDirectoryClient.getProperties} operation.\n */\nexport interface DirectoryGetPropertiesOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Options to configure the {@link ShareDirectoryClient.setMetadata} operation.\n */\nexport interface DirectorySetMetadataOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Options to configure Directory - List Handles Segment operations.\n *\n * See:\n * - {@link ShareDirectoryClient.listHandlesSegment}\n * - {@link ShareDirectoryClient.iterateHandleSegments}\n * - {@link ShareDirectoryClient.listHandleItems}\n *\n */\nexport interface DirectoryListHandlesSegmentOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Specifies the maximum number of entries to return. If the request does not specify maxResults,\n * or specifies a value greater than 5,000, the server will return up to 5,000 items.\n */\n maxResults?: number;\n /**\n * Specifies operation should apply to the directory specified in the URI, its files, its\n * subdirectories and their files.\n */\n recursive?: boolean;\n}\n\n/**\n * Options to configure the {@link ShareDirectoryClient.listHandles} operation.\n */\nexport interface DirectoryListHandlesOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Specifies whether operation should apply to the directory specified in the URI, its files, its\n * subdirectories and their files.\n */\n recursive?: boolean;\n}\n\n/**\n * Options to configure Directory - Force Close Handles Segment operations.\n *\n * See:\n * - {@link ShareDirectoryClient.forceCloseHandlesSegment}\n * - {@link ShareDirectoryClient.forceCloseAllHandles}\n */\nexport interface DirectoryForceCloseHandlesSegmentOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Specifies operation should apply to the directory specified in the URI, its files, its\n * subdirectories and their files.\n */\n recursive?: boolean;\n}\n\n/**\n * Additional response header values for close handles request.\n */\nexport interface DirectoryCloseHandlesHeaders {\n /**\n * This header uniquely identifies the request that was made and can be used for troubleshooting\n * the request.\n */\n requestId?: string;\n /**\n * Indicates the version of the File service used to execute the request.\n */\n version?: string;\n /**\n * A UTC date/time value generated by the service that indicates the time at which the response\n * was initiated.\n */\n date?: Date;\n /**\n * A string describing next handle to be closed. It is returned when more handles need to be\n * closed to complete the request.\n */\n marker?: string;\n}\n\n/**\n * Response type for {@link ShareDirectoryClient.forceCloseHandle}.\n */\nexport type DirectoryForceCloseHandlesResponse = WithResponse<\n CloseHandlesInfo & DirectoryCloseHandlesHeaders,\n DirectoryForceCloseHandlesHeaders\n>;\n\n/**\n * Options to configure {@link ShareDirectoryClient.forceCloseHandle}.\n */\nexport interface DirectoryForceCloseHandlesOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Contains response data for the {@link DirectoryClient.createIfNotExists} operation.\n */\nexport interface DirectoryCreateIfNotExistsResponse extends DirectoryCreateResponse {\n /**\n * Indicate whether the directory is successfully created. Is false when the directory is not changed as it already exists.\n */\n succeeded: boolean;\n}\n\n/**\n * Contains response data for the {@link DirectoryClient.deleteIfExists} operation.\n */\nexport interface DirectoryDeleteIfExistsResponse extends DirectoryDeleteResponse {\n /**\n * Indicate whether the directory is successfully deleted. Is false if the directory does not exist in the first place.\n */\n succeeded: boolean;\n}\n\n/**\n * A ShareDirectoryClient represents a URL to the Azure Storage directory allowing you to manipulate its files and directories.\n */\nexport class ShareDirectoryClient extends StorageClient {\n /**\n * context provided by protocol layer.\n */\n private context: Directory;\n\n private _shareName: string;\n private _path: string;\n private _name: string;\n\n private shareClientConfig?: ShareClientConfig;\n\n /**\n * The share name corresponding to this directory client\n */\n public get shareName(): string {\n return this._shareName;\n }\n\n /**\n * The full path of the directory\n */\n public get path(): string {\n return this._path;\n }\n\n /**\n * The name of the directory\n */\n public get name(): string {\n return this._name;\n }\n\n /**\n * Creates an instance of DirectoryClient.\n *\n * @param url - A URL string pointing to Azure Storage file directory, such as\n * \"https://myaccount.file.core.windows.net/myshare/mydirectory\". You can\n * append a SAS if using AnonymousCredential, such as\n * \"https://myaccount.file.core.windows.net/myshare/mydirectory?sasString\".\n * This method accepts an encoded URL or non-encoded URL pointing to a directory.\n * Encoded URL string will NOT be escaped twice, only special characters in URL path will be escaped.\n * However, if a directory name includes %, directory name must be encoded in the URL.\n * Such as a directory named \"mydir%\", the URL should be \"https://myaccount.file.core.windows.net/myshare/mydir%25\".\n * @param credential - Such as AnonymousCredential or StorageSharedKeyCredential.\n * If not specified, AnonymousCredential is used.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n constructor(\n url: string,\n credential?: Credential | TokenCredential,\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n options?: ShareClientOptions,\n );\n /**\n * Creates an instance of DirectoryClient.\n *\n * @param url - A URL string pointing to Azure Storage file directory, such as\n * \"https://myaccount.file.core.windows.net/myshare/mydirectory\". You can\n * append a SAS if using AnonymousCredential, such as\n * \"https://myaccount.file.core.windows.net/myshare/mydirectory?sasString\".\n * This method accepts an encoded URL or non-encoded URL pointing to a directory.\n * Encoded URL string will NOT be escaped twice, only special characters in URL path will be escaped.\n * However, if a directory name includes %, directory name must be encoded in the URL.\n * Such as a directory named \"mydir%\", the URL should be \"https://myaccount.file.core.windows.net/myshare/mydir%25\".\n * @param pipeline - Call newPipeline() to create a default\n * pipeline, or provide a customized pipeline.\n */\n constructor(url: string, pipeline: Pipeline, options?: ShareClientConfig);\n constructor(\n url: string,\n credentialOrPipeline?: Credential | TokenCredential | Pipeline,\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n options: ShareClientOptions = {},\n ) {\n let pipeline: Pipeline;\n if (isPipelineLike(credentialOrPipeline)) {\n pipeline = credentialOrPipeline;\n } else if (\n credentialOrPipeline instanceof Credential ||\n isTokenCredential(credentialOrPipeline)\n ) {\n pipeline = newPipeline(credentialOrPipeline, options);\n } else {\n // The second parameter is undefined. Use anonymous credential.\n pipeline = newPipeline(new AnonymousCredential(), options);\n }\n\n super(url, pipeline);\n ({\n baseName: this._name,\n shareName: this._shareName,\n path: this._path,\n } = getShareNameAndPathFromUrl(this.url));\n this.shareClientConfig = options;\n this.context = this.storageClientContext.directory;\n }\n\n /**\n * Creates a new directory under the specified share or parent directory.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-directory\n *\n * @param options - Options to Directory Create operation.\n * @returns Response data for the Directory operation.\n */\n public async create(options: DirectoryCreateOptions = {}): Promise<DirectoryCreateResponse> {\n if (!options.fileAttributes) {\n options = validateAndSetDefaultsForFileAndDirectoryCreateCommonOptions(options);\n // By default set it as a directory.\n const attributes: FileSystemAttributes = new FileSystemAttributes();\n attributes.directory = true;\n options.fileAttributes = attributes;\n }\n return tracingClient.withSpan(\n \"ShareDirectoryClient-create\",\n options,\n async (updatedOptions) => {\n return assertResponse<DirectoryCreateHeaders, DirectoryCreateHeaders>(\n await this.context.create(\n updatedOptions.fileAttributes\n ? fileAttributesToString(updatedOptions.fileAttributes!)\n : FileAttributesNone,\n {\n ...updatedOptions,\n fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime),\n fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime),\n fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime),\n ...this.shareClientConfig,\n },\n ),\n );\n },\n );\n }\n\n /**\n * Creates a new directory under the specified share or parent directory if it does not already exists.\n * If the directory already exists, it is not modified.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-directory\n *\n * @param options -\n */\n public async createIfNotExists(\n options: DirectoryCreateOptions = {},\n ): Promise<DirectoryCreateIfNotExistsResponse> {\n return tracingClient.withSpan(\n \"ShareDirectoryClient-createIfNotExists\",\n options,\n async (updatedOptions) => {\n try {\n const res = await this.create(updatedOptions);\n return {\n succeeded: true,\n ...res,\n };\n } catch (e: any) {\n if (e.details?.errorCode === \"ResourceAlreadyExists\") {\n return {\n succeeded: false,\n ...e.response?.parsedHeaders,\n _response: e.response,\n };\n }\n throw e;\n }\n },\n );\n }\n\n /**\n * Sets properties on the directory.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-directory-properties\n *\n * @param DirectoryProperties - Directory properties. If no values are provided,\n * existing values will be preserved.\n */\n public async setProperties(\n properties: DirectoryProperties = {},\n ): Promise<DirectorySetPropertiesResponse> {\n properties = validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions(properties);\n return tracingClient.withSpan(\n \"ShareDirectoryClient-setProperties\",\n properties,\n async (updatedOptions) => {\n return assertResponse<DirectorySetPropertiesHeaders, DirectorySetPropertiesHeaders>(\n await this.context.setProperties(\n updatedOptions.fileAttributes\n ? fileAttributesToString(updatedOptions.fileAttributes!)\n : FileAttributesPreserve,\n {\n ...updatedOptions,\n fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime),\n fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime),\n fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime),\n ...this.shareClientConfig,\n },\n ),\n );\n },\n );\n }\n\n /**\n * Creates a ShareDirectoryClient object for a sub directory.\n *\n * @param subDirectoryName - A subdirectory name\n * @returns The ShareDirectoryClient object for the given subdirectory name.\n *\n * Example usage:\n *\n * ```js\n * const directoryClient = shareClient.getDirectoryClient(\"<directory name>\");\n * await directoryClient.create();\n * console.log(\"Created directory successfully\");\n * ```\n */\n public getDirectoryClient(subDirectoryName: string): ShareDirectoryClient {\n return new ShareDirectoryClient(\n appendToURLPath(this.url, EscapePath(subDirectoryName)),\n this.pipeline,\n this.shareClientConfig,\n );\n }\n\n /**\n * Creates a new subdirectory under this directory.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-directory\n *\n * @param directoryName -\n * @param options - Options to Directory Create operation.\n * @returns Directory create response data and the corresponding DirectoryClient instance.\n */\n public async createSubdirectory(\n directoryName: string,\n options: DirectoryCreateOptions = {},\n ): Promise<{\n directoryClient: ShareDirectoryClient;\n directoryCreateResponse: DirectoryCreateResponse;\n }> {\n return tracingClient.withSpan(\n \"ShareDirectoryClient-createSubdirectory\",\n options,\n async (updatedOptions) => {\n const directoryClient = this.getDirectoryClient(directoryName);\n const directoryCreateResponse = await directoryClient.create(updatedOptions);\n return {\n directoryClient,\n directoryCreateResponse,\n };\n },\n );\n }\n\n /**\n * Removes the specified empty sub directory under this directory.\n * Note that the directory must be empty before it can be deleted.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-directory\n *\n * @param directoryName -\n * @param options - Options to Directory Delete operation.\n * @returns Directory deletion response data.\n */\n public async deleteSubdirectory(\n directoryName: string,\n options: DirectoryDeleteOptions = {},\n ): Promise<DirectoryDeleteResponse> {\n return tracingClient.withSpan(\n \"ShareDirectoryClient-deleteSubdirectory\",\n options,\n async (updatedOptions) => {\n const directoryClient = this.getDirectoryClient(directoryName);\n return directoryClient.delete(updatedOptions);\n },\n );\n }\n\n /**\n * Creates a new file or replaces a file under this directory. Note it only initializes the file with no content.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-file\n *\n * @param fileName -\n * @param size - Specifies the maximum size in bytes for the file, up to 4 TB.\n * @param options - Options to File Create operation.\n * @returns File creation response data and the corresponding file client.\n */\n public async createFile(\n fileName: string,\n size: number,\n options: FileCreateOptions = {},\n ): Promise<{ fileClient: ShareFileClient; fileCreateResponse: FileCreateResponse }> {\n return tracingClient.withSpan(\n \"ShareDirectoryClient-createFile\",\n options,\n async (updatedOptions) => {\n const fileClient = this.getFileClient(fileName);\n const fileCreateResponse = await fileClient.create(size, updatedOptions);\n return {\n fileClient,\n fileCreateResponse,\n };\n },\n );\n }\n\n /**\n * Removes the specified file under this directory from the storage account.\n * When a file is successfully deleted, it is immediately removed from the storage\n * account's index and is no longer accessible to clients. The file's data is later\n * removed from the service during garbage collection.\n *\n * Delete File will fail with status code 409 (Conflict) and error code SharingViolation\n * if the file is open on an SMB client.\n *\n * Delete File is not supported on a share snapshot, which is a read-only copy of\n * a share. An attempt to perform this operation on a share snapshot will fail with 400 (InvalidQueryParameterValue)\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-file2\n *\n * @param fileName - Name of the file to delete\n * @param options - Options to File Delete operation.\n * @returns File deletion response data.\n */\n public async deleteFile(\n fileName: string,\n options: FileDeleteOptions = {},\n ): Promise<FileDeleteResponse> {\n return tracingClient.withSpan(\n \"ShareDirectoryClient-deleteFile\",\n options,\n async (updatedOptions) => {\n const fileClient = this.getFileClient(fileName);\n return fileClient.delete(updatedOptions);\n },\n );\n }\n\n /**\n * Creates a {@link ShareFileClient} object.\n *\n * @param fileName - A file name.\n * @returns A new ShareFileClient object for the given file name.\n *\n * Example usage:\n *\n * ```js\n * const content = \"Hello world!\"\n *\n * const fileClient = directoryClient.getFileClient(\"<file name>\");\n *\n * await fileClient.create(content.length);\n * console.log(\"Created file successfully!\");\n *\n * await fileClient.uploadRange(content, 0, content.length);\n * console.log(\"Updated file successfully!\")\n * ```\n */\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-subclients */\n public getFileClient(fileName: string): ShareFileClient {\n return new ShareFileClient(\n appendToURLPath(this.url, EscapePath(fileName)),\n this.pipeline,\n this.shareClientConfig,\n );\n }\n\n /**\n * Returns true if the specified directory exists; false otherwise.\n *\n * NOTE: use this function with care since an existing directory might be deleted by other clients or\n * applications. Vice versa new directories might be added by other clients or applications after this\n * function completes.\n *\n * @param options - options to Exists operation.\n */\n public async exists(options: DirectoryExistsOptions = {}): Promise<boolean> {\n return tracingClient.withSpan(\n \"ShareDirectoryClient-exists\",\n options,\n async (updatedOptions) => {\n try {\n await this.getProperties({ ...updatedOptions, ...this.shareClientConfig });\n return true;\n } catch (e: any) {\n if (e.statusCode === 404) {\n return false;\n }\n throw e;\n }\n },\n );\n }\n\n /**\n * Returns all system properties for the specified directory, and can also be used to check the\n * existence of a directory. The data returned does not include the files in the directory or any\n * subdirectories.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-directory-properties\n *\n * @param options - Options to Directory Get Properties operation.\n * @returns Response data for the Directory Get Properties operation.\n */\n public async getProperties(\n options: DirectoryGetPropertiesOptions = {},\n ): Promise<DirectoryGetPropertiesResponse> {\n return tracingClient.withSpan(\n \"ShareDirectoryClient-getProperties\",\n options,\n async (updatedOptions) => {\n return assertResponse<DirectoryGetPropertiesHeaders, DirectoryGetPropertiesHeaders>(\n await this.context.getProperties({ ...updatedOptions, ...this.shareClientConfig }),\n );\n },\n );\n }\n\n /**\n * Removes the specified empty directory. Note that the directory must be empty before it can be\n * deleted.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-directory\n *\n * @param options - Options to Directory Delete operation.\n * @returns Response data for the Directory Delete operation.\n */\n public async delete(options: DirectoryDeleteOptions = {}): Promise<DirectoryDeleteResponse> {\n return tracingClient.withSpan(\n \"ShareDirectoryClient-delete\",\n options,\n async (updatedOptions) => {\n return assertResponse<DirectoryDeleteHeaders, DirectoryDeleteHeaders>(\n await this.context.delete({ ...updatedOptions, ...this.shareClientConfig }),\n );\n },\n );\n }\n\n /**\n * Removes the specified empty directory if it exists. Note that the directory must be empty before it can be\n * deleted.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-directory\n *\n * @param options -\n */\n public async deleteIfExists(\n options: DirectoryDeleteOptions = {},\n ): Promise<DirectoryDeleteIfExistsResponse> {\n return tracingClient.withSpan(\n \"ShareDirectoryClient-deleteIfExists\",\n options,\n async (updatedOptions) => {\n try {\n const res = await this.delete(updatedOptions);\n return {\n succeeded: true,\n ...res,\n };\n } catch (e: any) {\n if (\n e.details?.errorCode === \"ResourceNotFound\" ||\n e.details?.errorCode === \"ParentNotFound\"\n ) {\n return {\n succeeded: false,\n ...e.response?.parsedHeaders,\n _response: e.response,\n };\n }\n throw e;\n }\n },\n );\n }\n\n /**\n * Updates user defined metadata for the specified directory.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-directory-metadata\n *\n * @param metadata - If no metadata provided, all existing directory metadata will be removed\n * @param options - Options to Directory Set Metadata operation.\n * @returns Response data for the Directory Set Metadata operation.\n */\n public async setMetadata(\n metadata?: Metadata,\n options: DirectorySetMetadataOptions = {},\n ): Promise<DirectorySetMetadataResponse> {\n return tracingClient.withSpan(\n \"ShareDirectoryClient-setMetadata\",\n options,\n async (updatedOptions) => {\n return assertResponse<DirectorySetMetadataHeaders, DirectorySetMetadataHeaders>(\n await this.context.setMetadata({\n ...updatedOptions,\n metadata,\n ...this.shareClientConfig,\n }),\n );\n },\n );\n }\n\n /**\n * Returns an AsyncIterableIterator for {@link DirectoryListFilesAndDirectoriesSegmentResponse} objects\n *\n * @param marker - A string value that identifies the portion of\n * the list of files and directories to be returned with the next listing operation. The\n * operation returns the ContinuationToken value within the response body if the\n * listing operation did not return all files and directories remaining to be listed\n * with the current page. The ContinuationToken value can be used as the value for\n * the marker parameter in a subsequent call to request the next page of list\n * items. The marker value is opaque to the client.\n * @param options - Options to list files and directories operation.\n */\n private async *iterateFilesAndDirectoriesSegments(\n marker?: string,\n options: DirectoryListFilesAndDirectoriesSegmentOptions = {},\n ): AsyncIterableIterator<DirectoryListFilesAndDirectoriesSegmentResponse> {\n if (options.prefix === \"\") {\n options.prefix = undefined;\n }\n\n let listFilesAndDirectoriesResponse;\n do {\n listFilesAndDirectoriesResponse = await this.listFilesAndDirectoriesSegment(marker, options);\n marker = listFilesAndDirectoriesResponse.continuationToken;\n yield await listFilesAndDirectoriesResponse;\n } while (marker);\n }\n\n /**\n * Returns an AsyncIterableIterator for file and directory items\n *\n * @param options - Options to list files and directories operation.\n */\n private async *listFilesAndDirectoriesItems(\n options: DirectoryListFilesAndDirectoriesSegmentOptions = {},\n ): AsyncIterableIterator<\n ({ kind: \"file\" } & FileItem) | ({ kind: \"directory\" } & DirectoryItem)\n > {\n if (options.prefix === \"\") {\n options.prefix = undefined;\n }\n\n let marker: string | undefined;\n for await (const listFilesAndDirectoriesResponse of this.iterateFilesAndDirectoriesSegments(\n marker,\n options,\n )) {\n for (const file of listFilesAndDirectoriesResponse.segment.fileItems) {\n yield { kind: \"file\", ...file };\n }\n for (const directory of listFilesAndDirectoriesResponse.segment.directoryItems) {\n yield { kind: \"directory\", ...directory };\n }\n }\n }\n\n /**\n * Returns an async iterable iterator to list all the files and directories\n * under the specified account.\n *\n * .byPage() returns an async iterable iterator to list the files and directories in pages.\n *\n * Example using `for await` syntax:\n *\n * ```js\n * let i = 1;\n * for await (const entity of directoryClient.listFilesAndDirectories()) {\n * if (entity.kind === \"directory\") {\n * console.log(`${i++} - directory\\t: ${entity.name}`);\n * } else {\n * console.log(`${i++} - file\\t: ${entity.name}`);\n * }\n * }\n * ```\n *\n * Example using `iter.next()`:\n *\n * ```js\n * let i = 1;\n * let iter = directoryClient.listFilesAndDirectories();\n * let entity = await iter.next();\n * while (!entity.done) {\n * if (entity.value.kind === \"directory\") {\n * console.log(`${i++} - directory\\t: ${entity.value.name}`);\n * } else {\n * console.log(`${i++} - file\\t: ${entity.value.name}`);\n * }\n * entity = await iter.next();\n * }\n * ```\n *\n * Example using `byPage()`:\n *\n * ```js\n * // passing optional maxPageSize in the page settings\n * let i = 1;\n * for await (const response of directoryClient\n * .listFilesAndDirectories()\n * .byPage({ maxPageSize: 20 })) {\n * for (const fileItem of response.segment.fileItems) {\n * console.log(`${i++} - file\\t: ${fileItem.name}`);\n * }\n * for (const dirItem of response.segment.directoryItems) {\n * console.log(`${i++} - directory\\t: ${dirItem.name}`);\n * }\n * }\n * ```\n *\n * Example using paging with a marker:\n *\n * ```js\n * let i = 1;\n * let iterator = directoryClient.listFilesAndDirectories().byPage({ maxPageSize: 3 });\n * let response = (await iterator.next()).value;\n *\n * // Prints 3 file and directory names\n * for (const fileItem of response.segment.fileItems) {\n * console.log(`${i++} - file\\t: ${fileItem.name}`);\n * }\n *\n * for (const dirItem of response.segment.directoryItems) {\n * console.log(`${i++} - directory\\t: ${dirItem.name}`);\n * }\n *\n * // Gets next marker\n * let dirMarker = response.continuationToken;\n *\n * // Passing next marker as continuationToken\n * iterator = directoryClient\n * .listFilesAndDirectories()\n * .byPage({ continuationToken: dirMarker, maxPageSize: 4 });\n * response = (await iterator.next()).value;\n *\n * // Prints 10 file and directory names\n * for (const fileItem of response.segment.fileItems) {\n * console.log(`${i++} - file\\t: ${fileItem.name}`);\n * }\n *\n * for (const dirItem of response.segment.directoryItems) {\n * console.log(`${i++} - directory\\t: ${dirItem.name}`);\n * }\n * ```\n *\n * @param options - Options to list files and directories operation.\n * @returns An asyncIterableIterator that supports paging.\n */\n public listFilesAndDirectories(\n options: DirectoryListFilesAndDirectoriesOptions = {},\n ): PagedAsyncIterableIterator<\n ({ kind: \"file\" } & FileItem) | ({ kind: \"directory\" } & DirectoryItem),\n DirectoryListFilesAndDirectoriesSegmentResponse\n > {\n const include: ListFilesIncludeType[] = [];\n if (options.includeTimestamps) {\n include.push(\"Timestamps\");\n }\n if (options.includeEtag) {\n include.push(\"Etag\");\n }\n if (options.includeAttributes) {\n include.push(\"Attributes\");\n }\n if (options.includePermissionKey) {\n include.push(\"PermissionKey\");\n }\n if (options.prefix === \"\") {\n options.prefix = undefined;\n }\n\n const updatedOptions: DirectoryListFilesAndDirectoriesSegmentOptions = {\n ...options,\n ...(include.length > 0 ? { include: include } : {}),\n };\n\n // AsyncIterableIterator to iterate over files and directories\n const iter = this.listFilesAndDirectoriesItems(updatedOptions);\n return {\n /**\n * The next method, part of the iteration protocol\n */\n async next() {\n return iter.next();\n },\n /**\n * The connection to the async iterator, part of the iteration protocol\n */\n [Symbol.asyncIterator]() {\n return this;\n },\n /**\n * Return an AsyncIterableIterator that works a page at a time\n */\n byPage: (settings: PageSettings = {}) => {\n return this.iterateFilesAndDirectoriesSegments(\n removeEmptyString(settings.continuationToken),\n {\n maxResults: settings.maxPageSize,\n ...updatedOptions,\n },\n );\n },\n };\n }\n\n /**\n * Returns a list of files or directories under the specified share or directory. It lists the\n * contents only for a single level of the directory hierarchy.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/list-directories-and-files\n *\n * @param marker - A string value that identifies the portion of the list to be returned with the next list operation.\n * @param options - Options to Directory List Files and Directories Segment operation.\n * @returns Response data for the Directory List Files and Directories operation.\n */\n private async listFilesAndDirectoriesSegment(\n marker?: string,\n options: DirectoryListFilesAndDirectoriesSegmentOptions = {},\n ): Promise<DirectoryListFilesAndDirectoriesSegmentResponse> {\n if (options.prefix === \"\") {\n options.prefix = undefined;\n }\n return tracingClient.withSpan(\n \"ShareDirectoryClient-listFilesAndDirectoriesSegment\",\n options,\n async (updatedOptions) => {\n const rawResponse = assertResponse<\n DirectoryListFilesAndDirectoriesSegmentHeaders &\n GeneratedListFilesAndDirectoriesSegmentResponse,\n DirectoryListFilesAndDirectoriesSegmentHeaders,\n GeneratedListFilesAndDirectoriesSegmentResponse\n >(\n await this.context.listFilesAndDirectoriesSegment({\n ...updatedOptions,\n marker,\n ...this.shareClientConfig,\n }),\n );\n const wrappedResponse: DirectoryListFilesAndDirectoriesSegmentResponse = {\n ...ConvertInternalResponseOfListFiles(rawResponse),\n _response: {\n ...rawResponse._response,\n parsedBody: ConvertInternalResponseOfListFiles(rawResponse._response.parsedBody),\n }, // _response is made non-enumerable\n };\n return wrappedResponse;\n },\n );\n }\n\n /**\n * Returns an AsyncIterableIterator for {@link DirectoryListHandlesResponse}\n *\n * @param marker - A string value that identifies the portion of the list to be\n * returned with the next list handles operation. The operation returns a\n * marker value within the response body if the list returned was not complete.\n * The marker value may then be used in a subsequent call to request the next\n * set of list items.\n * @param options - Options to list handles operation.\n */\n private async *iterateHandleSegments(\n marker?: string,\n options: DirectoryListHandlesSegmentOptions = {},\n ): AsyncIterableIterator<DirectoryListHandlesResponse> {\n let listHandlesResponse;\n if (!!marker || marker === undefined) {\n do {\n listHandlesResponse = await this.listHandlesSegment(marker, options);\n marker = listHandlesResponse.continuationToken;\n yield await listHandlesResponse;\n } while (marker);\n }\n }\n\n /**\n * Returns an AsyncIterableIterator for handles\n *\n * @param options - Options to list handles operation.\n */\n private async *listHandleItems(\n options: DirectoryListHandlesSegmentOptions = {},\n ): AsyncIterableIterator<HandleItem> {\n let marker: string | undefined;\n for await (const listHandlesResponse of this.iterateHandleSegments(marker, options)) {\n if (listHandlesResponse.handleList) {\n for (const handle of listHandlesResponse.handleList) {\n yield handle;\n }\n }\n }\n }\n\n /**\n * Returns an async iterable iterator to list all the handles.\n * under the specified account.\n *\n * .byPage() returns an async iterable iterator to list the handles in pages.\n *\n * Example using `for await` syntax:\n *\n * ```js\n * let i = 1;\n * let iter = dirClient.listHandles();\n * for await (const handle of iter) {\n * console.log(`Handle ${i++}: ${handle.path}, opened time ${handle.openTime}, clientIp ${handle.clientIp}`);\n * }\n * ```\n *\n * Example using `iter.next()`:\n *\n * ```js\n * let i = 1;\n * let iter = dirClient.listHandles();\n * let handleItem = await iter.next();\n * while (!handleItem.done) {\n * console.log(`Handle ${i++}: ${handleItem.value.path}, opened time ${handleItem.value.openTime}, clientIp ${handleItem.value.clientIp}`);\n * handleItem = await iter.next();\n * }\n * ```\n *\n * Example using `byPage()`:\n *\n * ```js\n * // passing optional maxPageSize in the page settings\n * let i = 1;\n * for await (const response of dirClient.listHandles({ recursive: true }).byPage({ maxPageSize: 20 })) {\n * if (response.handleList) {\n * for (const handle of response.handleList) {\n * console.log(`Handle ${i++}: ${handle.path}, opened time ${handle.openTime}, clientIp ${handle.clientIp}`);\n * }\n * }\n * }\n * ```\n *\n * Example using paging with a marker:\n *\n * ```js\n * let i = 1;\n * let iterator = dirClient.listHandles().byPage({ maxPageSize: 2 });\n * let response = await iterator.next();\n *\n * // Prints 2 handles\n * if (response.value.handleList) {\n * for (const handle of response.value.handleList) {\n * console.log(`Handle ${i++}: ${handle.path}, opened time ${handle.openTime}, clientIp ${handle.clientIp}`);\n * }\n * }\n *\n * // Gets next marker\n * let marker = response.value.continuationToken;\n *\n * // Passing next marker as continuationToken\n * console.log(` continuation`);\n * iterator = dirClient.listHandles().byPage({ continuationToken: marker, maxPageSize: 10 });\n * response = await iterator.next();\n *\n * // Prints 2 more handles assuming you have more than four directory/files opened\n * if (!response.done && response.value.handleList) {\n * for (const handle of response.value.handleList) {\n * console.log(`Handle ${i++}: ${handle.path}, opened time ${handle.openTime}, clientIp ${handle.clientIp}`);\n * }\n * }\n * ```\n *\n * @param options - Options to list handles operation.\n *\n * An asyncIterableIterator that supports paging.\n */\n public listHandles(\n options: DirectoryListHandlesOptions = {},\n ): PagedAsyncIterableIterator<HandleItem, DirectoryListHandlesResponse> {\n // an AsyncIterableIterator to iterate over handles\n const iter = this.listHandleItems(options);\n return {\n /**\n * The next method, part of the iteration protocol\n */\n async next() {\n return iter.next();\n },\n /**\n * The connection to the async iterator, part of the iteration protocol\n */\n [Symbol.asyncIterator]() {\n return this;\n },\n /**\n * Return an AsyncIterableIterator that works a page at a time\n */\n byPage: (settings: PageSettings = {}) => {\n return this.iterateHandleSegments(removeEmptyString(settings.continuationToken), {\n maxResults: settings.maxPageSize,\n ...options,\n });\n },\n };\n }\n\n /**\n * Lists handles for a directory.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/list-handles\n *\n * @param marker - Optional. A string value that identifies the portion of the list to be\n * returned with the next list handles operation. The operation returns a\n * marker value within the response body if the list returned was not complete.\n * The marker value may then be used in a subsequent call to request the next\n * set of list items.\n * @param options -\n */\n private async listHandlesSegment(\n marker?: string,\n options: DirectoryListHandlesSegmentOptions = {},\n ): Promise<DirectoryListHandlesResponse> {\n return tracingClient.withSpan(\n \"ShareDirectoryClient-listHandlesSegment\",\n options,\n async (updatedOptions) => {\n marker = marker === \"\" ? undefined : marker;\n const response = assertResponse<\n DirectoryListHandlesHeaders & GeneratedListHandlesResponse,\n DirectoryListHandlesHeaders,\n GeneratedListHandlesResponse\n >(\n await this.context.listHandles({\n ...updatedOptions,\n marker,\n ...this.shareClientConfig,\n }),\n );\n\n // TODO: Protocol layer issue that when handle list is in returned XML\n // response.handleList is an empty string\n if ((response.handleList as any) === \"\") {\n response.handleList = undefined;\n }\n const wrappedResponse: DirectoryListHandlesResponse = {\n ...ConvertInternalResponseOfListHandles(response),\n _response: {\n ...response._response,\n parsedBody: ConvertInternalResponseOfListHandles(response._response.parsedBody),\n },\n };\n\n return wrappedResponse;\n },\n );\n }\n\n /**\n * Force close all handles for a directory.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/force-close-handles\n *\n * @param marker - Optional. A string value that identifies the position of handles that will\n * be closed with the next force close handles operation.\n * The operation returns a marker value within the response\n * body if there are more handles to close. The marker value\n * may then be used in a subsequent call to close the next set of handles.\n * @param options -\n */\n private async forceCloseHandlesSegment(\n marker?: string,\n options: DirectoryForceCloseHandlesSegmentOptions = {},\n ): Promise<DirectoryForceCloseHandlesResponse> {\n return tracingClient.withSpan(\n \"ShareDirectoryClient-forceCloseHandlesSegment\",\n options,\n async (updatedOptions) => {\n if (marker === \"\") {\n marker = undefined;\n }\n const rawResponse = assertResponse<\n DirectoryForceCloseHandlesHeaders,\n DirectoryForceCloseHandlesHeaders\n >(\n await this.context.forceCloseHandles(\"*\", {\n ...updatedOptions,\n marker,\n ...this.shareClientConfig,\n }),\n );\n return {\n ...rawResponse,\n closedHandlesCount: rawResponse.numberOfHandlesClosed ?? 0,\n closeFailureCount: rawResponse.numberOfHandlesFailedToClose ?? 0,\n };\n },\n );\n }\n\n /**\n * Force close all handles for a directory.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/force-close-handles\n *\n * @param options -\n */\n public async forceCloseAllHandles(\n options: DirectoryForceCloseHandlesSegmentOptions = {},\n ): Promise<CloseHandlesInfo> {\n return tracingClient.withSpan(\n \"ShareDirectoryClient-forceCloseAllHandles\",\n options,\n async (updatedOptions) => {\n let handlesClosed = 0;\n let numberOfHandlesFailedToClose = 0;\n let marker: string | undefined = \"\";\n\n do {\n const response = await this.forceCloseHandlesSegment(marker, updatedOptions);\n marker = response.marker;\n if (response.closedHandlesCount) {\n handlesClosed += response.closedHandlesCount;\n }\n if (response.closeFailureCount) {\n numberOfHandlesFailedToClose += response.closeFailureCount;\n }\n } while (marker);\n\n return {\n closedHandlesCount: handlesClosed,\n closeFailureCount: numberOfHandlesFailedToClose,\n };\n },\n );\n }\n\n /**\n * Force close a specific handle for a directory.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/force-close-handles\n *\n * @param aborter - Create a new Aborter instance with Aborter.none or Aborter.timeout(),\n * goto documents of Aborter for more examples about request cancellation\n * @param handleId - Specific handle ID, cannot be asterisk \"*\".\n * Use forceCloseHandlesSegment() to close all handles.\n * @param options -\n */\n public async forceCloseHandle(\n handleId: string,\n options: DirectoryForceCloseHandlesOptions = {},\n ): Promise<DirectoryForceCloseHandlesResponse> {\n return tracingClient.withSpan(\n \"ShareDirectoryClient-forceCloseHandle\",\n options,\n async (updatedOptions) => {\n if (handleId === \"*\") {\n throw new RangeError(\n `Parameter handleID should be a specified handle ID. Use forceCloseHandlesSegment() to close all handles.`,\n );\n }\n\n const rawResponse = await this.context.forceCloseHandles(handleId, {\n ...updatedOptions,\n ...this.shareClientConfig,\n });\n const response = rawResponse as DirectoryForceCloseHandlesResponse;\n response.closedHandlesCount = rawResponse.numberOfHandlesClosed || 0;\n response.closeFailureCount = rawResponse.numberOfHandlesFailedToClose || 0;\n return response;\n },\n );\n }\n\n /**\n * Renames a directory.\n * This API only supports renaming a directory in the same share.\n *\n * @param destinationPath - Specifies the destination path to rename to. The path will be encoded to put into a URL to specify the destination.\n * @param options - Options for the renaming operation.\n * @returns Response data for the file renaming operation.\n *\n * Example usage:\n *\n * ```js\n *\n * // Rename the directory\n * await diretoryClient.rename(destinationPath);\n * console.log(\"Renamed directory successfully!\");\n * ```\n */\n public async rename(\n destinationPath: string,\n options: DirectoryRenameOptions = {},\n ): Promise<{\n destinationDirectoryClient: ShareDirectoryClient;\n directoryRenameResponse: DirectoryRenameResponse;\n }> {\n const split: string[] = destinationPath.split(\"?\");\n let destinationUrl: string;\n if (split.length === 2) {\n const pathOnly = EscapePath(split[0]);\n const renameDestination = `/${this.shareName}/${pathOnly}`;\n destinationUrl = setURLPath(this.url, renameDestination);\n destinationUrl = setURLQueries(destinationUrl, split[1]);\n } else if (split.length === 1) {\n const pathOnly = EscapePath(destinationPath);\n const renameDestination = `/${this.shareName}/${pathOnly}`;\n destinationUrl = setURLPath(this.url, renameDestination);\n } else {\n throw new RangeError(\"Destination path should not contain more than one query string\");\n }\n\n const destDirectory = new ShareDirectoryClient(\n destinationUrl,\n this.pipeline,\n this.shareClientConfig,\n );\n\n return tracingClient.withSpan(\n \"ShareDirectoryClient-rename\",\n options,\n async (updatedOptions) => {\n const response = assertResponse<DirectoryRenameHeaders, DirectoryRenameHeaders>(\n await destDirectory.context.rename(this.url, {\n ...updatedOptions,\n sourceLeaseAccessConditions: updatedOptions.sourceLeaseAccessConditions\n ? {\n sourceLeaseId: updatedOptions.sourceLeaseAccessConditions.leaseId,\n }\n : undefined,\n destinationLeaseAccessConditions: updatedOptions.destinationLeaseAccessConditions\n ? {\n destinationLeaseId: updatedOptions.destinationLeaseAccessConditions.leaseId,\n }\n : undefined,\n ...this.shareClientConfig,\n }),\n );\n\n return {\n destinationDirectoryClient: destDirectory,\n directoryRenameResponse: response,\n };\n },\n );\n }\n}\n\n/**\n * Options to configure the {@link ShareFileClient.create} operation.\n */\nexport interface FileCreateOptions extends FileAndDirectoryCreateCommonOptions, CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * File HTTP headers like Content-Type.\n */\n fileHttpHeaders?: FileHttpHeaders;\n\n /**\n * A collection of key-value string pair to associate with the file storage object.\n */\n metadata?: Metadata;\n /**\n * Lease access conditions.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n}\n\nexport interface FileProperties extends FileAndDirectorySetPropertiesCommonOptions, CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * File HTTP headers like Content-Type.\n */\n fileHttpHeaders?: FileHttpHeaders;\n /**\n * Lease access conditions.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n}\n\nexport interface SetPropertiesResponse extends FileSetHTTPHeadersResponse {}\n\n/**\n * Options to configure the {@link ShareFileClient.delete} operation.\n */\nexport interface FileDeleteOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Lease access conditions.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n}\n\n/**\n * Options to configure File - Download operations.\n *\n * See:\n * - {@link ShareFileClient.download}\n * - {@link ShareFileClient.downloadToFile}\n */\nexport interface FileDownloadOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Optional. ONLY AVAILABLE IN NODE.JS.\n *\n * How many retries will perform when original body download stream unexpected ends.\n * Above kind of ends will not trigger retry policy defined in a pipeline,\n * because they doesn't emit network errors.\n *\n * With this option, every additional retry means an additional ShareFileClient.download() request will be made\n * from the broken point, until the requested range has been successfully downloaded or maxRetryRequests is reached.\n *\n * Default value is 5, please set a larger value when loading large files in poor network.\n */\n maxRetryRequests?: number;\n\n /**\n * When this header is set to true and\n * specified together with the Range header, the service returns the MD5 hash\n * for the range, as long as the range is less than or equal to 4 MB in size.\n */\n rangeGetContentMD5?: boolean;\n\n /**\n * Download progress updating event handler.\n */\n onProgress?: (progress: TransferProgressEvent) => void;\n /**\n * Lease access conditions.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n}\n\n/**\n * Options to configure the {@link ShareFileClient.uploadRange} operation.\n */\nexport interface FileUploadRangeOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * An MD5 hash of the content. This hash is\n * used to verify the integrity of the data during transport. When the\n * Content-MD5 header is specified, the File service compares the hash of the\n * content that has arrived with the header value that was sent. If the two\n * hashes do not match, the operation will fail with error code 400 (Bad\n * Request).\n */\n contentMD5?: Uint8Array;\n\n /**\n * Progress updating event handler.\n */\n onProgress?: (progress: TransferProgressEvent) => void;\n /**\n * Lease access conditions.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n\n /**\n * The last write time for the file.\n * A value of Preserve may be passed to keep an existing value unchanged.\n * A value of Now may be used to indicate the time of the request.\n * By default, the value will be set as Now.\n */\n fileLastWrittenMode?: FileLastWrittenMode;\n}\n\n/**\n * Options to configure the {@link ShareFileClient.uploadRangeFromURL} operation.\n */\nexport interface FileUploadRangeFromURLOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * The timeout parameter is expressed in seconds. For more information, see <a\n * href=\"https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN\">Setting\n * Timeouts for File Service Operations.</a>\n */\n timeoutInSeconds?: number;\n /**\n * Specify the crc64 calculated for the range of bytes that must be read from the copy source.\n */\n sourceContentCrc64?: Uint8Array;\n /**\n * Additional parameters for the operation\n */\n sourceConditions?: SourceModifiedAccessConditions;\n /**\n * Lease access conditions.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n /**\n * Only Bearer type is supported. Credentials should be a valid OAuth access token to copy source.\n */\n sourceAuthorization?: HttpAuthorization;\n /**\n * The last write time for the file.\n * A value of preserve may be passed to keep an existing value unchanged.\n * A value of now may be used to indicate the time of the request.\n * By default, the value will be set as now.\n */\n fileLastWrittenMode?: FileLastWrittenMode;\n}\n\n/**\n * The option is defined as parity to REST definition.\n * While it's not ready to be used now, considering Crc64 of source content is\n * not accessible.\n */\n// export interface IFileUploadRangeFromURLOptions extends CommonOptions {\n// /**\n// * Crc64 of the source content.\n// *\n// * @type {Uint8Array}\n// * @memberof IFileUploadRangeFromURLOptions\n// */\n// sourceContentCrc64?: Uint8Array;\n\n// /**\n// * Source modified access condition.\n// *\n// * @type {SourceModifiedAccessConditions}\n// * @memberof IFileUploadRangeFromURLOptions\n// */\n// sourceModifiedAccessConditions?: SourceModifiedAccessConditions;\n// }\n\n/**\n * Options to configure the {@link ShareFileClient.getRangeList} operation.\n */\nexport interface FileGetRangeListOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Optional. Specifies the range of bytes over which to list ranges, inclusively.\n */\n range?: Range;\n /**\n * Lease access conditions.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n /**\n * This header is allowed only when prevShareSnapshot parameter is set.\n * Determines whether the changed ranges for a file that has been renamed or moved between the target snapshot (or the live file) and the previous snapshot should be listed.\n * If the value is true, the valid changed ranges for the file will be returned. If the value is false, the operation will result in a failure with 409 (Conflict) response.\n * The default value is false.\n */\n includeRenames?: boolean;\n}\n\n/**\n * Options to configure the {@link ShareFileClient.exists} operation.\n */\nexport interface FileExistsOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Options to configure the {@link ShareFileClient.getProperties} operation.\n */\nexport interface FileGetPropertiesOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Lease access conditions.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n}\n\n/**\n * Contains response data for the {@link ShareFileClient.getRangeList} operation.\n */\nexport type FileGetRangeListResponse = WithResponse<\n FileGetRangeListHeaders & {\n /**\n * Range list for an Azure file.\n */\n rangeList: RangeModel[];\n },\n FileGetRangeListHeaders,\n RangeModel[]\n>;\n\n/**\n * Options to configure the {@link ShareFileClient.startCopyFromURL} operation.\n */\nexport interface FileStartCopyOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * A collection of key-value string pair to associate with the file storage object.\n */\n metadata?: Metadata;\n /**\n * Lease access conditions.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n /**\n * If specified the permission (security descriptor) shall be set for the directory/file. This\n * header can be used if Permission size is lesser than or equal to 8KB, else x-ms-file-permission-key header shall be\n * used. Default value: Inherit. If SDDL is specified as input, it must have owner, group and\n * dacl. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be\n * specified.\n */\n filePermission?: string;\n /**\n * Optional. Available for version 2023-06-01 and later. Specifies the format in which the permission is returned.\n * Acceptable values are SDDL or binary. If x-ms-file-permission-format is unspecified or explicitly set to SDDL, the permission is returned in SDDL format.\n * If x-ms-file-permission-format is explicitly set to binary, the permission is returned as a base64 string representing the binary encoding of the permission\n */\n filePermissionFormat?: FilePermissionFormat;\n /**\n * Key of the permission to be set for the directory/file. Note: Only one of the\n * x-ms-file-permission or x-ms-file-permission-key should be specified.\n */\n filePermissionKey?: string;\n /**\n * SMB info.\n */\n copyFileSmbInfo?: CopyFileSmbInfo;\n}\n\n/**\n * Options to configure the {@link ShareFileClient.setMetadata} operation.\n */\nexport interface FileSetMetadataOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Lease access conditions.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n}\n\n/**\n * Options to configure the {@link ShareFileClient.setHttpHeaders} operation.\n */\nexport interface FileSetHttpHeadersOptions\n extends FileAndDirectorySetPropertiesCommonOptions,\n CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Lease access conditions.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n}\n\n/**\n * Options to configure the {@link ShareFileClient.abortCopyFromURL} operation.\n */\nexport interface FileAbortCopyFromURLOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Lease access conditions.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n}\n\n/**\n * Options to configure the {@link ShareFileClient.resize} operation.\n */\nexport interface FileResizeOptions\n extends FileAndDirectorySetPropertiesCommonOptions,\n CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Lease access conditions.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n}\n\n/**\n * Options to configure the {@link ShareFileClient.clearRange} operation.\n */\nexport interface FileClearRangeOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Lease access conditions.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n /**\n * The last write time for the file.\n * A value of preserve may be passed to keep an existing value unchanged.\n * A value of now may be used to indicate the time of the request.\n * By default, the value will be set as now.\n */\n fileLastWrittenMode?: FileLastWrittenMode;\n}\n\n/**\n * Options to configure File - List Handles Segment operations.\n *\n * See:\n * - {@link ShareFileClient.listHandlesSegment}\n * - {@link ShareFileClient.iterateHandleSegments}\n * - {@link ShareFileClient.listHandleItems}\n */\nexport interface FileListHandlesSegmentOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Specifies the maximum number of entries to return. If the request does not specify maxResults,\n * or specifies a value greater than 5,000, the server will return up to 5,000 items.\n */\n maxPageSize?: number;\n}\n\nexport interface FileListHandlesOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Options to configure File - Force Close Handles operations.\n *\n * See:\n * - {@link ShareFileClient.forceCloseHandlesSegment}\n * - {@link ShareFileClient.forceCloseAllHandles}\n * - {@link ShareFileClient.forceCloseHandle}\n */\nexport interface FileForceCloseHandlesOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Additional response header values for close handles request.\n */\nexport interface FileCloseHandlesHeaders {\n /**\n * This header uniquely identifies the request that was made and can be used for troubleshooting\n * the request.\n */\n requestId?: string;\n /**\n * Indicates the version of the File service used to execute the request.\n */\n version?: string;\n /**\n * A UTC date/time value generated by the service that indicates the time at which the response\n * was initiated.\n */\n date?: Date;\n /**\n * A string describing next handle to be closed. It is returned when more handles need to be\n * closed to complete the request.\n */\n marker?: string;\n}\n\n/**\n * Response type for {@link ShareFileClient.forceCloseHandle}.\n */\nexport type FileForceCloseHandlesResponse = WithResponse<\n CloseHandlesInfo & FileCloseHandlesHeaders,\n FileForceCloseHandlesHeaders\n>;\n\n/**\n * Option interface for ShareFileClient.uploadStream().\n */\nexport interface FileUploadStreamOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Azure File HTTP Headers.\n */\n fileHttpHeaders?: FileHttpHeaders;\n\n /**\n * Metadata of the Azure file.\n */\n metadata?: Metadata;\n\n /**\n * Progress updater.\n */\n onProgress?: (progress: TransferProgressEvent) => void;\n /**\n * Lease access conditions.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n}\n\n/**\n * Option interface for File - Upload operations\n *\n * See:\n * - {@link ShareFileClient.uploadFile}\n * - {@link ShareFileClient.uploadSeekableStream}\n */\nexport interface FileParallelUploadOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * RangeSize specifies the range size to use in each parallel upload,\n * the default (and maximum size) is FILE_RANGE_MAX_SIZE_BYTES.\n */\n rangeSize?: number;\n\n /**\n * Progress updater.\n */\n onProgress?: (progress: TransferProgressEvent) => void;\n\n /**\n * File HTTP Headers.\n */\n fileHttpHeaders?: FileHttpHeaders;\n\n /**\n * Metadata of an Azure file.\n */\n metadata?: Metadata;\n\n /**\n * Concurrency indicates the maximum number of ranges to upload in parallel.\n * If not provided, 5 concurrency will be used by default.\n */\n concurrency?: number;\n /**\n * Lease access conditions.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n}\n\n/**\n * Option interface for the {@link ShareFileClient.downloadToBuffer} operation.\n */\nexport interface FileDownloadToBufferOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * When downloading Azure files, download method will try to split large file into small ranges.\n * Every small range will be downloaded via a separate request.\n * This option defines size data every small request trying to download.\n * Must be greater than 0, will use the default value if undefined,\n */\n rangeSize?: number;\n\n /**\n * Optional. ONLY AVAILABLE IN NODE.JS.\n *\n * How many retries will perform when original range download stream unexpected ends.\n * Above kind of ends will not trigger retry policy defined in a pipeline,\n * because they doesn't emit network errors.\n *\n * With this option, every additional retry means an additional ShareFileClient.download() request will be made\n * from the broken point, until the requested range has been successfully downloaded or\n * maxRetryRequestsPerRange is reached.\n *\n * Default value is 5, please set a larger value when in poor network.\n */\n maxRetryRequestsPerRange?: number;\n\n /**\n * Progress updater.\n */\n onProgress?: (progress: TransferProgressEvent) => void;\n\n /**\n * Concurrency indicates the maximum number of ranges to download in parallel.\n * If not provided, 5 concurrency will be used by default.\n */\n concurrency?: number;\n /**\n * Lease access conditions.\n */\n leaseAccessConditions?: LeaseAccessConditions;\n}\n\n/**\n * Contains response data for the {@link ShareFileClient.deleteIfExists} operation.\n */\nexport interface FileDeleteIfExistsResponse extends FileDeleteResponse {\n /**\n * Indicate whether the file is successfully deleted. Is false if the file does not exist in the first place.\n */\n succeeded: boolean;\n}\n\n/**\n * Options to configure {@link ShareFileClient.generateSasUrl} operation.\n */\nexport interface FileGenerateSasUrlOptions extends CommonGenerateSasUrlOptions {\n /**\n * Optional only when identifier is provided. Specifies the list of permissions to be associated with the SAS.\n */\n permissions?: FileSASPermissions;\n}\n\n/**\n * Options to configure the {@link ShareFileClient.rename} operation.\n */\nexport interface FileRenameOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n\n /**\n * Lease access condition for source file. Required if the source file has an active infinite lease.\n */\n sourceLeaseAccessConditions?: LeaseAccessConditions;\n\n /**\n * Lease access condition for destination file. Required if the destination file has an active infinite lease.\n */\n destinationLeaseAccessConditions?: LeaseAccessConditions;\n\n /**\n * Optional.\n * Specifies the option to copy file security descriptor from source file or to set it using the value which is defined by the header value of x-ms-file-permission or x-ms-file-permission-key.\n */\n copyFileSmbInfo?: CopyFileSmbInfo;\n\n /**\n * A name-value pair to associate with a file storage object.\n */\n metadata?: Metadata;\n\n /**\n * Optional.\n * The timeout parameter is expressed in seconds. For more information, see <a href=\"https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN\">Setting Timeouts for File Service Operations.</a>\n */\n timeoutInSeconds?: number;\n\n /**\n * Optional.\n * If specified the permission (security descriptor) shall be set for the directory/file.\n */\n filePermission?: string;\n\n /**\n * Optional. Available for version 2023-06-01 and later. Specifies the format in which the permission is returned.\n * Acceptable values are SDDL or binary. If x-ms-file-permission-format is unspecified or explicitly set to SDDL, the permission is returned in SDDL format.\n * If x-ms-file-permission-format is explicitly set to binary, the permission is returned as a base64 string representing the binary encoding of the permission\n */\n filePermissionFormat?: FilePermissionFormat;\n\n /**\n * Optional.\n * Key of the permission to be set for the directory/file. Note: Only one of the filePermission or filePermissionKey should be specified.\n */\n filePermissionKey?: string;\n\n /**\n * Optional.\n * A boolean value for if the destination file already exists, whether this request will overwrite the file or not. If true, the rename will succeed and will overwrite the destination file. If not provided or if false and the destination file does exist, the request will not overwrite the destination file. If provided and the destination file doesn’t exist, the rename will succeed. Note: This value does not override the x-ms-file-copy-ignore-read-only header value.\n */\n replaceIfExists?: boolean;\n\n /**\n * Optional.\n * A boolean value that specifies whether the ReadOnly attribute on a preexisting destination file should be respected. If true, the rename will succeed, otherwise, a previous file at the destination with the ReadOnly attribute set will cause the rename to fail.\n */\n ignoreReadOnly?: boolean;\n\n /**\n * Optional.\n * Content type to set on the File.\n */\n contentType?: string;\n}\n\n/**\n * Options to configure the {@link ShareDirectoryClient.rename} operation.\n */\nexport interface DirectoryRenameOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n\n /**\n * Lease access condition for source file. Required if the source file has an active infinite lease.\n */\n sourceLeaseAccessConditions?: LeaseAccessConditions;\n\n /**\n * Lease access condition for destination file. Required if the destination file has an active infinite lease.\n */\n destinationLeaseAccessConditions?: LeaseAccessConditions;\n\n /**\n * Optional.\n * Specifies the option to copy file security descriptor from source file or to set it using the value which is defined by the header value of x-ms-file-permission or x-ms-file-permission-key.\n */\n copyFileSmbInfo?: CopyFileSmbInfo;\n\n /**\n * Optional.\n * The timeout parameter is expressed in seconds. For more information, see <a href=\"https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN\">Setting Timeouts for File Service Operations.</a>\n */\n timeoutInSeconds?: number;\n\n /**\n * Optional.\n * A name-value pair to associate with a file storage object.\n */\n metadata?: Metadata;\n\n /**\n * Optional.\n * If specified the permission (security descriptor) shall be set for the directory/file.\n */\n filePermission?: string;\n\n /**\n * Optional. Available for version 2023-06-01 and later. Specifies the format in which the permission is returned.\n * Acceptable values are SDDL or binary. If x-ms-file-permission-format is unspecified or explicitly set to SDDL, the permission is returned in SDDL format.\n * If x-ms-file-permission-format is explicitly set to binary, the permission is returned as a base64 string representing the binary encoding of the permission\n */\n filePermissionFormat?: FilePermissionFormat;\n\n /**\n * Optional.\n * Key of the permission to be set for the directory/file. Note: Only one of the filePermission or filePermissionKey should be specified.\n */\n filePermissionKey?: string;\n /**\n * Optional.\n * A boolean value for if the destination file already exists, whether this request will overwrite the file or not. If true, the rename will succeed and will overwrite the destination file. If not provided or if false and the destination file does exist, the request will not overwrite the destination file. If provided and the destination file doesn’t exist, the rename will succeed. Note: This value does not override the x-ms-file-copy-ignore-read-only header value.\n */\n replaceIfExists?: boolean;\n\n /**\n * Optional.\n * A boolean value that specifies whether the ReadOnly attribute on a preexisting destination file should be respected. If true, the rename will succeed, otherwise, a previous file at the destination with the ReadOnly attribute set will cause the rename to fail.\n */\n ignoreReadOnly?: boolean;\n}\n\n/**\n * A ShareFileClient represents a URL to an Azure Storage file.\n */\nexport class ShareFileClient extends StorageClient {\n /**\n * context provided by protocol layer.\n */\n private context: File;\n\n private _shareName: string;\n private _path: string;\n private _name: string;\n\n private shareClientConfig?: ShareClientConfig;\n\n /**\n * The share name corresponding to this file client\n */\n public get shareName(): string {\n return this._shareName;\n }\n\n /**\n * The full path of the file\n */\n public get path(): string {\n return this._path;\n }\n\n /**\n * The name of the file\n */\n public get name(): string {\n return this._name;\n }\n\n /**\n * Creates an instance of ShareFileClient.\n *\n * @param url - A URL string pointing to Azure Storage file, such as\n * \"https://myaccount.file.core.windows.net/myshare/mydirectory/file\". You can\n * append a SAS if using AnonymousCredential, such as\n * \"https://myaccount.file.core.windows.net/myshare/mydirectory/file?sasString\".\n * This method accepts an encoded URL or non-encoded URL pointing to a file.\n * Encoded URL string will NOT be escaped twice, only special characters in URL path will be escaped.\n * However, if a file or directory name includes %, file or directory name must be encoded in the URL.\n * Such as a file named \"myfile%\", the URL should be \"https://myaccount.file.core.windows.net/myshare/mydirectory/myfile%25\".\n * @param credential - Such as , StorageSharedKeyCredential or TokenCredential,\n * If not specified, AnonymousCredential is used.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n constructor(\n url: string,\n credential?: Credential | TokenCredential,\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n options?: ShareClientOptions,\n );\n /**\n * Creates an instance of ShareFileClient.\n *\n * @param url - A URL string pointing to Azure Storage file, such as\n * \"https://myaccount.file.core.windows.net/myshare/mydirectory/file\". You can\n * append a SAS if using AnonymousCredential, such as\n * \"https://myaccount.file.core.windows.net/myshare/mydirectory/file?sasString\".\n * This method accepts an encoded URL or non-encoded URL pointing to a file.\n * Encoded URL string will NOT be escaped twice, only special characters in URL path will be escaped.\n * However, if a file or directory name includes %, file or directory name must be encoded in the URL.\n * Such as a file named \"myfile%\", the URL should be \"https://myaccount.file.core.windows.net/myshare/mydirectory/myfile%25\".\n * @param pipeline - Call newPipeline() to create a default\n * pipeline, or provide a customized pipeline.\n */\n constructor(url: string, pipeline: Pipeline, options?: ShareClientConfig);\n constructor(\n url: string,\n credentialOrPipeline?: Credential | TokenCredential | Pipeline,\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n options?: ShareClientOptions,\n ) {\n let pipeline: Pipeline;\n if (isPipelineLike(credentialOrPipeline)) {\n pipeline = credentialOrPipeline;\n } else if (\n credentialOrPipeline instanceof Credential ||\n isTokenCredential(credentialOrPipeline)\n ) {\n pipeline = newPipeline(credentialOrPipeline, options);\n } else {\n // The second parameter is undefined. Use anonymous credential.\n pipeline = newPipeline(new AnonymousCredential(), options);\n }\n\n super(url, pipeline);\n ({\n baseName: this._name,\n shareName: this._shareName,\n path: this._path,\n } = getShareNameAndPathFromUrl(this.url));\n this.shareClientConfig = options;\n this.context = this.storageClientContext.file;\n }\n\n /**\n * Creates a new ShareFileClient object identical to the source but with the specified share snapshot timestamp.\n * Provide \"\" will remove the snapshot and return a URL to the base ShareFileClient.\n *\n * @param shareSnapshot - The share snapshot timestamp.\n * @returns A new ShareFileClient object identical to the source but with the specified share snapshot timestamp.\n */\n public withShareSnapshot(shareSnapshot: string): ShareFileClient {\n return new ShareFileClient(\n setURLParameter(\n this.url,\n URLConstants.Parameters.SHARE_SNAPSHOT,\n shareSnapshot.length === 0 ? undefined : shareSnapshot,\n ),\n this.pipeline,\n this.shareClientConfig,\n );\n }\n\n /**\n * Creates a new file or replaces a file. Note it only initializes the file with no content.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-file\n *\n * @param size - Specifies the maximum size in bytes for the file, up to 4 TB.\n * @param options - Options to File Create operation.\n * @returns Response data for the File Create operation.\n *\n * Example usage:\n *\n * ```js\n * const content = \"Hello world!\";\n *\n * // Create the file\n * await fileClient.create(content.length);\n * console.log(\"Created file successfully!\");\n *\n * // Then upload data to the file\n * await fileClient.uploadRange(content, 0, content.length);\n * console.log(\"Updated file successfully!\")\n * ```\n */\n public async create(size: number, options: FileCreateOptions = {}): Promise<FileCreateResponse> {\n if (size < 0 || size > FILE_MAX_SIZE_BYTES) {\n throw new RangeError(`File size must >= 0 and < ${FILE_MAX_SIZE_BYTES}.`);\n }\n options = validateAndSetDefaultsForFileAndDirectoryCreateCommonOptions(options);\n\n options.fileHttpHeaders = options.fileHttpHeaders || {};\n return tracingClient.withSpan(\"ShareFileClient-create\", options, async (updatedOptions) => {\n return assertResponse<FileCreateHeaders, FileCreateHeaders>(\n await this.context.create(\n size,\n updatedOptions.fileAttributes\n ? fileAttributesToString(updatedOptions.fileAttributes!)\n : FileAttributesNone,\n {\n ...updatedOptions,\n fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime),\n fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime),\n fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime),\n ...this.shareClientConfig,\n },\n ),\n );\n });\n }\n\n /**\n * Reads or downloads a file from the system, including its metadata and properties.\n *\n * * In Node.js, data returns in a Readable stream `readableStreamBody`\n * * In browsers, data returns in a promise `contentAsBlob`\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-file\n *\n * @param offset - From which position of the file to download, greater than or equal to 0\n * @param count - How much data to be downloaded, greater than 0. Will download to the end when undefined\n * @param options - Options to File Download operation.\n * @returns Response data for the File Download operation.\n *\n * Example usage (Node.js):\n *\n * ```js\n * // Download a file to a string\n * const downloadFileResponse = await fileClient.download();\n * console.log(\n * \"Downloaded file content:\",\n * (await streamToBuffer(downloadFileResponse.readableStreamBody)).toString()}\n * );\n *\n * // A helper method used to read a Node.js readable stream into string\n * async function streamToBuffer(readableStream) {\n * return new Promise((resolve, reject) => {\n * const chunks = [];\n * readableStream.on(\"data\", (data) => {\n * chunks.push(data instanceof Buffer ? data : Buffer.from(data));\n * });\n * readableStream.on(\"end\", () => {\n * resolve(Buffer.concat(chunks));\n * });\n * readableStream.on(\"error\", reject);\n * });\n * }\n * ```\n *\n * Example usage (browsers):\n *\n * ```js\n * // Download a file to a string\n * const downloadFileResponse = await fileClient.download(0);\n * console.log(\n * \"Downloaded file content:\",\n * await blobToString(await downloadFileResponse.blobBody)}\n * );\n *\n * // A helper method used to convert a browser Blob into string.\n * export async function blobToString(blob: Blob): Promise<string> {\n * const fileReader = new FileReader();\n * return new Promise<string>((resolve, reject) => {\n * fileReader.onloadend = (ev: any) => {\n * resolve(ev.target!.result);\n * };\n * fileReader.onerror = reject;\n * fileReader.readAsText(blob);\n * });\n * }\n * ```\n */\n public async download(\n offset: number = 0,\n count?: number,\n options: FileDownloadOptions = {},\n ): Promise<FileDownloadResponseModel> {\n return tracingClient.withSpan(\"ShareFileClient-download\", options, async (updatedOptions) => {\n if (updatedOptions.rangeGetContentMD5 && offset === 0 && count === undefined) {\n throw new RangeError(`rangeGetContentMD5 only works with partial data downloading`);\n }\n\n const downloadFullFile = offset === 0 && !count;\n const res = assertResponse<RawFileDownloadResponse, FileDownloadHeaders>(\n await this.context.download({\n ...updatedOptions,\n requestOptions: {\n onDownloadProgress: isNode ? undefined : updatedOptions.onProgress, // for Node.js, progress is reported by RetriableReadableStream\n },\n range: downloadFullFile ? undefined : rangeToString({ offset, count }),\n ...this.shareClientConfig,\n }),\n );\n\n // Return browser response immediately\n if (!isNode) {\n return res;\n }\n\n // We support retrying when download stream unexpected ends in Node.js runtime\n // Following code shouldn't be bundled into browser build, however some\n // bundlers may try to bundle following code and \"FileReadResponse.ts\".\n // In this case, \"FileDownloadResponse.browser.ts\" will be used as a shim of \"FileDownloadResponse.ts\"\n // The config is in package.json \"browser\" field\n if (updatedOptions.maxRetryRequests === undefined || updatedOptions.maxRetryRequests < 0) {\n // TODO: Default value or make it a required parameter?\n updatedOptions.maxRetryRequests = DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS;\n }\n\n if (res.contentLength === undefined) {\n throw new RangeError(`File download response doesn't contain valid content length header`);\n }\n\n return new FileDownloadResponse(\n res,\n async (start: number): Promise<NodeJS.ReadableStream> => {\n const updatedDownloadOptions: FileDownloadOptionalParams = {\n range: rangeToString({\n count: offset + res.contentLength! - start,\n offset: start,\n }),\n };\n\n // Debug purpose only\n // console.log(\n // `Read from internal stream, range: ${\n // chunkDownloadOptions.range\n // }, options: ${JSON.stringify(chunkDownloadOptions)}`\n // );\n\n const downloadRes = await this.context.download({\n ...updatedOptions,\n ...updatedDownloadOptions,\n ...this.shareClientConfig, // TODO: confirm whether this is needed\n });\n\n if (!(downloadRes.etag === res.etag)) {\n throw new Error(\"File has been modified concurrently\");\n }\n return downloadRes.readableStreamBody!;\n },\n offset,\n res.contentLength!,\n {\n maxRetryRequests: updatedOptions.maxRetryRequests,\n onProgress: updatedOptions.onProgress,\n },\n );\n });\n }\n\n /**\n * Returns true if the specified file exists; false otherwise.\n *\n * NOTE: use this function with care since an existing file might be deleted by other clients or\n * applications. Vice versa new files might be added by other clients or applications after this\n * function completes.\n *\n * @param options - options to Exists operation.\n */\n public async exists(options: FileExistsOptions = {}): Promise<boolean> {\n return tracingClient.withSpan(\"ShareFileClient-exists\", options, async (updatedOptions) => {\n try {\n await this.getProperties(updatedOptions);\n return true;\n } catch (e: any) {\n if (e.statusCode === 404) {\n return false;\n }\n throw e;\n }\n });\n }\n\n /**\n * Returns all user-defined metadata, standard HTTP properties, and system properties\n * for the file. It does not return the content of the file.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-file-properties\n *\n * @param options - Options to File Get Properties operation.\n * @returns Response data for the File Get Properties operation.\n */\n public async getProperties(\n options: FileGetPropertiesOptions = {},\n ): Promise<FileGetPropertiesResponse> {\n return tracingClient.withSpan(\n \"ShareFileClient-getProperties\",\n options,\n async (updatedOptions) => {\n return assertResponse<FileGetPropertiesHeaders, FileGetPropertiesHeaders>(\n await this.context.getProperties({ ...updatedOptions, ...this.shareClientConfig }),\n );\n },\n );\n }\n\n /**\n * Sets properties on the file.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-file-properties\n *\n * @param properties - File properties. For file HTTP headers(e.g. Content-Type),\n * if no values are provided, existing HTTP headers will be removed.\n * For other file properties(e.g. fileAttributes), if no values are provided,\n * existing values will be preserved.\n */\n public async setProperties(properties: FileProperties = {}): Promise<SetPropertiesResponse> {\n properties = validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions(properties);\n properties.fileHttpHeaders = properties.fileHttpHeaders || {};\n return tracingClient.withSpan(\n \"ShareFileClient-setProperties\",\n properties,\n async (updatedOptions) => {\n return assertResponse<FileSetHttpHeadersHeaders, FileSetHttpHeadersHeaders>(\n await this.context.setHttpHeaders(\n updatedOptions.fileAttributes\n ? fileAttributesToString(updatedOptions.fileAttributes!)\n : FileAttributesPreserve,\n {\n ...updatedOptions,\n fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime),\n fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime),\n fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime),\n ...this.shareClientConfig,\n },\n ),\n );\n },\n );\n }\n\n /**\n * Removes the file from the storage account.\n * When a file is successfully deleted, it is immediately removed from the storage\n * account's index and is no longer accessible to clients. The file's data is later\n * removed from the service during garbage collection.\n *\n * Delete File will fail with status code 409 (Conflict) and error code SharingViolation\n * if the file is open on an SMB client.\n *\n * Delete File is not supported on a share snapshot, which is a read-only copy of\n * a share. An attempt to perform this operation on a share snapshot will fail with 400 (InvalidQueryParameterValue)\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-file2\n *\n * @param options - Options to File Delete operation.\n * @returns Response data for the File Delete operation.\n */\n public async delete(options: FileDeleteOptions = {}): Promise<FileDeleteResponse> {\n return tracingClient.withSpan(\"ShareFileClient-delete\", options, async (updatedOptions) => {\n return assertResponse<FileDeleteHeaders, FileDeleteHeaders>(\n await this.context.delete({ ...updatedOptions, ...this.shareClientConfig }),\n );\n });\n }\n\n /**\n * Removes the file from the storage account if it exists.\n * When a file is successfully deleted, it is immediately removed from the storage\n * account's index and is no longer accessible to clients. The file's data is later\n * removed from the service during garbage collection.\n *\n * Delete File will fail with status code 409 (Conflict) and error code SharingViolation\n * if the file is open on an SMB client.\n *\n * Delete File is not supported on a share snapshot, which is a read-only copy of\n * a share. An attempt to perform this operation on a share snapshot will fail with 400 (InvalidQueryParameterValue)\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-file2\n *\n * @param options -\n */\n public async deleteIfExists(\n options: FileDeleteOptions = {},\n ): Promise<FileDeleteIfExistsResponse> {\n return tracingClient.withSpan(\n \"ShareFileClient-deleteIfExists\",\n options,\n async (updatedOptions) => {\n try {\n const res = await this.delete(updatedOptions);\n return {\n succeeded: true,\n ...res,\n };\n } catch (e: any) {\n if (\n e.details?.errorCode === \"ResourceNotFound\" ||\n e.details?.errorCode === \"ParentNotFound\"\n ) {\n return {\n succeeded: false,\n ...e.response?.parsedHeaders,\n _response: e.response,\n };\n }\n throw e;\n }\n },\n );\n }\n\n /**\n * Sets HTTP headers on the file.\n *\n * If no option provided, or no value provided for the file HTTP headers in the options,\n * these file HTTP headers without a value will be cleared.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-file-properties\n *\n * @param FileHttpHeaders - File HTTP headers like Content-Type.\n * Provide undefined will remove existing HTTP headers.\n * @param options - Options to File Set HTTP Headers operation.\n * @returns Response data for the File Set HTTP Headers operation.\n */\n public async setHttpHeaders(\n fileHttpHeaders: FileHttpHeaders = {},\n options: FileSetHttpHeadersOptions = {},\n ): Promise<FileSetHTTPHeadersResponse> {\n // FileAttributes, filePermission, createTime, lastWriteTime will all be preserved\n options = validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions(options);\n return tracingClient.withSpan(\n \"ShareFileClient-setHTTPHeaders\",\n options,\n async (updatedOptions) => {\n return assertResponse<FileSetHttpHeadersHeaders, FileSetHttpHeadersHeaders>(\n await this.context.setHttpHeaders(\n updatedOptions.fileAttributes\n ? fileAttributesToString(updatedOptions.fileAttributes!)\n : FileAttributesPreserve,\n {\n ...updatedOptions,\n fileHttpHeaders,\n fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime),\n fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime),\n fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime),\n ...this.shareClientConfig,\n },\n ),\n );\n },\n );\n }\n\n /**\n * Resize file.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-file-properties\n *\n * @param length - Resizes a file to the specified size in bytes.\n * If the specified byte value is less than the current size of the file,\n * then all ranges above the specified byte value are cleared.\n * @param options - Options to File Resize operation.\n * @returns Response data for the File Set HTTP Headers operation.\n */\n public async resize(\n length: number,\n options: FileResizeOptions = {},\n ): Promise<FileSetHTTPHeadersResponse> {\n if (length < 0) {\n throw new RangeError(`Size cannot less than 0 when resizing file.`);\n }\n // FileAttributes, filePermission, createTime, lastWriteTime will all be preserved.\n options = validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions(options);\n return tracingClient.withSpan(\"ShareFileClient-resize\", options, async (updatedOptions) => {\n return assertResponse<FileSetHttpHeadersHeaders, FileSetHttpHeadersHeaders>(\n await this.context.setHttpHeaders(fileAttributesToString(updatedOptions.fileAttributes!), {\n ...updatedOptions,\n fileContentLength: length,\n fileChangeOn: fileChangeTimeToString(options.changeTime),\n fileCreatedOn: fileCreationTimeToString(options.creationTime),\n fileLastWriteOn: fileLastWriteTimeToString(options.lastWriteTime),\n ...this.shareClientConfig,\n }),\n );\n });\n }\n\n /**\n * Updates user-defined metadata for the specified file.\n *\n * If no metadata defined in the option parameter, the file\n * metadata will be removed.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-file-metadata\n *\n * @param metadata - If no metadata provided, all existing directory metadata will be removed\n * @param options - Options to File Set Metadata operation.\n * @returns Response data for the File Set Metadata operation.\n */\n public async setMetadata(\n metadata: Metadata = {},\n options: FileSetMetadataOptions = {},\n ): Promise<FileSetMetadataResponse> {\n return tracingClient.withSpan(\n \"ShareFileClient-setMetadata\",\n options,\n async (updatedOptions) => {\n return assertResponse<FileSetMetadataHeaders, FileSetMetadataHeaders>(\n await this.context.setMetadata({\n ...updatedOptions,\n metadata,\n ...this.shareClientConfig,\n }),\n );\n },\n );\n }\n\n /**\n * Upload a range of bytes to a file. This operation can only be called on an existing file.\n * It won't change the size, properties or metadata of the file.\n * Both the start and count of the range must be specified. The range can be up to 4 MB in size.\n *\n * @param body - Blob, string, ArrayBuffer, ArrayBufferView or a function\n * which returns a new Readable stream whose offset is from data source beginning.\n * @param offset - Offset position of the destination Azure File to upload.\n * @param contentLength - Length of body in bytes. Use Buffer.byteLength() to calculate body length for a\n * string including non non-Base64/Hex-encoded characters.\n * @param options - Options to File Upload Range operation.\n * @returns Response data for the File Upload Range operation.\n *\n * Example usage:\n *\n * ```js\n * const content = \"Hello world!\";\n *\n * // Create the file\n * await fileClient.create(content.length);\n * console.log(\"Created file successfully!\");\n *\n * // Then upload data to the file\n * await fileClient.uploadRange(content, 0, content.length);\n * console.log(\"Updated file successfully!\")\n * ```\n */\n public async uploadRange(\n body: HttpRequestBody,\n offset: number,\n contentLength: number,\n options: FileUploadRangeOptions = {},\n ): Promise<FileUploadRangeResponse> {\n return tracingClient.withSpan(\n \"ShareFileClient-uploadRange\",\n options,\n async (updatedOptions) => {\n if (offset < 0) {\n throw new RangeError(`offset must be >= 0`);\n }\n\n if (contentLength <= 0 || contentLength > FILE_RANGE_MAX_SIZE_BYTES) {\n throw new RangeError(\n `contentLength must be > 0 and <= ${FILE_RANGE_MAX_SIZE_BYTES} bytes`,\n );\n }\n\n if (contentLength > FILE_RANGE_MAX_SIZE_BYTES) {\n throw new RangeError(`offset must be < ${FILE_RANGE_MAX_SIZE_BYTES} bytes`);\n }\n\n return assertResponse<FileUploadRangeHeaders, FileUploadRangeHeaders>(\n await this.context.uploadRange(\n rangeToString({ count: contentLength, offset }),\n \"update\",\n contentLength,\n {\n ...updatedOptions,\n requestOptions: {\n onUploadProgress: updatedOptions.onProgress,\n },\n body,\n ...this.shareClientConfig,\n },\n ),\n );\n },\n );\n }\n\n /**\n * Upload a range of bytes to a file where the contents are read from a another file's URL.\n * The range can be up to 4 MB in size.\n *\n * @param sourceURL - Specify a URL to the copy source, Shared Access Signature(SAS) maybe needed for authentication.\n * @param sourceOffset - The source offset to copy from. Pass 0 to copy from the beginning of source file.\n * @param destOffset - Offset of destination file.\n * @param count - Number of bytes to be uploaded from source file.\n * @param options - Options to configure File - Upload Range from URL operation.\n */\n public async uploadRangeFromURL(\n sourceURL: string,\n sourceOffset: number,\n destOffset: number,\n count: number,\n options: FileUploadRangeFromURLOptions = {},\n ): Promise<FileUploadRangeFromURLResponse> {\n return tracingClient.withSpan(\n \"ShareFileClient-uploadRangeFromURL\",\n options,\n async (updatedOptions) => {\n if (sourceOffset < 0 || destOffset < 0) {\n throw new RangeError(`sourceOffset and destOffset must be >= 0`);\n }\n\n if (count <= 0 || count > FILE_RANGE_MAX_SIZE_BYTES) {\n throw new RangeError(`count must be > 0 and <= ${FILE_RANGE_MAX_SIZE_BYTES} bytes`);\n }\n\n return assertResponse<FileUploadRangeFromURLHeaders, FileUploadRangeFromURLHeaders>(\n await this.context.uploadRangeFromURL(\n rangeToString({ offset: destOffset, count }),\n sourceURL,\n 0,\n {\n ...updatedOptions,\n sourceRange: rangeToString({ offset: sourceOffset, count }),\n sourceModifiedAccessConditions: updatedOptions.sourceConditions,\n copySourceAuthorization: httpAuthorizationToString(\n updatedOptions.sourceAuthorization,\n ),\n ...this.shareClientConfig,\n },\n ),\n );\n },\n );\n }\n /**\n * Clears the specified range and\n * releases the space used in storage for that range.\n *\n * @param offset -\n * @param contentLength -\n * @param options - Options to File Clear Range operation.\n */\n public async clearRange(\n offset: number,\n contentLength: number,\n options: FileClearRangeOptions = {},\n ): Promise<FileUploadRangeResponse> {\n return tracingClient.withSpan(\"ShareFileClient-clearRange\", options, async (updatedOptions) => {\n if (offset < 0 || contentLength <= 0) {\n throw new RangeError(`offset must >= 0 and contentLength must be > 0`);\n }\n\n return assertResponse<FileUploadRangeHeaders, FileUploadRangeHeaders>(\n await this.context.uploadRange(\n rangeToString({ count: contentLength, offset }),\n \"clear\",\n 0,\n { ...updatedOptions, ...this.shareClientConfig },\n ),\n );\n });\n }\n\n /**\n * Returns the list of valid ranges for a file.\n *\n * @param options - Options to File Get range List operation.\n */\n public async getRangeList(\n options: FileGetRangeListOptions = {},\n ): Promise<FileGetRangeListResponse> {\n return tracingClient.withSpan(\n \"ShareFileClient-getRangeList\",\n options,\n async (updatedOptions) => {\n const originalResponse = assertResponse<\n FileGetRangeListHeaders & ShareFileRangeList,\n FileGetRangeListHeaders,\n ShareFileRangeList\n >(\n await this.context.getRangeList({\n ...updatedOptions,\n range: updatedOptions.range ? rangeToString(updatedOptions.range) : undefined,\n ...this.shareClientConfig,\n }),\n );\n\n // Only returns ranges, ignoring clearRanges.\n const parsedBody = originalResponse._response.parsedBody.ranges\n ? originalResponse._response.parsedBody.ranges\n : [];\n return {\n ...originalResponse,\n _response: { ...originalResponse._response, parsedBody },\n rangeList: originalResponse.ranges ? originalResponse.ranges : [],\n };\n },\n );\n }\n\n /**\n * Returns the list of ranges that differ between a previous share snapshot and this file.\n *\n * @param prevShareSnapshot - The previous snapshot parameter is an opaque DateTime value that specifies the previous share snapshot to compare with.\n * @param options -\n */\n public async getRangeListDiff(\n prevShareSnapshot: string,\n options: FileGetRangeListOptions = {},\n ): Promise<FileGetRangeListDiffResponse> {\n return tracingClient.withSpan(\n \"ShareFileClient-getRangeListDiff\",\n options,\n async (updatedOptions) => {\n return assertResponse<\n FileGetRangeListHeaders & ShareFileRangeList,\n FileGetRangeListHeaders,\n ShareFileRangeList\n >(\n await this.context.getRangeList({\n ...updatedOptions,\n prevsharesnapshot: prevShareSnapshot,\n supportRename: options.includeRenames,\n range: updatedOptions.range ? rangeToString(updatedOptions.range) : undefined,\n ...this.shareClientConfig,\n }),\n );\n },\n );\n }\n\n /**\n * Copies a blob or file to a destination file within the storage account.\n *\n * @param copySource - Specifies the URL of the source file or blob, up to 2 KB in length.\n * To copy a file to another file within the same storage account, you may use Shared Key to\n * authenticate the source file. If you are copying a file from another storage account, or if you\n * are copying a blob from the same storage account or another storage account, then you must\n * authenticate the source file or blob using a shared access signature. If the source is a public\n * blob, no authentication is required to perform the copy operation. A file in a share snapshot\n * can also be specified as a copy source.\n * @param options - Options to File Start Copy operation.\n */\n public async startCopyFromURL(\n copySource: string,\n options: FileStartCopyOptions = {},\n ): Promise<FileStartCopyResponse> {\n return tracingClient.withSpan(\n \"ShareFileClient-startCopyFromURL\",\n options,\n async (updatedOptions) => {\n return assertResponse<FileStartCopyHeaders, FileStartCopyHeaders>(\n await this.context.startCopy(copySource, {\n ...updatedOptions,\n ...this.shareClientConfig,\n }),\n );\n },\n );\n }\n\n /**\n * Aborts a pending Copy File operation, and leaves a destination file with zero length and full\n * metadata.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/abort-copy-file\n *\n * @param copyId - Id of the Copy File operation to abort.\n * @param options - Options to File Abort Copy From URL operation.\n */\n public async abortCopyFromURL(\n copyId: string,\n options: FileAbortCopyFromURLOptions = {},\n ): Promise<FileAbortCopyResponse> {\n return tracingClient.withSpan(\n \"ShareFileClient-abortCopyFromURL\",\n options,\n async (updatedOptions) => {\n return assertResponse<FileAbortCopyHeaders, FileAbortCopyHeaders>(\n await this.context.abortCopy(copyId, { ...updatedOptions, ...this.shareClientConfig }),\n );\n },\n );\n }\n\n // High Level functions\n\n /**\n * Creates a new Azure File or replaces an existing Azure File, and then uploads a Buffer(Node)/Blob/ArrayBuffer/ArrayBufferView to it.\n *\n * @param data - Buffer(Node), Blob, ArrayBuffer or ArrayBufferView\n * @param options -\n */\n public async uploadData(\n data: Buffer | Blob | ArrayBuffer | ArrayBufferView,\n options: FileParallelUploadOptions = {},\n ): Promise<void> {\n return tracingClient.withSpan(\"ShareFileClient-uploadData\", options, async (updatedOptions) => {\n if (isNode) {\n let buffer: Buffer;\n if (data instanceof Buffer) {\n buffer = data;\n } else if (data instanceof ArrayBuffer) {\n buffer = Buffer.from(data);\n } else {\n data = data as ArrayBufferView;\n buffer = Buffer.from(data.buffer, data.byteOffset, data.byteLength);\n }\n\n return this.uploadSeekableInternal(\n (offset: number, size: number): Buffer => buffer.slice(offset, offset + size),\n buffer.byteLength,\n updatedOptions,\n );\n } else {\n const browserBlob = new Blob([data]);\n return this.uploadSeekableInternal(\n (offset: number, size: number): Blob => browserBlob.slice(offset, offset + size),\n browserBlob.size,\n updatedOptions,\n );\n }\n });\n }\n\n /**\n * ONLY AVAILABLE IN BROWSERS.\n *\n * Uploads a browser Blob object to an Azure file. Requires a blobFactory as the data source,\n * which need to return a Blob object with the offset and size provided.\n *\n * @param blobFactory -\n * @param size -\n * @param options -\n */\n async uploadSeekableBlob(\n blobFactory: (offset: number, size: number) => Blob,\n size: number,\n options: FileParallelUploadOptions = {},\n ): Promise<void> {\n return tracingClient.withSpan(\n \"ShareFileClient-UploadSeekableBlob\",\n options,\n async (updatedOptions) => {\n return this.uploadSeekableInternal(blobFactory, size, updatedOptions);\n },\n );\n }\n\n /**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * Creates a new Azure File or replaces an existing Azure File, and then uploads a local file to it.\n *\n * @param filePath - Full path of local file\n * @param fileClient - ShareFileClient\n * @param options -\n */\n public async uploadFile(\n filePath: string,\n options: FileParallelUploadOptions = {},\n ): Promise<void> {\n return tracingClient.withSpan(\"ShareFileClient-uploadFile\", options, async (updatedOptions) => {\n const size = (await fsStat(filePath)).size;\n return this.uploadSeekableInternal(\n (offset, count) => {\n return () =>\n fsCreateReadStream(filePath, {\n autoClose: true,\n end: count ? offset + count - 1 : Infinity,\n start: offset,\n });\n },\n size,\n updatedOptions,\n );\n });\n }\n\n /**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * Accepts a Node.js Readable stream factory, and uploads in blocks to an Azure File.\n * The Readable stream factory must returns a Node.js Readable stream starting from the offset defined. The offset\n * is the offset in the Azure file to be uploaded.\n *\n * @param streamFactory - Returns a Node.js Readable stream starting\n * from the offset defined\n * @param size - Size of the Azure file\n * @param fileClient - ShareFileClient\n * @param options -\n */\n async uploadResetableStream(\n streamFactory: (offset: number, count?: number) => NodeJS.ReadableStream,\n size: number,\n options: FileParallelUploadOptions = {},\n ): Promise<void> {\n return tracingClient.withSpan(\n \"ShareFileClient-uploadResetableStream\",\n options,\n async (updatedOptions) => {\n return this.uploadSeekableInternal(\n (offset: number, count?: number) => {\n return () => streamFactory(offset, count);\n },\n size,\n updatedOptions,\n );\n },\n );\n }\n\n /**\n *\n * @param bodyFactory -\n * @param size - Size of the Azure file\n * @param fileClient - ShareFileClient\n * @param options -\n */\n private async uploadSeekableInternal(\n bodyFactory: (offset: number, count: number) => HttpRequestBody,\n size: number,\n options: FileParallelUploadOptions = {},\n ): Promise<void> {\n return tracingClient.withSpan(\n \"ShareFileClient-uploadSeekableInternal\",\n options,\n async (updatedOptions) => {\n if (!options.rangeSize) {\n options.rangeSize = FILE_RANGE_MAX_SIZE_BYTES;\n }\n if (options.rangeSize < 0 || options.rangeSize > FILE_RANGE_MAX_SIZE_BYTES) {\n throw new RangeError(`options.rangeSize must be > 0 and <= ${FILE_RANGE_MAX_SIZE_BYTES}`);\n }\n\n if (!options.fileHttpHeaders) {\n options.fileHttpHeaders = {};\n }\n\n if (!options.concurrency) {\n options.concurrency = DEFAULT_HIGH_LEVEL_CONCURRENCY;\n }\n if (options.concurrency < 0) {\n throw new RangeError(`options.concurrency cannot less than 0.`);\n }\n\n // Create the file\n await this.create(size, {\n abortSignal: options.abortSignal,\n fileHttpHeaders: options.fileHttpHeaders,\n metadata: options.metadata,\n leaseAccessConditions: options.leaseAccessConditions,\n tracingOptions: updatedOptions.tracingOptions,\n });\n\n const numBlocks: number = Math.floor((size - 1) / options.rangeSize) + 1;\n let transferProgress: number = 0;\n const batch = new Batch(options.concurrency);\n\n for (let i = 0; i < numBlocks; i++) {\n batch.addOperation(async (): Promise<any> => {\n const start = options.rangeSize! * i;\n const end = i === numBlocks - 1 ? size : start + options.rangeSize!;\n const contentLength = end - start;\n await this.uploadRange(bodyFactory(start, contentLength), start, contentLength, {\n abortSignal: options.abortSignal,\n leaseAccessConditions: options.leaseAccessConditions,\n tracingOptions: updatedOptions.tracingOptions,\n });\n // Update progress after block is successfully uploaded to server, in case of block trying\n transferProgress += contentLength;\n if (options.onProgress) {\n options.onProgress({ loadedBytes: transferProgress });\n }\n });\n }\n return batch.do();\n },\n );\n }\n\n /**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * Downloads an Azure file in parallel to a buffer.\n * Offset and count are optional, pass 0 for both to download the entire file.\n *\n * Warning: Buffers can only support files up to about one gigabyte on 32-bit systems or about two\n * gigabytes on 64-bit systems due to limitations of Node.js/V8. For files larger than this size,\n * consider {@link downloadToFile}.\n *\n * @param buffer - Buffer to be fill, must have length larger than count\n * @param offset - From which position of the Azure File to download\n * @param count - How much data to be downloaded. Will download to the end when passing undefined\n * @param options -\n */\n public async downloadToBuffer(\n buffer: Buffer,\n offset?: number,\n count?: number,\n options?: FileDownloadToBufferOptions,\n ): Promise<Buffer>;\n\n /**\n * ONLY AVAILABLE IN NODE.JS RUNTIME\n *\n * Downloads an Azure file in parallel to a buffer.\n * Offset and count are optional, pass 0 for both to download the entire file\n *\n * Warning: Buffers can only support files up to about one gigabyte on 32-bit systems or about two\n * gigabytes on 64-bit systems due to limitations of Node.js/V8. For files larger than this size,\n * consider {@link downloadToFile}.\n *\n * @param offset - From which position of the Azure file to download\n * @param count - How much data to be downloaded. Will download to the end when passing undefined\n * @param options -\n */\n public async downloadToBuffer(\n offset?: number,\n count?: number,\n options?: FileDownloadToBufferOptions,\n ): Promise<Buffer>;\n\n public async downloadToBuffer(\n bufferOrOffset?: Buffer | number,\n offsetOrCount?: number,\n countOrOptions?: FileDownloadToBufferOptions | number,\n optOptions: FileDownloadToBufferOptions = {},\n ): Promise<Buffer> {\n let buffer: Buffer | undefined = undefined;\n let offset: number;\n let count: number;\n let options: FileDownloadToBufferOptions = optOptions;\n\n if (bufferOrOffset instanceof Buffer) {\n buffer = bufferOrOffset;\n offset = offsetOrCount || 0;\n count = typeof countOrOptions === \"number\" ? countOrOptions : 0;\n } else {\n offset = typeof bufferOrOffset === \"number\" ? bufferOrOffset : 0;\n count = typeof offsetOrCount === \"number\" ? offsetOrCount : 0;\n options = (countOrOptions as FileDownloadToBufferOptions) || {};\n }\n\n return tracingClient.withSpan(\n \"ShareFileClient-downloadToBuffer\",\n options,\n async (updatedOptions) => {\n if (!options.rangeSize) {\n options.rangeSize = FILE_RANGE_MAX_SIZE_BYTES;\n }\n if (options.rangeSize < 0) {\n throw new RangeError(\"rangeSize option must be > 0\");\n }\n\n if (offset < 0) {\n throw new RangeError(\"offset option must be >= 0\");\n }\n\n if (count && count <= 0) {\n throw new RangeError(\"count option must be > 0\");\n }\n\n if (!options.concurrency) {\n options.concurrency = DEFAULT_HIGH_LEVEL_CONCURRENCY;\n }\n if (options.concurrency < 0) {\n throw new RangeError(`options.concurrency cannot less than 0.`);\n }\n\n // Customer doesn't specify length, get it\n if (!count) {\n const response = await this.getProperties({\n abortSignal: options.abortSignal,\n leaseAccessConditions: options.leaseAccessConditions,\n tracingOptions: updatedOptions.tracingOptions,\n });\n count = response.contentLength! - offset;\n if (count < 0) {\n throw new RangeError(\n `offset ${offset} shouldn't be larger than file size ${response.contentLength!}`,\n );\n }\n }\n\n if (!buffer) {\n try {\n buffer = Buffer.alloc(count);\n } catch (error: any) {\n throw new Error(\n `Unable to allocate a buffer of size: ${count} bytes. Please try passing your own Buffer to ` +\n 'the \"downloadToBuffer method or try using other methods like \"download\" or \"downloadToFile\".' +\n `\\t ${error.message}`,\n );\n }\n }\n\n if (buffer.length < count) {\n throw new RangeError(\n `The buffer's size should be equal to or larger than the request count of bytes: ${count}`,\n );\n }\n\n let transferProgress: number = 0;\n const batch = new Batch(options.concurrency);\n for (let off = offset; off < offset + count; off = off + options.rangeSize) {\n batch.addOperation(async () => {\n // Exclusive chunk end position\n let chunkEnd = offset + count!;\n if (off + options.rangeSize! < chunkEnd) {\n chunkEnd = off + options.rangeSize!;\n }\n const response = await this.download(off, chunkEnd - off, {\n abortSignal: options.abortSignal,\n maxRetryRequests: options.maxRetryRequestsPerRange,\n leaseAccessConditions: options.leaseAccessConditions,\n tracingOptions: updatedOptions.tracingOptions,\n });\n const stream = response.readableStreamBody!;\n await streamToBuffer(stream, buffer!, off - offset, chunkEnd - offset);\n // Update progress after block is downloaded, in case of block trying\n // Could provide finer grained progress updating inside HTTP requests,\n // only if convenience layer download try is enabled\n transferProgress += chunkEnd - off;\n if (options.onProgress) {\n options.onProgress({ loadedBytes: transferProgress });\n }\n });\n }\n await batch.do();\n return buffer;\n },\n );\n }\n\n /**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * Creates a new Azure File or replaces an existing Azure File, and then uploads a Node.js Readable stream into it.\n * This method will try to create an Azure File, then starts uploading chunk by chunk.\n * Size of chunk is defined by `bufferSize` parameter.\n * Please make sure potential size of stream doesn't exceed file size.\n *\n * PERFORMANCE IMPROVEMENT TIPS:\n * * Input stream highWaterMark is better to set a same value with bufferSize\n * parameter, which will avoid Buffer.concat() operations.\n *\n * @param stream - Node.js Readable stream. Must be less or equal than file size.\n * @param size - Size of file to be created. Maximum size allowed is 4 TB.\n * If this value is larger than stream size, there will be empty bytes in file tail.\n * @param bufferSize - Size of every buffer allocated in bytes, also the chunk/range size during\n * the uploaded file. Size must be greater than 0 and lesser than or equal to 4 * 1024 * 1024 (4MB)\n * @param maxBuffers - Max buffers will allocate during uploading, positive correlation\n * with max uploading concurrency\n * @param options -\n */\n public async uploadStream(\n stream: Readable,\n size: number,\n bufferSize: number,\n maxBuffers: number,\n options: FileUploadStreamOptions = {},\n ): Promise<void> {\n return tracingClient.withSpan(\n \"ShareFileClient-uploadStream\",\n options,\n async (updatedOptions) => {\n if (!options.fileHttpHeaders) {\n options.fileHttpHeaders = {};\n }\n\n if (bufferSize <= 0 || bufferSize > FILE_RANGE_MAX_SIZE_BYTES) {\n throw new RangeError(`bufferSize must be > 0 and <= ${FILE_RANGE_MAX_SIZE_BYTES}`);\n }\n\n if (maxBuffers < 0) {\n throw new RangeError(`maxBuffers must be > 0.`);\n }\n\n // Create the file\n await this.create(size, {\n abortSignal: options.abortSignal,\n fileHttpHeaders: options.fileHttpHeaders,\n metadata: options.metadata,\n leaseAccessConditions: options.leaseAccessConditions,\n tracingOptions: updatedOptions.tracingOptions,\n });\n\n let transferProgress: number = 0;\n const scheduler = new BufferScheduler(\n stream,\n bufferSize,\n maxBuffers,\n async (buffer: Buffer, offset?: number) => {\n if (transferProgress + buffer.length > size) {\n throw new RangeError(\n `Stream size is larger than file size ${size} bytes, uploading failed. ` +\n `Please make sure stream length is less or equal than file size.`,\n );\n }\n\n await this.uploadRange(buffer, offset!, buffer.length, {\n abortSignal: options.abortSignal,\n leaseAccessConditions: options.leaseAccessConditions,\n tracingOptions: updatedOptions.tracingOptions,\n });\n\n // Update progress after block is successfully uploaded to server, in case of block trying\n transferProgress += buffer.length;\n if (options.onProgress) {\n options.onProgress({ loadedBytes: transferProgress });\n }\n },\n // Concurrency should set a smaller value than maxBuffers, which is helpful to\n // reduce the possibility when a outgoing handler waits for stream data, in\n // this situation, outgoing handlers are blocked.\n // Outgoing queue shouldn't be empty.\n Math.ceil((maxBuffers / 4) * 3),\n );\n return scheduler.do();\n },\n );\n }\n\n /**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * Downloads an Azure Blob to a local file.\n * Fails if the the given file path already exits.\n * Offset and count are optional, pass 0 and undefined respectively to download the entire blob.\n *\n * @param filePath -\n * @param offset - From which position of the block blob to download.\n * @param count - How much data to be downloaded. Will download to the end when passing undefined.\n * @param options - Options to Blob download options.\n * @returns The response data for blob download operation,\n * but with readableStreamBody set to undefined since its\n * content is already read and written into a local file\n * at the specified path.\n */\n public async downloadToFile(\n filePath: string,\n offset: number = 0,\n count?: number,\n options: FileDownloadOptions = {},\n ): Promise<FileDownloadResponseModel> {\n return tracingClient.withSpan(\n \"ShareFileClient-downloadToFile\",\n options,\n async (updatedOptions) => {\n const response = await this.download(offset, count, updatedOptions);\n if (response.readableStreamBody) {\n await readStreamToLocalFile(response.readableStreamBody, filePath);\n }\n\n // The stream is no longer accessible so setting it to undefined.\n (response as any).fileDownloadStream = undefined;\n return response;\n },\n );\n }\n\n /**\n * Lists handles for a file.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/list-handles\n *\n * @param marker - Optional. A string value that identifies the portion of the list to be\n * returned with the next list handles operation. The operation returns a\n * marker value within the response body if the list returned was not complete.\n * The marker value may then be used in a subsequent call to request the next\n * set of list items.\n * @param options -\n */\n private async listHandlesSegment(\n marker?: string,\n options: FileListHandlesSegmentOptions = {},\n ): Promise<FileListHandlesResponse> {\n return tracingClient.withSpan(\n \"ShareFileClient-listHandlesSegment\",\n options,\n async (updatedOptions) => {\n marker = marker === \"\" ? undefined : marker;\n const response = assertResponse<\n FileListHandlesHeaders & GeneratedListHandlesResponse,\n FileListHandlesHeaders,\n GeneratedListHandlesResponse\n >(\n await this.context.listHandles({\n ...updatedOptions,\n ...this.shareClientConfig,\n marker,\n }),\n );\n\n // TODO: Protocol layer issue that when handle list is in returned XML\n // response.handleList is an empty string\n if ((response.handleList as any) === \"\") {\n response.handleList = undefined;\n }\n\n const wrappedResponse: DirectoryListHandlesResponse = {\n ...ConvertInternalResponseOfListHandles(response),\n _response: {\n ...response._response,\n parsedBody: ConvertInternalResponseOfListHandles(response._response.parsedBody),\n },\n };\n\n return wrappedResponse;\n },\n );\n }\n\n /**\n * Returns an AsyncIterableIterator for FileListHandlesResponse\n *\n * @param marker - A string value that identifies the portion of the list to be\n * returned with the next list handles operation. The operation returns a\n * marker value within the response body if the list returned was not complete.\n * The marker value may then be used in a subsequent call to request the next\n * set of list items.\n * @param options - Options to list handles operation.\n */\n private async *iterateHandleSegments(\n marker?: string,\n options: FileListHandlesSegmentOptions = {},\n ): AsyncIterableIterator<FileListHandlesResponse> {\n let listHandlesResponse;\n if (!!marker || marker === undefined) {\n do {\n listHandlesResponse = await this.listHandlesSegment(marker, options);\n marker = listHandlesResponse.continuationToken;\n yield listHandlesResponse;\n } while (marker);\n }\n }\n\n /**\n * Returns an AsyncIterableIterator for handles\n *\n * @param options - Options to list handles operation.\n */\n private async *listHandleItems(\n options: FileListHandlesSegmentOptions = {},\n ): AsyncIterableIterator<HandleItem> {\n let marker: string | undefined;\n for await (const listHandlesResponse of this.iterateHandleSegments(marker, options)) {\n if (listHandlesResponse.handleList) {\n for (const handle of listHandlesResponse.handleList) {\n yield handle;\n }\n }\n }\n }\n\n /**\n * Returns an async iterable iterator to list all the handles.\n * under the specified account.\n *\n * .byPage() returns an async iterable iterator to list the handles in pages.\n *\n * @param options - Options to list handles operation.\n *\n * An asyncIterableIterator that supports paging.\n */\n public listHandles(\n options: FileListHandlesOptions = {},\n ): PagedAsyncIterableIterator<HandleItem, FileListHandlesResponse> {\n // an AsyncIterableIterator to iterate over handles\n const iter = this.listHandleItems(options);\n return {\n /**\n * The next method, part of the iteration protocol\n */\n async next() {\n return iter.next();\n },\n /**\n * The connection to the async iterator, part of the iteration protocol\n */\n [Symbol.asyncIterator]() {\n return this;\n },\n /**\n * Return an AsyncIterableIterator that works a page at a time\n */\n byPage: (settings: PageSettings = {}) => {\n return this.iterateHandleSegments(removeEmptyString(settings.continuationToken), {\n maxPageSize: settings.maxPageSize,\n ...options,\n });\n },\n };\n }\n\n /**\n * Force close all handles for a file.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/force-close-handles\n *\n * @param marker - Optional. A string value that identifies the position of handles that will\n * be closed with the next force close handles operation.\n * The operation returns a marker value within the response\n * body if there are more handles to close. The marker value\n * may then be used in a subsequent call to close the next set of handles.\n * @param options - Options to force close handles operation.\n */\n private async forceCloseHandlesSegment(\n marker?: string,\n options: FileForceCloseHandlesOptions = {},\n ): Promise<FileForceCloseHandlesResponse> {\n return tracingClient.withSpan(\n \"ShareFileClient-forceCloseHandlesSegment\",\n options,\n async (updatedOptions) => {\n marker = marker === \"\" ? undefined : marker;\n const rawResponse = await this.context.forceCloseHandles(\"*\", {\n ...updatedOptions,\n ...this.shareClientConfig,\n marker,\n });\n const response = rawResponse as FileForceCloseHandlesResponse;\n response.closedHandlesCount = rawResponse.numberOfHandlesClosed || 0;\n response.closeFailureCount = rawResponse.numberOfHandlesFailedToClose || 0;\n return response;\n },\n );\n }\n\n /**\n * Force close all handles for a file.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/force-close-handles\n *\n * @param options - Options to force close handles operation.\n */\n public async forceCloseAllHandles(\n options: FileForceCloseHandlesOptions = {},\n ): Promise<CloseHandlesInfo> {\n return tracingClient.withSpan(\n \"ShareFileClient-forceCloseAllHandles\",\n options,\n async (updatedOptions) => {\n let handlesClosed = 0;\n let numberOfHandlesFailedToClose = 0;\n let marker: string | undefined = \"\";\n\n do {\n const response: FileForceCloseHandlesResponse = await this.forceCloseHandlesSegment(\n marker,\n { tracingOptions: updatedOptions.tracingOptions },\n );\n marker = response.marker;\n if (response.closedHandlesCount) {\n handlesClosed += response.closedHandlesCount;\n }\n if (response.closeFailureCount) {\n numberOfHandlesFailedToClose += response.closeFailureCount;\n }\n } while (marker);\n\n return {\n closedHandlesCount: handlesClosed,\n closeFailureCount: numberOfHandlesFailedToClose,\n };\n },\n );\n }\n\n /**\n * Force close a specific handle for a file.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/force-close-handles\n *\n * @param handleId - Specific handle ID, cannot be asterisk \"*\".\n * Use forceCloseAllHandles() to close all handles.\n * @param FileForceCloseHandlesOptions - Options to force close handles operation.\n */\n public async forceCloseHandle(\n handleId: string,\n options: FileForceCloseHandlesOptions = {},\n ): Promise<FileForceCloseHandlesResponse> {\n return tracingClient.withSpan(\n \"ShareFileClient-forceCloseHandle\",\n options,\n async (updatedOptions) => {\n if (handleId === \"*\") {\n throw new RangeError(\n `Parameter handleID should be a specified handle ID. Use forceCloseHandlesSegment() to close all handles.`,\n );\n }\n\n const rawResponse = await this.context.forceCloseHandles(handleId, {\n ...updatedOptions,\n ...this.shareClientConfig,\n });\n const response = rawResponse as FileForceCloseHandlesResponse;\n response.closedHandlesCount = rawResponse.numberOfHandlesClosed || 0;\n response.closeFailureCount = rawResponse.numberOfHandlesFailedToClose || 0;\n return response;\n },\n );\n }\n\n /**\n * Get a {@link ShareLeaseClient} that manages leases on the file.\n *\n * @param proposeLeaseId - Initial proposed lease Id.\n * @returns A new ShareLeaseClient object for managing leases on the file.\n */\n public getShareLeaseClient(proposeLeaseId?: string): ShareLeaseClient {\n return new ShareLeaseClient(this, proposeLeaseId);\n }\n\n /**\n * Only available for clients constructed with a shared key credential.\n *\n * Generates a Service Shared Access Signature (SAS) URI based on the client properties\n * and parameters passed in. The SAS is signed by the shared key credential of the client.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas\n *\n * @param options - Optional parameters.\n * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.\n */\n public generateSasUrl(options: FileGenerateSasUrlOptions): string {\n if (!(this.credential instanceof StorageSharedKeyCredential)) {\n throw RangeError(\n \"Can only generate the SAS when the client is initialized with a shared key credential\",\n );\n }\n\n const sas = generateFileSASQueryParameters(\n {\n shareName: this.shareName,\n filePath: this.path,\n ...options,\n },\n this.credential,\n ).toString();\n\n return appendToURLQuery(this.url, sas);\n }\n\n /**\n * Only available for clients constructed with a shared key credential.\n *\n * Generates string to sign for a Service Shared Access Signature (SAS) URI based on the client properties\n * and parameters passed in. The SAS is signed by the shared key credential of the client.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas\n *\n * @param options - Optional parameters.\n * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.\n */\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n public generateSasStringToSign(options: FileGenerateSasUrlOptions): string {\n if (!(this.credential instanceof StorageSharedKeyCredential)) {\n throw RangeError(\n \"Can only generate the SAS when the client is initialized with a shared key credential\",\n );\n }\n\n return generateFileSASQueryParametersInternal(\n {\n shareName: this.shareName,\n filePath: this.path,\n ...options,\n },\n this.credential,\n ).stringToSign;\n }\n\n /**\n * Renames a file.\n * This API only supports renaming a file in the same share.\n *\n * @param destinationPath - Specifies the destination path to rename to. The path will be encoded to put into a URL to specify the destination.\n * @param options - Options for the renaming operation.\n * @returns Response data for the file renaming operation.\n *\n * Example usage:\n *\n * ```js\n *\n * // Rename the file\n * await fileClient.rename(destinationPath);\n * console.log(\"Renamed file successfully!\");\n * ```\n */\n public async rename(\n destinationPath: string,\n options: FileRenameOptions = {},\n ): Promise<{\n destinationFileClient: ShareFileClient;\n fileRenameResponse: FileRenameResponse;\n }> {\n const split: string[] = destinationPath.split(\"?\");\n let destinationUrl: string;\n if (split.length === 2) {\n const pathOnly = EscapePath(split[0]);\n const renameDestination = `/${this.shareName}/${pathOnly}`;\n destinationUrl = setURLPath(this.url, renameDestination);\n destinationUrl = setURLQueries(destinationUrl, split[1]);\n } else if (split.length === 1) {\n const pathOnly = EscapePath(destinationPath);\n const renameDestination = `/${this.shareName}/${pathOnly}`;\n destinationUrl = setURLPath(this.url, renameDestination);\n } else {\n throw new RangeError(\"Destination path should not contain more than one query string\");\n }\n\n const destFile = new ShareFileClient(destinationUrl, this.pipeline, this.shareClientConfig);\n return tracingClient.withSpan(\"ShareFileClient-rename\", options, async (updatedOptions) => {\n const response = assertResponse<FileRenameHeaders, FileRenameHeaders>(\n await destFile.context.rename(this.url, {\n ...updatedOptions,\n sourceLeaseAccessConditions: updatedOptions.sourceLeaseAccessConditions\n ? {\n sourceLeaseId: updatedOptions.sourceLeaseAccessConditions.leaseId,\n }\n : undefined,\n destinationLeaseAccessConditions: updatedOptions.destinationLeaseAccessConditions\n ? {\n destinationLeaseId: updatedOptions.destinationLeaseAccessConditions.leaseId,\n }\n : undefined,\n fileHttpHeaders: options.contentType\n ? {\n fileContentType: options.contentType,\n }\n : undefined,\n ...this.shareClientConfig,\n }),\n );\n\n return {\n destinationFileClient: destFile,\n fileRenameResponse: response,\n };\n });\n }\n}\n\n/**\n * The details of the response for a specific lease operation.\n */\nexport interface LeaseOperationResponseHeaders {\n /**\n * The ETag contains a value that you can use to perform operations conditionally. If the request\n * version is 2011-08-18 or newer, the ETag value will be in quotes.\n */\n etag?: string;\n /**\n * Returns the date and time the file was last modified. Any operation that modifies the file,\n * including an update of the file's metadata or properties, changes the last-modified time of\n * the file.\n */\n lastModified?: Date;\n /**\n * Approximate time remaining in the lease period, in seconds. Only availabe for {@link ShareLeaseClient.breakLease} for share lease.\n */\n leaseTimeInSeconds?: number;\n /**\n * Uniquely identifies a file's lease, won't be set when returned by releaseLease.\n */\n leaseId?: string;\n /**\n * This header uniquely identifies the request that was made and can be used for troubleshooting\n * the request.\n */\n requestId?: string;\n /**\n * Indicates the version of the Blob service used to execute the request. This header is returned\n * for requests made against version 2009-09-19 and above.\n */\n version?: string;\n /**\n * UTC date/time value generated by the service that indicates the time at which the response was\n * initiated\n */\n date?: Date;\n errorCode?: string;\n}\n\n/**\n * Contains the response data for operations that acquire, change, break or release a lease.\n *\n * See {@link ShareLeaseClient}.\n */\nexport type LeaseOperationResponse = WithResponse<\n LeaseOperationResponseHeaders,\n LeaseOperationResponseHeaders\n>;\n\n/**\n * lease operations options.\n */\nexport interface LeaseOperationOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * A client that manages leases for a {@link ShareFileClient} or {@link ShareClient}.\n * @see https://docs.microsoft.com/rest/api/storageservices/lease-file\n * and\n * @see https://docs.microsoft.com/rest/api/storageservices/lease-share\n */\nexport class ShareLeaseClient {\n private _leaseId: string;\n private _url: string;\n private fileOrShare: File | Share;\n\n private shareClientConfig?: ShareClientConfig;\n /**\n * Gets the lease Id.\n *\n * @readonly\n */\n public get leaseId(): string {\n return this._leaseId;\n }\n\n /**\n * Gets the url.\n *\n * @readonly\n */\n public get url(): string {\n return this._url;\n }\n\n /**\n * Creates an instance of ShareLeaseClient.\n * @param client - The client to make the lease operation requests.\n * @param leaseId - Initial proposed lease id.\n */\n constructor(client: ShareFileClient | ShareClient, leaseId?: string) {\n const clientContext: StorageClientContext = client[\"storageClientContext\"];\n\n if (client instanceof ShareClient) {\n this.fileOrShare = clientContext.share;\n this.shareClientConfig = client[\"shareClientConfig\"];\n } else {\n this.fileOrShare = clientContext.file;\n this.shareClientConfig = client[\"shareClientConfig\"];\n }\n this._url = client.url;\n\n if (!leaseId) {\n leaseId = randomUUID();\n }\n this._leaseId = leaseId;\n }\n\n /**\n * Establishes and manages a lock on a file, share or share snapshot for write and delete operations.\n *\n * @param duration - Specifies the duration of lease in seconds. For file, the only allowed value is -1 for a lease that never expires. For share, must be -1 or between 15 to 60.\n * @param options - Options for the lease management operation.\n * @returns Response data for acquire lease operation.\n */\n public async acquireLease(\n duration: number = -1,\n options: LeaseOperationOptions = {},\n ): Promise<LeaseOperationResponse> {\n return tracingClient.withSpan(\n \"ShareLeaseClient-acquireLease\",\n options,\n async (updatedOptions) => {\n return assertResponse<LeaseOperationResponseHeaders, LeaseOperationResponseHeaders>(\n await this.fileOrShare.acquireLease({\n ...updatedOptions,\n ...this.shareClientConfig,\n duration,\n proposedLeaseId: this._leaseId,\n }),\n );\n },\n );\n }\n\n /**\n * To change the ID of an existing lease.\n *\n * @param proposedLeaseId - the proposed new lease Id.\n * @param options - Options for the lease management operation.\n * @returns Response data for change lease operation.\n */\n public async changeLease(\n proposedLeaseId: string,\n options: LeaseOperationOptions = {},\n ): Promise<LeaseOperationResponse> {\n return tracingClient.withSpan(\n \"ShareLeaseClient-changeLease\",\n options,\n async (updatedOptions) => {\n const response = assertResponse<\n LeaseOperationResponseHeaders,\n LeaseOperationResponseHeaders\n >(\n await this.fileOrShare.changeLease(this._leaseId, {\n ...updatedOptions,\n ...this.shareClientConfig,\n proposedLeaseId,\n }),\n );\n this._leaseId = proposedLeaseId;\n return response;\n },\n );\n }\n\n /**\n * To free the lease if it is no longer needed so that another client may\n * immediately acquire a lease.\n *\n * @param options - Options for the lease management operation.\n * @returns Response data for release lease operation.\n */\n public async releaseLease(options: LeaseOperationOptions = {}): Promise<LeaseOperationResponse> {\n return tracingClient.withSpan(\n \"ShareLeaseClient-releaseLease\",\n options,\n async (updatedOptions) => {\n return assertResponse<LeaseOperationResponseHeaders, LeaseOperationResponseHeaders>(\n await this.fileOrShare.releaseLease(this._leaseId, {\n ...updatedOptions,\n ...this.shareClientConfig,\n }),\n );\n },\n );\n }\n\n /**\n * To force end the lease.\n *\n * @param options - Options for the lease management operation.\n * @returns Response data for break lease operation.\n */\n public async breakLease(options: LeaseOperationOptions = {}): Promise<LeaseOperationResponse> {\n return tracingClient.withSpan(\n \"ShareLeaseClient-breakLease\",\n options,\n async (updatedOptions) => {\n return assertResponse<LeaseOperationResponseHeaders, LeaseOperationResponseHeaders>(\n await this.fileOrShare.breakLease({\n ...updatedOptions,\n ...this.shareClientConfig,\n }),\n );\n },\n );\n }\n\n /**\n * To renew the lease. Only available for lease on share or share snapshot.\n * Note that the lease may be renewed even if it has expired as long as the share has not been leased again since the expiration of that lease.\n * When you renew a lease, the lease duration clock resets.\n *\n * @param options - Options for the lease management operation.\n * @returns Response data for renew lease operation.\n */\n public async renewLease(options: LeaseOperationOptions = {}): Promise<LeaseOperationResponse> {\n return tracingClient.withSpan(\n \"ShareLeaseClient-renewLease\",\n options,\n async (updatedOptions) => {\n if (isFile(this.fileOrShare)) {\n throw new RangeError(\"The renewLease operation is not available for lease on file.\");\n }\n return assertResponse<LeaseOperationResponseHeaders, LeaseOperationResponseHeaders>(\n await this.fileOrShare.renewLease(this._leaseId, {\n ...updatedOptions,\n ...this.shareClientConfig,\n }),\n );\n },\n );\n }\n}\n\n/**\n * @internal\n */\nfunction isFile(fileOrShare: File | Share): fileOrShare is File {\n return \"renewLease\" in fileOrShare;\n}\n"]}