var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var FileDownloadResponse_exports = {};
__export(FileDownloadResponse_exports, {
  FileDownloadResponse: () => FileDownloadResponse
});
module.exports = __toCommonJS(FileDownloadResponse_exports);
var import_core_util = require("@azure/core-util");
var import_RetriableReadableStream = require("./utils/RetriableReadableStream.js");
var import_utils_common = require("./utils/utils.common.js");
var import_storage_common = require("@azure/storage-common");
class FileDownloadResponse {
  /**
   * Indicates that the service supports
   * requests for partial file content.
   *
   * @readonly
   */
  get acceptRanges() {
    return this.originalResponse.acceptRanges;
  }
  /**
   * Returnes if it was previously specified
   * for the file.
   *
   * @readonly
   */
  get cacheControl() {
    return this.originalResponse.cacheControl;
  }
  /**
   * Returns the value that was specified
   * for the 'x-ms-content-disposition' header and specifies how to process the
   * response.
   *
   * @readonly
   */
  get contentDisposition() {
    return this.originalResponse.contentDisposition;
  }
  /**
   * Returns the value that was specified
   * for the Content-Encoding request header.
   *
   * @readonly
   */
  get contentEncoding() {
    return this.originalResponse.contentEncoding;
  }
  /**
   * Returns the value that was specified
   * for the Content-Language request header.
   *
   * @readonly
   */
  get contentLanguage() {
    return this.originalResponse.contentLanguage;
  }
  /**
   * The number of bytes present in the
   * response body.
   *
   * @readonly
   */
  get contentLength() {
    return this.originalResponse.contentLength;
  }
  /**
   * If the file has an MD5 hash and the
   * request is to read the full file, this response header is returned so that
   * the client can check for message content integrity. If the request is to
   * read a specified range and the 'x-ms-range-get-content-md5' is set to
   * true, then the request returns an MD5 hash for the range, as long as the
   * range size is less than or equal to 4 MB. If neither of these sets of
   * conditions is true, then no value is returned for the 'Content-MD5'
   * header.
   *
   * @readonly
   */
  get contentMD5() {
    return this.originalResponse.contentMD5;
  }
  /**
   * Indicates the range of bytes returned if
   * the client requested a subset of the file by setting the Range request
   * header.
   *
   * @readonly
   */
  get contentRange() {
    return this.originalResponse.contentRange;
  }
  /**
   * The content type specified for the file.
   * The default content type is 'application/octet-stream'
   *
   * @readonly
   */
  get contentType() {
    return this.originalResponse.contentType;
  }
  /**
   * Conclusion time of the last attempted
   * Copy File operation where this file was the destination file. This value
   * can specify the time of a completed, aborted, or failed copy attempt.
   *
   * @readonly
   */
  get copyCompletedOn() {
    return this.originalResponse.copyCompletedOn;
  }
  /**
   * String identifier for the last attempted Copy
   * File operation where this file was the destination file.
   *
   * @readonly
   */
  get copyId() {
    return this.originalResponse.copyId;
  }
  /**
   * Contains the number of bytes copied and
   * the total bytes in the source in the last attempted Copy File operation
   * where this file was the destination file. Can show between 0 and
   * Content-Length bytes copied.
   *
   * @readonly
   */
  get copyProgress() {
    return this.originalResponse.copyProgress;
  }
  /**
   * URL up to 2KB in length that specifies the
   * source file used in the last attempted Copy File operation where this file
   * was the destination file.
   *
   * @readonly
   */
  get copySource() {
    return this.originalResponse.copySource;
  }
  /**
   * State of the copy operation
   * identified by 'x-ms-copy-id'. Possible values include: 'pending',
   * 'success', 'aborted', 'failed'
   *
   * @readonly
   */
  get copyStatus() {
    return this.originalResponse.copyStatus;
  }
  /**
   * Only appears when
   * x-ms-copy-status is failed or pending. Describes cause of fatal or
   * non-fatal copy operation failure.
   *
   * @readonly
   */
  get copyStatusDescription() {
    return this.originalResponse.copyStatusDescription;
  }
  /**
   * A UTC date/time value generated by the service that
   * indicates the time at which the response was initiated.
   *
   * @readonly
   */
  get date() {
    return this.originalResponse.date;
  }
  /**
   * The ETag contains a value that you can use to
   * perform operations conditionally, in quotes.
   *
   * @readonly
   */
  get etag() {
    return this.originalResponse.etag;
  }
  get errorCode() {
    return this.originalResponse.errorCode;
  }
  /**
   * If the file has a MD5 hash, and if
   * request contains range header (Range or x-ms-range), this response header
   * is returned with the value of the whole file's MD5 value. This value may
   * or may not be equal to the value returned in Content-MD5 header, with the
   * latter calculated from the requested range.
   *
   * @readonly
   */
  get fileContentMD5() {
    return this.originalResponse.fileContentMD5;
  }
  /**
   * The value of this header is set to
   * true if the file data and application metadata are completely encrypted
   * using the specified algorithm. Otherwise, the value is set to false (when
   * the file is unencrypted, or if only parts of the file/application metadata
   * are encrypted).
   *
   * @readonly
   */
  get isServerEncrypted() {
    return this.originalResponse.isServerEncrypted;
  }
  /**
   * Returns the date and time the file was last
   * modified. Any operation that modifies the file or its properties updates
   * the last modified time.
   *
   * @readonly
   */
  get lastModified() {
    return this.originalResponse.lastModified;
  }
  /**
   * A name-value pair
   * to associate with a file storage object.
   *
   * @readonly
   */
  get metadata() {
    return this.originalResponse.metadata;
  }
  /**
   * This header uniquely identifies the request
   * that was made and can be used for troubleshooting the request.
   *
   * @readonly
   */
  get requestId() {
    return this.originalResponse.requestId;
  }
  /**
   * Indicates the version of the File service used
   * to execute the request.
   *
   * @readonly
   */
  get version() {
    return this.originalResponse.version;
  }
  /**
   * Attributes set for the file.
   *
   * @readonly
   */
  get fileAttributes() {
    return this.originalResponse.fileAttributes;
  }
  /**
   * Creation time for the file.
   *
   * @readonly
   */
  get fileCreatedOn() {
    return this.originalResponse.fileCreatedOn;
  }
  /**
   * Last write time for the file.
   *
   * @readonly
   */
  get fileLastWriteOn() {
    return this.originalResponse.fileLastWriteOn;
  }
  /**
   * Change time for the file.
   *
   * @readonly
   */
  get fileChangeOn() {
    return this.originalResponse.fileChangeOn;
  }
  /**
   * Key of the permission set for the file.
   *
   * @readonly
   */
  get filePermissionKey() {
    return this.originalResponse.filePermissionKey;
  }
  /**
   * The fileId of the file.
   *
   * @readonly
   */
  get fileId() {
    return this.originalResponse.fileId;
  }
  /**
   * The parent fileId of the file.
   *
   * @readonly
   */
  get fileParentId() {
    return this.originalResponse.fileParentId;
  }
  /**
   * The response body as a browser Blob.
   * Always undefined in node.js.
   *
   * @readonly
   */
  get contentAsBlob() {
    return this.originalResponse.blobBody;
  }
  /**
   * When a file is leased, specifies whether the lease is of infinite or fixed duration. Possible
   * values include: 'infinite', 'fixed'
   */
  get leaseDuration() {
    return this.originalResponse.leaseDuration;
  }
  /**
   * Lease state of the file. Possible values include: 'available', 'leased', 'expired',
   * 'breaking', 'broken'
   */
  get leaseState() {
    return this.originalResponse.leaseState;
  }
  /**
   * The current lease status of the file. Possible values include: 'locked', 'unlocked'
   */
  get leaseStatus() {
    return this.originalResponse.leaseStatus;
  }
  /**
   * Properties of NFS files
   */
  get posixProperties() {
    return this.originalResponse.posixProperties;
  }
  get structuredBodyType() {
    return this.originalResponse.structuredBodyType;
  }
  get structuredContentLength() {
    return this.originalResponse.structuredContentLength;
  }
  /**
   * The response body as a node.js Readable stream.
   * Always undefined in the browser.
   *
   * It will automatically retry when internal read stream unexpected ends.
   *
   * @readonly
   */
  get readableStreamBody() {
    return import_core_util.isNodeLike ? this.fileDownloadStream : void 0;
  }
  get _response() {
    return this.originalResponse._response;
  }
  originalResponse;
  fileDownloadStream;
  /**
   * Creates an instance of FileDownloadResponse.
   *
   * @param originalResponse -
   * @param getter -
   * @param offset -
   * @param count -
   * @param options -
   */
  constructor(originalResponse, getter, offset, count, options = {}) {
    this.originalResponse = (0, import_utils_common.assertResponse)(
      originalResponse
    );
    const bodyStream = this.originalResponse.structuredBodyType ? (0, import_storage_common.structuredMessageDecodingStream)(this.originalResponse.readableStreamBody, {}) : this.originalResponse.readableStreamBody;
    this.fileDownloadStream = new import_RetriableReadableStream.RetriableReadableStream(
      bodyStream,
      getter,
      offset,
      count,
      options
    );
  }
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  FileDownloadResponse
});
//# sourceMappingURL=FileDownloadResponse.js.map
