@azure/storage-file-share
Version:
Microsoft Azure Storage SDK for JavaScript - File
1,076 lines (1,014 loc) • 407 kB
TypeScript
import type { AbortSignalLike } from '@azure/abort-controller';
import { AzureLogger } from '@azure/logger';
import * as coreClient from '@azure/core-client';
import * as coreHttpCompat from '@azure/core-http-compat';
import * as coreRestPipeline from '@azure/core-rest-pipeline';
import { HttpHeadersLike as HttpHeaders } from '@azure/core-http-compat';
import { CompatResponse as HttpOperationResponse } from '@azure/core-http-compat';
import type { HttpPipelineLogLevel } from '@azure/core-http-compat';
import { RequestBodyType as HttpRequestBody } from '@azure/core-rest-pipeline';
import type { KeepAliveOptions } from '@azure/core-http-compat';
import type { OperationTracingOptions } from '@azure/core-tracing';
import type { PagedAsyncIterableIterator } from '@azure/core-paging';
import type { ProxySettings } from '@azure/core-rest-pipeline';
import type { Readable } from 'stream';
import { RequestPolicy } from '@azure/core-http-compat';
import { RequestPolicyFactory } from '@azure/core-http-compat';
import { RequestPolicyOptionsLike as RequestPolicyOptions } from '@azure/core-http-compat';
import { RestError } from '@azure/core-rest-pipeline';
import type { TokenCredential } from '@azure/core-auth';
import type { TransferProgressEvent } from '@azure/core-rest-pipeline';
import type { UserAgentPolicyOptions } from '@azure/core-rest-pipeline';
import { WebResourceLike as WebResource } from '@azure/core-http-compat';
/** An Access policy. */
export declare interface AccessPolicy {
/** The date-time the policy is active. */
startsOn?: string;
/** The date-time the policy expires. */
expiresOn?: string;
/** The permissions for the ACL policy. */
permissions?: string;
}
/** Defines values for AccessRight. */
declare type AccessRight = "Read" | "Write" | "Delete";
/**
* ONLY AVAILABLE IN NODE.JS RUNTIME.
*
* This is a helper class to construct a string representing the permissions granted by an AccountSAS. Setting a value
* to true means that any SAS which uses these permissions will grant permissions for that operation. Once all the
* values are set, this should be serialized with toString and set as the permissions field on an
* {@link AccountSASSignatureValues} object. It is possible to construct the permissions string without this class, but
* the order of the permissions is particular and this class guarantees correctness.
*/
export declare class AccountSASPermissions {
/**
* Parse initializes the AccountSASPermissions fields from a string.
*
* @param permissions -
*/
static parse(permissions: string): AccountSASPermissions;
/**
* Permission to read resources and list queues and tables granted.
*/
read: boolean;
/**
* Permission to write resources granted.
*/
write: boolean;
/**
* Permission to delete blobs and files granted.
*/
delete: boolean;
/**
* Permission to list blob containers, blobs, shares, directories, and files granted.
*/
list: boolean;
/**
* Permission to add messages, table entities, and append to blobs granted.
*/
add: boolean;
/**
* Permission to create blobs and files granted.
*/
create: boolean;
/**
* Permissions to update messages and table entities granted.
*/
update: boolean;
/**
* Permission to get and delete messages granted.
*/
process: boolean;
/**
* Produces the SAS permissions string for an Azure Storage account.
* Call this method to set AccountSASSignatureValues Permissions field.
*
* Using this method will guarantee the resource types are in
* an order accepted by the service.
*
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas
*
*/
toString(): string;
}
/**
* ONLY AVAILABLE IN NODE.JS RUNTIME.
*
* This is a helper class to construct a string representing the resources accessible by an AccountSAS. Setting a value
* to true means that any SAS which uses these permissions will grant access to that resource type. Once all the
* values are set, this should be serialized with toString and set as the resources field on an
* {@link AccountSASSignatureValues} object. It is possible to construct the resources string without this class, but
* the order of the resources is particular and this class guarantees correctness.
*/
export declare class AccountSASResourceTypes {
/**
* Creates an {@link AccountSASResourceTypes} from the specified resource types string. This method will throw an
* Error if it encounters a character that does not correspond to a valid resource type.
*
* @param resourceTypes -
*/
static parse(resourceTypes: string): AccountSASResourceTypes;
/**
* Permission to access service level APIs granted.
*/
service: boolean;
/**
* Permission to access container level APIs (Blob Containers, Tables, Queues, File Shares) granted.
*/
container: boolean;
/**
* Permission to access object level APIs (Blobs, Table Entities, Queue Messages, Files) granted.
*/
object: boolean;
/**
* Converts the given resource types to a string.
*
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas
*
*/
toString(): string;
}
/**
* ONLY AVAILABLE IN NODE.JS RUNTIME.
*
* This is a helper class to construct a string representing the services accessible by an AccountSAS. Setting a value
* to true means that any SAS which uses these permissions will grant access to that service. Once all the
* values are set, this should be serialized with toString and set as the services field on an
* {@link AccountSASSignatureValues} object. It is possible to construct the services string without this class, but
* the order of the services is particular and this class guarantees correctness.
*/
export declare class AccountSASServices {
/**
* Creates an {@link AccountSASServices} from the specified services string. This method will throw an
* Error if it encounters a character that does not correspond to a valid service.
*
* @param services -
*/
static parse(services: string): AccountSASServices;
/**
* Permission to access blob resources granted.
*/
blob: boolean;
/**
* Permission to access file resources granted.
*/
file: boolean;
/**
* Permission to access queue resources granted.
*/
queue: boolean;
/**
* Permission to access table resources granted.
*/
table: boolean;
/**
* Converts the given services to a string.
*
*/
toString(): string;
}
/**
* ONLY AVAILABLE IN NODE.JS RUNTIME.
*
* AccountSASSignatureValues is used to generate a Shared Access Signature (SAS) for an Azure Storage account. Once
* all the values here are set appropriately, call {@link generateAccountSASQueryParameters} to obtain a representation of the SAS
* which can actually be applied to file urls. Note: that both this class and {@link SASQueryParameters} exist because
* the former is mutable and a logical representation while the latter is immutable and used to generate actual REST
* requests.
*
* @see https://learn.microsoft.com/en-us/azure/storage/common/storage-dotnet-shared-access-signature-part-1
* for more conceptual information on SAS
*
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas
* for descriptions of the parameters, including which are required
*/
export declare interface AccountSASSignatureValues {
/**
* If not provided, this defaults to the service version targeted by this version of the library.
*/
version?: string;
/**
* Optional. SAS protocols allowed.
*/
protocol?: SASProtocol;
/**
* Optional. When the SAS will take effect.
*/
startsOn?: Date;
/**
* The time after which the SAS will no longer work.
*/
expiresOn: Date;
/**
* Specifies which operations the SAS user may perform. Please refer to {@link AccountSASPermissions} for help
* constructing the permissions string.
*/
permissions: AccountSASPermissions;
/**
* Optional. IP range allowed.
*/
ipRange?: SasIPRange;
/**
* The values that indicate the services accessible with this SAS. Please refer to {@link AccountSASServices} to
* construct this value.
*/
services: string;
/**
* The values that indicate the resource types accessible with this SAS. Please refer
* to {@link AccountSASResourceTypes} to construct this value.
*/
resourceTypes: string;
}
/**
* AnonymousCredential provides a credentialPolicyCreator member used to create
* AnonymousCredentialPolicy objects. AnonymousCredentialPolicy is used with
* HTTP(S) requests that read public resources or for use with Shared Access
* Signatures (SAS).
*/
export declare class AnonymousCredential extends Credential_2 {
/**
* Creates an {@link AnonymousCredentialPolicy} object.
*
* @param nextPolicy -
* @param options -
*/
create(nextPolicy: RequestPolicy, options: RequestPolicyOptions): AnonymousCredentialPolicy;
}
/**
* AnonymousCredentialPolicy is used with HTTP(S) requests that read public resources
* or for use with Shared Access Signatures (SAS).
*/
export declare class AnonymousCredentialPolicy extends CredentialPolicy {
/**
* Creates an instance of AnonymousCredentialPolicy.
* @param nextPolicy -
* @param options -
*/
constructor(nextPolicy: RequestPolicy, options: RequestPolicyOptions);
}
/**
* The base class from which all request policies derive.
*/
export declare abstract class BaseRequestPolicy implements RequestPolicy {
/**
* The next policy in the pipeline. Each policy is responsible for executing the next one if the request is to continue through the pipeline.
*/
readonly _nextPolicy: RequestPolicy;
/**
* The options that can be passed to a given request policy.
*/
readonly _options: RequestPolicyOptions;
/**
* The main method to implement that manipulates a request/response.
*/
protected constructor(
/**
* The next policy in the pipeline. Each policy is responsible for executing the next one if the request is to continue through the pipeline.
*/
_nextPolicy: RequestPolicy,
/**
* The options that can be passed to a given request policy.
*/
_options: RequestPolicyOptions);
/**
* Sends a network request based on the given web resource.
* @param webResource - A {@link WebResourceLike} that describes a HTTP request to be made.
*/
abstract sendRequest(webResource: WebResource): Promise<HttpOperationResponse>;
/**
* Get whether or not a log with the provided log level should be logged.
* @param logLevel - The log level of the log that will be logged.
* @returns Whether or not a log with the provided log level should be logged.
*/
shouldLog(logLevel: HttpPipelineLogLevel): boolean;
/**
* Attempt to log the provided message to the provided logger. If no logger was provided or if
* the log level does not meat the logger's threshold, then nothing will be logged.
* @param logLevel - The log level of this log.
* @param message - The message of this log.
*/
log(logLevel: HttpPipelineLogLevel, message: string): void;
}
export declare interface ClearRange {
start: number;
end: number;
}
/**
* Close handles result information.
*/
export declare interface CloseHandlesInfo {
closedHandlesCount: number;
/**
* Contains count of number of handles that failed to close.
*/
closeFailureCount?: number;
}
/**
* Common options of the {@link ShareGenerateSasUrlOptions} and {@link FileGenerateSasUrlOptions}.
*/
export declare interface CommonGenerateSasUrlOptions {
/**
* The version of the service this SAS will target. If not specified, it will default to the version targeted by the
* library.
*/
version?: string;
/**
* Optional. SAS protocols, HTTPS only or HTTPSandHTTP
*/
protocol?: SASProtocol;
/**
* Optional. When the SAS will take effect.
*/
startsOn?: Date;
/**
* Optional only when identifier is provided. The time after which the SAS will no longer work.
*/
expiresOn?: Date;
/**
* Optional. IP ranges allowed in this SAS.
*/
ipRange?: SasIPRange;
/**
* Optional. The name of the access policy on the share this SAS references if any.
*
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/establishing-a-stored-access-policy
*/
identifier?: string;
/**
* Optional. The cache-control header for the SAS.
*/
cacheControl?: string;
/**
* Optional. The content-disposition header for the SAS.
*/
contentDisposition?: string;
/**
* Optional. The content-encoding header for the SAS.
*/
contentEncoding?: string;
/**
* Optional. The content-language header for the SAS.
*/
contentLanguage?: string;
/**
* Optional. The content-type header for the SAS.
*/
contentType?: string;
}
/**
* An interface for options common to every remote operation.
*/
export declare interface CommonOptions {
tracingOptions?: OperationTracingOptions;
}
/** Parameter group */
export declare interface CopyFileSmbInfo {
/** Specifies either the option to copy file attributes from a source file(source) to a target file or a list of attributes to set on a target file. */
fileAttributes?: string;
/** Specifies either the option to copy file creation time from a source file(source) to a target file or a time value in ISO 8601 format to set as creation time on a target file. */
fileCreationTime?: string;
/** Specifies either the option to copy file last write time from a source file(source) to a target file or a time value in ISO 8601 format to set as last write time on a target file. */
fileLastWriteTime?: string;
/** Specifies either the option to copy file last write time from a source file(source) to a target file or a time value in ISO 8601 format to set as last write time on a target file. */
fileChangeTime?: string;
/** 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. */
filePermissionCopyMode?: PermissionCopyModeType;
/** Specifies the option to overwrite the target file if it already exists and has read-only attribute set. */
ignoreReadOnly?: boolean;
/** Specifies the option to set archive attribute on a target file. True means archive attribute will be set on a target file despite attribute overrides or a source file state. */
setArchiveAttribute?: boolean;
}
/** Defines values for CopyStatusType. */
export declare type CopyStatusType = "pending" | "success" | "aborted" | "failed";
/** CORS is an HTTP feature that enables a web application running under one domain to access resources in another domain. Web browsers implement a security restriction known as same-origin policy that prevents a web page from calling APIs in a different domain; CORS provides a secure way to allow one domain (the origin domain) to call APIs in another domain. */
export declare interface CorsRule {
/** The origin domains that are permitted to make a request against the storage service via CORS. The origin domain is the domain from which the request originates. Note that the origin must be an exact case-sensitive match with the origin that the user age sends to the service. You can also use the wildcard character '*' to allow all origin domains to make requests via CORS. */
allowedOrigins: string;
/** The methods (HTTP request verbs) that the origin domain may use for a CORS request. (comma separated) */
allowedMethods: string;
/** The request headers that the origin domain may specify on the CORS request. */
allowedHeaders: string;
/** The response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer. */
exposedHeaders: string;
/** The maximum amount time that a browser should cache the preflight OPTIONS request. */
maxAgeInSeconds: number;
}
/**
* Credential is an abstract class for Azure Storage HTTP requests signing. This
* class will host an credentialPolicyCreator factory which generates CredentialPolicy.
*/
declare abstract class Credential_2 implements RequestPolicyFactory {
/**
* Creates a RequestPolicy object.
*
* @param _nextPolicy -
* @param _options -
*/
create(_nextPolicy: RequestPolicy, _options: RequestPolicyOptions): RequestPolicy;
}
export { Credential_2 as Credential }
/**
* Credential policy used to sign HTTP(S) requests before sending. This is an
* abstract class.
*/
export declare abstract class CredentialPolicy extends BaseRequestPolicy {
/**
* Sends out request.
*
* @param request -
*/
sendRequest(request: WebResource): Promise<HttpOperationResponse>;
/**
* Child classes must implement this method with request signing. This method
* will be executed in {@link sendRequest}.
*
* @param request -
*/
protected signRequest(request: WebResource): WebResource;
}
/**
* A factory function that creates a new CredentialPolicy that uses the provided nextPolicy.
*/
export declare type CredentialPolicyCreator = (nextPolicy: RequestPolicy, options: RequestPolicyOptions) => CredentialPolicy;
/** Defines values for DeleteSnapshotsOptionType. */
export declare type DeleteSnapshotsOptionType = "include" | "include-leased";
/** Parameter group */
declare interface DestinationLeaseAccessConditions {
/** Required if the destination file has an active infinite lease. The lease ID specified for this header must match the lease ID of the destination file. If the request does not include the lease ID or it is not valid, the operation fails with status code 412 (Precondition Failed). If this header is specified and the destination file does not currently have an active lease, the operation will also fail with status code 412 (Precondition Failed). */
destinationLeaseId?: string;
}
/** Interface representing a Directory. */
declare interface Directory {
/**
* Creates a new directory under the specified share or parent directory.
* @param options The options parameters.
*/
create(options?: DirectoryCreateOptionalParams): Promise<DirectoryCreateResponse_2>;
/**
* Returns all system properties for the specified directory, and can also be used to check the
* existence of a directory. The data returned does not include the files in the directory or any
* subdirectories.
* @param options The options parameters.
*/
getProperties(options?: DirectoryGetPropertiesOptionalParams): Promise<DirectoryGetPropertiesResponse_2>;
/**
* Removes the specified empty directory. Note that the directory must be empty before it can be
* deleted.
* @param options The options parameters.
*/
delete(options?: DirectoryDeleteOptionalParams): Promise<DirectoryDeleteResponse_2>;
/**
* Sets properties on the directory.
* @param options The options parameters.
*/
setProperties(options?: DirectorySetPropertiesOptionalParams): Promise<DirectorySetPropertiesResponse_2>;
/**
* Updates user defined metadata for the specified directory.
* @param options The options parameters.
*/
setMetadata(options?: DirectorySetMetadataOptionalParams): Promise<DirectorySetMetadataResponse_2>;
/**
* Returns a list of files or directories under the specified share or directory. It lists the contents
* only for a single level of the directory hierarchy.
* @param options The options parameters.
*/
listFilesAndDirectoriesSegment(options?: DirectoryListFilesAndDirectoriesSegmentOptionalParams): Promise<DirectoryListFilesAndDirectoriesSegmentResponse_2>;
/**
* Lists handles for directory.
* @param options The options parameters.
*/
listHandles(options?: DirectoryListHandlesOptionalParams): Promise<DirectoryListHandlesResponse_2>;
/**
* Closes all handles open for given directory.
* @param handleId Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) is
* a wildcard that specifies all handles.
* @param options The options parameters.
*/
forceCloseHandles(handleId: string, options?: DirectoryForceCloseHandlesOptionalParams): Promise<DirectoryForceCloseHandlesResponse_2>;
/**
* Renames a directory
* @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length.
* @param options The options parameters.
*/
rename(renameSource: string, options?: DirectoryRenameOptionalParams): Promise<DirectoryRenameResponse_2>;
}
/**
* Additional response header values for close handles request.
*/
export declare interface DirectoryCloseHandlesHeaders {
/**
* This header uniquely identifies the request that was made and can be used for troubleshooting
* the request.
*/
requestId?: string;
/**
* Indicates the version of the File service used to execute the request.
*/
version?: string;
/**
* A UTC date/time value generated by the service that indicates the time at which the response
* was initiated.
*/
date?: Date;
/**
* A string describing next handle to be closed. It is returned when more handles need to be
* closed to complete the request.
*/
marker?: string;
}
/** Defines headers for Directory_create operation. */
export declare interface DirectoryCreateHeaders {
/** The ETag contains a value which represents the version of the directory, in quotes. */
etag?: string;
/** Returns the date and time the share was last modified. Any operation that modifies the directory or its properties updates the last modified time. Operations on files do not affect the last modified time of the directory. */
lastModified?: Date;
/** This header uniquely identifies the request that was made and can be used for troubleshooting the request. */
requestId?: string;
/** Indicates the version of the File service used to execute the request. */
version?: string;
/** A UTC date/time value generated by the service that indicates the time at which the response was initiated. */
date?: Date;
/** The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise. */
isServerEncrypted?: boolean;
/** Key of the permission set for the directory. */
filePermissionKey?: string;
/** Attributes set for the directory. */
fileAttributes?: string;
/** Creation time for the directory. */
fileCreatedOn?: Date;
/** Last write time for the directory. */
fileLastWriteOn?: Date;
/** Change time for the directory. */
fileChangeOn?: Date;
/** The fileId of the directory. */
fileId?: string;
/** The parent fileId of the directory. */
fileParentId?: string;
/** Properties of NFS files. */
posixProperties?: FilePosixProperties;
/** Error Code */
errorCode?: string;
}
/** Defines headers for Directory_create operation. */
declare interface DirectoryCreateHeaders_2 {
/** The ETag contains a value which represents the version of the directory, in quotes. */
etag?: string;
/** Returns the date and time the share was last modified. Any operation that modifies the directory or its properties updates the last modified time. Operations on files do not affect the last modified time of the directory. */
lastModified?: Date;
/** This header uniquely identifies the request that was made and can be used for troubleshooting the request. */
requestId?: string;
/** Indicates the version of the File service used to execute the request. */
version?: string;
/** A UTC date/time value generated by the service that indicates the time at which the response was initiated. */
date?: Date;
/** The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise. */
isServerEncrypted?: boolean;
/** Key of the permission set for the directory. */
filePermissionKey?: string;
/** Attributes set for the directory. */
fileAttributes?: string;
/** Creation time for the directory. */
fileCreatedOn?: Date;
/** Last write time for the directory. */
fileLastWriteOn?: Date;
/** Change time for the directory. */
fileChangeOn?: Date;
/** The fileId of the directory. */
fileId?: string;
/** The parent fileId of the directory. */
fileParentId?: string;
/** NFS only. The mode of the file or directory. */
fileMode?: string;
/** NFS only. The owner of the file or directory. */
owner?: string;
/** NFS only. The owning group of the file or directory. */
group?: string;
/** NFS only. Type of the file or directory. */
nfsFileType?: NfsFileType;
/** Error Code */
errorCode?: string;
}
/**
* Contains response data for the {@link DirectoryClient.createIfNotExists} operation.
*/
export declare interface DirectoryCreateIfNotExistsResponse extends DirectoryCreateResponse {
/**
* Indicate whether the directory is successfully created. Is false when the directory is not changed as it already exists.
*/
succeeded: boolean;
}
/** Optional parameters. */
declare interface DirectoryCreateOptionalParams extends coreClient.OperationOptions {
/** 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> */
timeoutInSeconds?: number;
/** Valid value is backup */
fileRequestIntent?: ShareTokenIntent;
/** A name-value pair to associate with a file storage object. */
metadata?: {
[propertyName: string]: string;
};
/** Optional. Available for version 2023-06-01 and later. Specifies the format in which the permission is returned. 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. 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 */
filePermissionFormat?: FilePermissionFormat;
/** If true, the trailing dot will not be trimmed from the target URI. */
allowTrailingDot?: boolean;
/** If specified the permission (security descriptor) shall be set for the directory/file. This header can be used if Permission size is <= 8KB, else x-ms-file-permission-key header shall be used. Default value: Inherit. If SDDL is specified as input, it must have owner, group and dacl. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified. */
filePermission?: string;
/** Key of the permission to be set for the directory/file. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified. */
filePermissionKey?: string;
/** If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default. */
fileAttributes?: string;
/** Creation time for the file/directory. Default value: Now. */
fileCreatedOn?: string;
/** Last write time for the file/directory. Default value: Now. */
fileLastWriteOn?: string;
/** Change time for the file/directory. Default value: Now. */
fileChangeOn?: string;
/** Optional, NFS only. The owner of the file or directory. */
owner?: string;
/** Optional, NFS only. The owning group of the file or directory. */
group?: string;
/** Optional, NFS only. The file mode of the file or directory */
fileMode?: string;
}
/**
* Options to configure {@link ShareDirectoryClient.create} operation.
*/
export declare interface DirectoryCreateOptions extends FileAndDirectoryCreateCommonOptions, CommonOptions {
/**
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the @azure/abort-controller to create an `AbortSignal`.
*/
abortSignal?: AbortSignalLike;
/**
* A collection of key-value string pair to associate with the file storage object.
*/
metadata?: Metadata;
}
/** Contains response data for the create operation. */
export declare type DirectoryCreateResponse = WithResponse<DirectoryCreateHeaders, DirectoryCreateHeaders>;
/** Contains response data for the create operation. */
declare type DirectoryCreateResponse_2 = DirectoryCreateHeaders_2;
/** Defines headers for Directory_delete operation. */
export declare interface DirectoryDeleteHeaders {
/** This header uniquely identifies the request that was made and can be used for troubleshooting the request. */
requestId?: string;
/** Indicates the version of the File service used to execute the request. */
version?: string;
/** A UTC date/time value generated by the service that indicates the time at which the response was initiated. */
date?: Date;
/** Error Code */
errorCode?: string;
}
/**
* Contains response data for the {@link DirectoryClient.deleteIfExists} operation.
*/
export declare interface DirectoryDeleteIfExistsResponse extends DirectoryDeleteResponse {
/**
* Indicate whether the directory is successfully deleted. Is false if the directory does not exist in the first place.
*/
succeeded: boolean;
}
/** Optional parameters. */
declare interface DirectoryDeleteOptionalParams extends coreClient.OperationOptions {
/** 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> */
timeoutInSeconds?: number;
/** Valid value is backup */
fileRequestIntent?: ShareTokenIntent;
/** If true, the trailing dot will not be trimmed from the target URI. */
allowTrailingDot?: boolean;
}
/**
* Options to configure the {@link ShareDirectoryClient.delete} operation.
*/
export declare interface DirectoryDeleteOptions extends CommonOptions {
/**
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the @azure/abort-controller to create an `AbortSignal`.
*/
abortSignal?: AbortSignalLike;
}
/** Contains response data for the delete operation. */
export declare type DirectoryDeleteResponse = WithResponse<DirectoryDeleteHeaders, DirectoryDeleteHeaders>;
/** Contains response data for the delete operation. */
declare type DirectoryDeleteResponse_2 = DirectoryDeleteHeaders;
/**
* Options to configure the {@link ShareDirectoryClient.exists} operation.
*/
export declare interface DirectoryExistsOptions extends CommonOptions {
/**
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the @azure/abort-controller to create an `AbortSignal`.
*/
abortSignal?: AbortSignalLike;
}
/** Defines headers for Directory_forceCloseHandles operation. */
export declare interface DirectoryForceCloseHandlesHeaders {
/** This header uniquely identifies the request that was made and can be used for troubleshooting the request. */
requestId?: string;
/** Indicates the version of the File service used to execute the request. */
version?: string;
/** A UTC date/time value generated by the service that indicates the time at which the response was initiated. */
date?: Date;
/** A string describing next handle to be closed. It is returned when more handles need to be closed to complete the request. */
marker?: string;
/** Contains count of number of handles closed. */
numberOfHandlesClosed?: number;
/** Contains count of number of handles that failed to close. */
numberOfHandlesFailedToClose?: number;
/** Error Code */
errorCode?: string;
}
/** Optional parameters. */
declare interface DirectoryForceCloseHandlesOptionalParams extends coreClient.OperationOptions {
/** 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> */
timeoutInSeconds?: number;
/** Valid value is backup */
fileRequestIntent?: ShareTokenIntent;
/** A string value that identifies the portion of the list to be returned with the next list operation. The operation returns a marker value within the response body if the list returned was not complete. The marker value may then be used in a subsequent call to request the next set of list items. The marker value is opaque to the client. */
marker?: string;
/** The snapshot parameter is an opaque DateTime value that, when present, specifies the share snapshot to query. */
shareSnapshot?: string;
/** If true, the trailing dot will not be trimmed from the target URI. */
allowTrailingDot?: boolean;
/** Specifies operation should apply to the directory specified in the URI, its files, its subdirectories and their files. */
recursive?: boolean;
}
/**
* Options to configure {@link ShareDirectoryClient.forceCloseHandle}.
*/
export declare interface DirectoryForceCloseHandlesOptions extends CommonOptions {
/**
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the @azure/abort-controller to create an `AbortSignal`.
*/
abortSignal?: AbortSignalLike;
}
/**
* Response type for {@link ShareDirectoryClient.forceCloseHandle}.
*/
export declare type DirectoryForceCloseHandlesResponse = WithResponse<CloseHandlesInfo & DirectoryCloseHandlesHeaders, DirectoryForceCloseHandlesHeaders>;
/** Contains response data for the forceCloseHandles operation. */
declare type DirectoryForceCloseHandlesResponse_2 = DirectoryForceCloseHandlesHeaders;
/**
* Options to configure Directory - Force Close Handles Segment operations.
*
* See:
* - {@link ShareDirectoryClient.forceCloseHandlesSegment}
* - {@link ShareDirectoryClient.forceCloseAllHandles}
*/
export declare interface DirectoryForceCloseHandlesSegmentOptions extends CommonOptions {
/**
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the @azure/abort-controller to create an `AbortSignal`.
*/
abortSignal?: AbortSignalLike;
/**
* Specifies operation should apply to the directory specified in the URI, its files, its
* subdirectories and their files.
*/
recursive?: boolean;
}
/** Defines headers for Directory_getProperties operation. */
export declare interface DirectoryGetPropertiesHeaders {
/** A set of name-value pairs that contain metadata for the directory. */
metadata?: {
[propertyName: string]: string;
};
/** The ETag contains a value that you can use to perform operations conditionally, in quotes. */
etag?: string;
/** Returns the date and time the Directory was last modified. Operations on files within the directory do not affect the last modified time of the directory. */
lastModified?: Date;
/** This header uniquely identifies the request that was made and can be used for troubleshooting the request. */
requestId?: string;
/** Indicates the version of the File service used to execute the request. */
version?: string;
/** A UTC date/time value generated by the service that indicates the time at which the response was initiated. */
date?: Date;
/** The value of this header is set to true if the directory metadata is completely encrypted using the specified algorithm. Otherwise, the value is set to false. */
isServerEncrypted?: boolean;
/** Attributes set for the directory. */
fileAttributes?: string;
/** Creation time for the directory. */
fileCreatedOn?: Date;
/** Last write time for the directory. */
fileLastWriteOn?: Date;
/** Change time for the directory. */
fileChangeOn?: Date;
/** Key of the permission set for the directory. */
filePermissionKey?: string;
/** The fileId of the directory. */
fileId?: string;
/** The parent fileId of the directory. */
fileParentId?: string;
/** Properties of NFS files. */
posixProperties?: FilePosixProperties;
/** Error Code */
errorCode?: string;
}
/** Defines headers for Directory_getProperties operation. */
declare interface DirectoryGetPropertiesHeaders_2 {
/** A set of name-value pairs that contain metadata for the directory. */
metadata?: {
[propertyName: string]: string;
};
/** The ETag contains a value that you can use to perform operations conditionally, in quotes. */
etag?: string;
/** Returns the date and time the Directory was last modified. Operations on files within the directory do not affect the last modified time of the directory. */
lastModified?: Date;
/** This header uniquely identifies the request that was made and can be used for troubleshooting the request. */
requestId?: string;
/** Indicates the version of the File service used to execute the request. */
version?: string;
/** A UTC date/time value generated by the service that indicates the time at which the response was initiated. */
date?: Date;
/** The value of this header is set to true if the directory metadata is completely encrypted using the specified algorithm. Otherwise, the value is set to false. */
isServerEncrypted?: boolean;
/** Attributes set for the directory. */
fileAttributes?: string;
/** Creation time for the directory. */
fileCreatedOn?: Date;
/** Last write time for the directory. */
fileLastWriteOn?: Date;
/** Change time for the directory. */
fileChangeOn?: Date;
/** Key of the permission set for the directory. */
filePermissionKey?: string;
/** The fileId of the directory. */
fileId?: string;
/** The parent fileId of the directory. */
fileParentId?: string;
/** NFS only. The mode of the file or directory. */
fileMode?: string;
/** NFS only. The owner of the file or directory. */
owner?: string;
/** NFS only. The owning group of the file or directory. */
group?: string;
/** NFS only. Type of the file or directory. */
nfsFileType?: NfsFileType;
/** Error Code */
errorCode?: string;
}
/** Optional parameters. */
declare interface DirectoryGetPropertiesOptionalParams extends coreClient.OperationOptions {
/** 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> */
timeoutInSeconds?: number;
/** Valid value is backup */
fileRequestIntent?: ShareTokenIntent;
/** The snapshot parameter is an opaque DateTime value that, when present, specifies the share snapshot to query. */
shareSnapshot?: string;
/** If true, the trailing dot will not be trimmed from the target URI. */
allowTrailingDot?: boolean;
}
/**
* Options to configure the {@link ShareDirectoryClient.getProperties} operation.
*/
export declare interface DirectoryGetPropertiesOptions extends CommonOptions {
/**
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the @azure/abort-controller to create an `AbortSignal`.
*/
abortSignal?: AbortSignalLike;
}
/** Contains response data for the getProperties operation. */
export declare type DirectoryGetPropertiesResponse = WithResponse<DirectoryGetPropertiesHeaders, DirectoryGetPropertiesHeaders>;
/** Contains response data for the getProperties operation. */
declare type DirectoryGetPropertiesResponse_2 = DirectoryGetPropertiesHeaders_2;
/** A listed directory item. */
export declare interface DirectoryItem {
name: string;
fileId?: string;
/** File properties. */
properties?: FileProperty;
attributes?: string;
permissionKey?: string;
}
/** A listed directory item. */
declare interface DirectoryItem_2 {
name: StringEncoded;
fileId?: string;
/** File properties. */
properties?: FileProperty;
attributes?: string;
permissionKey?: string;
}
/**
* Options to configure {@link ShareDirectoryClient.listFilesAndDirectories} operation.
*/
export declare interface DirectoryListFilesAndDirectoriesOptions extends CommonOptions {
/**
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the @azure/abort-controller to create an `AbortSignal`.
*/
abortSignal?: AbortSignalLike;
/**
* Filters the results to return only entries whose
* name begins with the specified prefix.
*/
prefix?: string;
includeTimestamps?: boolean;
includeEtag?: boolean;
includeAttributes?: boolean;
includePermissionKey?: boolean;
/**
* Optional. Specified that extended info should be included in the returned {@link FileItem} or {@link DirectoryItem}.
* If true, the Content-Length property will be up-to-date, FileId will be returned in response.
*/
includeExtendedInfo?: boolean;
}
/** Defines headers for Directory_listFilesAndDirectoriesSegment operation. */
export declare interface DirectoryListFilesAndDirectoriesSegmentHeaders {
/** Specifies the format in which the results are returned. Currently this value is 'application/xml'. */
contentType?: string;
/** This header uniquely identifies the request that was made and can be used for troubleshooting the request. */
requestId?: string;
/** Indicates the version of the File service used to execute the request. */
version?: string;
/** A UTC date/time value generated by the service that indicates the time at which the response was initiated. */
date?: Date;
/** Error Code */
errorCode?: string;
}
/** Optional parameters. */
declare interface DirectoryListFilesAndDirectoriesSegmentOptionalParams extends coreClient.OperationOptions {
/** 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> */
timeoutInSeconds?: number;
/** Valid value is backup */
fileRequestIntent?: ShareTokenIntent;
/** Filters the results to return only entries whose name begins with the specified prefix. */
prefix?: string;
/** A string value that identifies the portion of the list to be returned with the next list operation. The operation returns a marker value within the response body if the list returned was not complete. The marker value may then be used in a subsequent call to request the next set of list items. The marker value is opaque to the client. */
marker?: string;
/** Specifies the maximum number of entries to return. If the request does not specify maxresults, or specifies a value greater than 5,000, the server will return up to 5,000 items. */
maxResults?: number;
/** The snapshot parameter is an opaque DateTime value that, when present, specifies the share snapshot to query. */
shareSnapshot?: string;
/** If true, the trailing dot will not be trimmed from the target URI. */
allowTrailingDot?: boolean;
/** Include this parameter to specify one or more datasets to include in the response. */
include?: ListFilesIncludeType[];
/** Include extended information. */
includeExtendedInfo?: boolean;
}
/** Contains response data for the listFilesAndDirectoriesSegment operation. */
export declare type DirectoryListFilesAndDirectoriesSegmentResponse = WithResponse<DirectoryListFilesAndDirectoriesSegmentHeaders & ListFilesAndDirectoriesSegmentResponse, DirectoryListFilesAndDirectoriesSegmentHeaders, ListFilesAndDirectoriesSegmentResponse>;
/** Contains response data for the listFilesAndDirectoriesSegment operation. */
declare type DirectoryListFilesAndDirectoriesSegmentResponse_2 = DirectoryListFilesAndDirectoriesSegmentHeaders & ListFilesAndDirectoriesSegmentResponse_2;
/** Defines headers for Directory_listHandles operation. */
export declare interface DirectoryListHandlesHeaders {
/** Specifies the format in which the results are returned. Currently this value is 'application/xml'. */
contentType?: string;
/** This header uniquely identifies the request that was made and can be used for troubleshooting the request. */
requestId?: string;
/** Indicates the version of the File service used to execute the request. */
version?: string;
/** A UTC date/time value generated by the service that indicates the time at which the response was initiated. */
date?: Date;
/** Error Code */
errorCode?: string;
}
/** Optional parameters. */
declare interface DirectoryListHandlesOptionalParams extends coreClient.OperationOptions {
/** 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> */
timeoutInSeconds?: number;
/** Valid value is backup */
fileRequestIntent?: ShareTokenIntent;
/** A string value that identifies the portion of the list to be returned with the next list operation. The operation returns a marker value within the response body if the list returned was not complete. The marker value may then be used in a subsequent call to request the next set of list items. The marker value is opaque to the client. */
marker?: string;
/** Specifies the maximum number of entries to return. If the request does not specify maxresults, or specifies a value greater than 5,000, the server will return up to 5,000 items. */
maxResults?: number;
/** The snapshot parameter is an opaque DateTime value that, when present, specifies the share snapshot to query. */
shareSnapshot?: string;
/** If true, the trailing dot will not be trimmed from the target URI. */
allowTrailingDot?: boolean;
/** Specifies operation should apply to the directory specified in the URI, its files, its subdirectories and their files. */
recursive?: boolean;
}
/**
* Options to configure the {@link ShareDirectoryClient.listHandles} operation.
*/
export declare interface DirectoryListHandlesOptions extends CommonOptions {
/**
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the @azure/abort-controller to create an `AbortSignal`.
*/
abortSignal?: AbortSignalLike;
/**
* Specifies whether operation should apply to the directory specified in the URI, its files, its
* subdirectories and their files.
*/
recursive?: boolean;
}
/** Contains response data for the listHandles operation. */
export declare type DirectoryListHandlesResponse = WithResponse<DirectoryListHandlesHeaders & ListHandlesResponse, DirectoryListHandlesHeaders, ListHandlesResponse>;
/** Contains response data for the listHandles operation. */
declare type DirectoryListHandlesResponse_2 = DirectoryListHandlesHeaders & ListHandlesResponse_2;
/**
* Options to configure Directory - List Handles Segment operations.
*
* See:
* - {@link ShareDirectoryClient.listHandlesSegment}
* - {@link ShareDirectoryClient.iterateHandleSegments}
* - {@link ShareDirectoryClient.listHandleItems}
*
*/
expor